Would you like to track your Facebook ads on iOS devices with the shopping cart? Then initialize the cart as described here and set up the checkout on your own domain. See here.
The following steps are necessary to integrate the Digistore24 shopping cart:
1. Integrate the shopping cart and add links
a) Integrate the shopping cart
i. Via JavaScript
1. Add the following code to your website:
<script src="https://www.digistore24-scripts.com/service/digistore.js"></script>
<script> digistoreCart(); </script>
ii) Via WordPress shortcode
The WordPress shortcode only works in conjunction with WordPress and the installed Digistore24 plugin (version 2.17 or higher).
- First, install the Digistore24 plugin. Follow the instructions here.
- Go to the editing view of your website in WordPress.
- Now enter the following shortcode in the text field at any desired location: [digistore_cart]
- Now adjust the buy buttons of your product. These should no longer directly lead to your order form. Follow the instructions here.
- Then integrate the cart button. You can find a description here.
b) Set up buy links
This link will add the products to the shopping cart when the customer clicks on your buy button.
Important:
Please use only the classic HTML tag for links.
<a href="Link">Link-Text</a>
Otherwise, Digistore24 will not correctly recognize the buy button.
The buy URL for the cart is:
https://www.digistore24.com/add/PRODUCT-ID
- Replace the placeholder PRODUCT-ID with your product ID. You can find it, for example, under Account > Products in the product line.
- Integrate the link correctly, as shown in the following examples:
Code for a text link:
<a href="https://www.digistore24.com/add/PRODUCT-ID">LINK TEXT</a>
Code for an image link:
<a href="https://www.digistore24.com/add/PRODUCT-ID"><img src="URL-TO-IMAGE"/></a>
c) Integrate cart link/button
So that the customer can always see what they are purchasing and can easily complete the order, integrate this cart link or button on your website:
https://www.digistore24.com/cart
Example:
Code for a text link:
<a href="https://www.digistore24.com/cart">Link text</a>
Code for an image link:
<a href="https://www.digistore24.com/cart"><img src="url-to-button-image"/></a>
d) Optional: Integrate checkout link or button
You can set up a direct link to the order form on your website, so that the customer can directly enter payment details.
The URL for this is:
https://www.digistore24.com/checkout
Code for a text link:
<a href="https://www.digistore24.com/checkout">Link text</a>
Code for an image link:
<a href="https://www.digistore24.com/checkout"><img src="url-to-button-image"/></a>
2. Set up the checkout page
a) On Digistore24 domain
You don’t need to do anything further unless you want to specify your own order form. To do this, use one of the following codes (JavaScript or WordPress shortcode) and replace "4321" with the order form ID.
JavaScript:
<script src="https://www.digistore24-scripts.com/service/digistore.js"></script>
<script> digistoreCart('orderform_id=4321'); </script>
WordPress shortcode:
[digistore_cart orderform_id=4321]
b) On your own domain
If you want to track your Facebook ads on the Digistore24 shopping cart with iOS devices, it is necessary to integrate the Digistore24 shopping cart on your own domain.
- Insert one of these codes:
- JavaScript:
<style> body { margin:0; } </style> <script src='https://www.digistore24.com/service/js/orderform_widget.js'></script><iframe class='ds24_payIFrame' style='overflow: hidden; width: 100%; height: 100%; border: none; margin:0; padding: 0; background: transparent;' src='https://www.digistore24.com/checkout?iframe=1' ></iframe>
- WordPress shortcode:
[digistore_cart_checkout]
- JavaScript:
- In your cart initialization: Pass the checkout URL to digistoreCart(). Example:
- JavaScript:
<script src="https://www.digistore24-scripts.com/service/digistore.js"></script> <script> digistoreCart('checkout_url=https://www.mydomain.com/my-checkout_url'); </script>
- WordPress shortcode:
[digistore_cart checkout_url=https://www.mydomain.com/my-checkout_url]
- JavaScript:
- Replace checkout_url=https://www.mydomain.com/my-checkout_url with the URL from step 1 of section 3b.
NoteYou can specify both the checkout URL and the order form simultaneously:
JavaScript:
<script src="https://www.digistore24-scripts.com/service/digistore.js"></script> <script> digistoreCart('orderform_id=4321 checkout_url=https://www.mydomain.com/my-checkout_url'); </script>
WordPress shortcode:
[digistore_cart orderform_id=4321 checkout_url=https://www.mydomain.com/my-checkout_url]
3. Digistore24 shopping cart configuration options
The Digistore24 cart has several configuration options. To add a setting to the cart, you should extend your iframe, JavaScript, or WordPress shortcode with the following additional options:
In iframe: digistoreCart("Option1 Option2")
In JavaScript code: digistoreCart("Option1 Option2")
In WordPress shortcode: [digistore_cart Option1 Option2]
Possible settings and associated options
Option | Description of the setting |
info_position |
Specifies where the "Added to cart" message will be displayed. Possible values:
|
info_sticky | If specified, the cart summary is always displayed and pinned to the edge of the window. |
brutto | All prices in the cart are displayed including VAT. If not explicitly defined in the code or shortcode, the setting of the first product in the cart will be applied to all other products. |
netto | All prices in the cart are displayed as net prices plus VAT. If not explicitly defined in the code or shortcode, the setting of the first product in the cart will be applied to all other products. |
orderform_id=321 | Selects the order form that will be displayed after clicking "Proceed to checkout". If not explicitly defined in the code or shortcode, the setting of the first product in the cart will be applied to all other products. |
return_url=https://xyz | Defines where the customer will be redirected when they click the "Continue shopping" link on the order form. By default, the HTTP referrer is used, so the customer is redirected to the last page visited. |
thankyou_url=https://xyz | After the purchase, the buyer is redirected to this page. |
no_return_button | The "Continue shopping" link is hidden on the order form. |
currency_symbol | The currency symbol is displayed on the order form instead of the currency abbreviation (e.g., EUR → €). |
upsell=XXX |
Defines whether and how upsells are displayed in the order process. Several examples of possible applications follow: |
upsell=any | Digistore24 selects the upsells from the first product in the cart that has upsells. This is the default setting. |
upsell=1234 | Displays the upsells of product 1234 after the initial purchase. |
upsell=12,34,56,78,12 | Displays the upsells of product 12 after the initial purchase if it is in the cart. Otherwise, the upsells of product 34 will be displayed if it is in the cart. Otherwise, the next product in the list will be used. If none of the listed products have been added to the cart, the upsells of the last product ID in the list will be displayed (in this example, the product ID 12; this ID may be a duplicate ID, but it shouldn't be). |
upsell=123,any,456 | Displays the upsells of product 123 after the initial purchase if product 123 has been added to the cart; otherwise, the upsells of any other product in the cart (if upsells are available); otherwise, the upsells of product 456 will be displayed (even if product 456 is not in the cart). |
upsell=123,456,none | If product 123 is in the cart, the upsells of product 123 will be displayed after the initial purchase. Otherwise, if product 456 is in the cart, the upsells of product 456 will be displayed after the initial purchase. If none of the listed products have upsells, no upsells will be displayed after the initial purchase, and the customer will be redirected directly to the thank you page. |
upsell=none | Completely disables the display of upsells, regardless of whether products in the cart have upsells or not. |
upsell=first | Only displays the upsells of the first product in the cart. This is the default behavior for sales that do not occur through a cart. |
language=en | Sets the language to English. By default, the language of the first product added to the cart is used. Possible languages currently are: en (English) and de (German). |
orderform_as_popup | When the buyer clicks the "Proceed to checkout" button, the Digistore24 order form opens in a new window. |
tracking=your_tracking_ keyortracking ='Your tracking key' |
Adds the specified tracking key to the purchase (just as the GET parameter ds24tr does). If the tracking key contains spaces, please use quotation marks (e.g., tracking='my key'). |
currency=USD | The specified currency is used in the cart. Possible values are: EUR, USD, and CHF. |
quantity_readonly | The quantity cannot be changed on the order form. Products cannot be removed either. |
show_total_amount =some_name | Displays the cart value in the HTML element with the specified ID or CSS class or corresponding name. To do this, insert e.g., 0 EUR in the HTML code – 0 EUR will then be replaced with the actual cart value. If the buyer changes products or quantities in the cart, the amount is automatically updated. |
show_cart_items=some_name | Displays the contents of the shopping cart in the HTML element with the specified ID or CSS class or corresponding name. To do this, insert e.g., /div> |
on_cart_change =some_js_function |
Calls the JavaScript function some_js_function(cart) whenever the cart changes. cart is an object with these fields:
|
on_message=some _alert_function |
Calls the JavaScript function some_alert_function(msg_type, msg_text) each time a message is to be displayed to the user. msg_type can be error, warning, or info. |
voucher=some_voucher_code | Adds the voucher code some_voucher_code to the order. The voucher code is applied to the order (if it is valid for the first product purchased). |
theme=modern | Selects a modern theme for the cart. To use the classic theme, omit the parameter or set: theme=classic |
NoteIf not explicitly defined in the code or shortcode, the setting of the first product in the cart will be applied to all other products.
Example:
In JavaScript code:
In WordPress shortcode:
[digistore_cart language=en netto tracking="campaign 1"]
4. Tips and tricks for the Digistore24 shopping cart
Tip 1: Align payment plans of all products
If you sell products via subscription or installment payments, you should choose the same billing intervals for all products, e.g., monthly or yearly. This results in a lower number of charges for the customer.
You can mix one-time payment products with subscription and installment payment products. Digistore24 will then offer the buyer the billing interval that matches all products.
Example:
- Product 1 has annual payment and monthly payment.
- Product 2 has annual payment and bi-annual payment.
- Product 3 only has one-time payment.
The buyer can then only pay via annual payment.
If the products have trial periods, the shortest trial period of the selected products will be used. To ensure that the charges are processed together, it should also be decided for all products (including one-time payments) whether VAT should be included in the price or not.
You can adjust both settings under Account > Products in the product details tab "Payment plans".
Tip 2 (for your web designer): Keep windows displayed permanently
If your web designer is going to style the cart, they may want to keep the various windows displayed permanently to better customize them. To do this, they can add the following option to the URL where the cart is integrated:
?ds24debug, e.g., https://www.domain.com?ds24debug.
Tip 3 (for your web developer): Add products via JavaScript
If you want to make your website more flexible, there is the option to add products to the cart using the JavaScript function ds24cart_add(), e.g.:
- ds24cart_add(123)
adds product 123 to the cart - ds24cart_add(123, 3)
adds product 123 to the cart three times
Use ds24cart_show(button) to display the cart.
Example:
<button onclick="return ds24cart_show(this);">Show cart</button>