Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29
  1. #21
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    Brilliant, thank you so much

    created c_3.css and in it
    .product-price span.sale-price {
    display:none;
    }

    seemed to work like a charm

    Thank you, thank you

  2. #22
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Hide price in one category

    Quote Originally Posted by Congerman View Post
    Brilliant, thank you so much

    created c_3.css and in it
    .product-price span.sale-price {
    display:none;
    }

    seemed to work like a charm

    Thank you, thank you
    As long as the product is configured to disallow being added to cart, this CSS fix may be sufficient.
    You might want to test to be sure that EVERY time that product is ever displayed that the URL contains a &cPath= value that ends in _3 else that CSS won't fire.
    .

    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. #23
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    Quote Originally Posted by DrByte View Post
    As long as the product is configured to disallow being added to cart, this CSS fix may be sufficient.
    You might want to test to be sure that EVERY time that product is ever displayed that the URL contains a &cPath= value that ends in _3 else that CSS won't fire.
    Thanks, They are only in there with a quantity of "0" so a sold button shows instead of add to cart

    Would be great to get your code to work on my template as that should sort out the source code problem still showing the price.

    Can yours be adapted to show an image instead of price on listing and info pages in specified category?

  4. #24
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Hide price in one category

    I haven't tested it, but you could try replacing this:

    Code:
    return '';
    with returning the HTML for the image.

    Code:
    return zen_image(whatever relevant parameters here);
    or
    Code:
    return '<img src="/your/server/images/folder/and/filename.jpg">';
    .

    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. #25
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    ok so functions prices

    $product_check = $db->Execute("select master_categories_id, products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call, products_type from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" . " limit 1");

    if ($product_check->fields['master_categories_id'] == 10) { // change '10' here to the category number
    return '<img src="/your/server/images/folder/and/filename.jpg">';
    }

  6. #26
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    dam did not work

    if ($product_check->fields['master_categories_id'] == 3) { // change '10' here to the category number
    return '<img src="http://www.artofrecycling.co.uk/images/8x8trans.gif" />';
    }
    Last edited by Congerman; 15 Jul 2016 at 07:40 PM.

  7. #27
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Hide price in one category

    When you say did not work. Please elaborate. Errors in logs directory? If you view the source code for the page is there a broken image or path? Etc...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #28
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    still just shows £0.00 in price field instead of the gif I directed it to in the return command

    I know it can be done with the css file but if I can get this function to work it should care the source code problem still showing the price

  9. #29
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Hide price in one category

    source code says

    <a class="product-name" href="http://artofrecycling.co.uk/shop/index.php?main_page=product_info&amp;products_id=7">Library Armchairs.</a>
    <div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <span class="sale-price" itemprop="price">&pound;0.00</span>
    </div>

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. v151 Hide one category from category side box
    By robbie269 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Feb 2014, 03:35 PM
  2. Hide one category in LH box
    By gprit in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 26 Jul 2010, 01:49 PM
  3. Hide category count -- on only ONE category
    By reneep in forum Setting Up Categories, Products, Attributes
    Replies: 31
    Last Post: 28 Apr 2010, 08:13 PM
  4. Hide Price for only one category
    By microinfo in forum General Questions
    Replies: 2
    Last Post: 26 Jun 2008, 11:13 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