Results 1 to 2 of 2
  1. #1

    Default How to ad css class to all sold out products on product listing

    Hello, i am wondering how to add css class to all products images that are sold out on product listing pages?
    I want to make black/white all pictures of sold out products till they are again in stock.

    Best regards and many thanks in advance.
    My most recent work: magprom.net

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

    Default Re: How to ad css class to all sold out products on product listing

    Quote Originally Posted by perfumbg View Post
    Hello, i am wondering how to add css class to all products images that are sold out on product listing pages?
    I want to make black/white all pictures of sold out products till they are again in stock.

    Best regards and many thanks in advance.
    Seems that basically will want to target the file: includes/modules/YOUR_TEMPLATE/product_listing.php

    There is a while loop within that file and the variable $listing->fields['products_quantity'] represents the quantity of the product in question. From that point, would want to "properly" assign the start and end of your new class based on your setup and desired operation. As to having that apply only to the product listing and not say featured listing, or specials listing, then as part of the check would need to identify if the $page_name or other factors are set as desired... Even testing perhaps if $tpl_page_body == 'tpl_index_product_list.php' might be possible (value is assigned back in the main_template_vars.php file for includes/modules/pages/index when the page is presenting categories.) There are other ways to test/identify the current page and it all depends on how you want things to work. :)

    By-the-way YOUR_TEMPLATE would be the template override folder that is named the same as where your template is installed in the path includes/templates/YOUR_TEMPLATE. If the file does not exist in that directory then copy the file of the same name from includes/modules to the template override (creating the directory if necessary) and then make the edits desired...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 Hide Normalprice for sold out products & in product listing page ONLY!
    By Green Books in forum General Questions
    Replies: 1
    Last Post: 4 Oct 2015, 06:06 PM
  2. How do I add a unique css class (or html id) to product listing items?
    By feemcgill in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 19 Apr 2011, 05:51 PM
  3. All products showing as Sold Out
    By gayleamy in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 2 Oct 2008, 07:38 AM
  4. Products Quantity? Updating all vs showing Sold Out
    By rooisnor in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 13 Jul 2008, 09:58 PM
  5. Sold out products listing in New products
    By sparkiii in forum Basic Configuration
    Replies: 3
    Last Post: 27 Sep 2007, 10:58 PM

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