Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 71
  1. #11
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    You can add other categories to the no-show list with just a few characters for each one.
    I'll tell you how tomorrow.

  2. #12
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

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

    Glenn, as you mentioned in this quasi-related thread:

    http://www.zen-cart.com/forum/showth...514#post373514
    (Thread summary: To have a single category within a store that is Showcase-only. The rest of the store operates normally, displaying prices & cart)

    This same logic does seem like it could be applied. However, it's way out of my league to do so. Could I trouble you to point me in the right direction?

    It does seem that the ability to do this would be quite helpful to a number of people. (My self-serving way of being benevolent )

    Thanks - Tim

  3. #13
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    Will do, Tim. First, the logic to include other categories/subcategories in this list:

    (!ereg("(^1$|^1_)",$cPath))

    You can find a full description of the PHP function ereg() in online tutorials like w3schools. For present purposes, there are three elements to understand.

    ^1$ means"the string is exactly 1".
    ^1_ means "the string starts with 1_".
    | means "or".

    And of course $cPath is the variable that holds the current category path, visible in the address bar.

    For any top category (##) with or without subcategories, ^##$ will specify that top category.
    For any top category with subcategories, ^##_ will specify all of its subcategories (and sub-subs etc.).
    One step more detailed, for any subcategory (23_42), ^23_42$ will specify only that subcategory. THis can be extended as desired.
    You can string any number of these specifications together with | between them, and if any one of them is true, ereg will return true.

    Since in this case we want to execute if not in these categories, we add ! in front of ereg which says "f ereg is false, return true; if ereg is true, return false".

    THis bit of logic can be embedded in any PHP statement where true or false is being evaluated on a category/product page.

  4. #14
    Join Date
    Jun 2006
    Location
    My family and I live in Brighton, England
    Posts
    982
    Plugin Contributions
    0

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

    Quote Originally Posted by gjh42 View Post
    Will do, Tim. First, the logic to include other categories/subcategories in this list:

    (!ereg("(^1$|^1_)",$cPath))

    You can find a full description of the PHP function ereg() in online tutorials like w3schools. For present purposes, there are three elements to understand.

    ^1$ means"the string is exactly 1".
    ^1_ means "the string starts with 1_".
    | means "or".

    And of course $cPath is the variable that holds the current category path, visible in the address bar.

    For any top category (##) with or without subcategories, ^##$ will specify that top category.
    For any top category with subcategories, ^##_ will specify all of its subcategories (and sub-subs etc.).
    One step more detailed, for any subcategory (23_42), ^23_42$ will specify only that subcategory. THis can be extended as desired.
    You can string any number of these specifications together with | between them, and if any one of them is true, ereg will return true.

    Since in this case we want to execute if not in these categories, we add ! in front of ereg which says "f ereg is false, return true; if ereg is true, return false".

    THis bit of logic can be embedded in any PHP statement where true or false is being evaluated on a category/product page.
    Huh...!?! OK, I'll have to stew on that a bit and look into the tutorials. (And/or start drinking heavily) Whose wonderful idea was this, anyway?!

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

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

    Quote Originally Posted by gjh42 View Post
    Will do, Tim. First, the logic to include other categories/subcategories in this list:

    (!ereg("(^1$|^1_)",$cPath))

    You can find a full description of the PHP function ereg() in online tutorials like w3schools. For present purposes, there are three elements to understand.

    ^1$ means"the string is exactly 1".
    ^1_ means "the string starts with 1_".
    | means "or".

    And of course $cPath is the variable that holds the current category path, visible in the address bar.

    For any top category (##) with or without subcategories, ^##$ will specify that top category.
    For any top category with subcategories, ^##_ will specify all of its subcategories (and sub-subs etc.).
    One step more detailed, for any subcategory (23_42), ^23_42$ will specify only that subcategory. THis can be extended as desired.
    You can string any number of these specifications together with | between them, and if any one of them is true, ereg will return true.

    Since in this case we want to execute if not in these categories, we add ! in front of ereg which says "f ereg is false, return true; if ereg is true, return false".

    THis bit of logic can be embedded in any PHP statement where true or false is being evaluated on a category/product page.
    is that something I have to understand TOO!!!

    I knew, when I 'finished" my store in less then a week, it was too good to be true!

    If you're online and have some time, please email me and let me know if you have any sort of IMs. If I can just wrap my blonde brain around it, I will get it eventually. I'm just SOOOO scared to mess with what is already working that it kept me awake all last night .

    I try to calm down, we have new kittens in the house, so I go and hold one, but the minute I live the "nursery", I break out in a cold sweat cause I'm worried about getting this to work correctly.
    I was so happy that I thought all I had to do was just start adding stock.... I was wrong .

    I'm going to go read over your posts (again and again) and see if anything starts to gel.
    Thanks!
    Lalla
    www.LilleyPadGifts.com
    www.NothingButRomance.com

  6. #16
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    OK, Tim, don't worry! Bite-size chunks coming up ;)

    I included the full explanation for those who want to apply the logic to other situations; for you both, you can use what I have posted essentially as is.

    Working in /includes/templates/your_template/templates/tpl_product_info_display.php, find this section
    PHP 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']);
    ?></h2>
    <!--eof Product Price block -->
    and add

    <?php if (!ereg("(^23$|^23_)",$cPath)) { ?>

    and

    <?php } ?>

    to get
    PHP Code:
    <!--bof Product Price block -->
    <?php if (!ereg("(^23$|^23_)",$cPath)) { ?><!--no price in gallery -->
    <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']);
    ?></h2>
    <?php ?><!--/no price in gallery -->
    <!--eof Product Price block -->
    Change 23 to your gallery category id, and the price will not be shown on any product viewed in the gallery.
    Last edited by gjh42; 13 May 2007 at 10:47 PM.

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

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

    were we typing at the same time or what? LMAO!

  8. #18
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    Lalla, if you post a list of the category ids you want to skip the qty on, I will show you how the full testing list will look. You can take that as an example when you want toadd another category to the list.

  9. #19
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    550
    Plugin Contributions
    0

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

    Quote Originally Posted by gjh42 View Post
    Lalla, if you post a list of the category ids you want to skip the qty on, I will show you how the full testing list will look. You can take that as an example when you want toadd another category to the list.
    Ok, cool ,
    From the cat's I have showing now, it would be the following that should NOT show a qty because they are treated as individual items.

    1 - Comics
    2 - Salt & Pepper Shakers
    3- Postcards
    22- Lucy & Me Bears


    Thanks so much!

  10. #20
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

    The other categories besides Comics don't have subcats, so I will include the simplest form of the test.

    (^1$|^1_|^2$|^3$|^22$)

    PHP Code:
    <?php echo (((!ereg("(^1$|^1_|^2$|^3$|^22$)",$cPath)) and $flag_show_product_info_quantity == and $products_quantity >0) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
    If you want to include another top cat which has subcats (say id 27), you would add it to the above list like this:

    (^1$|^1_|^2$|^3$|^22$|^27_)

 

 
Page 2 of 8 FirstFirst 1234 ... LastLast

Similar Threads

  1. v138a Want Quantiy Box Instead of Buy Now Button on Specials
    By ribow in forum General Questions
    Replies: 0
    Last Post: 22 Jun 2012, 01:06 AM
  2. qty box not show with buy now buttom
    By hoang in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 4 Apr 2010, 03:27 PM
  3. Installed template, now want to go back... database problem
    By Bredpitt in forum General Questions
    Replies: 1
    Last Post: 8 Mar 2010, 07:34 AM
  4. All products listing: can I have a buy now and a qty box?
    By twiddletails in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 20 Nov 2008, 05:15 PM
  5. Removed all boxes to the left and now want to extend main page over.
    By estrange in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Jun 2007, 09:20 AM

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