Blog Sections Open

Converting Shopkeeper Prices by Exchange Rate with OnSHKgetProductPrice

A historical Shopkeeper pattern for converting stored prices into storefront and cart values through an event hook.

A recurring Shopkeeper pattern on older Evolution CMS stores was to store the base price in one currency and show the real storefront price in another. The key was making the same conversion reach both the product page and the cart logic.

The storefront side

The initial setup usually started with a TV such as price holding a dollar value, plus a PHx modifier or helper that multiplied the value by a local exchange rate for display.

if ($e->name == 'OnSHKgetProductPrice') {
    if (isset($price)) {
        $e->output($price * $kurs);
    }
}

Why the cart still showed the wrong number

Displaying a converted number in the template is not enough. Shopkeeper still reads the original product price unless the cart pipeline itself is intercepted. That is why the historical answer focused on the OnSHKgetProductPrice event: it gives Shopkeeper the converted value before totals are calculated.

The practical pattern

Use one authoritative exchange-rate source, apply it in the product output layer for display, and apply the same logic in OnSHKgetProductPrice so the cart, totals, and checkout use the exact same converted price.

Why this matters historically

This is one of the better examples of early Evo commerce pragmatism. Rather than rebuilding Shopkeeper, teams used the plugin event layer to keep business rules centralized. Later posts about TV-based pricing and dynamic cart recalculation build directly on this kind of pattern.

Related posts

Using a Central Exchange Rate for Shopkeeper Pricing
Applying Markups and Rounding Rules to Shopkeeper Prices Automatically

Newer post

SEO Titles and Meta Descriptions for Shopkeeper Products in External Tables

A practical SEO pattern for product pages when the catalog lives outside the normal document fields.

Older post

Google Translate TV Output in Evolution CMS: An Early Automation Idea

A historical experiment in automatically translating TV content through an external service.