Jump to content

Save button of Customization Form (Add to cart)


Recommended Posts

I need some customization fields in my products and i like when i click on the save customization Button add to cart directly.
I add this code:

Product.js

function saveCustomization()
{

   $('#quantityBackup').val($('#quantity_wanted').val());
   $('body select[@id^="group_"]').each(function() {
       $('#customizationForm').attr('action', $('#customizationForm').attr('action') + '&' + this.id + '=' + parseInt(this.value));
   });
   $('#customizationForm').attr('action', $('#customizationForm').attr('action')+'&fflag=1');
   $('#customizationForm').submit();

}


$(document).ready(function(){
if( $("div#fflag").length > 0 ){
       auxiliar=$('#customizationForm').attr('action').split('&');
       $('#customizationForm').attr('action', auxiliar[0]);
       $('#addtocart').click();
   }
...



Product.php

if($_GET["fflag"]==1){
   echo '';
}



The problem is that I´m redirect to cart.php and dont load the product page.

Thanks

Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...