- Posts: 13
- Thank you received: 1
Add products newer than 3 weeks to a category
12 years 1 month ago #168523
by kimono
Add products newer than 3 weeks to a category was created by kimono
-- 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.
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.
12 years 1 month ago #168545
by Jerome
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.
Replied by Jerome on topic Add products newer than 3 weeks to a category
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
By
It will add the support of "{time}" in the global mass action system, not only in the Acymailing integration.
Regards,
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
Code:
if((in_array($filter['operator'],array('<=','>=','<','>')) && !preg_match('/^(?:\d+|\d*\.\d+)$/',$filter['value']))){
echo JText::_('WRONG_VALUE').' - ';
return '1 = 2';
}
Code:
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';
}
}
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.146 seconds