P
P
pokanub2021-06-18 01:39:14
WordPress
pokanub, 2021-06-18 01:39:14

How to implement dynamic pricing in wordpress acf?

There are events by dates made through entries, and the price is displayed through the acf field. It is necessary that a ticket purchased a week before is cheaper by 10%, and two weeks by 15% ... so the price will be different from the date ... from 7 days to 3 hours before the start, the current price, 3 hours before the start of the event, the price becomes 2000.
Who faced it, give a direction where to dig.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aricus, 2021-06-18
@Aricus

I think that it is better not to change the original price (all the more, it can be crossed out for clarity), but use discounts as modifiers, calculating the price each time you withdraw or calculate the amount in the basket. Of course, such a calculation should be placed in a special function or class.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question