Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Sep 2008
    Posts
    220
    Plugin Contributions
    0

    Default How to hide an attribute so that it is not shown in front end

    Hi everyone

    Name:  Skjermbilde 2023-09-29 195352.jpg
Views: 454
Size:  45.3 KB

    Say i want to hide the attribute: 3m + 10m so that it is not shown in front end. How can i do this?

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

    Default Re: How to hide an attribute so that it is not shown in front end

    Delete it from this screen as in not make it an option associated with this product.

    That at least is one solution.

    It would really help for there to be an explanation about what you are really trying to accomplish...

    There's ways to use css to hide it from the front end, but it comes down to, is this temporary? Why is it associated to begin with? What are your future plans? Why only hide on the store front? Etc...

    No need to answer all of those, they are just example questions that would help the community identify how they can help you reach your goal.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2008
    Posts
    220
    Plugin Contributions
    0

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by mc12345678 View Post
    Delete it from this screen as in not make it an option associated with this product.

    That at least is one solution.

    It would really help for there to be an explanation about what you are really trying to accomplish...

    There's ways to use css to hide it from the front end, but it comes down to, is this temporary? Why is it associated to begin with? What are your future plans? Why only hide on the store front? Etc...

    No need to answer all of those, they are just example questions that would help the community identify how they can help you reach your goal.

    Thanks for your reply. Yes i know i can delete it. However then i have to somewhere write up the price so that i dont forget it. Yes it is temporary so that i can put it back on when it is back in stock. So i wanted to hide it simply so that it is not visible. Seems no way except deleting it?

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,294
    Plugin Contributions
    1

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by navido View Post
    Thanks for your reply. Yes i know i can delete it. However then i have to somewhere write up the price so that i dont forget it. Yes it is temporary so that i can put it back on when it is back in stock. So i wanted to hide it simply so that it is not visible. Seems no way except deleting it?
    Quote Originally Posted by mc12345678 View Post
    ... There's ways to use css to hide it from the front end ...
    As @mc12345678 says you can hide it with CSS. If you want to hide it for an individual product then you can create a product-specific stylesheet (see CSS_read_me.txt in the CSS folder) similarly for an individual category, otherwise add the CSS rules to your main stylesheet.
    Simon

  5. #5
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: How to hide an attribute so that it is not shown in front end

    Will one of the "Stock by Attribute" plugins work to turn it off when stock = zero?

    but possibly opening a new can-of-worms?
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,334
    Plugin Contributions
    94

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by simon1066 View Post
    As @mc12345678 says you can hide it with CSS. If you want to hide it for an individual product then you can create a product-specific stylesheet (see CSS_read_me.txt in the CSS folder) similarly for an individual category, otherwise add the CSS rules to your main stylesheet.
    Using CSS to hide that option (via display: none;) still leaves the option for a crafty person to display and, thus, select it for purchase.

    I'll suggest also marking that attribute as "Display Only" (the left-most icon) so that it can't be added to the cart.

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

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by navido View Post
    Thanks for your reply. Yes i know i can delete it. However then i have to somewhere write up the price so that i dont forget it. Yes it is temporary so that i can put it back on when it is back in stock. So i wanted to hide it simply so that it is not visible. Seems no way except deleting it?
    Quote Originally Posted by RixStix View Post
    Will one of the "Stock by Attribute" plugins work to turn it off when stock = zero?

    but possibly opening a new can-of-worms?
    It seems that the desire is to support such common action (zero quantity of the product's attribute modifying display) routinely. If it is just a once in a while, for a very short time, affecting few items type of thing, then yes definitely a can-of-worms or overkill. If determined the desired way to go, then there are options of software out there from fully free open source to commercial.

    As to retention of the associated data, there are other ways to "backup" the data such as exporting the attribute data for a product or category and ideally then to again upload that data back. I am not referring to a complete database backup and restore, but instead something that targets your need.

    It's all about what capability you want to have, maintain, and will help you make the sales you need instead of messing around with your site and what you need now as compared to what you want available in the future.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jul 2012
    Posts
    16,797
    Plugin Contributions
    17

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by lat9 View Post
    Using CSS to hide that option (via display: none;) still leaves the option for a crafty person to display and, thus, select it for purchase.
    Absolutely and just one more reason for explanation of the desired goal.

    As later identified, appears to be a stock by attribute related feature or perhaps more complicatedly stated appears to need product attribute modification based on attribute stock availability.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Aug 2020
    Location
    Richarson
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to hide an attribute so that it is not shown in front end

    I apologize if this is not the correct thread, but it's the closest I can find searching through the forum...
    I am using 1.5.8a w/ Classic Responsive template and SBA plugin. All is working great. I just have a "tweek" I would like to make and thought I had it resolved, but did not. My goal is to allow the "display only" attribute prices appear on the product listing when the "base price" is also selected. It seems the out of box option does not currently allow this functionality.

    I do not write code and it is somewhat foreign to me buy I have managed to get by thanks to the file structure of zencart that allows simple changes. I found the code below in the includes/functions directory under the functions_prices.php file and changed it as displayed. With the change Display only attributes are now displaying prices on the product listing pages. That's great. However, I also need the NON-display only attributes to display prices on the product listing pages. Why? The display only attributes are not inventory items, they are displayed for group prices display only purposes not for tracking inventory, but when I turn off the display only option, the drop down displays the display only attributes as "out of stock" which can be confusing to users, I would prefer it not say anything as it does w/ the display only option. As for the non display only options, those are single items that are tracked for inventory and therefore not display only, but I would like the prices displayed on the product listing as well.

    I am aware that I can choose to place the prices w/ the product and not select the "Product Priced by Attributes" to have them display. But I would prefer to update all prices w/ EP on the attributes spreadsheet instead of having to go to the Full and Attributes pages for price updates. SBA works perfect for my use and if I can simply have the display only AND non display only attributes display on the product listing it would be perfect for my use.

    PHP Code:
     $sql "SELECT options_id, price_prefix, options_values_price,
                        attributes_display_only, attributes_price_base_included,
                 CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
                 FROM " 
    TABLE_PRODUCTS_ATTRIBUTES "
                 WHERE products_id = " 
    . (int)$product_id "
                 AND attributes_display_only != 1
                 AND attributes_price_base_included=1
                 ORDER BY options_id, value"
    ;
        
    $results $db->Execute($sql);

        
    $the_options_id 'x';
        
    $the_base_price 0
    and I changed it to
    PHP Code:
     $sql "SELECT options_id, price_prefix, options_values_price,
                        attributes_display_only, attributes_price_base_included,
                 CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
                 FROM " 
    TABLE_PRODUCTS_ATTRIBUTES "
                 WHERE products_id = " 
    . (int)$product_id "
                 AND attributes_display_only != 0
                 AND attributes_price_base_included=1
                 ORDER BY options_id, value"
    ;
        
    $results $db->Execute($sql);

        
    $the_options_id 'x';
        
    $the_base_price 0
    Sorry for the long message and I hope this makes sense, if not, I am happy to clarify. Thank you.

  10. #10
    Join Date
    Aug 2020
    Location
    Richarson
    Posts
    139
    Plugin Contributions
    0

    Default Re: How to hide an attribute so that it is not shown in front end

    Quote Originally Posted by chuckrey View Post
    I apologize if this is not the correct thread, but it's the closest I can find searching through the forum...
    I am using 1.5.8a w/ Classic Responsive template and SBA plugin. All is working great. I just have a "tweek" I would like to make and thought I had it resolved, but did not. My goal is to allow the "display only" attribute prices appear on the product listing when the "base price" is also selected. It seems the out of box option does not currently allow this functionality.

    I do not write code and it is somewhat foreign to me buy I have managed to get by thanks to the file structure of zencart that allows simple changes. I found the code below in the includes/functions directory under the functions_prices.php file and changed it as displayed. With the change Display only attributes are now displaying prices on the product listing pages. That's great. However, I also need the NON-display only attributes to display prices on the product listing pages. Why? The display only attributes are not inventory items, they are displayed for group prices display only purposes not for tracking inventory, but when I turn off the display only option, the drop down displays the display only attributes as "out of stock" which can be confusing to users, I would prefer it not say anything as it does w/ the display only option. As for the non display only options, those are single items that are tracked for inventory and therefore not display only, but I would like the prices displayed on the product listing as well.

    I am aware that I can choose to place the prices w/ the product and not select the "Product Priced by Attributes" to have them display. But I would prefer to update all prices w/ EP on the attributes spreadsheet instead of having to go to the Full and Attributes pages for price updates. SBA works perfect for my use and if I can simply have the display only AND non display only attributes display on the product listing it would be perfect for my use.

    PHP Code:
     $sql "SELECT options_id, price_prefix, options_values_price,
                        attributes_display_only, attributes_price_base_included,
                 CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
                 FROM " 
    TABLE_PRODUCTS_ATTRIBUTES "
                 WHERE products_id = " 
    . (int)$product_id "
                 AND attributes_display_only != 1
                 AND attributes_price_base_included=1
                 ORDER BY options_id, value"
    ;
        
    $results $db->Execute($sql);

        
    $the_options_id 'x';
        
    $the_base_price 0
    and I changed it to
    PHP Code:
     $sql "SELECT options_id, price_prefix, options_values_price,
                        attributes_display_only, attributes_price_base_included,
                 CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
                 FROM " 
    TABLE_PRODUCTS_ATTRIBUTES "
                 WHERE products_id = " 
    . (int)$product_id "
                 AND attributes_display_only != 0
                 AND attributes_price_base_included=1
                 ORDER BY options_id, value"
    ;
        
    $results $db->Execute($sql);

        
    $the_options_id 'x';
        
    $the_base_price 0
    Sorry for the long message and I hope this makes sense, if not, I am happy to clarify. Thank you.
    Update.... I played around with it a bit and simply deleted the following:
    AND attributes_display_only != 0
    seems to work for me now. If there is any reason this is not recommended, I would appreciate the input, but for my purpose seems to work fine...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 How to hide an attribute so that it is not shown in front end
    By navido in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 19 Oct 2023, 02:31 AM
  2. v153 freeoptions is not appearing on front end
    By jsarwar in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 2 Jul 2016, 12:23 AM
  3. v139b Crisis! Back end works, front end does not!
    By Tamuren in forum General Questions
    Replies: 2
    Last Post: 25 Jan 2012, 02:22 AM
  4. Categories not showing up in front end but it is added in back end
    By raaj.smvec in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 22 Apr 2010, 12:06 PM
  5. weird string appears beside attribute selection in front-end
    By vasilios in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Jan 2009, 01:56 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