Quantcast
Channel: WHMCS Community Forums
Viewing all articles
Browse latest Browse all 13458

help - adjust onclick addtocart function

$
0
0
i need to adjust the orderform addtocart function so that from the configure product page when you click to add to the cart the order will get added but the page will redirect to a different product group rather than the view cart page

the html line code is

Code:

<input type="button" value="{$LANG.continueshopping} &raquo;" class="checkout" onclick="addtocart();" /><br />
the js code is

Code:

functionaddtocart (gid) {    jQuery("#loading1").slideDown();
    jQuery.post("cart.php", 'ajax=1&a=confproduct&'+jQuery("#orderfrm").serialize(),
    function(data){
        if (data) {
            jQuery("#configproducterror").html(data);
            jQuery("#configproducterror").slideDown();
            jQuery("#loading1").slideUp();
        } else {
            if (gid) window.location='cart.php?gid='+gid;
            else window.location='cart.php?a=confdomains';
        }
    });

now i know that if i adjust the onclick to use
Code:

onclick="addtocart('43');"
this button will not go to the view cart page but will instead load product group 43

what i want to achieve however is to add the order to the cart on click and redirect to group 43

can anyone assist me with this adjustment to the js code to achieve this

Viewing all articles
Browse latest Browse all 13458

Trending Articles