M
M
maksplotnikoff2016-03-15 15:24:19
MODX
maksplotnikoff, 2016-03-15 15:24:19

Price by region?

On the main page there is a slider that displays "hot" offers. It is necessary to make sure that, depending on the region, the price for this offer changes. What should you read about?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2016-03-15
@maksplotnikoff

It is necessary to determine the geolocation by IP, then, depending on the received region, display the price
Something like:

<?php

$location = getLocationByIp($_SERVER['REMOTE_ADDR']);

switch ($location) {
    case 'Moscow':
        $price = 1500;
        break;
    
    default:
        /* Есле геолокация не определилась */
        $price = 1000;
}

I
Igor, 2016-03-17
@ig0r74

There is a geolocation component: https://modstore.pro/packages/utilities/geolocation
Demo: location.vgrish.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question