Skip to main content
added 4 characters in body
Source Link

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates afteraround the function convert"convert" in

Magento\Quote\Model\Quote\Item\ToOrderItem 

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

public function afterConvertaroundConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem 

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates around the function "convert" in

Magento\Quote\Model\Quote\Item\ToOrderItem 

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

public function aroundConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

deleted 113 characters in body
Source Link

I have an instance of \Magento\Quote\Model\Quote\Item $item\Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem

Magento\Quote\Model\Quote\Item\ToOrderItem 

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

Thanks!

 public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId$item->getOrderId doesn't work.

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

Thanks!

 public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem 

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

added 1054 characters in body
Source Link

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

Thanks!

 public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

Thanks!

I have an instance of \Magento\Quote\Model\Quote\Item $item

I need to get the order ID of the order in which that particular item has been purchased.

For full disclosure, I am using a plugin function called afterConvert, which operates after the function convert in

Magento\Quote\Model\Quote\Item\ToOrderItem

Anyway, the table for quote_item doesn't seem to have the order_id in it.

Any idea how I could go about it?

Thanks!

 public function afterConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, \Closure $proceed, \Magento\Quote\Model\Quote\Item $item, $additional = [] ) { $order = null; $item->getQuote(); $options = $this->configurationHelper->getOptions($item); foreach ($options as $option){ if($option['label'] == 'Clarity'){ $clarity = $option['value']; } if($option['label'] == 'Color'){ $color = $option['value']; } if($option['label'] == 'Shape'){ $shape = $option['value']; } if($option['label'] == 'Carat'){ $carat = $option['value']; } } /** @var \Magento\ConfigurableProduct\Api\Data\ConfigurableItemOptionValueInterface $option */ $qrcode = $this->qrcodeFactory->create(); $orderID = $item->getOrderId(); 

But $item->getOrderId doesn't work.

Source Link
Loading