Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37
  1. #1
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Sold New Products display Sold Out instead of price on index and products_new pages

    Currently, in my admin, I have my stock set to leave product status ON when product sells out.

    regardless of this setting...

    Is there a way to get the product to display "Sold Out" instead of the price when it sells out? on the index and products_new page?

    Changing the product price to $0 gets rid of the price, but "sold out" would be more clear to users.

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

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    You would have to change the display price function that if a product is sold out or products_quantity <= 0 that it should return, as the price, sold out or an image or something other than the price that is being built in the functions_prices for this display price function ...
    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
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    So would have edit each page: index, product listing, all, new, search, featured, p info etc with some sort of
    if products_quantity <= 0 then <img src=> php something } something
    code?

    Or is there a way to do it globally? ZC seems to know not to display a price when the price is zero, is there a way to hook into this? and replace the blank space with a sold out image?

    functions_prices.php ?

    In any case how would I get started?
    Last edited by dharma; 14 Oct 2008 at 04:57 AM.

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

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    All of the prices are displayed with the display price function in the functions_prices.php using a single function for everywhere except the shopping_cart and checkout ...

    Look in the function file for:
    Code:
    ////
    // Display Price Retail
    // Specials and Tax Included
      function zen_get_products_display_price($products_id) {
    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
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    Quote Originally Posted by Ajeh View Post
    You would have to change the display price function that if a product is sold out or products_quantity <= 0 that it should return, as the price, sold out or an image or something other than the price that is being built in the functions_prices for this display price function ...
    Found this section, what would the code be to replace the blank space with an image of "Sold Out"?

    am I even close?

    PHP Code:
    ////
    // Display Price Retail
    // Specials and Tax Included
      
    function zen_get_products_display_price($products_id) {
        global 
    $db$currencies;

        
    $free_tag "";
        
    $call_tag "";
        
        
    // replace blank price space with sold out image on all pages
         
    if products_quantity <= {
          
            return 
    'BUTTON_IMAGE_SOLD_OUT';
          }
        

    // 0 = normal shopping
    // 1 = Login to shop
    // 2 = Can browse but no prices
        // verify display of prices
          
    switch (true) { 

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

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    You would need to check the products_quantity with the function:
    Code:
      function zen_get_products_stock($products_id) {
    It isn't available until you look it up ...

    Then, whatever you return would change what the price displays as ...
    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
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    Quote Originally Posted by Ajeh View Post
    You would need to check the products_quantity with the function:
    Code:
      function zen_get_products_stock($products_id) {
    It isn't available until you look it up ...

    Then, whatever you return would change what the price displays as ...
    Then this is correct?

    PHP Code:
    //// 
    // Display Price Retail 
    // Specials and Tax Included 
      
    function zen_get_products_display_price($products_id) { 
        global 
    $db$currencies

        
    $free_tag ""
        
    $call_tag ""
         
        
    // replace blank price space with sold out image on all pages 
         
      
    function zen_get_products_display_price($products_id) { 

    if 
    products_quantity <= 
           
            return 
    'BUTTON_IMAGE_SOLD_OUT'
          } 
     } 
         

    // 0 = normal shopping 
    // 1 = Login to shop 
    // 2 = Can browse but no prices 
        // verify display of prices 
          
    switch (true) { 

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

    database error Re: Sold New Products display Sold Out instead of price on index and products_new pag

    In a word ... no ...

    Try something like:
    PHP Code:
    // replace blank price space with sold out image on all pages 
         
      
    $products_quantity zen_get_products_display_price($products_id);
    if 
    $products_quantity <= {       
            
    $return_button zen_image_button(BUTTON_IMAGE_SOLD_OUTBUTTON_SOLD_OUT_ALT);
            return 
    $return_button
          

    I have not tested this but this is the basic idea ...you may need to tweak this some ...
    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!

  9. #9
    Join Date
    Nov 2006
    Posts
    512
    Plugin Contributions
    0

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    I tried the code and my site went away, whoops! I hate when that happens

    any obvious errors? too many of these { thingys maybe?

    PHP Code:
    ////
    // Display Price Retail
    // Specials and Tax Included
      
    function zen_get_products_display_price($products_id) {
        global 
    $db$currencies;

        
    $free_tag "";
        
    $call_tag "";
    //test
          
      
    $products_quantity zen_get_products_display_price($products_id); 
    if 
    $products_quantity <= {        
            
    $return_button zen_image_button(BUTTON_IMAGE_SOLD_OUTBUTTON_SOLD_OUT_ALT); 
            return 
    $return_button 
          

          
    // 0 = normal shopping
    // 1 = Login to shop
    // 2 = Can browse but no prices
        // verify display of prices
          
    switch (true) {
            case (
    CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):
            
    // customer must be logged in to browse
            
    return '';
            break;
            case (
    CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == ''):
            
    // customer may browse but no prices
            
    return TEXT_LOGIN_FOR_PRICE_PRICE;
            break;
            case (
    CUSTOMERS_APPROVAL == '3' and TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM != ''):
            
    // customer may browse but no prices
            
    return TEXT_LOGIN_FOR_PRICE_PRICE_SHOWROOM;
            break;
            case ((
    CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customer_id'] == ''):
            
    // customer must be logged in to browse
            
    return TEXT_AUTHORIZATION_PENDING_PRICE;
            break;
            case ((
    CUSTOMERS_APPROVAL_AUTHORIZATION != '0' and CUSTOMERS_APPROVAL_AUTHORIZATION != '3') and $_SESSION['customers_authorization'] > '0'):
            
    // customer must be logged in to browse
            
    return TEXT_AUTHORIZATION_PENDING_PRICE;
            break;
            default:
            
    // proceed normally
            
    break;
          }

    // show case only 

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

    Default Re: Sold New Products display Sold Out instead of price on index and products_new pag

    You if needs to be changed:
    Code:
    if $products_quantity <= 0 {
    To read:
    Code:
    if ($products_quantity <= 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!

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 2
    Last Post: 7 Jul 2016, 06:34 AM
  2. Gap in product listing between price and 'sold out' button (new thread)
    By Thannaree in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 6 Sep 2012, 11:41 AM
  3. Replies: 7
    Last Post: 28 Mar 2011, 04:08 AM
  4. New Products still showing Sold Out and Disabled Items
    By shawnchr in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 1 Nov 2010, 12:57 AM
  5. 'Sold out' button instead of price on main page
    By wendon in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Jan 2010, 10:53 AM

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