Blog Sections Open

Updating Shopkeeper Prices Dynamically with JavaScript and changePrice

Shopkeeper can recalculate the base price, but many storefronts also need discounted totals, old prices, or savings values updated at the same time.

This donor contained a practical Shopkeeper customization: when the chosen option changes the current price, the frontend should also update related values such as the old price or the amount saved.

Key requirement

The setup depends on enabling:

[!Shopkeeper? &orderFormPage=`15` &changePrice=`1`!]

Example JavaScript extension

$(priceTxt).empty().append('<span style="display:none;">'+curPrice+'</span>'+newPrice);

var priceaktiaTxt = $('.shk-aktia-price:first', parent);
var aktiaPrice = parseFloat(newPrice) * 1.25;
$(priceaktiaTxt).empty().append('<span>'+aktiaPrice+'</span>');

The original note also calculated a separate savings value and rendered it into its own placeholder element.

Why this is useful

Many Evo stores need richer visual pricing than Shopkeeper outputs by default. Extending the frontend price-update logic lets you preserve the underlying cart mechanics while improving the storefront presentation.

The main caution is consistency: if JavaScript changes what the customer sees, the server-side order data must still match the same business rules.

Newer post

Handling File Attachments in eForm Without Breaking Validation

A practical eForm pattern for contact forms with file uploads, captcha, validation, and hosted-mail constraints on legacy Evolution CMS builds.

Older post

Filtering Ditto Results by Multi-Select TV Values

How to work with multi-select TV values in Ditto when one stored field needs to match more than one semantic category.