News:

Support the VirtueMart project and become a member

Main Menu

Auto-reduce customfield value by 1 every day?

Started by mailblade, February 11, 2018, 09:09:43 AM

Previous topic - Next topic

mailblade

Solved; Will use STUDIO 42's suggestion.

I've got a small issue I am not sure on how to approach.

Let's say I've got a customfield "Days until Release", with each product having a different "Days until Release" customfield value (5, 10 etc).

How would I go about automatically reducing this value in the database by 1 every day until it reaches zero and then stops reducing?

I'm not really sure how to go about this, so any advice/tips would be kindly appreciated.

Thanks

AH

Maybe you should set a date rather than days and do the calculation based on that
Regards
A

Joomla 3.10.11
php 8.0

Studio 42

This need to do a customfield plugin, or use a standard customfield using a date and compare with current date.
In all case this need to have some PHP knowledge to do the plugin or to check the customfield ID, compare and display the countdown.
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

mailblade

Yes thanks guys will try that. For now, I'll just run an SQL query myself everyday to reduce by 1 every morning.

Studio 42

You complicate your live for nothing, but it's your choice
Free XML sitemap generator [url="http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm"]http://shop.st42.fr/en/catalog/products/virtuemart-2-sitemap.htm[/url]  , Free Unused Image cleaner [url="http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm"]http://shop.st42.fr/en/products/virtuemart-media-folder-clear.htm[/url]
Language Switch in product & category [url="http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm"]http://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm[/url]
More extentions [url="http://shop.st42.fr/en/"]http://shop.st42.fr/en/[/url]

mailblade

I mean until I figure out how to do a custom plugin this will have to do.