1

I want user's specific measurement for product. So once order is placed, we will send a confirmation mail with a link of form. When user will open that link, a form will open. In that form user can fill the measurements form field. And i want to save those details from form into Order details So in backend these details will be added with order details. So is there any extension or solution for this? Thanks

  • have tried the solution ? – Anil Suthar Jun 7 '16 at 12:36
1

Obviously, you can do this but there is no ready made extension available for the exact requirement.

So Create a new Extension, with sql setup file like :

<?php
$installer = $this;
$installer->startSetup();

$installer->addAttribute("order", "form_field1", array("type"=>"varchar"));
$installer->addAttribute("quote", "form_field1", array("type"=>"varchar"));

$installer->addAttribute("order", "form_field2", array("type"=>"varchar"));
$installer->addAttribute("quote", "form_field2", array("type"=>"varchar"));

$installer->addAttribute("order", "form_field3", array("type"=>"varchar"));
$installer->addAttribute("quote", "form_field4", array("type"=>"varchar"));

//...
//Add all form fields that customers are going to fill after order is placed from that Email link

$installer->endSetup();
?>

This will add new columns like form_field1, form_field2, etc... to sales_flat_order and sales_flat_quote tables. These tables are responsible for storing all Order data/attributes. Now we are going to add values to these columns/fields.

Add all fields that you want to save from that Form.

Now, In that form's post action, you can load Order and Save these fields, like:

<?php
//load by order_id 
$order = Mage::getModel('sales/order')->load(ORDER_ID);

//OR load by Increment Id 
//$order = Mage::getModel('sales/order')->loadByIncrementId(ORDER_Increment_Id);

$order->setFormField1("POSTED VALUE HERE");
$order->setFormField2("POSTED VALUE HERE");
//....
// Set all field here

//Updating Order by form fields
$order->save();
?>

This will SAVE all form data to the appropriate order.

Now, for Showing these data to Order edit page in admin, follow this tutorial. You can edit custom.phtml to format the view of that fields.

Hope this helps to get the Idea for whole process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.