Add products newer than 3 weeks to a category

  • Posts: 13
  • Thank you received: 1
10 years 3 months ago #168523

-- HikaShop version -- : 2.3.2

Hi,

I want to use a mass action in order to add products, which are newer than 3 weeks to the category "new".
I have tried an expression, which somebody mentioned in this forum before: {time}-1814400 (for "3 weeks in seconds") with "product_created <= {time}-1814400".
But all I get is the message "wrong value - 0 results".

>> What expression do I have to insert here?

Unfortunately, I didn't find any helpful hints in the documentation.
Looking forward to any advice.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 3 months ago #168545

Hi,

Firstly, I guess it will be "product_created" >= {time}-1814400.
Secondly, you have the edit the file "administrator/components/com_hikashop/classes/massaction.php" and replace the code

		if((in_array($filter['operator'],array('<=','>=','<','>')) && !preg_match('/^(?:\d+|\d*\.\d+)$/',$filter['value']))){
			echo JText::_('WRONG_VALUE').' - ';
			return '1 = 2';
		}
By
		if((in_array($filter['operator'],array('<=','>=','<','>')) && !preg_match('/^(?:\d+|\d*\.\d+)$/',$filter['value']))){
			if(strpos($filter['value'],'{time}') !== false){
				$query = new HikaShopQuery();
				$filter['value'] = $query->_replaceDate($filter['value']);
				$filter['value'] = strftime('%Y-%m-%d %H:%M:%S',$filter['value']);
			} else {
				echo JText::_('WRONG_VALUE').' - ';
				return '1 = 2';
			}
		}
It will add the support of "{time}" in the global mass action system, not only in the Acymailing integration.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.053 seconds
Powered by Kunena Forum