Products | Scripts | Services | Tutorials | Books | Links | Contact | Bulletin Board

The CITY Shop

Overview | Concept | Licensing | Demo/Download | Installation | Gallery | Last Updates | FAQ

Templates | Views | Engines | Libraries | Main Setup | Shop Setup | Database | Session | Shipping

Engines

These are the shop specific packages used to build data and/or html display.

ShopBillingLib.pm

This package provides the interface to the billing module associated to what the user chose as method of payment. This package has no constructor method. It is currently used in the ShopOrderLib.pm:

RequireFile($S->{-SHOP_PATH}, 'ShopBillingLib.pm');
$Errors = ShopBillingLib::_process($S, $OX);

It uses the $OX hash which is nothing else than the form input hash, after validation. Its main use is to interface with the merchant routine, the EPI.pm module. If the shop does not use online processing, this routine will return an empty string. The following keys will be added to the $OX hash, if the payment did not access a gateway module:

-ORDER_PROCESSED will contain: "N" (Not Processed)
-ORDER_WARNING will contain: "1002:Your Order was Saved on File"

If the gateway module returns errors or warnings, they will be placed in the -ORDER_WARNING and -ORDER_ERROR keys.

If the payment succeeds, the key "-ORDER_PROCESSED" will contain: "B" (Billed)

Back to Top

ShopBuildTagData.pm

This package processes all the XML tags from a static page, and formats the output. This package has no constructor. The function is called from the store.cgi, as follows:

RequireFile($S->{-SHOP_PATH}, 'ShopBuildTagData.pm');
$MapData = ShopBuildTagData::_process($S, \@Template, \%D);

The function returns in $MapData the reference of a hash of tag values, if present. The @Template is the contents of the static page, one line per array item. The %D is the array of system standard tags, like form tags, hidden fields, etc... Here are a couple examples:

  • JavaScriptHeader
  • HTMLStyle
  • ScriptLink
  • SecureScriptLink
  • EndFormTag
  • FormTag
  • FormTagOneClick
  • ManagerFormTag
  • HiddenFields

Additional to these parameters, the function takes an anonymous hash of form fields, which would be relevant to the building of output in the static page.

Here is an example of how these tags can be called in a static page:

A static product page, with a product price insert:

<cityshop:display:ProductPriceHTML/>

An "Add To Cart" link, provided the product ID, and an option:

<cityshop:display:ProductAddToCartLink:100005:1:link:2:10004-1:Add two (Gift-wrapped)/>

An order quantity box, with fancy display:

<cityshop:display:ProductOrderQuantityField:100005:1:select:1;2:one;two:Select Amount/>

A product options table, the same format as in the product page. The ID displayed is the product ID:

<cityshop:display:ProductOptions:100005:1/>

A product options table, displayed as a text table, no form fields displayed. The ID displayed is the product ID:

<cityshop:display:ProductOptionsDisplay:100005:1/>

A single product option, displayed as in the product options table. The ID displayed is the option ID:

<cityshop:display:Option:100005:1/>

A single product option, displayed as a text table, no form field displayed. The ID displayed is the option ID:

<cityshop:display:OptionDisplay:100005:1/>

Another tags can and will be added as need be, basically the syntax is:

<cityshop:display:FieldName:ProductID:Item Index on Page:display type:.../>

the above are of course valid for an entry related to a certain product, which will be the case with most tags. It is totally possible to write custom code to display pretty much anything, we will just provide a few generic examples.

Aside from the "cityshop:display" parameter, we might provide support for some other tag clasess in the future, like for example "cityshop:process" for routines that will eventually return a formatted output. We are open for suggestions.

Back to Top