CN- display this project list and receive the selection. They belong exclusively on the payment and shipping method page (ws_pay_deliv.htm), because that is where the buyer makes this decision.
Guide: Climate-neutral production
What goes where
The feature spans several pages of the shop, and only part of it runs via CN tags.
Reference: Climate-neutral production in the basket
The complete example
The outer range
WS-ClimateNeutralActivated is required. If the feature is not enabled in the shop, nothing should appear at this point.The project list
CN-Data
The central tag, in three roles.The range only applies if the basket reaches the configured minimum quantity of CO2 at all and ClimatePartner is reachable. An empty negative range is therefore not unusual but the normal case for small orders.
Project details
All tags in this section apply only within the{@CN-Data} loop.
CN-ProjectCurrency and CN-ProjectUnit are not described in the previous documentation but are present in the shop. ClimatePartner always calculates in kilograms; CN-ProjectUnit outputs this unit as text.CN-ProjectAvailableCompensationAmount is formatted using the settings from the <ClimateNeutral> section, that is, with the decimal places and separators defined there. The prices, by contrast, use the shop’s price format.Checking for a specific value
These tags can be used as a range tag with a parameter. The range applies if the project’s value matches the parameter.Without a parameter, the range applies if any value exists at all. This is the usual enclosing range, for example to set a link only if there is a project page.
Prices
Two amounts with four variants each.Controlling decimal places
The four tags for the price per kilogram accept the number of decimal places as a parameter. Without a parameter, it is two.Three decimal places are often necessary here, because the price per kilogram is regularly in the range of a few cents. With two places, many projects would show the same number.
The selection
The buyer selects exactly one project or none. Five tags form this selection group.CN-Project_radioname always outputs the same fixed name. This is exactly what makes the options a group from which only one can be selected. So use this tag for the “no project” option as well, and not a name of your own.CN-Project_radioselected_noproject applies as long as the buyer has not selected anything. This is the initial state, so the first option is preselected by default.Alternative currency
There is an alternative currency variant for all eight price tags.
The four tags for the price per kilogram take the decimal places as the first parameter and a three-letter ISO currency code as the second. The four tags for the total price take only the ISO code. Without a code, the alternative currency selected by the buyer is used.
As with all alternative currency tags, the range applies as soon as an exchange rate exists, not only when the amount is greater than zero.
Tag overview
All tags are permitted on the payment and shipping method page (
ws_pay_deliv.htm), within {CN-Data}. All tags for an individual project are additionally permitted only within the {@CN-Data} loop.
Related topics
- Guide: Climate-neutral production
- Reference:
<ClimateNeutral>section - Reference: Climate-neutral production in the basket
- Reference: AltCurrency- (Alternative currency)
