Forums / Basic Configuration / Product Notifications Sidebox: Display IF Global checked + item is Out of Stock only

Product Notifications Sidebox: Display IF Global checked + item is Out of Stock only

Locked

Views: 3,157

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
14 Feb 2007, 4:04 PM
#1
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Product Notifications Sidebox: Display IF Global checked + item is Out of Stock only

I am trying to figure out a way to email my customers when a product is back in stock.

I like the product notification sidebox, and would change the wording from "Notifications - Notify me of updates" to "Out of Stock? please click here to Add to Backorder List and receive email notification when back in stock" via the english file. Great! But, if this box appears with every product it will be confusing/unnecessary to see unless a product is out of stock.

Is there some way or code to have the Product Notifications Sidebox Appear only if the product is out of stock?

perhaps an If statement?

more importantly.......as my back orders range from a week to months....is there a way then to keep the Product Notifications Sidebox appearing even if the customer checks "Global Product Notifications" of all products?

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

17 Feb 2007, 6:05 PM
#2
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Re: Product Notifications Sidebox: Display IF Global checked + item is Out of Stock only

I managed to get this far on my own, but am stuck :frusty: because I don't know how to code ZC php....can anyone help me:

from modules/sideboxes/YOUR_TEMPLATE/product_notifications.php:

// test if box should show
  $show_product_notifications = false;

  if (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
    if (isset($_SESSION['customer_id'])) {
      $check_query = "select count(*) as count
                      from " . TABLE_CUSTOMERS_INFO . "
                      where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
                      and global_product_notifications = '1'";
  1. Have the notifications side box appear even if global notification is checked.

I would like to take out this line,

     and global_product_notifications = '1'"; 

but do not know how to end (;) this statement:

     where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
                      
  1. Have sidebox appear only IF out of stock

need to add something like this to the false statement above:

if ($_SESSION['cart']->count_contents() <= 0) {

but do not know how to describe "out of stock" as it is in ZC, Is even possible?

Am on the right track? Is there a better way?

BTW Good Reference: http://www.zen-cart.com/forum/showpost.php?p=109661&postcount=3

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41