Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. $quote=$this->quote->create(); //Create object of quote
  2. $quote->setStore($store); //set store for which you create quote
  3. $customer= $this->customerRepository->getById($customer->getEntityId());
  4. $quote->setCurrency();
  5. $quote->assignCustomer($customer); //Assign quote to customer
  6. foreach($orderData['items'] as $item){
  7. $product = $this->getProduct($item['product_id']);
  8. $product->setPrice($item['price']);
  9. $super_attributes = $item["super_attribute"];
  10.  
  11. $qty = $super_attributes["qty"];
  12.  
  13. $addLot = ($item["realQty"] != $qty) ? " - Lot de ".$item["realQty"] : "";
  14. $hasBroderie = $item["hasBroderie"];
  15. if($hasBroderie){
  16. $qty = $qty/$qty ;
  17. $addLot = ($item["realQty"] != $qty) ? " - Lot de ".$item["realQty"] : "";
  18. }
  19. $options = $item["options"];
  20. $product->setOptions($options);
  21. $product->setName($product->getName().$addLot);
  22. $quote->addProduct(
  23. $product,
  24. $super_attributes);
  25. }
  26.  
  27. $requestInfo = new MagentoFrameworkDataObject(
  28. ['qty' => $qty ,'super_attribute' => $optionsProd]
  29. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement