Engines
These are the shop specific packages used to build data and/or html display.
- ShopBannerAd - interface module for banner ads, not yet fully
implemented
- ShopBillingLib - payment interface module
- ShopBuildTagData - builds the output
for the static tags
- ShopCartLib - processes the cart and prepares
data for display
- ShopDBLib - processes most common database
queries and prepares generic output
- ShopDBSetup - provides the database structure for migrating
to SQL
- ShopDiscountLib - processes the items
discount
- ShopEmailUserData - emails the user
his/her account information, if they forgot it
- ShopExtendedOrderLib - provides routines for additional features
in the order process
- ShopMenuBuilder - formats the menues
for display
- ShopOrderLib - processes the order form
in all stages
- ShopProcessOrderItems - processes
the routines associated with items, after placing the order
- ShopProductBuilder - prepares data
for product display. Has a few submodules, and the code currently available
in these modules might be migrated to view packages later on.
- ShopSearchLib - processes a search request
- ShopShippingLib - shipping interface
module
- ShopUserDataLib - formats the user
data for 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
|