Critical ESHOPMAN Insight: Understanding and Resolving Invisible Product Option Values

As an e-commerce expert at Move My Store, we frequently delve into the intricacies of platforms like ESHOPMAN to ensure seamless operations for our merchants. A recent community discussion brought to light a critical issue concerning product option values within ESHOPMAN, particularly how newly added values to existing product options can become silently invisible, impacting variant creation and overall product data integrity. This insight is crucial for ESHOPMAN users, developers, and merchants managing their storefronts via HubSpot CMS.

The Challenge: Silently Unlinked Product Option Values

Imagine meticulously updating your product catalog within ESHOPMAN, adding a new 'Size' or 'Color' option value to an existing product. You save your changes, and everything appears normal. However, when you go to create or edit a product variant, that new value is nowhere to be found. It doesn't appear in the variant creation dropdowns, nor is it returned when querying the product through the ESHOPMAN Admin API.

This isn't just a display glitch; it's a deeper data integrity issue. While the new value is indeed created in the underlying product_option_value table, it fails to establish a crucial link in the product_product_option_value table. This omission means the value is never properly associated with the product, rendering it effectively non-existent for the storefront and most administrative functions.

Reproducing the Issue in ESHOPMAN

The problem can be consistently reproduced in ESHOPMAN 2.x installations (confirmed on versions 2.17.2 and 2.21.0). Here’s a simplified breakdown of the steps:

  1. Create a product in ESHOPMAN with an option, for example, "Type," and an initial value like "A."
  2. Edit the product and add a new value, "B," to the existing "Type" option. Save the changes.
  3. Attempt to create a new variant for the product. You'll find only "A" is selectable; "B" remains invisible.

A direct database query reveals the asymmetry:

SELECT pov.value,
       EXISTS (SELECT 1 FROM product_product_option_value ppov
                WHERE ppov.product_opti
                  AND ppov.deleted_at IS NULL) AS linked
FROM product_option_value pov
JOIN product_option po ON po.id = pov.option_id
WHERE po.id = '

This query would show 'A' as linked and 'B' as unlinked, confirming the missing association.

The Technical Root Cause

The core of the issue lies within the ESHOPMAN platform's internal services, specifically related to how product options are updated. When an option is created together with its values, the system correctly uses a path (addProductOptionToProduct_) that ensures both the option value and its link to the product are established.

However, when updating an existing product option by adding a new value, the process goes through a different path (updateProductOptions_). This function upserts the option and its values, creating the product_option_value row, but it critically misses the step to create the corresponding product_product_option_value link row. The relevant code snippet from the ESHOPMAN Product Module Service illustrates this:

const { entities: productOptions } = await this.productOptionService_.upsertWithReplace(
  normalizedInput, { relations: ["values"] }, sharedContext
)
return productOptions

As seen, this code focuses on upserting the option and its values but does not explicitly handle the linking mechanism between the product and the newly added option values.

Impact on ESHOPMAN Merchants and Developers

The consequences of this unlinking are significant:

  • Invisible Management: Merchants cannot select these values when creating variants in their HubSpot storefront management, nor can they easily remove them through the ESHOPMAN admin, as the admin UI cannot "see" unlinked values.
  • Silent Failure: The save operation completes without error, providing no indication to the user that the new value is not fully integrated.
  • Data Consistency Challenges: Tools or custom integrations that rely on the ESHOPMAN product graph (e.g., GET /admin/products/:id?fields=options.values.value) will not return these unlinked values, leading to inconsistencies.

For developers building custom ESHOPMAN applications or integrations with the Admin API, this means extra vigilance. Standard queries might miss critical data, necessitating direct queries to product_option_value to detect such orphaned entries.

Community Solution and Best Practices

The community discussion confirms this as a bug requiring a platform fix. The solution involves enhancing the updateOptions_ function within the ESHOPMAN Product Module Service to detect newly inserted values and explicitly create the matching product_product_option_value entries, mirroring the logic already present in addProductOptionToProduct_. Until a permanent fix is deployed, developers might consider temporary workarounds, such as programmatically linking the values to make them visible for proper management or deletion.

This insight highlights the importance of robust data linking in headless commerce platforms like ESHOPMAN, especially when integrating with powerful storefronts like HubSpot CMS. Staying informed about these nuances ensures your ESHOPMAN product data remains accurate and fully functional across all touchpoints.

Start with the tools

Explore migration tools

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

Explore migration tools