OFFER- returns the header data of an offer, that is, number, date, costs and totals. OPR- returns the products in it, that is, name, quantity, offer price and discount. Both are held together by two nested loops.
Guide: Customer-specific offers · Reference: Offers section
The structure of an offer page
The shop system stores a customer’s offers and an offer’s products in two separate lists. The outer loop{@WS-OffersList} runs over the offers and each time reloads the products of the offer currently reached. Only then does the inner loop {@OPR-Data} operate on filled data.
The outer loop recalculates the offer totals on each pass. The tags
OFFER-TotalSumNet, OFFER-TotalSumGross and OFFER-TotalSumVAT are therefore only reliable within the loop.The number in the argument of
CAT-AdvData otherwise limits the number of listed products. For $Offers, the shop system does not evaluate it; the loop always runs over all products of the offer. Write the number anyway so that the notation matches all other CAT-AdvData areas.WS-OffersList is described under WS- (General tags), CAT-AdvData under CAT- (Categories and product lists).
The header data of an offer
All four also work as area tags and take effect if a value is available. This is worthwhile for
OFFER-Descr and OFFER-ExpireDate, because both fields are not mandatory in the import.Payment method, shipping method and totals
Each offer has a payment method, a shipping method and the resulting costs. Each is available in three variants: net, gross and as a VAT amount.
In addition, there are the names of the two methods and three older tags without a breakdown.
These five tags are not described in the previous documentation.
OFFER-PaymentName and OFFER-DeliveryName are the only way to show the customer at all which payment and shipping method are stored for their offer. The three cost tags without a suffix date from the time before the split into net and gross. In new templates, use the variants with Net, Gross and VAT, because it is clear there what is output.All amounts are output in the shop’s number format, that is, with the configured decimal separator and thousands separator. The shop system does not append a currency; you add it yourself with
WS-Currency or WS-CurrencySymbol.The products of an offer
OPR-Data is exclusively a loop tag. As a single tag or area tag, it outputs nothing. The check whether any products exist at all is handled by the area tag {CAT-AdvData($Offers,99)} above it, which hides itself automatically for an empty offer.
OPR-Insert and OPR-Image are not described in the previous documentation. OPR-Image returns a complete address to the product image, not just the file name. If there is no image, the output remains empty and the area tag does not take effect, so you can cleanly omit the image column.Displaying variants
OPR-Variations has two tasks. As a single tag, it outputs the permanently assigned variants of the offer product, for example size and color. As an area tag, it takes effect if variants or text input fields are present.
The prices
The discount
In the offer, you specify only one of the two values. The shop system calculates the other. If you specify the percentage, the amount results from it; if you specify the amount, the percentage results from it.
Both tags output an empty string for a value of zero. The area tag then does not take effect, and the discount notice disappears automatically. So you don’t need a separate check for “no discount”.
Selecting an offer
If a customer has several offers, there are two ways to show them. The first is a selection list. For this, you placeWS-OffersList as a single tag. The shop system builds a complete select box from it with all of the customer’s offers, and the customer only ever sees the selected one.
WS-PrintHiddenOfferInput takes care of this.
WS-PrintHiddenOfferInput generates a complete hidden input field with the index of the current loop pass. So you don’t write an input element around it. Only place it within the loop, because outside it the index is zero.WS-OffersCount outputs the number of offers and is suitable for a heading above the list.
Messages
MSG-Offers_Notify outputs notice texts related to the offers, for example if an offer has expired.
The tags at a glance
All
OFFER- tags only apply within the {@WS-OffersList} loop, and all OPR- tags additionally only within {@OPR-Data}. The shop system evaluates the tag names regardless of capitalization.
Related topics
- Guide: Customer-specific offers
- Reference: Offers section
- Reference: WS- (General tags)
- Reference: CAT- (Categories and product lists)
