cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an add to cart with custom options direct link?

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

How to create an add to cart with custom options direct link?

Hi, 

I'm new on magento and i trying to create a direct link to add to cart a product with custom options but the generated link only add the product and i need also the custom options.

 

 This is the code I'm using to create the link:

<pre>
$params = array(
'form_key'=>$formKey->getFormKey(),
'product' => $product->getId(),
'qty' => 1,
'price' => $my_new_price,
'options['.intval($option_A_id).']'=>$option_A_value,
'options['.intval($option_B_id).']'=>$option_B_value
);
$this->_redirect("checkout/cart/add/form_key/", $params);
</pre>