Prevent discounts for new products

  • Posts: 323
  • Thank you received: 18
  • Hikashop Business
3 months 3 weeks ago #362815

-- HikaShop version -- : 5.1.0
-- Joomla version -- : 4

We have special law for books. We are not allowed to have discount (that includes coupons to) on books 6 months since the publication of the book.
Solution would be to enter date of publication in product.
Any idea how to?

Please Log in or Create an account to join the conversation.

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
3 months 3 weeks ago #362816

Hi,

On solution would be to create an unpublished category "discount". Then, create a custom product field of the type "text" where you would enter the date of publication in the unix timestamp format.
Then, you could create a mass action with :
- a filter on the column of this custom field with a condition like this: < {time}-15778476
- a second condition on the category column category_name being different than the unpublished discount category's name
- an action "add category" with that unpublished discount category selected
This way, when running this mass action, the system will add the products with a publication date older than 6 months to that discount category.
And then, in your discounts and coupons meant to apply for any product on your shop, you can select that discount category so that products not linked to it won't be taken into account.

That's a bit of stretching of the capabilities of HikaShop though. A cleaner solution would be to develop a plugin implementing the discount API and coupon API ( www.hikashop.com/support/documentation/6...entation.html#coupon ) to check the date of publication on the fly when the discounts / coupons are being loaded. The advantage of this method is that instead of a custom text field with the unix timestamp (which is necessary so that you can use a mass action filter on it), you can use a custom field of the type "advanced date picker" which will be more convenient to set the publication date. The drawback is that it requires some development.

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum