Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

zimmer-media

Change Product Add Date to affect New

Recommended Posts

from ps-forum - with date-picker

admin folder\themes\default\template\controllers\products\informations.tlp

find the code

<div id="product-pack-container" {if $product_type != Product::PTYPE_PACK}style="display:none"{/if}></div>

<hr />

add this after

``` {if $product->date_add}

{/if}

Share this post


Link to post
Share on other sites

Does it give you an option to set old products as new? Please show live example for non programmers :)

Share this post


Link to post
Share on other sites

@MockoB

For us this is very helpful. If we get lists of new items from our wholesalers (dropshipping), then we can upload them by CSV. Very often, we only have to edit and activate the new articles several days later. So we can activate the article with the current date.

Share this post


Link to post
Share on other sites

Perfect! I wonder why it is not native feature. I sell products which are unique and I was deleting it after every sale. Recently I decided to change just the picture to avoid loosing ranking but it is hard for customers to find them because they have to list all the product pages ... Are you sure it will not cause any troubles with database or other related features? And is it possible to add for the non native TB theme?

Share this post


Link to post
Share on other sites

@MockoB I use the code for over a year with PS. There I had so far no problems. Since I have already switched some of my shops to TB, I could not find any problems so far. The code affects only the template in the BO under Edit Product, where the date of the article can be changed. In the FO, the article appears accordingly under NEW, if the date was set to the current.

Share this post


Link to post
Share on other sites

I can confirm that this works like a charm because we used this already with PS 1.5. But sometimes we needed to deal with just the opposite, because we didn't want every new entry to show up in frontend. So we backdated the products via date_add and for the remaining new products "abused" the database field upc. Every entry > 0 serves as condition in blocknewproducts to display a product (or not). This is helpful, if you have many new products, but don't want them all in your shop's frontend and want only a choice of them displayed.

Share this post


Link to post
Share on other sites

@Occam Yes. In the case of products which are used, for example, as an emergency aid for various things or are not to appear as new, we use an older date in the date field.

Share this post


Link to post
Share on other sites

Great, I will implement it in my next shop! One more question, what if I update the store? Do I have to update the code also in the file and if that's the case is there way to avoid changes to be overwritten?

Share this post


Link to post
Share on other sites

Would it bother you all if I wrote a dev blog post about this?

Share this post


Link to post
Share on other sites

Not at all, feel free to do so. But in this case you should mention that the update safe way to implement such changes is always an override of the standard behavior and not a direct core change. The modified informations.tpl should be created as

/override/controllers/admin/templates/products/informations.tpl

Share this post


Link to post
Share on other sites

This should be added to the core I have moded my file works perfect YAH no more going into myphpadmin to change the date. Thank You

Share this post


Link to post
Share on other sites

Hm I am very surprised that is working. How can it without changing any php file?

Btw I have coded a very similair function in an internal module... In other words: I also would like to see this in core ;)

Share this post


Link to post
Share on other sites

I have a list of a lot of them. Image mapping, shipping orders to multiple addresses, using multiple carriers per order. There are a lot.

Share this post


Link to post
Share on other sites

@Nemo Thank you for creating the video to make it understandable to create an override and edit a template.

http://nemops.com/eidt-product-creation-date-thirtybees-prestashop/

@zimmer-media - Thanks for creating this for us in the first place. Naturally, @Nemo gave you credit for it. :)

0_1515865492106_added new field to BO product info - new from.jpg

Share this post


Link to post
Share on other sites

I have change the add product date, but it don't come up on the FO, tab NEW products. browser cache and BO cache refreshed. On the pictuere there are the "new" label.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...