[Skip to main content](#vessel-content)

#   Add products newer than 3 weeks to a category

##

- **[kimono](/forum/user/12457-kimono "View kimono's Profile")**
- [![kimono's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12457-kimono "View kimono's Profile") Topic Author
- [ Offline](/forum/user/12457-kimono)

Less More

- Posts: 13
- Thank you received: 1
-
-

12 years 2 months ago [\#168523](#168523) by [kimono](/forum/user/12457-kimono "View kimono's Profile")  *[Add products newer than 3 weeks to a category](/forum/44-mass-actions/870546-add-products-newer-than-3-weeks-to-a-category#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 &quot;new&quot;. I have tried an expression, which somebody mentioned in this forum before: {time}-1814400 (for &quot;3 weeks in seconds&quot;) with &quot;product&#95;created &gt; What expression do I have to insert here?  Unfortunately, I didn't find any helpful hints in the documentation. Looking forward to any advice.")* was created by *[kimono](/forum/user/12457-kimono "View kimono's Profile")*

-- 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 &lt;= {time}-1814400".
But all I get is the message "wrong value - 0 results".

&gt;&gt; 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84NzA1NDYtYWRkLXByb2R1Y3RzLW5ld2VyLXRoYW4tMy13ZWVrcy10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

12 years 2 months ago [\#168545](#168545) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Add products newer than 3 weeks to a category](/forum/44-mass-actions/870546-add-products-newer-than-3-weeks-to-a-category#168545 "-- 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 &quot;new&quot;. I have tried an expression, which somebody mentioned in this forum before: {time}-1814400 (for &quot;3 weeks in seconds&quot;) with &quot;product&#95;created &gt; 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,

Firstly, I guess it will be "product_created" &gt;= {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('&lt;=','&gt;=','&lt;','&gt;')) &amp;&amp; !preg_match('/^(?:\d+&#124;\d*\.\d+)$/',$filter['value']))){ echo JText::_('WRONG_VALUE').' - '; return '1 = 2'; }

By Code:

if((in_array($filter['operator'],array('&lt;=','&gt;=','&lt;','&gt;')) &amp;&amp; !preg_match('/^(?:\d+&#124;\d*\.\d+)$/',$filter['value']))){ if(strpos($filter['value'],'{time}') !== false){ $query = new HikaShopQuery(); $filter['value'] = $query-&gt;_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 &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84NzA1NDYtYWRkLXByb2R1Y3RzLW5ld2VyLXRoYW4tMy13ZWVrcy10by1hLWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
