ESHOPMAN

Mastering Currency Display in ESHOPMAN: Ensuring Accuracy from Admin Panel to Storefront

In the intricate world of e-commerce, precision is paramount. From inventory management to order fulfillment, every detail contributes to a seamless customer experience and robust financial operations. Among these, the accurate handling and display of currency stand out as one of the most critical aspects. For businesses leveraging ESHOPMAN, our powerful headless commerce platform wrapped as a HubSpot application, ensuring that prices are shown correctly across all touchpoints – the Admin Panel, the storefront deployed via HubSpot CMS, and the underlying database – is not just good practice; it's essential for trust and operational integrity.

Recently, a valuable discussion within the ESHOPMAN community brought to light a common pitfall related to currency data entry and its impact on display within the ESHOPMAN ecosystem. Understanding this nuance is key to mastering your store's financial presentation.

PostgreSQL currency table schema with decimal_digits
PostgreSQL currency table schema with decimal_digits

The Seemingly Misleading Display in the ESHOPMAN Admin Panel

A user reported an observation that initially caused some confusion: the ESHOPMAN Admin Panel, which provides comprehensive storefront management directly within HubSpot, appeared to display monetary amounts as raw integer values rather than properly formatted decimal values. For instance, a product price intended to be 31.90 PLN (Polish Zloty) was showing up as 3190,00 zł in various sections of the Admin Panel, including order lists, detailed order views, and product prices within order summaries.

This discrepancy was particularly puzzling because the user's ESHOPMAN setup was seemingly correct:

  • The core ESHOPMAN platform, built on Node.js/TypeScript, was running smoothly.
  • A robust PostgreSQL database was in use for data storage.
  • The PLN (Polish Zloty) currency was correctly configured with decimal_digits = 2, indicating two decimal places for display.

Crucially, further investigation revealed that the database was indeed storing values in their smallest currency unit (e.g., 3190 for 31.90 PLN). Even more reassuringly, 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, while providing powerful management capabilities, might have been missing a crucial conversion step for display purposes, presenting the raw database value directly.

Understanding ESHOPMAN's Robust Currency Handling Philosophy

To truly grasp this situation, it's important to understand ESHOPMAN's underlying philosophy for currency management. Like many modern e-commerce platforms, ESHOPMAN, with its Node.js/TypeScript backend and PostgreSQL database, stores monetary values in their smallest currency unit (e.g., cents for USD, groszy for PLN). This approach offers several significant advantages:

  • Precision: It avoids potential floating-point arithmetic errors that can occur when dealing with decimal numbers in computer systems, ensuring exact calculations.
  • Consistency: All financial calculations are performed on whole numbers, leading to consistent results across the platform.
  • Database Efficiency: Storing integers can sometimes be more efficient for database operations.

The magic of displaying these values correctly lies in the application of currency-specific formatting rules, primarily driven by the decimal_digits configuration.

Verifying Currency Configuration and Stored Values

When diagnosing such display issues, the first step is always to verify your currency configuration and how values are stored directly in your database. This ensures that the foundational data is correct. 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 correctly defined with the appropriate number of decimal digits. For PLN, this should typically be 2. If this value is incorrect, it would impact both the Admin Panel and the storefront.

The ESHOPMAN Ecosystem: Admin API vs. Store API Display

The ESHOPMAN platform leverages two primary APIs: the Admin API and the Store API. The Store API is responsible for serving data to your HubSpot CMS storefront, handling all necessary formatting and conversions to present user-friendly prices. This is why the storefront correctly displayed 31,90 zł.

The Admin Panel, integrated within HubSpot for storefront management, interacts with the Admin API. The observed discrepancy highlighted a scenario where the Admin Panel was, in certain views, displaying the raw integer value retrieved from the database without applying the decimal_digits conversion for presentation. This is a display-level inconsistency, not an issue with the underlying data integrity or the Store API's functionality.

Impact and Ensuring Consistent Display Across ESHOPMAN

While the underlying data and customer-facing storefront remained accurate, a misleading display in the Admin Panel can cause confusion for merchants. It can lead to questions about financial accuracy, complicate order management, and erode trust in the system's presentation layer. For an e-commerce expert, ensuring that all interfaces reflect the true monetary value is paramount.

The ESHOPMAN team is committed to providing a seamless and accurate experience across all facets of the platform. Understanding this feedback helps in continuously refining the Admin Panel's display logic to ensure that all monetary values are consistently formatted according to their respective currency's decimal_digits configuration. This means that whether you're viewing an order summary in the HubSpot-integrated Admin Panel or browsing products on your HubSpot CMS storefront, the prices should always be presented in a clear, correctly formatted manner.

Best Practices for ESHOPMAN Users

To ensure you always have an accurate view of your store's finances:

  • Verify Currency Configuration: Regularly check your currency settings in the database to ensure decimal_digits are correctly set for all active currencies.
  • Understand Storage: Remember that ESHOPMAN stores currency in its smallest unit for precision. The display layer is responsible for formatting.
  • Test Across Interfaces: Always test how prices appear on both your HubSpot CMS storefront and within the ESHOPMAN Admin Panel after any significant changes to currency settings or product pricing.
  • Leverage ESHOPMAN Support: If you encounter any inconsistencies, reach out to ESHOPMAN support. Your feedback is invaluable for continuous improvement.

Conclusion

The accurate display of currency is a cornerstone of any successful e-commerce operation. ESHOPMAN, as a robust headless commerce platform built on Node.js/TypeScript and integrated with HubSpot, provides a powerful foundation for managing your online store. While the underlying data storage and storefront display are meticulously handled, understanding the nuances of how the Admin Panel presents this data is crucial for merchants.

By ensuring your currency configurations are correct and recognizing the distinction between raw stored values and formatted display, ESHOPMAN users can confidently manage their storefronts within HubSpot, knowing that their financial data is both precise and accurately represented across the entire ecosystem. This commitment to detail reinforces ESHOPMAN's position as a reliable partner for your e-commerce journey.

Share:

Start with the tools

Explore migration tools

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

Explore migration tools