shop.pl - implements the shop for BSE
shop.pl implements the shop for BSE.
Iterates over the items in the shopping cart, setting the item
tag
for each one.
Retreives the given field from the item. This can include product fields for this item.
The numeric index of the current item.
The "extended price", the product of the unit cost and the number of units for the current item in the cart. field defaults to the price of the product.
Formats the given field as a money value (without a currency symbol.)
The number of items in the cart.
Conditional tag, true if a registered user is logged in.
Retrieved the given field from the currently logged in user, if any.
This has the same tags as the Cart page, and some extras:
The total cost of all items in the cart.
This will need to be formatted as a money value with the money
tag.
An error message, if a validation error occurred.
The previously entered value for field. This should be used as the value for the various checkout fields, so that if a validation error occurs the user won't need to re-enter values.
These tags are used in the checkoutfinal_base.tmpl.
This is split out for these forms.
Order fields.
Can be used to check if this order is intended to be subscribing to a subscription.
You can also use "|format" at the end of a field to perform some simple formatting. Eg. <:order total |m6:> or <:order id |%06d:>.
Formats the value as a <number> wide money value.
Performs sprintf()
formatting on the value. Eg. %06d will format 25
as 000025.
These tags are used in the emails sent to the user to confirm an order and in the encrypted copy sent to the site administrator:
Iterates over the items in the order.
Access to the given field in the order item.
Access to the product field for the current order item.
Access to fields of the order.
The product of the field in the current item and it's quantity.
Formats the given field as a money value.
The mail generation template can use extra formatting specified with '|format':
Format the value as a number wide money value.
Performs sprintf formatting on the value.
Left justifies the value in a number wide field.
The order email sent to the site administrator has a couple of extra fields:
The credit card number of the user's credit card.
The entered expiry date for the user's credit card.
These names can be used with the <: order ... :> tag.
Monetary values should typically be used with <:money order ...:>
The order id or order number.
Delivery information for the order.
Billing information for the order.
Contact information for the order.
Total price of the order.
Wholesale cost of the total. Your costs, if you entered wholesale prices for the products.
GST (in Australia) payable on the order, if you entered GST for the products.
When the order was made.
Whether or not the order has been filled. This can be used with the order_filled target in shopadmin.pl for tracking filled orders.
The time and date when the order was filled.
The user who marked the order as filled.
Whether or not the order has been paid for. This can be used with a custom purchasing handler to mark the product as paid for. You can then filter the order list to only display paid for orders.
A custom payment handler can fill this with receipt information.
Generated by the prePurchase target, this can be used as a difficult to guess identifier for orders, when working with custom payment handlers.
This can be used by a custom payment handler to mark an order as cancelled if the user starts processing an order without completing payment.
The product id of this item.
The order Id.
The number of units for this item.
The price paid for the product.
The wholesale price for the product.
The gst for the product.
A comma separated list of options specified for this item. These correspond to the option names in the product.
New with 0.10_04 is the facility to set options for each product.
The cart, checkout and checkoutfinal pages now include the following tags:
within an item, iterates over the options for this item in the cart. Sets the item tag.
Retrieves the given field from the option, possible field names are:
The type/identifier for this option. eg. msize for a male clothing size field.
The underlying value of the option, eg. XL.
The description of the field from the product options hash. If the description isn't defined this is the same as the id. eg. Size.
The description of the value from the product options hash. eg. "Extra large".
A conditional tag, true if the current cart item has any options.
A simple rendering of the options as a parenthesized comma-separated list.