Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach($optionQty as $key => $qty) {
- if($qty > 0) {
- $params = [
- 'form_key' => $this->formKey->getFormKey(),
- 'product' => $productloaded->getId(),
- 'qty' => $qty,
- 'super_attribute' => [
- $attributeId => $key
- ],
- ];
- $productloaded->addCustomOption('additional_options', json_encode($additionalOptions));
- $this->cart->addProduct($productloaded, $params);
- }
- $this->cart->save();
- }
- Array
- (
- [179] => 3
- [180] => 0
- [181] => 3
- [183] => 0
- [184] => 0
- [185] => 3
- [186] => 0
- [187] => 0
- [188] => 0
- )
Add Comment
Please, Sign In to add comment