Announcement

Collapse
No announcement yet.

choice dropdown box changes when add to cart button clicked

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    choice dropdown box changes when add to cart button clicked

    I have a product with one component. The component has two attributes, colour and size.

    The component permutations are linked to hidden products with individual stock codes for each colour/size combination. Pricing, names and tax are based on the hidden product.

    The problem is that when the shopper selects the size, it changes to a different size when the add to cart button is pressed and therefore the wrong product appears in the shopping cart.

    What is going on (I've done this before with no problems at all) I've tried deleting the component and setting it up again but it didn't make any difference. The permutations show corrrectly in Actinic - its just when they are ordered that the problem occurs.

    for examples see www.edgeimpactdraft.co.uk, accessories section, baby/kids banz and stripey two peice set.

    Thanks in anticipation of enlightenment!

    #2
    It's not Actinic. Someone has given these products a custom Cart Button that includes some home-brewed JavaScript. E.g.

    <INPUT TYPE=SUBMIT VALUE="Add To Cart" NAME="_BABYBANZ" onClick="CheckLengthPrice(document.forms[1], 3); return false;">

    It's this JavaScript CheckLengthPrice routine that's messing with your choices.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman - you are either up very late or up very early!

      I can see where the javascript is in the Act_Cartbutton.html template.

      I'm adding new products into an existing site and I don't want to have to change how all the current products work (they use a customvar that the javascript uses which I can't change without a lot of work). The previous developer set up size and colour as two components with that javascript where as I want to have them as 1 component with two attributes linking to a specific size/colour stock code.

      Can I have a second CartButton.html template by coping and changing Act_Cartbutton.html to remove the javascript and then use this in my new products template. I can't see how to get the NETQUOTEVAR:ADDTOCARTBUTTON to use a different template.

      thanks

      Comment


        #4
        Yep - I was on an all-nighter!

        That JavaScript is tightly coded to a particular page layout and will break if you have more than 1 product on the page, or you (or Actinic) make any other layout changes. Be prepared.

        However all is not lost.

        If you create a new Product Template and replace

        NETQUOTEVAR:ADDTOCARTBUTTON

        with


        NETQUOTEVAR:VARIANTS
        NETQUOTEVAR:VARIANTADDTOCARTBUTTON

        then this separates all the Attributes and Choices from the Cart button. However your modified Cart Button is still called.

        This can be fixed by replacing

        NETQUOTEVAR:VARIANTADDTOCARTBUTTON above with

        <!-- NETQUOTEVAR:VARIANTADDTOCARTBUTTON -->
        <INPUT TYPE=SUBMIT VALUE="Add To Cart" NAME="_NETQUOTEVAR:PRODUCTREFERENCE">

        Don't forget you still need the NETQUOTEVAR:VARIANTS line so your Attributes, etc appear. However you can now position these anywhere, away from the Cart Button if you like.


        Norman
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman, for your very helpful comments and we will certainly bear this mind.

          Comment

          Working...
          X