10 years ago
0
Topic
Hello @ all,
I have searched the forum about a specific problem but I did not find a working solution.

I have made a content type for a product page. In this content type you will be able to fill in different prices for different sizes of the product (realized with a groupx).
You are also able to declare a certain price as an offer price (f.e. 10€ instead of 15€) and you will be able to add the date range in which this price is valid (f.e. form 1st of May to the 1st of June = date range).
IMPORTANT: This date fields are custom storage due to groupX and not the standard Joomla date fields!!

To show all this offerts in a module I have created a list module which ouptut all prices that are declared as an offer.
To this point everything works fine.

MY BIG PROBLEM:
I am not able to check if the current date is inside the date range. F.e. today is the 2nd of May so the offer is in the date range from the 1st of May to the 1st of June - the offer should be displayed. If it is outside of the date range the offer display should be disabled.
First of all, I am able to hide an outstanding offer with PHP in a custom template (no problem), but this is not what I want, because if a product contains an offer price which is not valid anymore the list module is always visible without a content. This is what I want to prevent: empty modules.

I have tried it with the datetime-picker plugin to get the current date, but I am not able to get it work.

Has someone an idea to point me into the right direction!?!





Get a VIP membership