1 Attachment(s)
How to hide an attribute so that it is not shown in front end
Hi everyone
Attachment 20399
Say i want to hide the attribute: 3m + 10m so that it is not shown in front end. How can i do this?
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.
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
mc12345678
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?
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
navido
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
... 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.
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?
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
simon1066
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.
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
navido
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
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.
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
lat9
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.
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.
Re: How to hide an attribute so that it is not shown in front end
Quote:
Originally Posted by
chuckrey
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...