Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Request out of stock products v1.01


bhbilbao

Recommended Posts

Need help with this contribution from 6 Nov 2006.

 

http://addons.oscommerce.com/info/4641

 

I searched for the original post , but there is nothing:

http://www.oscommerce.com/forums/index.php?showtopic=235395

 

The problem is when sending emails. Sends all Requested products to all customers, independent that the customer select it or not.

 

The problem are queries, i don´t know how could be the correct maner.

 

      case 'email':
  $purchase_customer_query = tep_db_query("select distinct customers_id from purchase where notify=0");
       while ($purchase_customer = tep_db_fetch_array($purchase_customer_query)){

$purchase_query = tep_db_query("select pch.purchase_id, pch.customer_name, pch.language, pch.products_id, pch.product_model, pch.product_name, pch.quantity from purchase pch left join products p using (products_id) where pch.notify = '0' and p.products_quantity >= pch.quantity and p.products_status = '1'");

           $purchase_count_query = tep_db_query("select count(*) as item_no from purchase pch left join products p using (products_id) where pch.notify = '0' and p.products_quantity >= pch.quantity and p.products_status = '1'");

           $purchase_count = tep_db_fetch_array($purchase_count_query);

           $customer_email_query = tep_db_query("select customers_email_address from customers where customers_id='".$purchase_customer['customers_id']."'");

           $customer_email = tep_db_fetch_array($customer_email_query);

           $purchase = tep_db_fetch_array($purchase_query);

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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