Questions tagged [order-items]

Denotes questions related to sales order items.

Filter by
Sorted by
Tagged with
0 votes
1 answer
123 views

Magento2 product_options field into the sales_order_itmes table

Does anyone know why, sometimes, into the table sales_order_itmes, I see rows that has product_options fields like this: { "info_buyRequest": { "uenc": "...
Safari's user avatar
  • 103
0 votes
0 answers
134 views

Not able to add filters on getItemsCollection in admin order page

I am implementing a feature, where I need to filter the order item list in order admin page. I have checked and found the list is getting from method getItemsCollection(). But when I am trying to ...
Gaurav Agrawal's user avatar
0 votes
0 answers
203 views

Split Custom Line Item in magento 2

I need a functionality to split custom line item in magento 2.3.4 . For example, suppose Product A has custom addon Child A, then by default magento will show like this Product-A-Child-A in sales ...
Mitul Vadalia's user avatar
1 vote
0 answers
371 views

Magento 2 Item with the same ID "24" already exists error

I don't know what is going on, but everytime I go to Sales > Orders, I see this error message: Item (Magento\Framework\View\Element\UiComponent\DataProvider\Document) with the same ID "24"...
Oscar Vazquez's user avatar
1 vote
2 answers
57 views

How to get all items of product purchased in Magento 2?

I would get information on all items of product purchased. I proceeded by this way but I can not have any information on all items of product purchased : <?php namespace MyTestSpace\...
learner's user avatar
  • 21
0 votes
1 answer
1k views

How to delete the order Items from magento using Rest API

I want to delete the order Item form the Successfully placed Order how to delete the order item.Can anyone help to solve this situation. Thanks in Advance :)
Sabareesh's user avatar
  • 358
2 votes
1 answer
706 views

I can't understand difference between quote/quoteitems and order/order Items Magento 2.3

I can't Understand the difference between Order And Quote or Order Items And Quote Items please explain what is it and how it works
Sabareesh's user avatar
  • 358
0 votes
2 answers
1k views

Magento 2 - Override Reorder controller and skip some items from reorder

I have to skip some items when the customer does Reorder. For this, I have overridden the controller Using Plugin. di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...
m2dev's user avatar
  • 73
0 votes
2 answers
296 views

Magento 2.2.10 is it possible to get all the orders status is pending?

I want to get all the orders where the status is pending. I want to do a second check where if the item status is cancelled. Is this possible to do?
Jack Brooks's user avatar
1 vote
0 answers
449 views

Magento 2 help validate function to count bundle product child items of an order

I'm trying to write a function that takes an order object, and returns an array of sku => qty (key-value) showing how many of each sku was sold/shipped. The tricky part is, magento formats line items ...
Mac A.'s user avatar
  • 280
1 vote
1 answer
6k views

How to get discount amount in Magento 2

I am trying to get discount amount, but no success How to get discount amount from $block->getShipment() <?php /** @var $_item \Magento\Sales\Model\Order\Item */ $_item = $block->getItem(...
summu's user avatar
  • 847
2 votes
2 answers
4k views

How to edit or update the ordered item data in magento 2

I want to edit some data's of ordered items like weight, price and some more. For that, I got the ordered item collection for the specific order. $objectManager = \Magento\Framework\App\...
Ramya's user avatar
  • 237
2 votes
1 answer
530 views

Magento 2 - After invoice delete programatically can't create new invoice properly

I have used the code if ($order->getInvoiceCollection()->count()) { $_invoices = $order->getInvoiceCollection(); if ($_invoices) { foreach ($_invoices as $invoice) { ...
Shoaib Munir's user avatar
  • 9,434
1 vote
0 answers
299 views

How to get bundle options qty ? Magento 2

How to get bundle product options qty from $order->getAllVisibleItems() ?
Robinio's user avatar
  • 771
1 vote
0 answers
178 views

Magento 2 : Display Ordered Items listing in customer account

In Magento 2 customer account I have to add a new tab and when customer visits it then on that page have to display a list of all items from all orders of customers. It will be grids of ordered items. ...
Magecode's user avatar
  • 1,504
1 vote
2 answers
2k views

How to add item status for an order in magento 2

I have multiple items in my order. How can I add item status and its tracking information for that order in My Account Orders? I am using this to get orders $_orders = $block->getOrders(); And ...
summu's user avatar
  • 847
2 votes
3 answers
2k views

How to add custom attribute in Collection?

namespace Magento\Sales\Model\Order; class Invoice { public function getAllItems() { $items = []; foreach ($this->getItemsCollection() as $item) { if (!$item-&...
HaFiz Umer's user avatar
  • 1,661
3 votes
1 answer
907 views

How get row from sales_order_item table by item_id in Magento 2?

How get specific row from sales_order_item by giving item_id? Which collection use to filter row? Can anyone guide me ? has any direct or indirect way to fetch sales_order_item record from item_id?
HaFiz Umer's user avatar
  • 1,661
1 vote
1 answer
1k views

How get order items using entity_id

This File responsible for setting Grand Total in Order Grid. I test it. <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\...
HaFiz Umer's user avatar
  • 1,661
3 votes
2 answers
790 views

Order Items Collection in Order Detail Page

This snapshot of order detail page. I Just want to known that which file or function call for setting this collection in this page. I want to just get Selected (Filter Row) Items Order.
HaFiz Umer's user avatar
  • 1,661
1 vote
1 answer
5k views

Magento 2 get order item actual price

In Magento 2, how can I get order item actual price? I tried using below way but it returns 0, although the code is working with Magento 1.9 use Magento\Framework\Event\ObserverInterface; class ...
Bikash Kaushik's user avatar
0 votes
1 answer
65 views

What is the role of visibility filter in colections Magento 2?

I am getting Order Items, from order collection by Order ID but as from the attached screen shot (Order 15) I am getting one product data two times. Can any body explain the reason and what will be ...
Ajwad Syed's user avatar
  • 1,591
6 votes
2 answers
4k views

How to add new item (product) into existing order programmatically in Magento 2

I have created one virtual product in my Magento2 website. Now, I want to add it programmatically to the existing customer orders on some occasions with its custom price and name. Can someone please ...
Pratik Navapara's user avatar
3 votes
1 answer
3k views

Magento 2 change order item price

I have an order which has the grand total that I need to fix because one of my products prices is incorrect, to do that I need to change the order item price and recollect order total, is there a way ...
nortonuser 's user avatar
1 vote
0 answers
417 views

Order item extension attributes are always last database entry

I have added extension attributes to order items, and values are successfully saved to table, when I get an order from rest API, extension attributes always show the value of last order item row for ...
Surjan Raghuwanshi's user avatar
0 votes
0 answers
189 views

Random missing product name in random orders

On rare and random occasions (once or twice a month) our client receives an order with one missing product name in the items list (see attached screenshot) - however the product name exists and is ...
Marc-André Appel's user avatar
2 votes
1 answer
1k views

How to display tax details at item lines in invoice?

I browsed the tables and discovered that tax rates, codes, etc are saved at order level. How can I display tax summary having tax code, rate, etc at each item line in invoices generated from backend?
Rizwan Dhuka's user avatar
0 votes
0 answers
228 views

Magento 2 : Get Items Ordered in Email Template

I'm looking to achieve a product grid of items ordered in an email template upon successful product. This is what I'm trying to achieve, in this exact order for each product. Is this doable? I can't ...
Jake Punton's user avatar
2 votes
1 answer
497 views

How to get category Id from order Item?

I want to get category Id from order Item. As we aware that we can get current_category on the product page. but how to get that category from orderItem object. We can get Product object via $...
sarfaraz Ahmed's user avatar
1 vote
0 answers
214 views

Magento 2 - passing variable output to another variable in email template

I'm working on order confirmation email and I want to pass variable output: {{var order.getMyCustomItem().getSomething('key')}} To another variable. In my case it's an order model: {{var order....
Mateusz Sieprawski's user avatar
2 votes
2 answers
2k views

Create Admin grid from join table collection

I'm new to magento 2, I have a query to join multiple table, only 1 custom table I've made and the rest is from Magento 2, the query looks like this: SELECT marketplace_orders.entity_id as id, ...
mileven's user avatar
  • 419
2 votes
3 answers
10k views

SOLVED - Magento 2 Get product_options value from sales_order_item

In sales_order_item table, there's a column product_options to store some custom values. I need to get the deliverydates from the following value (value from the db column product_options) {"...
Magento Learner's user avatar
1 vote
2 answers
3k views

How to get the ordered size of a product In Magento 2

I tried to get the size of a product/products that was ordered. So let's say a product has 5 sizes: S, M, L, XL,XLL and when i made the order the product x was bought with the size M. When i load ...
Alin Lupoiu's user avatar
  • 2,662
1 vote
1 answer
4k views

How to get child simple Product Obj from configurable Sales Order Items

I want to get Configurable child simple products from order items.How can I get child simple Product from the configurable product? I want to fetch only simple product object which associated with ...
Niraj Patel's user avatar
1 vote
1 answer
664 views

how to cancel certain order item rather than cancel whole order?

I need a function which is order cancel based on the item. Current scenario is that Magento does cancel whole order. What I want: A customer placed 2 ordered items. And after placed order, customer ...
Niraj Patel's user avatar
2 votes
4 answers
5k views

Magento 2 - Getting an order item tax percentage

I need to get an order item tax percentage <?php namespace Company\Module\Plugin; class myClass { protected $_orderRepository; public function __construct( \Magento\Sales\Api\...
Goose84's user avatar
  • 2,611
4 votes
1 answer
537 views

Cannot cancel order in Magento 1

I have an order with processing status and its invoice is canceled. When I use the order->canCancel() function, It returns me false. I checked the core and this is the part why I am getting false:...
Attila Naghi's user avatar
  • 4,013