Author Topic: "Add To Cart" Button Error & "Checkout" Link Problem  (Read 31587 times)

klogue

  • Beginner
  • *
  • Posts: 4
"Add To Cart" Button Error & "Checkout" Link Problem
« on: April 07, 2008, 20:40:13 pm »
I'm using Joomla 1.5.2 and the latest Nightly build of VirtueMart.

Here are the problems I'm having:

1) The "add to cart" button doesn't seem to do anything on the product details page.  When viewing the all listings for a particular category, the button works...sometimes.  When you click it on the individual product details page though, nothing happens.  Clicking the text link that does the same thing on other pages such as the "related items" area  works fine.  How do I make it work?

2) When you view the cart and click "Check Out" it takes you to this link:

http://www.mysite.com/index.php?page=checkout.index&ssl_redirect=1&option=com_virtuemart&Itemid=56

When I take out the "&ssl_redirect=1" the link works perfectly.  So the link would look like this:

http://www.mysite.com/index.php?page=checkout.index&option=com_virtuemart&Itemid=56

I have no need to use SSL because I'm using paypal as a payment processor, so how would I remove this variable entirely from the url?  I can't find the file that appends this to the url.



Regarding Issue #1 - Upon further inspection, I've noticed the following:

Code: [Select]
<form action="http://www.mysite.com/index.php" method="post" name="addtocart" id="addtocart">
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="page" value="shop.cart" />
    <input type="hidden" name="Itemid" value="56" />
    <input type="hidden" name="func" value="cartAdd" />
    <input type="hidden" name="prod_id" value="9" />
    <input type="hidden" name="product_id" value="9" />
    <input type="hidden" name="quantity" value="1" />
    <input type="hidden" name="set_price[]" value="" />
    <input type="hidden" name="adjust_price[]" value="" />
    <input type="hidden" name="master_product[]" value="" />
    <input type="submit" class="addtocart_button_module" value="Add to Cart" title="Add to Cart" />
</form>

That code is generated by the related items module at the bottom of product detail pages.  That code correctly adds the item to my cart when the link is clicked.

Now....
Code: [Select]
<div class="vmCartContainer">
   
    <form action="http://www.mysite.com/index.php" method="post" name="addtocart" id="addtocart_47fa7ffad5513" class="addtocart_form" onsubmit="handleAddToCart( this.id );return false;">

    <div class="vmCartDetails">
        <input type="hidden" name="product_id" value="10" />
        <input type="hidden" name="prod_id[]" value="10" />
    </div>
         
    <div style="float: right;vertical-align: middle;">
        <input type="hidden" id="quantity10" name="quantity[]" value="1" />   
        <input type="submit" class="addtocart_button" value="Add to Cart" title="Add to Cart" />
    </div>
       
    <input type="hidden" name="flypage" value="shop.flypage.tpl" />
    <input type="hidden" name="page" value="shop.cart" />
    <input type="hidden" name="manufacturer_id" value="1" />
    <input type="hidden" name="category_id" value="1" />
    <input type="hidden" name="func" value="cartAdd" />
    <input type="hidden" name="option" value="com_virtuemart" />
    <input type="hidden" name="Itemid" value="56" />
    <input type="hidden" name="set_price[]" value="" />
    <input type="hidden" name="adjust_price[]" value="" />
    <input type="hidden" name="master_product[]" value="" />

    </form>
</div>

That code does not work.  That code generates an add to cart button that does nothing when clicked.

klogue

  • Beginner
  • *
  • Posts: 4
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #1 on: April 08, 2008, 21:36:30 pm »
Here's the issue:

https://dev.virtuemart.net/cb/issue/1840?navigation=true

I turned off sh404sef for this component and it works correctly.

hopefully sh404sef support for virtuemart 1.1 will catch up.

d12welve

  • Beginner
  • *
  • Posts: 5
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #2 on: May 16, 2008, 16:44:36 pm »
Here's the issue:
https://dev.virtuemart.net/cb/issue/1840?navigation=true
I turned off sh404sef for this component and it works correctly.
hopefully sh404sef support for virtuemart 1.1 will catch up.

By making the changes that 'soeren_nb' suggested, my site is now working correctly. Thanks for posting this info.

tatanajllo

  • Beginner
  • *
  • Posts: 7
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #3 on: September 29, 2008, 17:11:01 pm »
Hey guys I tried soeren_nb's solution (replaced lines in Theme.js & virtuemart_parser.php) with no luck, it seems as though mootools is not loading correctly.

I get this message in firebug:

(new Element("div")).setProperty is not a function

And nothing happens, help!




tatanajllo

  • Beginner
  • *
  • Posts: 7
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #4 on: September 29, 2008, 18:06:41 pm »
Not solved but I already know what my problem was. Jquery vs Mootools.

Now I gotta find a solution for that!

tez

  • Jr. Member
  • **
  • Posts: 130
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #5 on: September 17, 2009, 07:44:00 am »
this is a bit tricky. Jquery + Mootools

friscodev

  • Beginner
  • *
  • Posts: 1
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #6 on: April 30, 2010, 22:51:34 pm »
jQuery.noConflict(); is the solution

http://api.jquery.com/jQuery.noConflict/

nemanja

  • Beginner
  • *
  • Posts: 4
    • www.evertical.net
Re: "Add To Cart" Button Error & "Checkout" Link Problem
« Reply #7 on: July 09, 2011, 17:18:32 pm »
does anyone knows the right code for virtuemart button? i found already 2 of them and they both got mistakes...

open div not cloased </form> and this one here it says <input type="hidden" id="quantity10" name="quantity[]" value="1" />   

that quantity10 is obviously wrong!

please guys anyone who know the right code please email me

nemanja@radevic.com

i am trying to make this work and i will provide back for whoso ever needs this code i made

http://www.gnosysoftbeta.com/hosting

thanks guys!
Nemanja Radevic
www.evertical.net
nemanja22@gmail.com (no spam please)