Skip to main content

Display NEW Badge For Number of Days

More
12 years 11 months ago #128596 by MyWorld
Is it possible to add badges to each individual product instead of adding the product to a category with the assigned badge?

For example, the client wants the badge "NEW" to be displayed for 7 days when a new product is added. The issue is the "End Date" is ONLY available for categories but not for individual products. This doesn't really work because products are added at different times so the we don't want them all ending the same time...

So basically, how can I have the "NEW" badge display for 7 days for a product.

Thank you!!

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

More
12 years 11 months ago #128642 by Jerome
Hi,

It is a good idea but I will see it differently.
If you will have to create a new badge each time you have a new product, it will be very difficult to manage.

I think that the "new" badge should be attached to a category without any date limitation.
But using a mass action, you can put products into a category (and remove them from a category).

So you can have a mass action which will put your new products to the special (hidden / unpublished) category if their create date is less than 7 days.
And you can have a mass action which will remove your "old" products from this special (hidden / unpublished) category if their create date is more than 7 days.

The mass action can be processed automatically every day using a cron task. So you won't have to do anything in your store except creating products.

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.

More
12 years 11 months ago #128670 by MyWorld

It is a good idea but I will see it differently.
If you will have to create a new badge each time you have a new product, it will be very difficult to manage.

Good point. I guess I was thinking of it similar to the "manage variants" that you create ONLY once. You would then add the "NEW" button to the NEW items and set the date for it to expire. But you know better how it would work ...

I think that the "new" badge should be attached to a category without any date limitation.
But using a mass action, you can put products into a category (and remove them from a category).

So you can have a mass action which will put your new products to the special (hidden / unpublished) category if their create date is less than 7 days.
And you can have a mass action which will remove your "old" products from this special (hidden / unpublished) category if their create date is more than 7 days.

The mass action can be processed automatically every day using a cron task. So you won't have to do anything in your store except creating products.


Ummm interesting... I will see if I can figure this out . Is there any documentation on this?

Thanks!!

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

More
12 years 11 months ago #128710 by nicolas

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

More
12 years 10 months ago #130665 by MyWorld
Hi there,

I'm trying to display items that are "NEW" for say 7 days but I'm not sure what options to select.

I'm not sure if it's category or product that I should choose as the "Data" to start. I am playing with both but none seem like its the correct one.

Can I get some direction please and thank you. Please see attached pic.

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

More
12 years 10 months ago - 12 years 10 months ago #130876 by Xavier
Hi,

It's actually not possible to set a filter based on the current date.
Thanks to add this additional code:
Code:
if(in_array($filter['type'],array('product_published','product_created','product_sale_start','product_sale_end','product_modified','product_last_seen_date')) && preg_match('/time-/',$filter['value'])){ $filter['value'] = time()-(int)str_replace('time-','',$filter['value']); }
Before:
Code:
$query->where[] = $this->massaction->getRequest($filter,'hk_product');
In the function onProcessProductMassFilterproductColumn of the file plugins/hikashop/massaction_product/massaction_product.php.

Be careful, this code will be override at the next release. But we will improve that until the next release ;)
Last edit: 12 years 10 months ago by Xavier.

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

Time to create page: 0.230 seconds
Powered by Kunena Forum