Jump to content

Recommended Posts

you can achieve this with mysql triggers, read this tutorial: disabling the out of stock products

I read this tutorial already but problem is that there is no trigger option in phpmyadmin and I even told my hosting server provider please upgrade it and in response from them is, they will upgrade after August,

 

So please guide me another way

 

post-364632-0-38232100-1372689476_thumb.pngpost-364632-0-09296900-1372689484_thumb.pngpost-364632-0-52094300-1372689495_thumb.png

Edited by mux (see edit history)
Link to comment
Share on other sites

if you've got possiblity to run cron jobs, you can run one with php script with code mentioned in the tutorial:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

 

run this script (for example) for every 10 minutes or as often as you like

Link to comment
Share on other sites

if you've got possiblity to run cron jobs, you can run one with php script with code mentioned in the tutorial:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

 

run this script (for example) for every 10 minutes or as often as you like

 

I do not have option of cron jobs in my hosting, can I get any help/guidness in coding structure? such as in classes/category.php or classes/Product.php

 

Thanks.

Link to comment
Share on other sites

no cron jobs, no triggers :| what hosting you use?

well, in this case, if you haven't got access to the features that i mentioned above you should edit core of the prestashop, there is no other way to achieve what you expect. unfortunately :(

Link to comment
Share on other sites

no cron jobs, no triggers :| what hosting you use?

well, in this case, if you haven't got access to the features that i mentioned above you should edit core of the prestashop, there is no other way to achieve what you expect. unfortunately :(

Thanks vekia,

Yes you are right, I should edit the core files of it.

Link to comment
Share on other sites

  • 5 weeks later...

swissindonesia but then product list will have "empty boxes" it mean that the products will not be excluded from the counter.

in addition - without "deactivating" the item - there is still possibility to order the product, for example from product page, or from simple modified form.

 

in my opinion it is necessary to "disable" the product. the question is: why the method provided above doesnt work ;)

 

Microame, what PS version you're using?

  • Like 1
Link to comment
Share on other sites

Hi Pascal,

 

yes there was a white space, but it is only a name. But still I have changed the white space but no change.

 

Hi Vekia,

 

Changed the quantity manually and in the cart it shows zero quntity and add to cart button is disabled. Still the product is visible.

post-585597-0-27837700-1375441925_thumb.png

post-585597-0-02295100-1375441931_thumb.png

post-585597-0-71765200-1375441936_thumb.png

Link to comment
Share on other sites

okay, so everything looks fine.

your quantities are stored in the correct tabe: ps_stock_available

 

now the question is why the trigger doesn't work

are you sure, that your hoster allows you to use triggers in the mysql?

Link to comment
Share on other sites

Just use an override for Category class - is this way - is just one line of code

 

Copy the attached Category.php in override/classes/

 

and let me know if is ok :)

 

Regards

 

 

Modification:

 

in function getProducts just put .' AND IFNULL(stock.quantity, 0) > 0 ' before

.' GROUP BY product_shop.id_product';

Category.php

Edited by MysysRo (see edit history)
Link to comment
Share on other sites

Hi MySys,

 

Yesterday I played with the exact same idea, but somehow it doesn't 'see' the file in the override/classes folder. Even the change in the original /classes/Category.php seemed not be seen, as if there's another overriding file in play.

 

Did you try it out and did it work for you when added to override/classes?? Curious...

pascal

Link to comment
Share on other sites

Hi PascalVG

 

On my 1.5.4.1 instance is working, just try the attached file from my post

 

But indeed is something strange with override, I can not override HookCore - it doesn't 'see' the modifications - I was forced to change

the original /classes/Hook.php

Link to comment
Share on other sites

  • 1 month later...

can you for test purposes manually change the quantity in the ps_stock_available table? (in phpmyadmin)

then check the products active field in the ps_products table

Hii Vekia

after create trigger rule...out of stock product show...

plese give any suggetion about it...

Thanks in advance

Link to comment
Share on other sites

Hii Vekia

after create trigger rule...out of stock product show...

plese give any suggetion about it...

Thanks in advance

 

i need little more informations like:

  1. what ps version
  2. are you sure that your hoster allow to use triggers?
  3. after trigger creation, does trigger appear on trigger list?
  4. you use advanced stock management?
  5. are you sure that you use correct table names? (especially prefix) 
Link to comment
Share on other sites

 

i need little more informations like:

  1. what ps version
  2. are you sure that your hoster allow to use triggers?
  3. after trigger creation, does trigger appear on trigger list?
  4. you use advanced stock management?
  5. are you sure that you use correct table names? (especially prefix) 

 

1.5.4.1 version

yeah

yes appear trigger in trigger list

i check use in stock advanced management system..

yeah table name is correct..

plz help me..

Link to comment
Share on other sites

  • 3 weeks later...

Hi everybody!

 

I've been looking around for a solution for this issue, and since PS version 1.5, it's so easy to deal with this kind of things.

 

That's why I've created this simple module that use the hook to disable the product after it's sold.

 

http://www.prestashop.com/forums/topic/278029-free-module-hide-disable-products-when-they-are-out-of-stock/

 

Regards for all!

Link to comment
Share on other sites

  • 2 weeks later...

the best way i found is to add this code in each product loop:

 
 {if $product.quantity > 0}
{/if}

so the old code is

{foreach from=$new_products item='product' name='newProducts'}
..........
{/foreach}

become:

{foreach from=$new_products item='product' name='newProducts'}
  {if $product.quantity > 0}

................

  {/if}
{/foreach}

enjoy :)

Link to comment
Share on other sites

the best way i found is to add this code in each product loop:

 
 {if $product.quantity > 0}
{/if}

so the old code is

{foreach from=$new_products item='product' name='newProducts'}
..........
{/foreach}

become:

{foreach from=$new_products item='product' name='newProducts'}
  {if $product.quantity > 0}

................

  {/if}
{/foreach}

enjoy :)

 

 

This does not work for products that allowed to be ordered when out of stock.

Link to comment
Share on other sites

i replied also in other topic related to this case, here is what i think about it:

 

hello

 

but for example, your store displays 10 products in category page (you can define how many products you want to display in BO)

script make query to database and get 10 products, for example - 9 of them have got quantity = 0.

 

you will see only 1 product on page then. it will looks weirdy especially when you will have additional pages (pagination)

one page with 1 product, several other pages with more / less products displayed...

Link to comment
Share on other sites

Spider, Maybe you want to allow the "allow out-of-stock orders" on a per-product basis, so El Patron has a point there.

 

N.B. I once made a trigger based version (in it's basic form it also didn't check for allow-out-of-stock, but can be added if needed). If anyone's interested...

Link to comment
Share on other sites

pascal...that would be great if you could provide the trigger with checks for out of stock rule.  Vekia could add to his tutorial trigger.

 

I've seen loads of 'half' complete solutions on this subject.  None of which work totally....

 

in my world..if either works totally or it fails completely, there are no half solutions to running a professional shop.

Link to comment
Share on other sites

Hi El Patron, all,

 

El patron, you asked for a trigger based version taking into account the allow out-of-stock ordering of individual products.

You can do something like this:

 

 

Create a trigger in the ps_stock_available:

Trigger name: change_active_allow_oos

Table: ps_stock_available

Time: after

Event: Update

Definition:

 

BEGIN
DECLARE SHOPWIDEOOS TINYINT(1) DEFAULT 0;
SET SHOPWIDEOOS = (SELECT CAST(`value` AS SIGNED) AS num
                FROM `ps_configuration`
                WHERE `name` = 'PS_ORDER_OUT_OF_STOCK'
                limit 1);

 
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);
UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity<=0 AND (out_of_stock =0 OR (out_of_stock = 2 AND SHOPWIDEOOS = 0)));
END

 

Explanation:

Step 1: (Purple):

declare a local integer variable called SHOPWIDEOOS inside the trigger, with default value 0

 

Step 2: (Green)

Get the current 'shop wide' value that defines if out of stock products can be ordered. This value comes from the ps_configuration file. You set this value in Back office, in Preferences->Products:

post-455771-0-86834900-1381733996_thumb.jpg

When Checked, this allows for products to be ordered when out of stock BUT ONLY IF the product has the allow out of stock setting is set to "default' (internal value of this option = 2)

post-455771-0-58701800-1381734320_thumb.jpg

 

(Of course you can also define per product if the product can be ordered or not, in the same menu. Then choose Deny (internal value = 0) or Allow (internal value = 1) instead of Default. We take care of that in step 4)

So we get this value and put it in the variable SHOPWIDEOOS (i.e. Shop Wide Out Of Stock) we defined in Step 1.

 

 

Step 3: (blue):

Nothing special here. We check if the value of quantity is more than 0. if so, we activate the product.

 

Step 4: (Red)

Here is the trick happening, we check if a product quantity becomes 0 or less. We then de-activate the product IF:

- Product has a value of Deny for allow out of stock ordering

- or Product has a value of Default, and the shop wide value is set to Deny (unchecked).

 

That does the trick.

 

Have fun playing with it!

 

pascal.

 

 

N.B. When developing the trigger, I came across something weird. First I had Step 3 and 4 swapped, and for some obscure reason, It didn't trigger the de-activate. Activate worked as normal. Swapping Step 3 and 4 did the trick. Don't ask me why.....  :wacko:  :unsure:

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I think the correct code for the trigger is this 

 

DELIMITER $$

 

CREATE

    /*[DEFINER = { user | CURRENT_USER }]*/

    TRIGGER `change_active_after_update` AFTER UPDATE  

    ON `ps_stock_available`

    FOR EACH ROW BEGIN

UPDATE ps_product_shop SET active = IF(NEW.quantity <= 0,0,1) WHERE id_product = OLD.id_product;

 

    END$$

 

DELIMITER ;

Link to comment
Share on other sites

  • 1 month later...

I initially posted only solution for the home - like solving method

complete solution must take into account: getPricesDrop; getNewProducts ...

Please upload the attached file into override/classes/

 

 

Best regards,

Mihai

 

In some reason Your hack doesn't work. But I like the idea and I need similar solution. As I have external stock management, what sends stock info to presta I want to hide these products, what’s are out of stock. But without pagination problem. I can't turn products off - as next day I can have again it in stock back and I want to manually turn it on.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

if you've got possiblity to run cron jobs, you can run one with php script with code mentioned in the tutorial:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);
run this script (for example) for every 10 minutes or as often as you like

 

Hello,

I create this file but i have message error Parse error: syntax error, unexpected T_STRING in /home/www/outofstock.php on line 3

 

Look my file please :

outofstock.php

 

thank you very much

Link to comment
Share on other sites

Hello,

I create this file but i have message error Parse error: syntax error, unexpected T_STRING in /home/www/outofstock.php on line 3

 

Look my file please :

attachicon.gifoutofstock.php

 

thank you very much

 

 

in fact:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

it's not a php code, this is a mysql query (two queries)

 

you ahve to run these queries in your database manager software like phpmyadmin.

Link to comment
Share on other sites

in fact:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

it's not a php code, this is a mysql query (two queries)

 

you ahve to run these queries in your database manager software like phpmyadmin.

Yes but in one of your post you talk about this :

 

if you've got possiblity to run cron jobs, you can run one with php script with code mentioned in the tutorial:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);

UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

run this script (for example) for every 10 minutes or as often as you like

 

 
So can you tell me how to create cron file. Because my webhost a cronweb so I can put my file in the root of my site and give him instruction eg www.phoneandcom.com / outofstock.php because I haven't trigger button
 
best regards
 
businessphoneandcom
Edited by businessphoneandcom (see edit history)
Link to comment
Share on other sites

in fact:

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

it's not a php code, this is a mysql query (two queries)

 

you ahve to run these queries in your database manager software like phpmyadmin.

Hello,

 

Thank you for your reply.

 

I would like to create this famous file to interact with my database in php.

 

How do I create this php file that will run me these two queries:

 

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);

 

and

 

UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

 

I know I need a code for my sql connection and so I can integrate it into the php file but otherwise could if you can create this file for me to use these two applications that would be nice. I'll just have to put this file in the root of my ftp and set up a task Webcron in my hosting such http://www.phoneandcom.com/my_file.php

 

Thank you in advance

 

Businessphoneandcom

http://ww.phoneandcom.com

Link to comment
Share on other sites

you have to include to this php, this file: config.inc.php, for exmaple with code:

require_once("config/config.inc.php");

 

then you will be able to use Db::staticfunction functions, it mean that you will be able to use prestashop core code to run own sql queries

Hello,

 

I try to make a php file, but without success when I type in my firefox explore www / phoneandcom.com / test_sql it gives me errors:

 

Warning: require_once(../config/config.inc.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/test_sql.php on line 3

 

Fatal error: require_once() [function.require]: Failed opening required '../config/config.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/test_sql.php on line 3

 

look at the file I created here:

test_sql.php

 

Can you please help me fix this file ?

 

Businessphoneandcom

Link to comment
Share on other sites

you have to include to this php, this file: config.inc.php, for exmaple with code:

require_once("config/config.inc.php");

 

then you will be able to use Db::staticfunction functions, it mean that you will be able to use prestashop core code to run own sql queries

Hello,

 

I create this file whith your recommandation :

 

test_requete.php

 

But is the same problem: errors in my url then I tape www.phoneandcom.com/test_requete.php: Parse error: syntax error, unexpected T_VARIABLE in /home/www/test_requete.php on line 10

 

Can you help me to fix the problem please

 

Businessphoneandcom

Edited by businessphoneandcom (see edit history)
Link to comment
Share on other sites

you have to include to this php, this file: config.inc.php, for exmaple with code:

require_once("config/config.inc.php");

 

then you will be able to use Db::staticfunction functions, it mean that you will be able to use prestashop core code to run own sql queries

Hello,

 

I'm telling I finally managed to create the famous PHP file to be placed in Webcron task with your help and my Google searches. yes "Google is your friend" as they say in France. Here is the PHP code for this file to place where you want in your ftp and set Webcron task on your host. Biensur replace the database name, password etc ... with your own login:

 

<?php

$link = mysql_connect('db_name_server', 'db_user', 'password');

if (!$link) {

    die('No connection possible: ' . mysql_error());

}

mysql_select_db('db_name');

 

mysql_query('UPDATE ps_1product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_1stock_available WHERE quantity=0)');

mysql_query('UPDATE ps_1product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_1stock_available WHERE quantity>0)');

 

?>

 

Thank you a lot

 

[sOLVED]

Link to comment
Share on other sites

  • 2 months later...

Hi El Patron, all,

 

El patron, you asked for a trigger based version taking into account the allow out-of-stock ordering of individual products.

You can do something like this:

 

 

Create a trigger in the ps_stock_available:

Trigger name: change_active_allow_oos

Table: ps_stock_available

Time: after

Event: Update

Definition:

 

BEGIN

DECLARE SHOPWIDEOOS TINYINT(1) DEFAULT 0;

SET SHOPWIDEOOS = (SELECT CAST(`value` AS SIGNED) AS num

                FROM `ps_configuration`

                WHERE `name` = 'PS_ORDER_OUT_OF_STOCK'

                limit 1);

 

UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity<=0 AND (out_of_stock =0 OR (out_of_stock = 2 AND SHOPWIDEOOS = 0)));

END

 

Explanation:

Step 1: (Purple):

declare a local integer variable called SHOPWIDEOOS inside the trigger, with default value 0

 

Step 2: (Green)

Get the current 'shop wide' value that defines if out of stock products can be ordered. This value comes from the ps_configuration file. You set this value in Back office, in Preferences->Products:

attachicon.gifallow ordering out of stock products.jpg

When Checked, this allows for products to be ordered when out of stock BUT ONLY IF the product has the allow out of stock setting is set to "default' (internal value of this option = 2)

attachicon.gifper product allow out of stock.jpg

 

(Of course you can also define per product if the product can be ordered or not, in the same menu. Then choose Deny (internal value = 0) or Allow (internal value = 1) instead of Default. We take care of that in step 4)

So we get this value and put it in the variable SHOPWIDEOOS (i.e. Shop Wide Out Of Stock) we defined in Step 1.

 

 

Step 3: (blue):

Nothing special here. We check if the value of quantity is more than 0. if so, we activate the product.

 

Step 4: (Red)

Here is the trick happening, we check if a product quantity becomes 0 or less. We then de-activate the product IF:

- Product has a value of Deny for allow out of stock ordering

- or Product has a value of Default, and the shop wide value is set to Deny (unchecked).

 

That does the trick.

 

Have fun playing with it!

 

pascal.

 

 

N.B. When developing the trigger, I came across something weird. First I had Step 3 and 4 swapped, and for some obscure reason, It didn't trigger the de-activate. Activate worked as normal. Swapping Step 3 and 4 did the trick. Don't ask me why.....  :wacko:  :unsure:

 

 

Hi

I'm trying to enable Prestashop to hide out of stock products EXCEPT those that can be ordered when out of stock and those that currently have stock.

 

My settings

Prestashop version: 1.6.0.8

Products | Products Stock | Allow ordering of out-of-stock products: NO

 

I have a few products configured Quantities | When out of stock: Allow Orders (the vast majority are set to Default)

 

I am using “Advanced Stock Management” and “specify available quantities manually”

 

I have am using vekia’s “How to automatically disable out of stock products in PrestaShop” trigger (excellent triggerJ). This is working 100%.

 

I have tried to use pascal’s trigger to display products that can be ordered when out of stock. But I am receiving the following error – picture attached

 

change_active_allow_oosERROR.png

https://www.dropbox.com/s/x2avfgpa4os79j3/change_active_allow_oosERROR.png

 

 

Can both vekia’s and pascal’s triggers work together?

 

Is there one trigger that hides out of stock items except those that have been enabled to be ordered when out of stock?

 

Thanks for any help or input…

 

change_active_allow_oos.png

https://www.dropbox.com/s/51plut62ea7zu8n/change_active_allow_oos.png

Edited by kacti (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...

I've tried this with a view to changing the visibility of the product, instead of whether it's active, as I wanted to keep the pages on the server to prevent problems with search engines.

 

I changed SET active=1 to SET visibility="both"

And SET active=0 to SET visibility="none"

 

Seems to work pretty well!

Link to comment
Share on other sites

I spoke to soon! There's actually a pretty big problem with this code (including the original):

 

A product is set to deny orders if out of stock.

This product is available in sizes small, medium, large, x large.

The size large sells out.

 

The ENTIRE item is deactivated! 

 

Is there a way to keep the item active if the TOTAL inventory is 1 or more? 

Link to comment
Share on other sites

  • 8 months later...

Hi,

 

I created the trigger and it worked to hide all the unavailable products. However it did not show the product again when it was in stock. Instead the product then became unactive and i had to reenable it. Now I removed the trigger and all the out of stock products are not showing. How do I make them visible again?
 

Thanks

Link to comment
Share on other sites

Hi,

 

I created the trigger and it worked to hide all the unavailable products. However it did not show the product again when it was in stock. Instead the product then became unactive and i had to reenable it. Now I removed the trigger and all the out of stock products are not showing. How do I make them visible again?

 

Thanks

See here: http://www.prestasho...cts-categories/

 

Hope it will be usefull  :)

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

can you for test purposes manually change the quantity in the ps_stock_available table? (in phpmyadmin)

then check the products active field in the ps_products table

i also use the same trigger for hide the ended stock item,but after that product showing with message" product is out of stock"

Link to comment
Share on other sites

  • 3 months later...

Hi guys. I wouldn't use mysql modifying because the PS tables are complicated and they have various links. You can easily use the classes PS already has.

For example, you can use a query to give you the products with certain amount of stock, like:

$sql = 'SELECT id_product FROM '._DB_PREFIX_.'product WHERE quantity = 0';
$id_product = (int)Db::getInstance()->getValue($sql);

This will give you the array $id_product array, then simply use a foreach to go through it and update the products as needed.

 

Disabling product it's a bad practice because you will lose your links and Google will penalize you.

Better to make the product not visible (but keep the link active) and also, you can hide or show the price.

 

I go like this:

function update($single_product_id){
	$product = new Product($single_product_id);
	$product->available_for_order = 0;
	$product->visibility = none;
	$product->show_price = 0;
	$product->save();
}

This will also get indexed in Prestashop so you will not be affected by cache or search indexation.

 

It is quick and painless and you can play with it as you see fit.

Link to comment
Share on other sites

  • 9 months later...

Hi guys. I wouldn't use mysql modifying because the PS tables are complicated and they have various links. You can easily use the classes PS already has.

For example, you can use a query to give you the products with certain amount of stock, like:

$sql = 'SELECT id_product FROM '._DB_PREFIX_.'product WHERE quantity = 0';
$id_product = (int)Db::getInstance()->getValue($sql);

This will give you the array $id_product array, then simply use a foreach to go through it and update the products as needed.

 

Disabling product it's a bad practice because you will lose your links and Google will penalize you.

Better to make the product not visible (but keep the link active) and also, you can hide or show the price.

 

I go like this:

function update($single_product_id){
	$product = new Product($single_product_id);
	$product->available_for_order = 0;
	$product->visibility = none;
	$product->show_price = 0;
	$product->save();
}

This will also get indexed in Prestashop so you will not be affected by cache or search indexation.

 

It is quick and painless and you can play with it as you see fit.

Hello tony, 

I have tried your function but I am receiving this error: 

Prestashop version: 1.6.1.11

 

This page isn’t working

sitename is currently unable to handle this request.

HTTP ERROR 500
Link to comment
Share on other sites

 

Hello tony, 

I have tried your function but I am receiving this error: 

Prestashop version: 1.6.1.11

 

This page isn’t working

sitename is currently unable to handle this request.

HTTP ERROR 500

 

 

Well, you must include certain files in order to be able to access the functions.

I use something like this:

include_once '../config/config.inc.php';
include(dirname(__FILE__).'/init.php');
ini_set('display_errors',1);
error_reporting(E_ALL & ~E_NOTICE);
$defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT')));
$languages = Language::getLanguages();
$lang_id = $defaultLanguage->id;
Link to comment
Share on other sites

Thank you tony_mik, 

 

Question, all of this should be included in classes/product.php ? 

I am novice :)

 

No, you have to create a .php file and run it from the servers console. This action will update the value of all products in database.

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