Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Customized attribute template not passing attribute selection to shopping cart

    I'm so close to finding a solution! I thought I had everything wrapped up for my project, but ran into a problem.

    Here's the page I am working on:
    http://www.cacorvettecustoms.com/ind...&products_id=2

    I have made an if/then statement when calling the "tpl_modules_attributes.php" from the "tpl_product_info_display.php" page. Basically, if it's any another product than this one, the standard attributes page loads. When this product, product_id=2, is loaded, i load a static attribute page.

    The first 4 attributes are fine the way the are. I am trying to get the color option to be dynamic based off the year. I have used a simple way to get this done. However, it seems that using the standard form names causes an issue. In the line:
    Code:
    <select name="id[5]" id="attrib-5" onchange="setOptions(document.cart_quantity.id[5].options[document.cart_quantity.id[5].selectedIndex].value);">
    The id[5] seems to be messing it up. I tried to rename the form components, and it worked for the page, but it does not carry the attributes over to the shopping cart.

    Help!

  2. #2
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Customized attribute template not passing attribute selection to shopping cart

    I see the title of the thread changed. Thanks! (I think) This does seem a more appropriate title.

  3. #3
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Customized attribute template not passing attribute selection to shopping cart

    I'm not sure if I found something or not.

    The actual code I am using in the onchange is:
    document.cart_quantity.id[5].options

    When I get an error, it shows...

    Line: 357
    Error: 'document.cart_quantity.id.5.options' is null or not an object

    Does this have to do with the name of the select on the form having a "[" and "]" ?

  4. #4
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Customized attribute template not passing attribute selection to shopping cart

    So I changed the id[5] to year and the id[6] to color and the page will work. However, as before, the attributes do not get passed to the shopping cart.

    So the special characters "[" and "]" are messing up the script. I've been searching all day for a way around this. Help!

    -steve

  5. #5
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Customized attribute template not passing attribute selection to shopping cart

    Morning bump!

  6. #6
    Join Date
    Oct 2007
    Posts
    65
    Plugin Contributions
    0

    Default Re: Customized attribute template not passing attribute selection to shopping cart

    Well I got this one solved. I used a script from the following URL:
    http://roshanbh.com.np/2007/12/chang...x-and-php.html

    Now it works! Check it out here:
    http://www.cacorvettecustoms.com/ind...&products_id=2


 

 

Similar Threads

  1. v150 Attribute images not in-line with attribute selection
    By JacobBushnell in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Aug 2012, 11:51 PM
  2. Default Attribute Selection and Add to Cart
    By onurich01 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 17 Jul 2009, 05:47 PM
  3. zero price in shopping cart if attribute not selected
    By artbobo in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 May 2008, 12:01 AM
  4. If attribute not selected - ERROR in the shopping cart
    By mikajlo in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Apr 2007, 03:48 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