NAME

shop.pl - implements the shop for BSE


DESCRIPTION

shop.pl implements the shop for BSE.


TAGS

Cart page

iterator ... items

Iterates over the items in the shopping cart, setting the item tag for each one.

item field

Retreives the given field from the item. This can include product fields for this item.

index

The numeric index of the current item.

extended [<field>]

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.

money which <field>

Formats the given field as a money value (without a currency symbol.)

count

The number of items in the cart.

ifUser

Conditional tag, true if a registered user is logged in.

user field

Retrieved the given field from the currently logged in user, if any.

Checkout tags

This has the same tags as the Cart page, and some extras:

total

The total cost of all items in the cart.

This will need to be formatted as a money value with the money tag.

message

An error message, if a validation error occurred.

old field

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.

Completed order

These tags are used in the checkoutfinal_base.tmpl.

item field
product field

This is split out for these forms.

order field

Order fields.

ifSubscribingTo subid

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:>.

m<number>

Formats the value as a <number> wide money value.

%<format>

Performs sprintf() formatting on the value. Eg. %06d will format 25 as 000025.

Mailed order tags

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:

iterate ... items

Iterates over the items in the order.

item field

Access to the given field in the order item.

product field

Access to the product field for the current order item.

order field

Access to fields of the order.

extended field

The product of the field in the current item and it's quantity.

money tag parameters

Formats the given field as a money value.

The mail generation template can use extra formatting specified with '|format':

m<number>

Format the value as a number wide money value.

%<format>

Performs sprintf formatting on the value.

<number>

Left justifies the value in a number wide field.

The order email sent to the site administrator has a couple of extra fields:

cardNumber

The credit card number of the user's credit card.

cardExpiry

The entered expiry date for the user's credit card.

Order fields

These names can be used with the <: order ... :> tag.

Monetary values should typically be used with <:money order ...:>

id

The order id or order number.

delivFirstName
delivLastName
delivStreet
delivSuburb
delivState
delivPostCode
delivCountry

Delivery information for the order.

billFirstName
billLastName
billStreet
billSuburb
billState
billPostCode
billCountry

Billing information for the order.

telephone
facsimile
emailAddress

Contact information for the order.

total

Total price of the order.

wholesaleTotal

Wholesale cost of the total. Your costs, if you entered wholesale prices for the products.

gst

GST (in Australia) payable on the order, if you entered GST for the products.

orderDate

When the order was made.

filled

Whether or not the order has been filled. This can be used with the order_filled target in shopadmin.pl for tracking filled orders.

whenFilled

The time and date when the order was filled.

whoFilled

The user who marked the order as filled.

paidFor

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.

paymentReceipt

A custom payment handler can fill this with receipt information.

randomId

Generated by the prePurchase target, this can be used as a difficult to guess identifier for orders, when working with custom payment handlers.

cancelled

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.

Order item fields

productId

The product id of this item.

orderId

The order Id.

units

The number of units for this item.

price

The price paid for the product.

wholesalePrice

The wholesale price for the product.

gst

The gst for the product.

options

A comma separated list of options specified for this item. These correspond to the option names in the product.

Options

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:

iterator ... options

within an item, iterates over the options for this item in the cart. Sets the item tag.

option field

Retrieves the given field from the option, possible field names are:

id

The type/identifier for this option. eg. msize for a male clothing size field.

value

The underlying value of the option, eg. XL.

desc

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.

label

The description of the value from the product options hash. eg. "Extra large".

ifOptions

A conditional tag, true if the current cart item has any options.

options

A simple rendering of the options as a parenthesized comma-separated list.