News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

"Add To Cart" Button Error & "Checkout" Link Problem

Started by klogue, April 07, 2008, 20:40:13 PM

Previous topic - Next topic

klogue

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:

<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....
<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

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

Quote from: klogue 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.

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

tatanajllo

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

Not solved but I already know what my problem was. Jquery vs Mootools.

Now I gotta find a solution for that!

tez



nemanja

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)