T
T
Terroris3372021-02-13 22:22:48
Laravel
Terroris337, 2021-02-13 22:22:48

How to implement a promotion system in an online store?

Good day, dear experts. I am writing an online store on Laravel and faced the problem of implementing a discount system. The idea is to make a promotion that will make a discount on all products of a certain category, or on a specific product, the promotion has an expiration date (start date and end date). I am considering an implementation option through Task Scheduling. Is there some kind of package for this or do everything by hand?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Daria Motorina, 2021-02-14
@glaphire

It is unlikely that there is a ready-made package, except perhaps a ready-made store on Laravel)
As a draft, you can sketch out a database schema:

product
category
sale
sale_category
sale_product

And sale is described as:
id
name
type (fixed, percent, formula)
value
start (datetime)
end (datetime)

And write down a service that will check for discounts for a category or product and calculate the final price. You just need to describe all the scenarios for calculating discounts verbally, and as a result, the service class will be easier to decompose

A
Adamos, 2021-02-13
@Adamos

The idea is to make a promotion that will make a discount on all products of a certain category, or on a specific product, the promotion has an expiration date (start date and end date).

The problem, apparently, is that you yourself do not know why in general to process this table on a schedule?
It is unlikely that someone's module will help you with this.

J
JhaoDa, 2021-02-14
@JhaoDa

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