Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $quote=$this->quote->create(); //Create object of quote
- $quote->setStore($store); //set store for which you create quote
- $customer= $this->customerRepository->getById($customer->getEntityId());
- $quote->setCurrency();
- $quote->assignCustomer($customer); //Assign quote to customer
- foreach($orderData['items'] as $item){
- $product = $this->getProduct($item['product_id']);
- $product->setPrice($item['price']);
- $super_attributes = $item["super_attribute"];
- $qty = $super_attributes["qty"];
- $addLot = ($item["realQty"] != $qty) ? " - Lot de ".$item["realQty"] : "";
- $hasBroderie = $item["hasBroderie"];
- if($hasBroderie){
- $qty = $qty/$qty ;
- $addLot = ($item["realQty"] != $qty) ? " - Lot de ".$item["realQty"] : "";
- }
- $options = $item["options"];
- $product->setOptions($options);
- $product->setName($product->getName().$addLot);
- $quote->addProduct(
- $product,
- $super_attributes);
- }
- $requestInfo = new MagentoFrameworkDataObject(
- ['qty' => $qty ,'super_attribute' => $optionsProd]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement