Mastering Currency Display in ESHOPMAN: A Common Data Entry Pitfall

One of the most critical aspects of any e-commerce platform is the accurate handling and display of currency. For ESHOPMAN users, ensuring that prices are shown correctly across the Admin Panel, storefront, and database is paramount. A recent community discussion shed light on a common pitfall related to currency data entry and how it impacts display within the ESHOPMAN ecosystem.

The Seemingly Misleading Display in the ESHOPMAN Admin Panel

A user reported an observation where the ESHOPMAN Admin Panel appeared to display monetary amounts as raw integer values, rather than properly formatted decimal values. For instance, a price intended to be 31.90 PLN was showing up as 3190,00 zł in the Admin Panel. This discrepancy was noted in various sections, including order lists, order details, and product prices within order summaries.

The user's ESHOPMAN setup involved:

  • ESHOPMAN platform (Node.js/TypeScript)
  • PostgreSQL database
  • PLN (Polish Zloty) currency, configured with decimal_digits = 2

Crucially, the database was found to store values in their smallest currency unit (e.g., 3190 for 31.90 PLN), and the storefront, deployed via HubSpot CMS and powered by the ESHOPMAN Store API, was correctly formatting and displaying prices as expected (e.g., 31,90 zł). This suggested that the ESHOPMAN Admin Panel, which provides storefront management within HubSpot, might be missing a conversion step.

Verifying Currency Configuration and Stored Values

To diagnose such issues, it's always a good practice to verify your currency configuration and how values are stored directly in your database. Here's how you might inspect these details in a PostgreSQL database:

SELECT code, name, symbol, decimal_digits FROM currency WHERE code = 'pln';

This query helps confirm that your currency, in this case, PLN, is indeed configured with decimal_digits = 2, indicating two decimal places for standard display.

To check how product prices are stored:

SELECT pv.title, pp.amount, pp.currency_code
FROM product_variant pv
JOIN product_variant_price_set pvps ON pv.id = pvps.variant_id
JOIN price_set ps ON pvps.price_set_id = ps.id
JOIN price pp ON ps.id = pp.price_set_id
LIMIT 5;

This query would show values like 3190 for an item, confirming that the database holds the price in its smallest unit (e.g., grosze for PLN, cents for USD).

The Revelation: A Data Entry Misconception

The core of the issue was not a bug in the ESHOPMAN Admin Panel's display logic, but rather a misunderstanding during data entry and import. As clarified by another community member, ESHOPMAN expects prices to be entered as their actual decimal value. If a user intends a price to be 31.90 PLN, they should input 31.90. The system then internally handles the conversion to the smallest currency unit (e.g., 3190) for storage and uses the decimal_digits configuration for correct display.

The user had incorrectly stored prices in the database by importing 3190, intending it to represent 31.90 PLN. However, ESHOPMAN interpreted this 3190 as the full monetary value, leading to it being displayed as 3190,00 zł in the Admin Panel. The storefront, in this specific case, was also compensating for this incorrect data by performing an unnecessary division by 100 on its end.

Key Takeaways and Best Practices for ESHOPMAN Users

This discussion highlights a crucial best practice for anyone managing product data in ESHOPMAN:

  • Understand ESHOPMAN's Currency Input: When entering prices, always input the value as you expect it to be displayed (e.g., 31.90 for 31 PLN and 90 grosze). ESHOPMAN handles the internal conversion to the smallest unit based on your currency's decimal_digits configuration.
  • Verify Data Import Processes: If you are importing product data, ensure your import scripts or tools are providing prices in the correct decimal format that ESHOPMAN expects, not pre-converted smallest units unless explicitly required by a specific API endpoint.
  • Consistency Across Platforms: Maintain consistency in how prices are handled from data entry to database storage, the ESHOPMAN Admin API, Store API, and finally, your HubSpot CMS storefront.

By adhering to these guidelines, ESHOPMAN users can avoid common currency display issues and ensure accurate price representation across their entire headless commerce setup managed through HubSpot.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools