> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# CN- (Climate-neutral production)

> The tags for climate-neutral production: list the available climate protection projects, output their details and prices, and let the buyer select one of them.

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.

| Task | Prefix | Page |
| - | - | - |
| Notice on the product | `PR-ClimateNeutral` | Product detail view |
| Notice per basket item and total quantity | `BASKET-PR-ClimateNeutral…`, `WS-ClimateNeutral…` | wherever the basket appears |
| **Project selection** | **`CN-`** | **Payment and shipping method page** |
| Costs in the invoice footer | `BASKET-ClimateNeutral…` | Order overview, order confirmation |
| Certificate and document | `WS-ClimateNeutralCert…` | Order confirmation |

Reference: Climate-neutral production in the basket

## The complete example

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{WS-ClimateNeutralActivated}
   {CN-Data}

      <input type="radio"
             name="~CN-Project_radioname~"
             value="~CN-Project_radiovalue_noproject~"
             {CN-Project_radioselected_noproject}checked{/CN-Project_radioselected_noproject}>
      Ohne klimaneutrale Produktion bestellen

      {@CN-Data}
         <input type="radio"
                name="~CN-Project_radioname~"
                value="~CN-Project_radiovalue~"
                {CN-Project_radioselected}checked{/CN-Project_radioselected}>

         <strong>~CN-ProjectName~</strong><br>
         Technologie: ~CN-ProjectTechnology~<br>
         Region: ~CN-ProjectRegion~, ~CN-ProjectCountry~<br>

         {CN-ProjectURL}<a href="~CN-ProjectURL~" target="_blank">Zum Projekt</a>{/CN-ProjectURL}
         {CN-ProjectPDF}<a href="~CN-ProjectPDF~">Projektbeschreibung als PDF</a>{/CN-ProjectPDF}<br>

         Kosten pro kg CO2: ~CN-ProjectPricePerUnit(3)~ ~WS-CurrencySymbol~<br>
         Gesamtkosten: ~CN-ProjectTotal~ ~WS-CurrencySymbol~
      {/@CN-Data}

   {/CN-Data}
{/WS-ClimateNeutralActivated}
```

> [!WARNING]
>
> 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.

> [!NOTE]
>
> 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.

| Usage | Result |
| - | - |
| Single tag | the number of available climate protection projects |
| Range tag | applies if at least one project is available |
| Loop tag | iterates over the projects |

> [!NOTE]
>
> 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.

| Tag | Provides |
| - | - |
| `CN-ProjectName` | the name of the project |
| `CN-ProjectNumber` | the project number |
| `CN-ProjectTechnology` | the technology used |
| `CN-ProjectRegion` | the region |
| `CN-ProjectCountry` | the country |
| `CN-ProjectType` | the type of project |
| `CN-ProjectURL` | the URL of the project description at ClimatePartner |
| `CN-ProjectPDF` | the URL of the project description as a PDF |
| `CN-ProjectAvailableCompensationAmount` | the total available compensation amount |
| `CN-ProjectCurrency` | the currency of the project |
| `CN-ProjectUnit` | the unit used for calculation |
| `CN-ProjectVATRate` | the configured VAT rate |

> [!NOTE]
>
> `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.

> [!NOTE]
>
> `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.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@CN-Data}
   {CN-ProjectCountry(Brasilien)}
      <img src="images/web/flagge-br.png" alt="Brasilien">
   {/CN-ProjectCountry(Brasilien)}

   {CN-ProjectTechnology(Windkraft)}
      <span class="symbol wind"></span>
   {/CN-ProjectTechnology(Windkraft)}
{/@CN-Data}
```

> [!WARNING]
>
> 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.

> [!NOTE]
>
> 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.

| Basis | net | gross | per shop setting | tax portion |
| - | - | - | - | - |
| Price per kg CO2 | `CN-ProjectPricePerUnitNet` | `CN-ProjectPricePerUnitGross` | `CN-ProjectPricePerUnit` | `CN-ProjectPricePerUnitVAT` |
| Total price of the offset | `CN-ProjectTotalNet` | `CN-ProjectTotalGross` | `CN-ProjectTotal` | `CN-ProjectTotalVAT` |

> [!WARNING]
>
> 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.

> [!WARNING]
>
> 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.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Kosten pro kg CO2: ~CN-ProjectPricePerUnit(3)~ ~WS-CurrencySymbol~
```

> [!NOTE]
>
> 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.

| Tag | Provides | Placed |
| - | - | - |
| `CN-Project_radioname` | the name of the selection group | inside and outside the loop |
| `CN-Project_radiovalue` | the value of this project | in the loop |
| `CN-Project_radioselected` | applies if this project is selected | in the loop |
| `CN-Project_radiovalue_noproject` | the value for "no project" | outside the loop |
| `CN-Project_radioselected_noproject` | applies if no project is selected | outside the loop |

> [!NOTE]
>
> `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.

> [!NOTE]
>
> `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.

| Tag | Corresponds to |
| - | - |
| `CN-AltCurrencyProjectPricePerUnit` | `CN-ProjectPricePerUnit` |
| `CN-AltCurrencyProjectPricePerUnitNet` | `CN-ProjectPricePerUnitNet` |
| `CN-AltCurrencyProjectPricePerUnitGross` | `CN-ProjectPricePerUnitGross` |
| `CN-AltCurrencyProjectPricePerUnitVAT` | `CN-ProjectPricePerUnitVAT` |
| `CN-AltCurrencyProjectTotal` | `CN-ProjectTotal` |
| `CN-AltCurrencyProjectTotalNet` | `CN-ProjectTotalNet` |
| `CN-AltCurrencyProjectTotalGross` | `CN-ProjectTotalGross` |
| `CN-AltCurrencyProjectTotalVAT` | `CN-ProjectTotalVAT` |

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.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@CN-Data}
   ~CN-ProjectTotal~ ~WS-CurrencySymbol~
   {CN-AltCurrencyProjectTotal}
      (~CN-AltCurrencyProjectTotal~ ~WS-AltCurrencySymbol~)
   {/CN-AltCurrencyProjectTotal}
{/@CN-Data}
```

> [!NOTE]
>
> 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

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `CN-Data` | yes | yes | yes | yes |
| `CN-ProjectName` | yes | yes | yes | – |
| `CN-ProjectNumber` | yes | yes | yes | – |
| `CN-ProjectTechnology` | yes | yes | yes | – |
| `CN-ProjectRegion` | yes | yes | yes | – |
| `CN-ProjectCountry` | yes | yes | yes | – |
| `CN-ProjectType` | yes | yes | yes | – |
| `CN-ProjectURL` | yes | yes | yes | – |
| `CN-ProjectPDF` | yes | yes | yes | – |
| `CN-ProjectAvailableCompensationAmount` | yes | yes | yes | – |
| `CN-ProjectCurrency` | yes | yes | yes | – |
| `CN-ProjectUnit` | yes | yes | yes | – |
| `CN-ProjectVATRate` | yes | yes | yes | – |
| `CN-ProjectPricePerUnit` with suffixes | yes | yes | yes | – |
| `CN-ProjectTotal` with suffixes | yes | yes | yes | – |
| `CN-AltCurrencyProjectPricePerUnit` with suffixes | yes | yes | yes | – |
| `CN-AltCurrencyProjectTotal` with suffixes | yes | yes | yes | – |
| `CN-Project_radioname` | yes | – | – | – |
| `CN-Project_radiovalue` | yes | – | – | – |
| `CN-Project_radioselected` | – | yes | yes | – |
| `CN-Project_radiovalue_noproject` | yes | – | – | – |
| `CN-Project_radioselected_noproject` | – | yes | yes | – |

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)


## Related topics

- [Climate-neutral production](https://dokumentation.websale.de/en/v8s/externe-dienste/klimaneutrale-produktion.md)
- [Climate-neutral production in the basket](https://dokumentation.websale.de/en/v8s/referenz/tags/basket/klimaneutrale-produktion-im-warenkorb.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [Shopping cart, prices, currency and bonus](https://dokumentation.websale.de/en/v8s/referenz/tags/ws/warenkorb-preise-waehrung-und-bonus.md)
- [External services: Overview](https://dokumentation.websale.de/en/v8s/externe-dienste/externe-dienste.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.