I am able to get the values of custom product attribute in the cart and checkout page. Using the code below

<group name="quote_item">
    <attribute name="ts_dimensions_height"/>
    <attribute name="ts_dimensions_length"/>
    <attribute name="ts_dimensions_width"/>

In this file VendorName/ModuleName/etc/catalog_attributes.xml

I wanted to get the custom product attribute value from the ordered item after the order placed event.

  • create event sales_order_place_after – Rk Rathod May 21 '19 at 6:25
  • @RkRathod I have created an event. I am able to get the order items data. I wanted to include the above-mentioned attribute in order item data – Syed Saleem May 21 '19 at 7:05
  • pleace attach code... – Rk Rathod May 21 '19 at 7:09
  • $order = $observer->getEvent()->getOrder(); $orderItems = $order->getItems(); foreach ($orderItems as $item) { $item->getData(); //$item data doesn't have the ts_dimensions_height, ts_dimensions_length, ts_dimensions_width attribute values } – Syed Saleem May 22 '19 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.