- Guide: Subscription module
- Reference: SUBS- (managing subscriptions)
The subscription function is enabled in the
Subscription section of the shop configuration. The selectable delivery intervals and the permitted payment methods are also defined there.Can this product be subscribed to
SUBS-CycleSelection is the bracketing around the entire subscription area. It applies if the product can be subscribed to.
Put the entire subscription part of the product template in this bracketing. Without it, the input fields also appear for products that cannot be subscribed to at all.
The cycle selection
The selectable delivery intervals are configured in the shop, not on the product.SUBS-CycleSelection_data loops over them and, as a single tag, returns their number.
The label from
SUBS-CycleSelection_data_descr comes from the Description parameter of the respective interval in the shop configuration. If nothing is stored there, the tag outputs nothing and does not apply as a bracketing either. In this case, build the label yourself from _data_count and the unit bracketings.As a single tag,
SUBS-CycleSelection_data_selected outputs a leading space followed by selected. You can therefore write it directly after the last attribute without adding a separator yourself.The unit of the interval
Four bracketings tell you which unit is involved. The technical code behind it is inSUBS-CycleSelection_data_unit_code.
According to the tag mask, the four unit tags are also permitted as single tags. However, they output nothing there. Use them exclusively as bracketings. The previous documentation lists them only as bracketings, which corresponds to their sensible use.
Addressing a specific entry
All_data_ tags optionally take a parameter, namely the sequential number of the interval. This lets you access a specific entry outside the loop.
SUBS-CycleSelection_data_selected without a parameter and outside the loop has a meaning of its own. There it applies as a bracketing if the buyer has selected an interval at all. This is suitable for a notice that the selection is still pending.Is the product already subscribed
Before you offer the subscription area, it is worth checking the buyer’s existing subscriptions. Two bracketings answer this, one via the product index and the other via the product number.The search covers all subscriptions of the logged-in buyer, regardless of their state. A paused subscription therefore also counts as existing.
The payment method for the subscription
A subscription is billed repeatedly and therefore does not work with every payment method. Which ones are permitted is defined in theAllowedPayments parameter in the Subscription section of the shop configuration.
SUBS-AllowedPayments and SUBS-PaymentMethod_selected() exist in the shop system but are not described in the previous documentation. Without them, a payment method selection cannot be built, even though the previous documentation already uses them in its examples.For subscriptions, the shop system only permits direct debit, invoice, PayPal Checkout and PayPal Checkout pay upon invoice as payment methods. Any other code in
AllowedPayments is discarded and logged when the configuration is read.The
UsePaymentCode parameter is the predecessor of AllowedPayments and should no longer be used. If it is set and AllowedPayments is not, it results in a list with exactly one entry. SUBS-FixedPaymentCodeUsed outputs this code as a single tag and applies as a bracketing as long as it is set.The bank details
For direct debit, the subscription needs bank details. Four tags cover this, and they build on one another.SUBS-BankData also loads from the database, namely the one set of bank details stored on the subscription. It answers the question “is there already one”, while SUBS-BankSelection answers the question “may one be selected at all”.SUBS-BankIndex_selected() exists in the shop system but is not described in the previous documentation. It compares its parameter with the most recently submitted selection and, without a parameter, applies if any selection exists at all.The delivery address
If the subscription is to go to a different address than the billing address, the buyer selects it from their address book.Both tags exist in the shop system but are not described in the previous documentation. The previous documentation already uses
SUBS-DelivAddress_input in an example without explaining it.The value 0 means “no different delivery address”, so the subscription goes to the billing address. Any value above that is the index of an address book entry, the same one that
D-DeliverySelection_value returns.The HTML names of the input fields
All_input tags return fixed names. On the product page, they are these:
Nevertheless, use the tags and not the names themselves. Within the loop over existing subscriptions, the same tags return a different name, namely the same one with the subscription identifier appended. This way, the template works in both contexts.
Tags at a glance
According to the tag mask, several tags are permitted as single tags but output nothing there. This concerns the four unit bracketings,
SUBS-ProdIndexOnSubscription() and SUBS-ProdNumberOnSubscription(). The table reflects the mask of the shop system; the previous documentation lists these tags only as bracketings.Related topics
- Guide: Subscription module
- Reference: SUBS- (managing subscriptions)
- Reference: E-SUBS- (subscription module)
- Reference: PAY- (payment methods)
- Reference:
Subscriptionsection in the shop configuration
