Kentico / xperience-by-kentico-shopify

This integration connects your Shopify store with the Xperience by Kentico application using Shopify Storefront and Shopify Admin APIs.
MIT License
3 stars 1 forks source link

Bug: Hardcoded Currency in ShopifyProductService #10

Closed liamgold closed 2 months ago

liamgold commented 2 months ago

Describe the bug In ShopifyPriceService.cs there is a hard coded currency, which means if you've configured a different Currency Code in the Xperience by Kentico admin site, you'll get an error retrieving prices where this service is used. Currently there is this code:

    string currency = CurrencyCode.CZK.ToString();

See screenshot 1 below which shows the result.

There are more hard coded Culture Codes/Currency Codes in the example project, which I assume is the responsibility of the developer to configure properly, but it would be ideal if the example project shows how to do this:

  1. ShopifyProductDetailController.cs has a hard coded culture and currency with a TODO:

    // TODO - dynamic resolve country
    string country = "CZ";
    string currency = "CZK";
  2. ShopifyProductListItemViewModel.cs has a hard coded currency code with a TODO:

    // TODO resolve currency
    string currency = "CZK";

See screenshot 2 below which shows the result.

To Reproduce Steps to reproduce the behavior:

  1. Configure GBP as a currency within the XbyK admin site
  2. Visit a page you've created using Shopify category page content type
  3. See screenshot 1 below
  4. Then go to a page you've created with Shopify product detail page content type
  5. . See screenshot 2 below

Expected behavior Should automatically handle getting the correct culture, and the currency code configured in the XbyK admin site.

Screenshots Screenshot 1 - instead of the correct from price showing, you'll get an identifier being rendered Shopify Price Service Error

Screenshot 2 - pricing panel is completely hidden, and replaced with a Coult not fetch variant prices error message on the front-end Variant Price Error

Library Version v1.0.0 (and pre-release)

martinkyjac commented 2 months ago

Hi Liam, thank you for the bug report. We will address this issue as soon as possible and keep you informed of our progress.