P
P
photosho2019-10-08 13:55:12
1C-Bitrix
photosho, 2019-10-08 13:55:12

Is it possible to sort goods by geo-coordinates in Bitrix?

It is necessary to implement the definition of the user's geo-coordinates and then sort the goods in the catalog so that the first place is taken by the goods located in the city from which the visitor came. Is this possible in Bitrix? As far as I know, such functionality is not provided out of the box, but perhaps there are some modules? Or, tell me how you could do it "on your own".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-10-08
Madzhugin @Suntechnic

Is this possible in Bitrix?

What does "possible in Btirix" mean? Bitrix is ​​written in php, and php is Turing complete, so it is even possible to write an OS on it.
There is nothing like it in the state. I don't know about mods either.
Probably there are several ways to implement, depending on your requirements.
Well, for example, if you have a total of, say, 5 cities in which you work, then you can create 5 properties for goods and pre-set the distance from each city in these properties. In the future, sort by this property depending on the city.
If you have unlimited cities, but you don’t need sorting, but what you described - first display the goods in this city, and then all the others, and a city is attached to each product, then I would suggest displaying the goods in two steps - first all the goods from the current city, and a separate component of all the rest.
Those. important first:
1 Understand what you call sorting and what you need.
2 Understand what geo-positions the user can have - whether it is cities or coordinates, and whether their number is limited.
3 Understand how you can store the positions of goods - again, these are cities or coordinates or something else.
Then think.

S
serginhold, 2019-10-08
@serginhold

Through get-lists practically in any way. Only with a self-written query, like this:
order by
if (location = {$id}, 0, 1) asc
(Sql needs to be known, etc., etc.)
---
Also, as a crutch option, make as many properties as locations on the site, and set 0 or 1 for everyone, like yes or no

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question