Answer the question
In order to leave comments, you need to log in
How to build a delivery list for placing an order on an online store?
How to build a delivery list for placing an order on an online store? what is the point. there are many options for deliveries from shopping malls, which I don’t know where to store either in the database or build on classes. everything would be fine and I chose the option of storing the database by storing ID / Name / Price there where price is the delivery price. But each shopping mall has its own prices, which are calculated individually through api, but the database will not be able to do this, or you do it by hand, this is generally nonsense. so here you need php to connect. and how to check it all. point me in the right direction please
Answer the question
In order to leave comments, you need to log in
Write your own algorithm for calculating the cost for each shopping mall and store the final cost in the database, for example.
You can add one more field where to store a string in a serialized form, which will contain, say, an array of the form:
Where the first element of the array is the position (place) in the delivery. And its key is an array with parameters, where the key is the description of the parameter, and the value is its price.
Well, depending on the key, display the corresponding service in the admin panel or somewhere else.
And in the price column, the sum of these services and positions. So you can always know what the price was formed for.
ALL stores use the API, don't even go to the grandmother.
Large deliverers have the most primitive API, for a specialist for 3 hours of work (as they like to say outbid on exchanges))) I.e. your client has chosen the city of delivery, door to door - to the warehouse, a request was sent to the deliveryman with parameters - city of dispatch, city of delivery, weight, dimensions, type of delivery, etc. An array comes in response, you parse it and show it to the client. Well, I say, special for 3 hours of work)))
The devil is in the details, for example, Russian Post and SDEK use different city identifiers, i.e. send a separate request for each. Or use aggregators.
No database is needed here, since the tariffs of the deliverers change in fact every day, although as an option you can score in the database if you need an approximate cost. On the other hand, several thousand cities can be applied to all weight options, all size options, all types of delivery options - I think you will need another database only for tariffs)))
Forget it and buy a ready-made plugin, they are available for almost any adequate CMS.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question