Please specify the product's option(s). configurable product magento -


I am working with configurable product, I have created a custom view to display the configurable product I'm getting an error while adding the addable product (please specify the product's option). This error occurs only with configurable product.

I am using this code to add to the cart $ params = array ('product' => $ product- & gt; 'iid '(),' Super_Edit '=> Array (133 = & gt;' 3 ', 143 =>' 19 ', 142 =>' 18 ', 141 =>' 16 ', 140 = '14', 144 = & gt; '21', 139 = & gt; '12 ', 138 = & gt; '10', 137 => '22', 136 = & gt; gt; 9 ', 135 = & gt;),' qty '=> 2,); $ Cart = Dana :: Millennintlton ('Checkout / Cart'); $ Cart- & gt; AddProduct ($ product, $ parameter); $ Cart- & gt; Save (); Dana :: getSingleton ('Checkout / Session') - & gt; SetCartWasUpdated (true);

In the code above

  'super_attribute' = & gt; Array (133 = & gt; '3 ', 143 = & gt; '19', 142 = & gt; '18', 141 => '16', 140 => '14', 139 = & '12' 138 => '10', 137 => '22', 136 => '9', 135 = & gt; 6 ', 144 = & gt; 21', )   

The array has the attribute value that I have chosen for the product. I do not know why this is happening, after many attempts I get an error, I have two parameters uenc

and $ params in form_key array should be like this
  $ params = array ('product' = & gt; $ s Pad-> getId (), 'form_key' = & gt; $ form_key, 'uenc' = & gt; Dana :: app () - getRequest () - & gt; getParam ('uenc', 1 ), 'Super_dataib' = & gt; $ super_attribute, 'qty' => $ qty,);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -