Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Posts
    68
    Plugin Contributions
    0

    Default Turn Off Max Quantity Display In Product Listing

    I posted this in the Products subforum and got no replies:

    Is there a way to turn off the Max: 1 display in the products listing?

    Our items don't allow for an Add button on the Products List so visitors see just the price @ right.

    I want to use the Max Qty field as a 'flag' for certain items to display a msg, but when I set it to anything but zero it displays on the Products List.

    How do I turn it off?

    I looked in product_listing.php and durned if I can see where it is.

    TIA,

    ---JC

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,880
    Plugin Contributions
    96

    Default Re: Turn Off Max Quantity Display In Product Listing

    The stock version of Zen Cart does not provide for styling (or not displaying) the min/max/unit/mix values in the "cartAdd" block. Here's an update to the function zen_get_products_quantity_min_units_display (present in /includes/functions/functions_prices.php) to add spans around each type of value so that they can be separately styled.

    Note that this will result in a CORE FILE OVERWRITE, so make a backup copy of the functions_prices.php and then edit the file to fully replace the function.


    Code:
    ////
    // Return a products quantity minimum and units display
      function zen_get_products_quantity_min_units_display($product_id, $include_break = true, $shopping_cart_msg = false) {
        $check_min = zen_get_products_quantity_order_min($product_id);
        $check_units = zen_get_products_quantity_order_units($product_id);
    
        $the_min_units='';
    
        if ($check_min != 1 or $check_units != 1) {
          if ($check_min != 1) {
            $the_min_units .= '<span class="qmin">' . PRODUCTS_QUANTITY_MIN_TEXT_LISTING . '&nbsp;' . $check_min . '</span>';
          }
          if ($check_units != 1) {
            $the_min_units .= '<span class="qunit">' . ($the_min_units ? ' ' : '' ) . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING . '&nbsp;' . $check_units . '</span>';
          }
    
    // don't check for mixed if not attributes
          $chk_mix = zen_get_products_quantity_mixed((int)$product_id);
          if ($chk_mix != 'none') {
    	    $the_min_units .= '<span class="qmix">';
            if (($check_min > 0 or $check_units > 0)) {
              if ($include_break == true) {
                $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
              } else {
                $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
              }
            } else {
              if ($include_break == true) {
                $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
              } else {
                $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
              }
            }
    		$the_min_units .= '</span>';
          }
        }
    
        // quantity max
        $check_max = zen_get_products_quantity_order_max($product_id);
    
        if ($check_max != 0) {
    	  $the_min_units .= '<span class="qmax">';
          if ($include_break == true) {
            $the_min_units .= ($the_min_units != '' ? '<br />' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
          } else {
            $the_min_units .= ($the_min_units != '' ? '&nbsp;&nbsp;' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
          }
    	  $the_min_units .= '</span>';
        }
    
        return $the_min_units;
      }

  3. #3
    Join Date
    Nov 2010
    Posts
    68
    Plugin Contributions
    0

    Default Re: Turn Off Max Quantity Display In Product Listing

    Perfect. Thanks!

    ---JC

 

 

Similar Threads

  1. v139f Turn Off Max Quantity Display In Product Listing
    By suntower in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 13 Mar 2012, 11:28 PM
  2. Can I turn off Quantity Box and Qty field in subcategory page (all product listing)?
    By bigstore in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Mar 2012, 10:28 PM
  3. Remove Max Quantity from Product Listing
    By dab in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 2 Dec 2009, 12:41 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