Retrieve price based on geolocation
Use the getPrice method to retrieve product prices based on geolocation.
To display product prices on your website without having the geolocation feature, you can use the getPrice API method, as described below.
Request sample
var data = {
PRODS: ' 12345678', // product ID
OPTIONS 12345678: '', // product pricing options if any
QTY: 1, //product quantity
CURRENCY: 'EUR', //product currency
COUPON: null, //discount to be applied
RESPONSE_TYPE: 'JSON'
};
$.ajax({
type: 'GET',
url: 'https://' + window.location.host + '/action/get_price.php',
data: data,
success: function (data) {
// your code here
},
error: function (error) {
console.error(error);
},
});A built URL that displays prices based on the customer's geolocation would look like this:
Last updated
Was this helpful?