Page 1 of 8 123 ... LastLast
Results 1 to 10 of 71
  1. #1
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    help question Removed Qty Box, now want it back for some

    I know at one time, when I was working with comics, I wanted to remove the Qty box.... we treat every comic as a individual item ... but now I'm working with Olympic Pins. I want the qty box to show for those items on the product page because we have multiple qtys of these. I thought I just had to checkmark YES to Show Qty Box, but that doesn't do it. The Qty box that shows with the Add To Cart button is showing ,but you can put any number in there ... I need to show the customer how many we have in stock.
    Can I have it both ways?

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,962
    Plugin Contributions
    25

    Default Re: Removed Qty Box, now want it back for some

    Is this on the same site as the comics?

    If not, you can set to show qty in stock in Catalog > Product Types > Product-General > edit layout.

    If yes, you can get the different display options in two ways.
    You can create a new product type for pins which can have its own settings; this requires a new database table and some files & editing.
    Or you can set qty in stock to "on" and add a test in the qty display code to skip if in a comics category (or to show it only if in a pins category, whichever is easier). You would do this in /includes/templates/your_template/templates/tpl_product_info_display.php.

    See the Parent Categories Separated In 3 sideboxes thread for how to distinguish categories to use.

  3. #3
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    Default Re: Removed Qty Box, now want it back for some

    Quote Originally Posted by gjh42 View Post
    Is this on the same site as the comics?

    If not, you can set to show qty in stock in Catalog > Product Types > Product-General > edit layout.

    If yes, you can get the different display options in two ways.
    You can create a new product type for pins which can have its own settings; this requires a new database table and some files & editing.
    Or you can set qty in stock to "on" and add a test in the qty display code to skip if in a comics category (or to show it only if in a pins category, whichever is easier). You would do this in /includes/templates/your_template/templates/tpl_product_info_display.php.

    See the Parent Categories Separated In 3 sideboxes thread for how to distinguish categories to use.
    Yes, this is all on the same site! And we are not going to just have pins and comics....everything that we run thru eBay and then some will be on this site. I was so hoping that I was done editing the site ... which is the "EASIEST" way to accomplish qty box showing for some and not for others? a new database and editing files is just so scarey since I FINALLY have it all working and now this.

  4. #4
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    Default Re: Removed Qty Box, now want it back for some

    Here is the area that I thought would change it per item... Qty total on or off... but it doesn't.
    So what are these for? Am I just not using the correct settings?
    I just changed the one shown below to YES, Show Qty box and a 1 in the Qty Max.... and of course it doesn't work. I could see if the Max Qty was set for the actual Qty that I have, then they couldn't order or back order any more then what is in stock...but if I have 1 of something, it just removes the Qty all together.




  5. #5
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    Default Re: Removed Qty Box, now want it back for some

    OK.... I think I figured it out. I found the following thread (and I hope this is how you post a thread link)

    http://www.zen-cart.com/forum/showth...Quantity+stock

    That told me where to look to find that I needed to edit my Stock preferences.

    THEN...
    I went back into my items. Turned off the Qty Box for the Comics, but put a 1 in the Max. Qty. Turned on the Qty Box for my pins and put the actual qty that I have in stock in the Max Qty field.
    What I think threw me off is that it says 0 = inlimited...1= no box.. something like that and I thought you could only set that field to 0 or 1.
    What ALSO threw me off was when I set a item qty to 1, it wasn't showing that, but that is because it doesn't when a qty is only 1, when I set one to 5, it shows the max they can buy is 5.

    Hope that makes sense and helps out someone else in the future

    L ~
    www.LilleyPadGifts.com

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,962
    Plugin Contributions
    25

    Default Re: Removed Qty Box, now want it back for some

    Glad you were able to figure out how to get what you wanted for the display.
    I do have a doubt about it, though... if someone buys one of your 5-in-stock items, your display will still say Max 5 until you manually change it to 4, and that setting by itself will happily let someone buy all 5 of the now 4 items. If you also set (in Configuration > Stock)
    Check stock level true
    Subtract stock true
    Allow Checkout false

    This should keep you safe.

    You still really want automatic qty-in-stock display, though, and for that you would best do as suggested above with Product Types > Product-General > edit layout and testing before display. That will be much less involved than a new product type.

  7. #7
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    Default Re: Removed Qty Box, now want it back for some

    Quote Originally Posted by gjh42 View Post
    Glad you were able to figure out how to get what you wanted for the display.
    I do have a doubt about it, though... if someone buys one of your 5-in-stock items, your display will still say Max 5 until you manually change it to 4, and that setting by itself will happily let someone buy all 5 of the now 4 items. If you also set (in Configuration > Stock)
    Check stock level true
    Subtract stock true
    Allow Checkout false

    This should keep you safe.

    You still really want automatic qty-in-stock display, though, and for that you would best do as suggested above with Product Types > Product-General > edit layout and testing before display. That will be much less involved than a new product type.
    I see what you mean.... now if I could wrap my brain around what you posted above about Product Types, I would do that... maybe I will be able to comprehend it tomorrow, but tonight I just can't .
    I do, however, already have my Stock configs set as you mentioned above.

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,962
    Plugin Contributions
    25

    Default Re: Removed Qty Box, now want it back for some

    OK, good. I thought you might since you were working in Stock, but wanted to mention it for completeness.

    In Product Types, all you have to do is set
    Show Quantity in Stock to 1.

    In tpl_product_info_display.php, you will want to add a test in this section
    PHP Code:
    <!--bof Product details list  -->
    <?php if ( (($flag_show_product_info_model == and $products_model !=&#8221;) or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
    <ul id="productDetailsList" >
      <?php echo (($flag_show_product_info_model == and $products_model !='') ? '<li>' TEXT_PRODUCT_MODEL $products_model '</li>' '') . "\n"?>
      <?php echo (($flag_show_product_info_weight == and $products_weight !=0) ? '<li>' TEXT_PRODUCT_WEIGHT .  $products_weight TEXT_PRODUCT_WEIGHT_UNIT '</li>'  '') . "\n"?>
      <?php echo (($flag_show_product_info_quantity == and $products_quantity >0) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
      <?php echo ((/*$flag_show_product_info_quantity == 1 and */$products_quantity <=0) ? '<li>' TEXT_PRODUCT_O_O_S '</li>'  '') . "\n"?>
    so this line
    <?php echo (($flag_show_product_info_quantity == 1 and $products_quantity >0) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
    is only executed if you are not in a comics category.
    A variation on this code
    PHP Code:
    if(in_array(str_replace("cPath=","",$box_categories_array[$i]['path']), explode(",",'3,21,21_57'))) { 
    where the last bunch of numbers are replaced by your comic category cPaths will control it.

    I'll go into it more thoroughly tomorrow, though it's not much more complicated than just this.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,962
    Plugin Contributions
    25

    Default Re: Removed Qty Box, now want it back for some

    Actually, since all your comics are under top category id #1, I believe you can achieve your goal with just this snippet (!ereg("(^1$|^1_)",$cPath)) inserted in the existing line:
    PHP Code:
     <?php echo (((!ereg("(^1$|^1_)",$cPath)) and $flag_show_product_info_quantity == and $products_quantity >0) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
    The function ereg will be true if $cPath either equals "1" or starts with "1_" (i.e. Comics), so if ereg is not true and the flag is on and there is 1 or more in stock, the qty in stock will be displayed. In Comics, this will never be displayed. In everything else, it will be.

    If you come to a product from Search or All Products, there will be no cPath involved and the qty in stock will always show.

  10. #10
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    371
    Plugin Contributions
    0

    Default Re: Removed Qty Box, now want it back for some

    Hmmmmm.... is this also true if I end up with another category that is one of a kinds? Right now, its Comics and Pins because I haven't started in on the others, but some will be handled the same as comics and some the same as pins. I'm afraid that what you showed above is only if Comics is the only product that we handle as individual items (because of condition and grades).

    I'm wayyyyyy passed sleepy here, so I will come back here tomorrow and see if I can understand it better. If you are around tomorrow, please let me know.
    Thanks!

 

 
Page 1 of 8 123 ... LastLast

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
  •