The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AxKit::App::TABOO::Data::Order - Order Data objects for TABOO-based Webshop

SYNOPSIS

  use AxKit::App::TABOO::Data::Order;
  $order = AxKit::App::TABOO::Data::Order->new();
  $order->load(what => '*', limit => {orderid => 345366});

DESCRIPTION

This Data class contains information about an order placed through a webshop of the site, such as what was ordered, who ordered it, total price, when it was shipped, etc.

METHODS

This class implements two methods, the rest is inherited from AxKit::App::TABOO::Data.

new()

The constructor. Nothing special.

load(what = '*', limit => {orderid => 345366})>

This reimplemented load method is similar to the standard load methods, but also attempts to build a more elaborate data structure.

STORED DATA

The data is stored in named fields, and for certain uses, it is good to know them. If you want to subclass this class, you might want to use the same names, see the documentation of AxKit::APP::TABOO::Data for more about this.

These are the names of the stored data of this class:

  • orderid - an identifier for the product, a simple word you use to retrieve the desired object.

  • catname - the identifier of a category. It is convenient to classify the product into a category.

  • title - A string meant for human consumption used to provide a short description of the product.

  • descr - A longer description of the product.

  • imgsmallurl - The URL of a small picture of the product suitable for quick viewing.

  • imglargeurl - The URL of a larger picture of the product.

  • imgcaption - A text that can be used as a caption for the pictures.

  • comment - Short comment suitable for including things that doesn't fit anywhere else. May also be used for internal comments not for public viewing.

For prices and items, consult documentation of the appropriate classes.

XML representation

The write_xml() method, implemented in the parent class, can be used to create an XML representation of the data in the object. The above names will be used as element names. The xmlelement() and xmlns() methods can be used to set the name of the root element and the namespace respectively. Usually, it doesn't make sense to change the defaults, which are

  • order

  • http://www.kjetil.kjernsmo.net/software/TABOO/NS/Order/Output

TODO

This is an early release, just to show off what I've been thinking about.

It hardly works at all, I'm afraid, but I hope the things that are here are interesting to someone looking to use TABOO for a webshop, as they are a good first step.

There's a big issue in that a typical order will consist of all the data from the data stores of the webshop. That's rather big, and requires some careful thinking. I have found that it is probably a bad idea to try to do it in the load method, so that is where it is halted for the time being.

FORMALITIES

See AxKit::App::TABOO.