Jump to content

Want To Mark New Products As Not New


MarMis

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?

Link to comment
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 3
Link to comment
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

Link to comment
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

Link to comment
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
Link to comment
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

Link to comment
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?

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

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 3
  • Thanks 2
Link to comment
Share on other sites

  • 9 months later...
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!

Link to comment
Share on other sites

  • 5 months later...

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...