D
D
Dinesh_Chugtai2019-12-04 13:55:03
PHP
Dinesh_Chugtai, 2019-12-04 13:55:03

Discount system for goods and baskets, how to implement the conditions?

Hello, this is the first time I've encountered a similar task and I can't get off the ground, because. I don't understand where to start. The task has the following conditions:
1. The ability to specify promotional codes that work for the total amount in the basket or for one product. They can be individual and general.
2. Discount on the total amount in the basket, the conditions can be as follows:
1. from 5500 to 10000 3%
discount 2. from 10000 5%
discount 3. 15% discount for one item or 350 rubles
4. Instead of a discount, present. For example, give out a toy when ordering a product.
5. Ability to start and stop the promotion by date.
I see the following tables:
5de78ef4dfad7490505069.png
According to the main table, the following data:

zone = 'cart' (cart, product)  // К чему применить, к всей корзине или к продукту

conditions = [
    0 => [
        'operator' => '>='
        'value' => '3500',
    ],
    1 => [
        'operator' => '<'
        'value' => '5500',
    ]
]

bonus = [
    'value' => '-3%' // вместо value, может быть product и его id, как подарок. Если процента нет, то отнимает рубли.
]

I apologize in advance for the mess in my head, I can not formulate my question better yet. How to implement exactly the conditions from and to, check what is applied to, etc.? Working on Laravel

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2019-12-04
@Dinesh_Chugtai

How to implement a system of rules to the basket on Laravel?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question