Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. foreach($optionQty as $key => $qty) {
  2. if($qty > 0) {
  3. $params = [
  4. 'form_key' => $this->formKey->getFormKey(),
  5. 'product' => $productloaded->getId(),
  6. 'qty' => $qty,
  7. 'super_attribute' => [
  8. $attributeId => $key
  9. ],
  10. ];
  11. $productloaded->addCustomOption('additional_options', json_encode($additionalOptions));
  12. $this->cart->addProduct($productloaded, $params);
  13.  
  14. }
  15. $this->cart->save();
  16.  
  17. }
  18.  
  19. Array
  20. (
  21. [179] => 3
  22. [180] => 0
  23. [181] => 3
  24. [183] => 0
  25. [184] => 0
  26. [185] => 3
  27. [186] => 0
  28. [187] => 0
  29. [188] => 0
  30. )
Add Comment
Please, Sign In to add comment