Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    5
    Plugin Contributions
    0

    Default 2 options for a product and each option has multiple attribute labels

    Hi,

    I've been searching but can't seem to find anything relating to what I'm trying to achieve.

    Essentially what I'm trying to do is allow the user to select from two or more options and each option will have a series of labels with a radio button at the end, similar to http://www.perfumeempire.com.au/depa...&labelid=21254 (this is not my site and it isn't using Zencart, but I want to lay it out the same in my Zencart)

    So I would have 'Product', 'RRP', 'You Save', 'Price' and depending on which final checkbox they chose it would be a different price.

    I've looked into the 'Product Attribute Grid' mod but I can't work out how to do it and not sure if you can with that.

    I hope that makes sense. Any help would be greatly appreciated as I've been going crazy over the last couple days trying to do it!!

    Thanks,
    Stu

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: 2 options for a product and each option has multiple attribute labels

    That will require a good bit of custom coding to acheive that result

    You might first determine how important this is to you and then get some estimates on the cost to have the code written and then you can decide
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Oct 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: 2 options for a product and each option has multiple attribute labels

    Thanks for the quick response!

    I actually did work out another way to do this using js. It was a few hours mucking around, but for anyone trying to do a similar thing I did the following:

    1. make the attribute labels all be radio buttons
    2. Use CSS to hide the radio buttons of the attributes you just want to be labels, leave one attribute displaying its radio buttons for the user to select from
    3. onsubmit of the form call a js function that checks which radio button was selected and the change its corresponding hidden radio buttons to be selected as well.

    HTML Code:
     <script language="JavaScript">
    <!--
    
    function selectAttributes()
    {
    var j = 0;
    
    var aryClassElementsPrice = getElementsByClassName( 'class4', document.body );
    var aryClassElementsSize = getElementsByClassName( 'class5', document.body );
    var aryClassElementsName = getElementsByClassName( 'class2', document.body );
    
    	for(i=0; i<aryClassElementsPrice.length; i++)
                {
                            if(aryClassElementsPrice[i].checked==true)
                            {
    									aryClassElementsSize[i].checked = true;
    									aryClassElementsName[i].checked = true;
    									j++;
                            }
    						
          		}
    			if(j == 0)
    			{
    				alert("Please select a size");
    			}
    			else
    			{
    				document.cart_quantity.submit();
    			}
    			       
    }
    
    function getElementsByClassName( strClassName, obj ) {
        var ar = arguments[2] || new Array();
        var re = new RegExp("\\b" + strClassName + "\\b", "g");
    
        if ( re.test(obj.className) ) {
            ar.push( obj );
        }
        for ( var i = 0; i < obj.childNodes.length; i++ )
            getElementsByClassName( strClassName, obj.childNodes[i], ar );
        
        return ar;
    }
    
    //-->
    </script>

 

 

Similar Threads

  1. Single product, Color options, but option to buy several of each??
    By tcarden in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 3 Dec 2012, 04:16 PM
  2. Replies: 3
    Last Post: 30 Jun 2011, 02:04 AM
  3. Multiple Pictures for Each Product
    By markajh in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 31 May 2011, 06:32 AM
  4. Same Option name, Different option values for each product
    By pramod in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 2 May 2010, 11:31 PM
  5. Pull down options for each product
    By irishshopper in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Apr 2010, 02:12 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