Questions tagged [order-collection]

Questions related to Magento order collections.

Filter by
Sorted by
Tagged with
0
votes
2answers
44 views

Magento 2: Filter order collection by payment method

I need to filter order collection based on payment method. I tried the following: $customerOrderCollection = $this->orderCollectionFactory->create()->addFieldToFilter('customer_id', $...
0
votes
1answer
9 views

Group and count orders by custom delivery date attribute

I have a custom attribute delivery_date set for my orders however I want to create a collection that groups all these dates together and tells me the order count for each date. I have attempted with ...
0
votes
1answer
44 views

How to use orderCollectionFactory and productCollectionFactory together in Model file?

I have created a custom attribute in product and saved a string in that value and I want if some one order those product of same value string i want that collection of product. So, i want to use \...
0
votes
2answers
68 views

How to add payment filter in Order collection factory magento 2.3

I need to add the "po_number" as filter in order collection factory, i am trying to implement this in the sales order history page using getOrders function in the History.php Full Code : <...
1
vote
3answers
516 views

Get billing address line 1 and line 2 in order collection: Magento 2

I am trying to get billing address line 1 and line 2 with city and state in order collection. Here is my code: $oid = 1; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order =...
0
votes
3answers
143 views

Magento2: I need to get order Purchase Order Date and Purchased From fields in observer

I need to get order Purchase Order Date and Purchased From fields in the observer. Here is my code: namespace Abc\Mkt\Observer; use Magento\Framework\Event\Observer; use Magento\Framework\Event\...
0
votes
3answers
172 views

Magento1 Get Item Details From Order Collection

in magento 1.9 i am working on order collection i am getting order collection successfully using below code now i want to get item details from order how i can get this .i am using this collection $...
3
votes
2answers
535 views

Magento 2.3.0 How to add store filter in searchCriteriaBuilder

In my custom module, I am trying to add store filter in orderRepository using searchCriteriaBuilder but it is throwing an error like below. 1 exception(s): Exception #0 (Exception): Warning: PDO::...
0
votes
2answers
39 views

How to get the items orders by the customer in the order collection?

I need to get the collection of orders with the the items ordered by using the customer ID. But I am not getting the items ordered in my collection. Please help. $objectManager = \Magento\Framework\...
1
vote
1answer
122 views

Magento 2.3.0 How to get product image from order item collection

I would like to get a product image from order items collection. How can I get a product thumbnail image? Below is my custom order item collection code : public function getEmailLogOrders() { $...
1
vote
2answers
468 views

Get collection of orders excluding cancelled order in Magento 2

I have got order collection with the following code: $orders = $objectManager->create('Magento\Sales\Model\Order')->getCollection(); Which is working fine. Problem is that it returns all types ...
5
votes
3answers
7k views

Get order collection by order id in Magento 2?

I am trying to get order collection by order id in Magento 2. Here is my code: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $orders = $objectManager->create('Magento\...
0
votes
0answers
38 views

Data Not Set in admin Grid in magento2

I am Filter the Order Collection. Code give as protected function searchResultToOutput(SearchResultInterface $searchResult) { $arrItems = []; $arrItems['items'] = []; foreach ($...
1
vote
2answers
769 views

How to get order collection filter with customer_is_guest and email (Magento 2)

How to get order id from collection with filter customer_is_guest = 1 and customer email $order_collection = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->...
5
votes
5answers
5k views

Column 'store_id' in where clause is ambiguous when adding custom order attribute to grid and changing store

I have created a custom order attribute and I am now able to show it in the sales order grid; my previous question: Adding custom sales order attribute to order grid If I were to change the drop down ...
0
votes
1answer
483 views

Magento 2 : How to get order collection group by customer?

To get order collection by customer wise i.e.., customer A and customer B have placed order and it should retrieve by customer wise per collection? public function getOrdersByCustomer() { $...
0
votes
2answers
896 views

Filter sales/order collection according to country

I would like to filter out my home country (GB or United Kingdom) from the following sales/order collection. How can this be done? $orders = Mage::getModel('sales/order')->getCollection() ...
2
votes
1answer
91 views

Order collection not showing the order that have been invoiced

I try to retrieve all the order collections, but when I observe by looping the collections and print the order id, I notice the order that has been invoiced is not inside the collection. $collections ...
1
vote
0answers
101 views

{M1) Product collection sort order by views for Most Viewed Products

Does anyone know how to order by views (ascending/descending) a product collection when working with most viewed products? I am using this following code: $_productCollection = Mage::...
2
votes
2answers
428 views

Magento 2 - Get orders that were completed x days ago

I'm trying to get all orders that were completed a certain number of days ago using the below code: protected $searchCriteria; public function __construct( \Magento\Framework\App\Action\Context ...
0
votes
3answers
2k views

Orders collection - how to get all in the time range (current day)

Trying to gather all the orders (current day) and sum totals Updated: $format = Mage::getModel('core/date')->date('Y/m/d'); $from = $format.' 00:00:00'; $now = Mage::getModel('core/...
2
votes
1answer
763 views

PayPal Automatically Update Payment Review Orders

If a customer pays via PayPal and his account is not covered, the order in Magento is in the state "payment_review". You can then: Accept the payment manually. Deny the payment. Get a payment update. ...