Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2008
    Posts
    188
    Plugin Contributions
    0

    Default Can I show an item as being out of stock yet still allow add to cart?

    Hi guys,

    Looking for a small bit of guidance please....

    I know you can set Zen to allow checkout of out of stock items. In this case there is a message displayed only after the customer has added to cart.

    The alternative is to show a sold out button instead of the add to cart box.

    What I would really like is for the produt listing page and search pages etc to show a message saying temporarily out of stock but to allow the customer to add to cart and checkout as normal.

    This is the way for example play.com is set up - in that you can see it is sold out and then when clicking on the item you see a message saying will be dispatched as soon as stock has arrived.

    If anyone has any ideas on if / how this can be achieved in Zen Cart I would be very grateful

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,159
    Plugin Contributions
    0

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    admin>configuration>stock>allow checkout

    Set to "true"
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

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

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Quote Originally Posted by afo View Post
    admin>configuration>stock>allow checkout

    Set to "true"

    Yes but this allows a customer to add to cart and only then are they told that the item is out of stock

    ( to explain a bit more - I do not show stock counts on the site so its not a case of them seeing 0 in stock before clicking on add to cart )

    I wish the site to say "temporarily out of stock" on the main index page / on the listings page / on the search pages etc but then have the ability to add to cart and checkout.

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

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    I am realising that this may be trickier than thought ....

    I am looking at product_listing.php and I see this:



    // product is in stock or customers may add it to cart anyway
    ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
    $how_many++;
    }
    // hide quantity box


    And I think that this is the starting point for what I would like to do. I need some code that will check the 'products_quantity' field in the database and if this is a value less than 1 to show a message under the price.

    So over at tpl_product_info_display.php I have .........



    Code:
    <!--bof Product Price block -->
    <h2 id="productPrices" class="productGeneral">
    <?php
    // base price
      if ($show_onetime_charges_description == 'true') {
        $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
      } else {
        $one_time = '';
      }
      echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
    ?><font color="#000066"> Delivered</font></h2>
    <!--eof Product Price block -->
    The last line with delivered is something I added into all products descriptions as we offer free shipping.

    Could anyone please point me in the direction of what code I would need to slap in under here that will check the database for stock levels and then display the relevant message ????

    I am thinking something like .....

    if ($listing->fields['products_quantity'] < 1 echo DEFINED_TEXT

    I know that is nowhere near complete but still ;)

  5. #5
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,159
    Plugin Contributions
    0

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Unfortunately, my php isn't strong enough to really help you. I believe you're on the right path. I'm sure someone will jump in with a suggestion (or 2 or 3...)

    It occurs to me that a solution to this may be a solution to those who want to have items that can be pre-ordered.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

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

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Believe it or not we take pre orders on our site already - we have just edited the " will be in stock on XXXXX " line to say " this item is available for per order and is due for release on XXXXXX and this solved the problem nicely.

    Thats why we need the ability to show an item as being out of stock on the product description so that we can have a temporarily out of stock message. Otherwise it would have been a case of editing the product to put an available date in a couple of weeks time and leaving it run with the " will be in stock on xxxxxx "

    In our case now it would mean all our products that go out of stock would be appearing on the future pre orders list which won't do at all

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

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Gentle bump !

  8. #8
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Has anyone come up with the code to place on the product listing page and product info page to show this? I would be interested in using this feature for my site.
    Eric
    www.GeneralExotics.com - Quality Exotic Pets delivered straight to your door!

  9. #9
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    Here is the code I came up with for the tpl_product_info_display.php page.

    TEXT TO SHOW IF PRODUCT IN STOCK

    Code:
    <?php if ($products_quantity > 0) {
                  // show if product in stock
    ?>              
    PUT YOUR TEXT HERE<?php
                } 
    ?>
    TEXT TO SHOW IF PRODUCT NOT IN STOCK

    Code:
    <?php if ($products_quantity == 0) {
                  // show if product out of stock
    ?>              
    PUT YOUR TEXT HERE<?php
                } 
    ?>
    I cannot figure out how to get the same thing to work on the products_listing.php page. Can anyone help?
    Eric
    www.GeneralExotics.com - Quality Exotic Pets delivered straight to your door!

  10. #10
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Can you show an item as being out of stock yet still allow add to cart

    I think I want to edit this code:

    Code:
                    &&
                    // product is in stock or customers may add it to cart anyway
                    ($listing->fields['products_quantity'] > 1 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 1) ) {
                        $how_many++;
                      }

    Except I want it to be products_quantity == 0

    I know I am close. Any help??
    Eric
    www.GeneralExotics.com - Quality Exotic Pets delivered straight to your door!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. 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
  2. How can I show the attribute weight for each item in cart?
    By Fay808 in forum Templates, Stylesheets, Page Layout
    Replies: 40
    Last Post: 5 Sep 2007, 07:33 AM
  3. attrib stock - 32 character string getting appended to each item in shopping cart
    By johnnybravoh in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 18 Jun 2007, 03:58 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
  •