Jump to content
MarMis

Want To Mark New Products As Not New

Recommended Posts

Standard all new products will be shown on the front page.

 

I have added a couple of "new" products in my shop. But.....these are not really new but moved from one shop to another.

I don't like all these products to be displayed on the front page.

Is there a possibility that I mark these, so that these will not be shown between the other "really" new products?

Share this post


Link to post
Share on other sites

Hi,

 

The best thing is you can assign old date_add to that product in the database. Modify date_add value in ps_product_shop database table.

 

Alternatively, you can do this by modifying code.

 

Edit

/var/www/html/prestashop1612/classes/Product.php

Search for

Product::cacheFrontFeatures($products_ids, $id_lang);

and add below three lines above search result.

 

foreach ($result as $index => $pro_id) { 
   if($pro_id['id_product'] == 11) unset($result[$index]);
}
  • Like 2

Share this post


Link to post
Share on other sites

 

Hi,

 

The best thing is you can assign old date_add to that product in the database. Modify date_add value in ps_product_shop database table.

 

Alternatively, you can do this by modifying code.

 

I hope this can be done per product. Try to find out where to find this.

Can you assist and let me know where I can find this?

 

thanks

Share this post


Link to post
Share on other sites

You need to know product id of those products, which you will find in url on edit product page. We are not aware of any setting in back end so you either need to access database or need to make change in code. If you are interested in some custom module for this feature, let us know.

Share this post


Link to post
Share on other sites

I am not so good in finding my way in the database. Need to learn sometime :)

 

 

The ID number should be the same as in front of the article in the backoffice?

or if I go into the article it is given like this:

 

The product link will look like this
https://www.tease2please.co.nz/lingerie-corsetsandbustiers/1101-Lingerie-CorsetsandBustiers-RomanticfrontZipperCorset.html

 

am I right to think that the ID number is 1101, as I have added

 

 

Have found the code as described and have changed it to the following:

 

        // Thus you can avoid one query per product, because there will be only one query for all the products of the cart
foreach ($result as $index => $pro_id) {
   if($pro_id['1101'] == 11) unset($result[$index]);
}
        Product::cacheFrontFeatures($products_ids, $id_lang);
        return Product::getProductsProperties((int)$id_lang, $result);

    }

 

 

But unfortunately it is still in the "new" products. What am I doing wrong

 

Thanks

Share this post


Link to post
Share on other sites

Try this

 

Edit below file.

/themes/default-bootstrap/product-list.tpl

search for

{foreach from=$products item=product name=products}

and add below line after search result.

 

{$prod_array=array('LILY POD WAND ATTACHMENT','BLACK ROTATION JELLY PENIS')}
{if in_array($product.name|escape:'html':'UTF-8',$prod_array)} 
    {continue}
{/if}
 
NOTE: you need to add condition based on your product name

Share this post


Link to post
Share on other sites

Thank you heaps for your advice.

The only problem is.... it doesn't work :(

 

I have tried to put it in default-bootstrap and in the warehouse theme I am using.

But nope.

 

Looks like:
 

<ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}">
    {foreach from=$products item=product name=products}
{$prod_array=array('BURLESQUE VALENTINA CORSET','Satin Organza Pin On Bustle')}
{if in_array($product.name|escape:'html':'UTF-8',$prod_array)}
    {continue}
{/if}
        {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo}

 

 

Please let me know what I am doing wrong. I like to add more corsets, but don't want them getting the attention of my main product-line

Share this post


Link to post
Share on other sites

I have found it!!!

 

It is as you suggested. I found the database and just need to change "date_add"

 

Great, just a question is there a possibility that I can select more products and change them all at once or do I need to add them one by one?

Share this post


Link to post
Share on other sites

You need to run below query to do this for multiple products at once. Please be careful while running query, modify it with care and it is highly recommended that you make backup of complete database first. You can even use our Prestashop EasyDB backup module to make automatic backup of specific table or complete table.

 

UPDATE `ps_product_shop` SET date_add= DATE_ADD(date_add, INTERVAL -100 month)
where id_product=1 or id_product=2

Share this post


Link to post
Share on other sites

My solution: (proved in ps 1.7)

in your database ( use phpMyAdmin for example) go to the table 

ps_product_shop

  and  change the attribute 

date_add

to a past, present or future date.

be aware, in the table ps_product_shop only ACTIVE products are listed. 

 

The Duration of time how long a product is marked as new is 20 days as default. To change go to:

 Backend --> (Shop-)Preferences --> Products

Edited by Henrik Pantle
grammer (see edit history)
  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
On 2/7/2019 at 7:17 PM, Henrik Pantle said:

My solution: (proved in ps 1.7)

in your database ( use phpMyAdmin for example) go to the table 


ps_product_shop

  and  change the attribute 


date_add

to a past, present or future date.

be aware, in the table ps_product_shop only ACTIVE products are listed. 

 

The Duration of time how long a product is marked as new is 20 days as default. To change go to:

 Backend --> (Shop-)Preferences --> Products

Muuuch better and quicker solution than all these alternatives on cloning the product..! Thank You Henrik for sharing this!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More