Skip to main content
With climate-neutral production, the buyer offsets the CO2 emissions of their order by supporting a climate protection project. The shop fetches which projects are available and what they cost from ClimatePartner. The tags with the prefix 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 first option, “without climate-neutral production”, is inside {CN-Data} but outside the {@CN-Data} loop. Inside the loop, it would appear as many times as there are projects.
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.
This option is not mentioned in any source page and has been derived here from the shop code. The values come from ClimatePartner and may change. So build the display in a way that still looks sensible without a match.
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.
The variant without a suffix depends on the shop’s price type: in a shop with gross prices, CN-ProjectTotal returns the gross amount; in a shop with net prices, the net amount. If you need to reliably distinguish between the two, use the explicit variants.
The total price is not simply the price per kilogram multiplied by the emission quantity. The shop first applies the configured minimum costs and then adds the surcharge, which is also configured. An amount recalculated from the two individual values will therefore differ.

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.
Reference: AltCurrency- (Alternative currency)

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.
  • Guide: Climate-neutral production
  • Reference: <ClimateNeutral> section
  • Reference: Climate-neutral production in the basket
  • Reference: AltCurrency- (Alternative currency)