V
V
Vladimir Terechov2019-02-26 21:38:55
OctoberCMS
Vladimir Terechov, 2019-02-26 21:38:55

How to make a promo code for an online store?

Here a person enters a promotional code, if there is such a code, then the delivery price is reduced by the percentage that the admin has registered in the admin panel for each promotional code. Okay, everything is clear here.
Shipping prices are recorded in the database. It turns out that I need to change the delivery price in the database if there is a promotional code, if I change it in the database, then it changes and will remain so until it is changed in the admin panel or a new promotional code is entered. The question is, how to change the shipping price in the database only for the user who entered the promotional code, if the shipping prices are recorded in the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2019-02-26
@JhaoDa

No way. The shipping cost in the DB is the original one. A new one is calculated from it, taking into account the promotional code. The promotional code and the new shipping cost are saved in the order (or not in the order).

P
Pavel Lovtsevich, 2019-03-18
@lautsevich

You write the store yourself, as I understand it, without using ready-made solutions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question