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::Productprices - Data object for product prices for TABOO-based Webshop.

SYNOPSIS

  use AxKit::App::TABOO::Data::Product;
  $product = AxKit::App::TABOO::Data::Product->new();
  $product->load('t-shirt');

DESCRIPTION

This Data class contains a price structure for a product. The price structure is meant to take into account that the price may be vary with the number of items ordered. This is represented by a threshold volume, and the price of a single item for up to and including that threshold.

METHODS

This class reimplements two methods in addition to the constructor, the rest is inherited from AxKit::App::TABOO::Data.

new()

The constructor. Nothing special.

load($prodid)

This reimplemented load method takes as argument a product ID, a string used to identify a product.

write_xml($doc, $parent)

This class reimplements the write_xml-method, which takes arguments $doc, which must be an XML::LibXML::Document object, and $parent, a reference to the parent node. The method will append the object it is handed it with the data contained in the data structure of the class in XML.

The price structure will be represented with a price element, containing the product ID in an attribute prodid and the threshold volume in an attribute volume, and the corresponding price is in the element content.

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:

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

  • volume - A threshold volume. If an order contains up to an including this volume of a product, the customer will pay the price contained in the corresponding price field for each item ordered.

  • price - see above.

TODO

Not much, actually... It may have to implement a save-method, perhaps.

FORMALITIES

See AxKit::App::TABOO.