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 In the code above 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 $ 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);
'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', )
uenc
$ 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
Post a Comment