Results 1 to 10 of 11

Hybrid View

  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,174
    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,174
    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!

 

 

Similar Threads

  1. v154 out of stock products not being removed from the cart.
    By delia in forum General Questions
    Replies: 17
    Last Post: 27 Jun 2015, 10:47 PM
  2. Replies: 3
    Last Post: 7 Nov 2010, 04:31 AM
  3. Replies: 9
    Last Post: 23 Nov 2008, 10:19 PM
  4. Out of Stock/disabled items still show in NEW section
    By dml311071 in forum General Questions
    Replies: 23
    Last Post: 25 Aug 2008, 05:19 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