How to get product price in the default currency, from the storefront?

Alex666
New Member
3 0 0

Hey guys,

 

The product json object (example: https://shop.vitals.co/products/ladies-short-sleeve-t-shirt.json) does not return the price of the product in the default currency. It includes only the presentment currency price. 

This becomes a problem, when the user switches the currency and continues navigating. This problem is even more pronounced, when the store has Price Rounding enabled.

Due to this issue, we are forced to use highly inefficient workaround logic with our servers.


Can anyone help with a solution to obtain the default currency price, without an additional request, especially outside of Shopify's API?

@Shopify, do you have any plans to add this info in a future API iteration? We were thinking the implementation should be similar to (see the green text):

      "variants":[
         {
            "id":16260637327411,
            "product_id":1727106023475,
            "title":"Charcoal-Black Triblend \/ S",
            "price":"93.00",

            "defaultCurrencyPrice":"123.45",
AND/OR

            "priceWithoutRounding":"123.45", //here, we can take the presentment currency rate from the Shopify.currency object and convert it accordingly in the storefront

            "sku":"3068390",
            "position":1,
            "compare_at_price":"",
            "fulfillment_service":"manual",
            "inventory_management":null,
            "option1":"Charcoal-Black Triblend",
            "option2":"S",
            "option3":null,
            "created_at":"2019-02-26T04:37:51-05:00",
            "updated_at":"2021-05-15T18:55:41-04:00",
            "taxable":true,
            "barcode":null,
            "grams":99,
            "image_id":5039324397619,
            "weight":3.5,
            "weight_unit":"oz",
            "requires_shipping":true
         },

 

Thank you all in advance. And please let me know if I can provide more details.

0 Likes
Alex666
New Member
3 0 0

@vix , could you please help with a point of view on this subject? Thank you in anticipation. 

0 Likes