Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Remove "Max:1" from product listing pages in 1.58a

    ZC 1.58a, PHP 7.4.3

    I've done a relatively clean install of 1.58a and haven't been able to remove the text "Max:1", "Max: 2" etc. from my Product Listing pages as shown in the photo below. There are plenty of threads about this but all seem to be for older versions of ZC and the files or code they reference I can't locate.

    Have notes about how I removed the text when I installed 1.57 a long time ago but that solution no longer can be implemented.

    Any solutions or suggestions are appreciated.


    Click image for larger version. 

Name:	Clipboard01.jpg 
Views:	166 
Size:	11.6 KB 
ID:	20597

  2. #2
    Join Date
    Apr 2009
    Posts
    425
    Plugin Contributions
    2

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    The code you want to look at is in includes\modules\product_listing.php lines 306 to 322.
    Code:
    case 'PRODUCT_LIST_PRICE':
                        $lc_align = 'center';
                        if ($product_listing_layout_style === 'table') $lc_align = 'right';
                        $lc_text = '';
                        // if ($product_listing_layout_style === 'columns') $lc_text .= '<label>' . TABLE_HEADING_PRICE . '</label>';
                        $lc_text .= $listing_price;
                        $lc_text .= '<br><br>';
                        $lc_text .= zen_get_buy_now_button($record['products_id'], $lc_button, $more_info_button);
                        $lc_text .= '<br>';
                        $lc_text .= zen_get_products_quantity_min_units_display($record['products_id']);
                        $lc_text .= '<br>';
                        if (zen_get_show_product_switch($record['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH')) {
                            if (zen_get_product_is_always_free_shipping($record['products_id'])) {
                                $lc_text .= TEXT_PRODUCT_FREE_SHIPPING_ICON;
                                $lc_text .= '<br>';
                            }
                        }
                        break;
    If you don't want to display min or max, you could remove the lines marked in red. I would then save the file back to your template includes\modules\YOURTEMPLATE\product_listing.php so it does not get overwritten. If the file already exists, then modify the file in your template.

    Alternatively, if you could hide the code with some css. Again this will hide min and max.

    Code:
    .qmax {
    	display: none;
    }
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  3. #3
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    Thanks @brittainmark . That fixed it. It's been a while since I made a donation to Zen Cart team and when I do so soon will dedicate it in your name

    Hopefully down to my last layout issue, and that's with the "Call for Price" text/link showing up for items I've sold and am keeping as an archive, as shown in the photo below. Was able to remove it by changing the text in lang.english.php ('TEXT_CALL_FOR_PRICE' => '',) but that gives lots of warnings in log for Undefined Constant.

    Best way to remove or hide this link/text?

    Previously I got rid of unwanted "More Info..." on product listing pages by adding to stylesheet.css this line " a.list-more {display: none;}"

    Wondering if I can do this with Call for Price text/link and if so what would the code added to stylesheet.css be? Or if there is a correct way to do it that would be better.



    Click image for larger version. 

Name:	Clipboard07.jpg 
Views:	4 
Size:	11.0 KB 
ID:	20598

  4. #4
    Join Date
    Apr 2009
    Posts
    425
    Plugin Contributions
    2

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    Why is the product set up as call for price in the first place?
    If the product has been sold and is not set up as call for price, and you don't allow people to buy sold out products, then it will appear but not show call for price.

    On the product set "call for price" to "no"
    In Admin>Configuration>Stock set "Allow Checkout" to "false".

    If you want to leave the product on the system but not have customers see it you can turn it off.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  5. #5
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    Thanks for the quick reply.

    Many years ago decided I wanted to keep all my unique sold items online and searchable. I've never used the "Call for Price" feature so I just changed the call for price image into a "SOLD" image that was impossible to miss.

    Buyers can't purchase an item marked Call for Price. Sold items are moved to a category called Archives. I was trying to do something like when you search on fleebay under Completed Listings. Probably a half-a*** way to go and am sure there are better ways but after a decade+ got used to it. If it ain't broke don't fix it? I don't know.

    Can I just add ?????? {display: none;} to stylesheet.css to hide this, and if so what would I put for ??????


    Quote Originally Posted by brittainmark View Post
    Why is the product set up as call for price in the first place?
    If the product has been sold and is not set up as call for price, and you don't allow people to buy sold out products, then it will appear but not show call for price.

    On the product set "call for price" to "no"
    In Admin>Configuration>Stock set "Allow Checkout" to "false".

    If you want to leave the product on the system but not have customers see it you can turn it off.

  6. #6
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    To be more clear:

    I'm using the "Call for Price" feature to display an image next to listings wherever they are. The image says "SOLD" in neon yellow.

    This shows up wherever the product is listed- in New Products, All Products, category product listing pages, product page, etc. Also on all the Admin pages. I've co-opted a feature for a purpose it wasn't intended to be used for, and it's always worked as I wanted it to so never put much thought into it after setting it up. It just worked.


    Quote Originally Posted by Ted Grapler View Post
    Thanks for the quick reply.

    Many years ago decided I wanted to keep all my unique sold items online and searchable. I've never used the "Call for Price" feature so I just changed the call for price image into a "SOLD" image that was impossible to miss.

    Buyers can't purchase an item marked Call for Price. Sold items are moved to a category called Archives. I was trying to do something like when you search on fleebay under Completed Listings. Probably a half-a*** way to go and am sure there are better ways but after a decade+ got used to it. If it ain't broke don't fix it? I don't know.

    Can I just add ?????? {display: none;} to stylesheet.css to hide this, and if so what would I put for ??????

  7. #7
    Join Date
    Apr 2009
    Posts
    425
    Plugin Contributions
    2

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    You can find these yourself by using the inspector on your browser. See https://docs.zen-cart.com/user/running/inspect/ for google chrome. Other browsers are similar. Then try the element you think you need. If that does not do it, try the parent or make the CSS more precise. Loop as required. Then, when you have made the change, test other pages to make sure you have not changed them as well.

    Try
    Code:
    #btnCallPrice {
    	display: none;
    }
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  8. #8
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    brittainmark again thanks for your help. I tried the code you suggested in stylesheet.css and had no affect on this situation.

    Have tried using browser Inspector previously to track down a solution, had no luck. The "Call for Price" text and link I want to get rid of for the items I've marked as Sold shows like this in Inspector:

    <!--bof Add to Cart box --> == $0
    <div id="cartAdd"> == $0
    <a href="https://mysite.com/index.php?main_page=ask_a_question&pid=6665">Call for Price</a>
    </div>
    <!--eof Add to Cart Box-->


    By experimenting I was able to get rid of the text and link it by removing Add to Cart somewhere in the code, but it also removed Add to Cart from all my items that were still available. So need to narrow it down so it only removes it for items I've marked as Call for Price(ie SOLD).

    Am pretty sure with Zen Cart 1.57 I just removed the text (lang.english.php to ('TEXT_CALL_FOR_PRICE' => '',) that still works fine in 1.58a but will give log warnings - "Undefined Constant that will cause errors in future versions."

    All suggestions are appreciated.


    Quote Originally Posted by brittainmark View Post
    You can find these yourself by using the inspector on your browser. See https://docs.zen-cart.com/user/running/inspect/ for google chrome. Other browsers are similar. Then try the element you think you need. If that does not do it, try the parent or make the CSS more precise. Loop as required. Then, when you have made the change, test other pages to make sure you have not changed them as well.

    Try
    Code:
    #btnCallPrice {
    	display: none;
    }

  9. #9
    Join Date
    Apr 2009
    Posts
    425
    Plugin Contributions
    2

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    What template are you using?

    This may work, but I don't know what to test against
    Code:
    #cartAdd a[href^="https://mysite.com/index.php?main_page=ask_a_question"] {
      display:none;
     }
    You will have to change mysite.com to the correct url. This is looking in the element with id "cartAdd" (<div id="cartAdd">) for a link <a> with a link (href) that starts "https://mysite.com/index.php?main_page=ask_a_question"
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  10. #10
    Join Date
    Nov 2015
    Location
    New Jersey USA
    Posts
    72
    Plugin Contributions
    0

    Default Re: Remove "Max:1" from product listing pages in 1.58a

    I tried adding to stylesheet.css

    #cartAdd a[href^="https://mysite.com/index.php?main_page=ask_a_question"] {
    display:none;
    }


    But it did not remove the link and text. I did change mysite.com to actual name of my website.

    I've got a temp solution and this is simply changing the text in lang.english.php on line 382 to 'TEXT_CALL_FOR_PRICE' => 'Out of Stock',

    It's not ideal because it adds redundant info and takes up additional space on the pages, but looks like only shows up when viewing my Archives category and I can live with that. It actually might be a good thing because sometimes people email me about availabilty of items marked with the yellow SOLD image, this will reinforce that the item is gone.

    Still looking for suggestions

    THANKS.





    Quote Originally Posted by brittainmark View Post
    What template are you using?

    This may work, but I don't know what to test against
    Code:
    #cartAdd a[href^="https://mysite.com/index.php?main_page=ask_a_question"] {
      display:none;
     }
    You will have to change mysite.com to the correct url. This is looking in the element with id "cartAdd" (<div id="cartAdd">) for a link <a> with a link (href) that starts "https://mysite.com/index.php?main_page=ask_a_question"

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Remove "Buy Now" from Product Listing
    By SusieQ228 in forum Customization from the Admin
    Replies: 8
    Last Post: 20 Dec 2010, 01:28 AM
  2. Remove "New Products" from Product Listing
    By TurtleDove in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Aug 2009, 05:45 AM
  3. Remove "Add: [ ]" and "Add selected products to cart" from product pages? possible?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Sep 2008, 03:13 AM
  4. Remove "Contact Us" button from Product Listing
    By xando in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 12 Nov 2006, 04:12 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