Shopify single customer lifetime value and currency conversion - shopify

Shopify docs say that liquid variable {{ customer.total_spent }} contains the total amount that the customer has spent on all orders in the currency's subunit – and that the value is output in the customer's local (presentment) currency.
The store in question is on a plan called "Shopify" (does not have Shopify Plus).
I'm trying to send an analytics event containing this value from Shopify standard order status page via additional scripts.
For the analytics to work correctly I need to either send customer's local currency – or have {{ customer.total_spent }} converted to my Shopify's store currency (in my case Euro).
How do I get customer's local currency ISO code?
Is it possible (and how) to convert {{ customer.total_spent }} to store currency using the conversion rate that is currently set up for a given Shopify store?

Related

Can we increase shipping rates in shopify using shopify script?

I found similar question in the forum, and from this answer I come to know about Career service. Which looks promising initially, but after reading the doc from here, I found that there is an issue for my use case.
This is my use case:
There will be multiple items in the cart with different delivery dates set(I store delivery dates in the line_item property)
now when user go to checkout the shipping rate has to be calculated based on the delivery dates(which are stored in the line item property for each line item)
shipping price should be calculated like ...... if there is only one delivery day, we need to offer x price, if there are two different delivery dates we need to offer 2x price and so on....
so the issue is, Carrier Service uses Server side cashing and it will only ask for price if any of these(variant IDs, default shipping box weight and dimensions, variant quantities, carrier service ID, origin address, destination address, item weights and signatures) field change. It doesn't include line item properties(where I have stored delivery dates).
I have also checked the shopify scripts from here, but after some mockups I come to know that we can only provide discount to the existing shipping rates and can not add new shipping method, or increase shipping price for existing shipping method.
Please help me to find a solution for this problem.

How to get returns/refund value from shopify api

I am trying to calculate the total sales of orders overtime similar to shopify reports dashboard. I tried using the transactions api and calculated the total sales by subtracting the refund value from sale value but the value I calculated and the one in shopify reports dashboard seems different but when I tried subtracting the returns value in the shopify dashboard and sale value from the transactions api I got the same value as in shopify dashboard.
So where can I find the returns data in shopify api ? or How can I calculate the returns value through shopify api?
For refund amount check Order API and Order object
You will find there field refunds that will contain transactions and refund_line_items.
I hope that will contain all information that will be required.

Getting a single value from fixer.io and use it on my website to multiply?

I have a bunch of prices listed on my website, in British Punds. I would like to pull the current currency exchange rate into my website, to convert this value to another currency. It seems that fixer.io gets the data I need, but how do I pull it into my page? I only need 1 value form it.
My page loads the prices from a database, so I guess I need to multiply the database numbers with jQuery when the page is loaded.
Thats not my current issue though. I just want to figure out how to pull a single number, and be able to use it on my page.
Good day.
If you need to get currency rates for British Punds with fixer.io, you can make get request to
GET https://api.fixer.io/latest?base=GBP
And you will get latest foreign exchange reference rates for GBP.
If you don't need all list of currencies you may use something like
GET https://api.fixer.io/latest?symbols=USD,EUR?base=GBP
And you will get exchange rates for USD and EUR with base GBP.
Hope it will help you!

Creating and updating products in BigCommerce via the API results in reformatted proudct codes and SKUs

Is there anything in the BigCommerce API that would detect a product code or SKU that resembles a date format (i.e. "12-34-7377") and automatically convert to another date format (i.e. "7377 -12-34").? We are seeing product codes like this get automatically reformatted by the BC API when creating and updating products via the API. I have already confirmed that JSON data being sent is the correct data/product code.

Currency used in the cart must match the currency of the seller account

My client's Google Checkout account is based in UK, hence its default currency is GBP. Accordingly, I thought I'd let users pay using GBP - they actually think they are paying in USD but behind the scenes I convert USD to GBP according to the conversion rate.
Anyway, I keep getting the following error message:
The currency used in the cart must match the currency of the seller account. You supplied a cart with USD and the seller account is associated with GBP.
When I check the Integration Console for the message that is being sent from the website to Google Checkout's API, this is what I get:
_type=checkout-shopping-cart&shopping-cart.items.item-1.item-name=Credits&shopping-cart.items.item-1.item-description=Description&shopping-cart.items.item-1.item-currency=GBP&shopping-cart.items.item-1.unit-price=64.42&shopping-cart.items.item-1.quantity=1
As you can see, I made sure the currency is set to GBP, yet it still complains. Is there anything I can do to fix this?
How are users thinking they are paying in USD? If they see the Place Order page in USD, then the cart is posted in USD, hence your problem.
Also please keep in mind that credit card companies will add extra fees for currency conversions, which are unknown at the time of transaction to both the seller and Google Checkout. Usually the fees appear as a separate item on the buyer's credit card statement. You may want to inform non-UK buyers about this and emphasize that the currency fees are out of your control.
This doc has some info related to this error:
https://checkout.google.com/support/sell/bin/answer.py?hl=en&answer=71444