Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Dec 2013
    Location
    Southampton, UK
    Posts
    51
    Plugin Contributions
    0

    Default Replace Sold out with text & qty with "in stock at suppliers" or something similar

    Hi all,

    I would like to make adjustments in they way zen cart shows the amount of stock when out of stock. I would like to allow checkout regardless of stock quantity (which I can already configure within zen cart) but in the product listing, show text rather than just the red out of stock label. I also want to be able to do the same sort of thing within the product description but replace the "0 units in stock" with in stock at suppliers" or words to that effect.

    Any help and suggestions would be greatly appreciated.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Replace Sold out with text & qty with "in stock at suppliers" or something simila

    Generically can search for: units in stock
    using the developers toolkit located in the tools section of the admin panel

    Lower left corner, enter the text being searched, select catalog in the dropdown, if the capitalization of what has been entered is important then mark the checkbox in that row, and then select search.

    The result will provide the file(s) that contain that particular wording and approximate line number (there was a line numbering issue in ZC 1.5.1 that identified one line larger than the actual). The word on the left side of the define in ALL_CAPS is the constant used to handle the info on the right side.

    Now that the ALL_CAPS word has been found, search on it to find exactly where it is used... A result should include the includes/templates directory. If the file(s) in question is not yet in your own templates directory, then before modifying the file, save a copy from the template_default directory to YOUR_TEMPLATE directory with the same folder structure and filename. Modify the file as necessary.

    As for the red image button, similar scenario, but replace the image of that red button with an image that displays what you want. Otherwise, may need to use CSS buttons to provide the customized text that is desired for the button(s).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Dec 2013
    Location
    Southampton, UK
    Posts
    51
    Plugin Contributions
    0

    Default Re: Replace Sold out with text & qty with "in stock at suppliers" or something simila

    Hi,

    Thanks for your reply. Unfortunately it is not quite what I meant. I have included pictures below to explain a bit better:

    I want to change this Name:  units.jpg
Views: 289
Size:  9.8 KB to this Name:  units2.jpg
Views: 285
Size:  9.4 KB

    In basic terms,

    x = qty

    if x > 0 then all stays as normal

    if x = or < 0 then custom text is shown

    I would also like to display text instead of the out of stock button but still show the add to cart quantity box to allow customers to checkout. Displaying the text would be easy enough, but displaying the add to cart quantity box as well as the text is the main part I am stuck on.

    if x= 0 or < 0 then custom text is shown as well as add to cart box.

    Any ideas?

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Replace Sold out with text & qty with "in stock at suppliers" or something simila

    Quote Originally Posted by Axeman View Post
    Hi,

    Thanks for your reply. Unfortunately it is not quite what I meant. I have included pictures below to explain a bit better:

    I want to change this Name:  units.jpg
Views: 289
Size:  9.8 KB to this Name:  units2.jpg
Views: 285
Size:  9.4 KB

    In basic terms,

    x = qty

    if x > 0 then all stays as normal

    if x = or < 0 then custom text is shown

    I would also like to display text instead of the out of stock button but still show the add to cart quantity box to allow customers to checkout. Displaying the text would be easy enough, but displaying the add to cart quantity box as well as the text is the main part I am stuck on.

    if x= 0 or < 0 then custom text is shown as well as add to cart box.

    Any ideas?
    Right, so my statement about the custom text still applies, need to find where/how the text is displayed and add your conditionals around it.

    As for the second, I'll be that I can't seem to remember the settings, but under configuration, possibly in my store, there is an option to allow checkout with negative stock and I believe add to cart when quantity is zero or something similar... It is part of ZC that allows/offers exactly what you are looking for to have "someone" else handle the missing stock... Darnit I can't seem to remember, but I thought it was a combination of some settings.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Replace Sold out with text & qty with "in stock at suppliers" or something simila

    So, following the process I dsscribed above, the area for the "units in stock" is found at the following:

    includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php

    Code:
    Line #138 : <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
    At least that was the line number for one of my templates.

    The text TEXT_PRODUCT_QUANTITY is/was defined in:

    Code:
    includes/languages/english/YOUR_TEMPLATE/product_free_shipping_info.php
    
    Line #18 : define('TEXT_PRODUCT_QUANTITY', ' Units in Stock');
    Well, that's the product_free_shipping file, but there is one for each product type... So product_info.php I think is the one for the above example but at a different line number...

    The first set of code would need the if statement and use a different language define constant.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Dec 2013
    Location
    Southampton, UK
    Posts
    51
    Plugin Contributions
    0

    Default Re: Replace Sold out with text & qty with "in stock at suppliers" or something simila

    I have just looked at my comment with the pictures that I uploaded and I have notice a mistake that I think has caused a little confusion. The 82 Units in stock should read 0 units in stock.

    So when my stock count reaches 0 then the custom text shows instead of 0 units in stock. Until my stock reaches 0 I want the amount of units in stock to show. The problem I can see there is that if I change the define text it will affect what will be displayed no matter how much is in stock.

    The other thing is that when the out of stock sign is showing there is no option of a qty box to continue checkout. I could keep the 0 units in stock and alter the sign to say the same thing. The main issue is that I still need to have a qty box which will not show if I have the out of stock sign showing.

 

 

Similar Threads

  1. v150 Replace Sold Out Image with Text
    By pyro_maniac in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 1 Apr 2012, 02:02 PM
  2. Adding a "New" image to the product listing (similar to "Sold Out" image)
    By javaman in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Feb 2010, 11:44 PM
  3. How hold sold items in catalog with show "SOLD OUT"?
    By NickolasB in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Oct 2007, 06:47 PM
  4. "Sold out" won't replace "Buy Now"
    By Donnettacb in forum Basic Configuration
    Replies: 22
    Last Post: 15 Nov 2006, 01:27 AM
  5. How do I replace SOLD OUT Images with text?
    By DavidRambo in forum Basic Configuration
    Replies: 6
    Last Post: 24 Jul 2006, 04:49 AM

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