Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    2,420
    Plugin Contributions
    2

    Default Disable attribute display when only one option

    This question may have been answered recently but last time I asked over a year ago there as no solution offered or available in Zen Cart 1.27 so thought I would ask again to see if newer 1.3x versions support workaround.

    Is there a method to hide the attribute display on the product info page when the attribute has only one option, that is when there is NO choice?

    That is when an option is not an option ;-)

    For instance for an eBook product, which is offered in PDF format only, how do I NOT display:

    "Please Choose: Downloadable eDoc - English PDF"
    (with enabled radio button which cannot be disabled).

    I can comment out code to display this info in the template file, but that would also impact all products with attributes with more than once option.

    Is there a switch in admin that would disable display of attribute info for products with a single attribute option?

    If not could a snippet of code be added somewhere which would test for this condition and set a flag which could be utilized in tpl_product_info_display.php.

    Any thoughts on best way to implement this idea? Thanks.

    Woody

  2. #2
    Join Date
    Jan 2005
    Location
    Minneapolis MN, USA
    Posts
    136
    Plugin Contributions
    1

    Default Re: Disable attribute display when only one option

    Hi Woody,

    I have a ~really clunky~ solution for you. Key word: clunky. "-)

    -- For the Option Name, make it something like "Product is Downloadable PDF" or whatever... nothing that says "select"; so it becomes "info" instead of a selectable attribute.

    -- Keep the Value/Radio Button stuff as it is now.

    -- In Attributes Controller for the product, set that button as follows:

    Used For Display Purposes Only: Yes
    Default Attribute to be Marked Selected: Yes

    [Probably the way you already have it set.]

    -- Now here's the horrible "clunky" part: Get the attrib id assigned to this and in your CSS file set that ID to "display: none;"

    Ex: #attrib-123-45 {display: none;}

    It's horrible, I know, and requires you to do it for each attribute you set up that needs to be done this way. But it works -- that was all I could come up with after hours of banging my head on the keyboard trying to make ZC do something it's not designed to do right now in terms of attribute display. "-)

    Maybe not what you want, just an idea as a stop-gap.

    Cheers,

    Becky

 

 

Similar Threads

  1. v151 From multiple Option Names and Attributes allow user to select one attribute only
    By tipada in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 27 Jan 2013, 03:10 AM
  2. Disable Add-to-cart when Display-only Attribute is Selected
    By david_johns in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 May 2010, 10:00 PM
  3. dropdown changes to radio if only one attribute option
    By ivanc in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 26 Mar 2009, 09:43 PM
  4. Eliminate "Please Choose" when only One attribute option is present?
    By zcnb in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 28 Oct 2008, 01:53 PM

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