Jump to content

[SOLVED]Stock alert on each product and not global 4 all


Recommended Posts

Hi,

I am looking four a solution wher i can add stock alert on every product because i have some very expensive product and i got only one of them in the stock.

Like it is now in presta has a function four a global alert four the stock alert.

I want to add on each product when to alert me!

Link to comment
Share on other sites

I don't understand what you want. PrestaShop lists out of stock products on the Catalog > Tracking tab and also has the option to send an email when stock is low. You can go to Modules > Mail alerts v2.2 (in the Tools section) > Configure, make sure that "Receive a notification if the quantity of a product is below the alert threshold" is ticked and then change the "Alert threshold". By default it is 3, but you can change it to 0 to be alerted when products are actually out of stock.

There is no option to specify a different alert threshold for each product though and no module I'm aware of does this. It would be difficult to do, since it would require adding another field to the ps_product table.

Link to comment
Share on other sites

Hi,

Okej no problem i have create a new line in the ps_product table that i call qty_varning.

In the file domain.com/admin/tabs/AdminTracking.php i want to edit the code a litet and need help with that :(

This is the code I THINK i need to change?


            case 'products_nostock':

               $sql = '
                   SELECT DISTINCT(id_product)
                   FROM `'._DB_PREFIX_.'product`
                   WHERE id_product IN (
                     SELECT id_product
                     FROM `'._DB_PREFIX_.'product`
                     WHERE id_product NOT IN (
                       SELECT DISTINCT(id_product)
                       FROM `'._DB_PREFIX_.'product_attribute`
                     )
                     AND quantity <= 0
                   ) OR id_product IN (
                     SELECT pa.id_product
                     FROM `'._DB_PREFIX_.'product_attribute` pa
                     WHERE pa.quantity <= 0
                   )
               ';

               $this->_list['message'] = $this->l('List of out of stock products:');
               break ;



Where the zero is in (same code as above)

                      AND quantity <= 0
                   ) OR id_product IN (
                     SELECT pa.id_product
                     FROM `'._DB_PREFIX_.'product_attribute` pa
                     WHERE pa.quantity <= 0




If i write echo $product->qty_varning i got the value i have putet in the database.

I need to insert my variabel qty_varning in some way. Dose any on have any example i can tray with.

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