Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Disable Product Images in one TOP category to affect all subcategories

    The below closed thread explains nicely how to disable images in a category.
    http://www.zen-cart.com/showthread.p...t-one-category

    In your css folder, add a file called c_x_x.css

    In that file, I added only the following and chose not to remove the heading.

    PHP Code:
    /**
     * CSS remove Images in product listing
    */

    .listingProductImage {
         
    displaynone;

    In order to keep the Heading, which is nice for a sortable list, I simply went into includes/languages/english/index.php and removed Product Images (between single quotes).

    BUT - I am after disabling Product Images in one TOP category to affect all subcategories to avoid creating 50+ css files per bottom category.

    I tried for example c_3.css and c_3_175.css but was forced to use c_3_175_845.css

    Any way around this? Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Disable Product Images in one TOP category to affect all subcategories

    A quick dirty trick:

    Create the following new file: /includes/templates/YOUR_TEMPLATE_FOLDER/jscript/jscript_categories_children_css.php
    containing:
    Code:
    <?php
    /**
     *  custom category handling for a parent and all its children ... works for any c_XX_XX_children.css  where XX_XX is any parent category
     */
      $tmp_cats = explode('_', $cPath);
      $value = '';
      foreach($tmp_cats as $val) {
        $value .= $val;
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . '/' . $_SESSION['language'] . '_c_' . $value . '_children.css';
        if (file_exists($perpagefile)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
        $value .= '_';
      }
    Then in your css folder put your new css file as "c_3_children.css" and it'll apply to all children below cPath=3
    Similarly, if you want to only affect the children of cPath=3_175 then make the filename be c_3_175_children.css instead.


    THIS CODE IS NOW INCLUDED IN v1.5.1
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Disable Product Images in one TOP category to affect all subcategories

    Dirty little trick worked like a charm - hand sanitizer anyone?!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Disable Product Images in one TOP category to affect all subcategories

    PS: You REALLY should be upgrading to a newer more secure version of Zen Cart. Yours has security holes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2010
    Posts
    182
    Plugin Contributions
    0

    Default Re: Disable Product Images in one TOP category to affect all subcategories

    Quote Originally Posted by DrByte View Post
    PS: You REALLY should be upgrading to a newer more secure version of Zen Cart. Yours has security holes.
    Oh don't I know it. We have taken a few directions to band-aid it, yet we have SOOO many customizations we're a little apprehensive on upgrading. I do know it is mandatory and have it on the plate for upcoming projects. We may outsource to someone who has done this many times. I wonder if it is easier than I'm making it out to be.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 10 Nov 2010, 11:52 AM
  2. Disable Category Sidebox on all but one ezpage
    By CyberWoolf in forum Basic Configuration
    Replies: 6
    Last Post: 18 Mar 2009, 02:44 AM
  3. Disable product images in just one category?
    By dimar in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 10 Jul 2008, 02:42 PM
  4. all product on top category, now i cannot create new category
    By tsakali in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 28 Dec 2007, 09:26 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