Skip to main content

Updated price calculation in checkout

· 3 min read
Pavel Husa

We scheduled breaking change in HTML and JavaScript of checkout process, which is going to break it in some blank templates and JavaScript addons or customizations without your cooperation. We need you to follow several steps listed below. It’s going to affect you if:
– you are using Blank template with custom JavaScript (on /admin/html-codes checked “Omit Shoptet Javascript”)
– you are using one of elements listed in tables below in your JavaScript

If you are affected by the second option, you can just check body for prices-original class and update your scripts according to this class. This class will be removed from body element together with new version of HTML described below.

If you are the author of Blank template with custom JavaScript, please follow the steps below.

First step​

In HTML editor in Shoptet admin (as well as in administration of blank template addon), you can now use placeholder #ASSETS_POSTFIX#, which has currently value -prices-original. Rename all currently included assets from your-assets.js to your-assets-prices-original.js and include them this way:

<script src="http://cdn.myshoptet.com/usr/your-eshop.cz/user/assets/your-assets#ASSETS_POSTFIX#.js"></script>

For several days will be used assets with prefix -prices-original.

Second step​

Please check DOM in checkout and adjust and test your script accordingly. Here is a list of upcoming changes. Please make sure that your scripts work with To be.

Billing​

Previous stateTo beDescription
data-billing-pricedata-billing-price-wvPrice with VAT
data-billing-price-wvdata-billing-price-wovPrice without VAT
–data-billing-price-vatVAT for the billing price
data-billing-price-iddata-billing-price-idInternal billing price id

Shipping​

Previous stateTo beDescription
data-shipping-pricedata-shipping-price-wvPrice with VAT
data-shipping-price-wvdata-shipping-price-wovPrice without VAT
–data-shipping-price-vatVAT for the shipping price
data-shipping-price-iddata-shipping-price-idInternal shipping price id

Total price​

Previous stateTo beDescription
data-price-totaldata-price-total-wvFinal price with VAT
data-price-total-wvdata-price-total-wovFinal price without VAT
–data-price-total-vatVAT for the final price

Final step​

After the new version of application with updated HTML will be released, we will let you know, so you could remove the #ASSETS_POSTFIX# and remove outdated your-assets-prices-original.js from FTP. You can also remove eventual conditions detecting prices-original class on body element.