1
votes

I am working on one magento site. my client requirement is after clicking on "Add To Cart" button it will be redirect to custom form instead of shopping cart page to get language profile information from the user.

After filling the form it redirect to shopping cart page. The langauge profile information added by user should be viewable by admin in the sales order page.

I have referred many forum but I can't find the solution please Can anyone guide me how to achieve this?

1

1 Answers

1
votes

Add to Cart button has onclick="productAddToCartForm.submit(this)" in {theme}/template/catalog/product/view/addtocart.phtml

you should change it like onclick="prepareSubmit(this)"

and define a js function

function prepareSubmit(data){
    var response = languagePopupShow();
    if(response)
    productAddToCartForm.submit(data);
}

languagePopupShow() will pop up a form that you will submit by ajax request and if result comes success then you will submit productAddToCartForm

Also you have to provide an extra form in customer account from where customer can manage language profile. And to show language information in order at admin, you have to add attribute in order and send value pragmatically during checkout.you can take help of Magento - Add custom attribute to order