Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    This is the exact same problem I am facing.

    If i display product qty on the page, then I get people either thinking that the -7 is just a dash in front of the number and that I have 7 on hand, or I have people that actually email to ask, "what does the -7 mean?"

    If I don't display the number available at all then I get tons of emails asking "is xyz in stock?"

    I want people to be able to order products even when I am out of stock, but there has got to be a way to display a "Out of stock, back order ok" message either on the product listings page and/or the product description. Not after they add it to the shopping cart.

  2. #2
    Join Date
    Oct 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    You should do as i did.

    In words:

    If q.ty > 0 ====> Print: AVAILABLE
    If q.ty = 0 ====> Print: NOT AVAILABLE - ON ORDER (and u let it order ---> Backorder)
    If Q.ty<0 ====> Print: Not available

    the code

    <?php
    if (zen_get_products_stock((int)$_GET['products_id']) >0) {
    $zc_stock_level_image = '<span class="Disponibile">' . DISPONIBILE . '</span>';
    }

    elseif (zen_get_products_stock((int)$_GET['products_id']) <0) {
    $zc_stock_level_image = '<span class="Arrivo">' . ESAURITO . '</span>';
    }

    else {
    $zc_stock_level_image = '<span class="Esaurito">' . IN_ARRIVO . '</span>';
    }
    echo '<b class="Stock">Stock Level: </b>' . $zc_stock_level_image;
    ?>

  3. #3
    Join Date
    Jul 2006
    Posts
    135
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    Which file are you referencing?

    Thanks.

  4. #4
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    Quote Originally Posted by jeanjean88 View Post
    You should do as i did.

    In words:

    If q.ty > 0 ====> Print: AVAILABLE
    If q.ty = 0 ====> Print: NOT AVAILABLE - ON ORDER (and u let it order ---> Backorder)
    If Q.ty<0 ====> Print: Not available

    the code


    This code ...... looks like a different language ( not just PHP )

    <?php
    if (zen_get_products_stock((int)$_GET['products_id']) >0) {
    $zc_stock_level_image = '<span class="Disponibile">' . DISPONIBILE . '</span>';
    }

    elseif (zen_get_products_stock((int)$_GET['products_id']) <0) {
    $zc_stock_level_image = '<span class="Arrivo">' . ESAURITO . '</span>';
    }

    else {
    $zc_stock_level_image = '<span class="Esaurito">' . IN_ARRIVO . '</span>';
    }
    echo '<b class="Stock">Stock Level: </b>' . $zc_stock_level_image;
    ?>

    Are these referncing a graphic file or a defined text ?? not 100% up on the PHP

    Thanks for the help

  5. #5
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    BIG BIG Thanks to JeanJean88

    Using the code provided and modified slightly I inserted this into my tpl_product_info_display.php file just after the product price block.

    Code:
     <!--eof Product Price block -->
    
    <?php
    if (zen_get_products_stock((int)$_GET['products_id']) >0) {
    $zc_stock_level_image = '<span style="color: #000000; font-size: 12px;">' . In_Stock . '</span>';
    }
    
    elseif (zen_get_products_stock((int)$_GET['products_id']) <0) {
    $zc_stock_level_image = '<span style="color: #FF0000; font-size: 12px;">' . Temporarily_Out_Of_Stock . '</span>';
    }
    
    else {
    $zc_stock_level_image = '<span   style="color: #FF0000; font-size: 12px;">' . Temporarily_Out_Of_Stock . '</span>';
    }
    echo '<b class="Stock">Stock Level: </b>' . $zc_stock_level_image;
    ?>  
    
    
    <!--bof free ship icon  -->
    You also need to insert into includes/languages/english/YOURTEMPLATE/product_info.php

    Code:
     define('In_Stock', 'In Stock');
    define('Temporarily_Out_Of_Stock', 'Temporarily Out Of Stock - Will Be Dispatched As Soon As Stock Arrives');
    Note these are the filenames and descriptions I happened to use - edit them to your own desires.

    I used inline definitions of the span styles - the first one for being in stock shows in black - the last two for the out of stocks is in red.

    I was not sure why JeanJean88 had the 3 variables - ie >0 , 0 and <0 as I am not familiar with his native language. I have left them in. Currently the <0 and 0 are pointing to the same temporarily out of stock message as all we want is a simple in stock or not in stock decision.

    but this could be changed for example to allow for greater than 0 to be in stock - ( knowing you have an inbound delivery of 10 untis ..... ) -1 to -10 to show up as "stock will be shipped early next week" and below -10 to simply be "out of stock - will be shipped as soon as stock arrives"

    Bulk of the credit on this to JeanJean88 though - that put me on the right track.

  6. #6
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think


  7. #7
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Re: I would like to show a product as being out of stock - not as simple as you think

    Quote Originally Posted by AlohaRover View Post
    This is the exact same problem I am facing.

    If i display product qty on the page, then I get people either thinking that the -7 is just a dash in front of the number and that I have 7 on hand, or I have people that actually email to ask, "what does the -7 mean?"

    If I don't display the number available at all then I get tons of emails asking "is xyz in stock?"

    I want people to be able to order products even when I am out of stock, but there has got to be a way to display a "Out of stock, back order ok" message either on the product listings page and/or the product description. Not after they add it to the shopping cart.
    We are also coming from the point of view that we dont want the customers to know exactly how many of each item is in stock. If you have 1 or 2 of each item then you look like a smaller amature site. So the simple in stock or temp out of stock message is what we need.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 25 Apr 2011, 08:46 AM
  2. Can I show an item as being out of stock yet still allow add to cart?
    By PatF in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 18 Jan 2010, 11:23 PM
  3. Show Product out of stock in checkout - not only in shopping cart.
    By Gomlers in forum Managing Customers and Orders
    Replies: 5
    Last Post: 13 Jul 2009, 03:01 PM
  4. New product not to show out of stock products
    By gardengate in forum Basic Configuration
    Replies: 0
    Last Post: 11 Sep 2006, 02:53 PM
  5. Something I think alot of people would like...
    By dogmatic69 in forum General Questions
    Replies: 0
    Last Post: 12 Jun 2006, 08:00 PM

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