Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2012
    Posts
    94
    Plugin Contributions
    0

    Default Automatically show "Call for Price" when items go out of stock

    Hello, I am new to zen-cart and the forums have been very helpful. Is there a way for it to automatically put items that are out of stock to show "call for price" (without the price showing)? Or do I have to manually go into the out of stock items and change them all to "call for price" (and also manually remove the price)? It would be great if I could have the system automatically do this for me. The parts we order are always changing in cost - so I didn't want to mislead someone into thinking they were guaranteed a certain price on an out of stock item.

    My second question is where do I go to change the .php to show "call for price" & "sold out" picture when an item is out of stock. I found a similar forum, but it didn't specifically say where to go OR if I was just adding the new description or overwritting some phrases. I apologize I am new, but if you can give the correct folder route I would greatly appreciate it!!

    Thanks in advance to anyone who has suggestions!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Automatically show "Call for Price" when items go out of stock

    A quick way to do this is to customize the functions zen_get_buy_now_button and zen_get_products_display_price and change the tpl_product_info_display.php ...

    In the file:
    /includes/functions/functions_general.php

    around line 1134 add the code in RED:
    Code:
        case ($button_check->fields['products_quantity'] <= 0 || $button_check->fields['product_is_call'] == '1'):
    In the file:
    /includes/functions/functions_prices.php

    around the line 193 add the code in RED:
    Code:
        $product_check = $db->Execute("select products_quantity, products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, products_type from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");
    if ($product_check->fields['products_quantity'] <= 0) {
      return '';
    }
    /includes/templates/your_template_dir/templates/tpl_product_info_display.php

    around the line 132 add the code in RED:
    Code:
      if ($products_quantity > 0 && $pr_attr->fields['total'] > 0) {
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jun 2012
    Posts
    94
    Plugin Contributions
    0

    Default Re: Automatically show "Call for Price" when items go out of stock

    You are amazing! Thank you!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Automatically show "Call for Price" when items go out of stock

    You are most welcome ... thanks for the update that this worked for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jun 2012
    Posts
    94
    Plugin Contributions
    0

    Default Re: Automatically show "Call for Price" when items go out of stock

    Ajeh,
    I changed my site to show the out of stock item, but I've had to change it back to show the sold out button, but I cannot seem to get it to show "call for price" instead of the price. The price is gone which is good, but can I add a call for price image or text instead of having nothing there? Apparently I am missing something. Can you help?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Automatically show "Call for Price" when items go out of stock

    You could try editing the function file:
    /includes/functions/functions_prices.php

    and around 192 add the code in RED:
    Code:
        // $new_fields = ', product_is_free, product_is_call, product_is_showroom_only';
        $product_check = $db->Execute("select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, products_type, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");
    
    if ($product_check->fields['products_quantity'] <= 0) {
      $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
      return $return_button;
    }
    
        // no prices on Document General
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jun 2012
    Posts
    94
    Plugin Contributions
    0

    Default Re: Automatically show "Call for Price" when items go out of stock

    Ajeh, You have saved me more than once. You are amazing! Thank you again!!
    Last edited by WWRepair; 2 Apr 2013 at 01:02 AM.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Automatically show "Call for Price" when items go out of stock

    Most welcome ... thanks for the update that this was able to work for you ...

    Remember the Zen Cart Team when you are rich and famous!
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v151 How to make all products show with "call for price" image
    By stoneroses6300 in forum General Questions
    Replies: 13
    Last Post: 20 Oct 2014, 11:16 AM
  2. "Notify me when Out of Stock items is back in stock" Mod?
    By mes7000 in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 21 Aug 2008, 06:04 PM
  3. When a specific Attribute is used - change price to "call for price"?
    By PaulRiedel in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 4 Nov 2007, 02:34 PM
  4. Automatically Overlay a "Sold Out" on Attribute which is Out of Stock
    By Stenrique in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Feb 2007, 06:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR