When we work in magento with out of box customization then we might need to add feature for search order by phone in admin grid or somewhere else.
In this blog we are going to search order by phone number/telephone/mobile number in magento2.
As technially, we need to search phone in order’s address table and need to get order ids and use that order ids to get order information.
Here is code for search order by phone
<?php
declare(strict_types=1); //We recommend to use always strict_types = 1 for quality code
namespace MageDad\Module\Model;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory as OrderCollectionFactory;
use Magento\Sales\Model\ResourceModel\Order\Address\CollectionFactory as AddressCollectionFactory;
class OrderSearch
{
public function __construct(
private OrderCollectionFactory $orderCollectionFactory,
private AddressCollectionFactory $addressCollectionFactory
) { }
/**
* {@inheritdoc}
*/
public function getOrderByPhone($phone)
{
$addressCollection = $this->addressCollectionFactory->create();
$addressCollection->addFieldToFilter('telephone', ['eq' => $phone]);
$orderIds = $addressCollection->getColumnValues('parent_id');
if (count($orderIds) > 0) {
$collection = $this->orderCollectionFactory->create();
$collection->addFieldToFilter('entity_id', ['in' => $orderIds]);
return $collection->getItems();
}
return [];
}
}
If you want to create API for search order by phone then you can refere GitHub module.
I hope this blog is useful to search order by phone in magento2. In case, I missed anything or need to add some more information, Don’t heisted to leave a comment in this blog, I’ll get back with some positive approach.
Keep loving ❤️ Keep inspiring 🤩 Keep liking 👍 No sharing 😂
67 Comments
Hello! Do you know if they make any plugins to help with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Thank you!
businessiraq.com: Your Ultimate Iraqi Business Gateway. Embark on a journey of discovery and opportunity with our meticulously crafted Iraq business directory, home to comprehensive online business listings that paint a vivid picture of the nation’s diverse economic tapestry. Stay informed and make strategic decisions with our up-to-date Iraq business news, while our Iraq jobs portal connects you with exciting career prospects. And for businesses ready to make their mark, our tender opportunities directory presents a world of procurement possibilities. Connect, explore, and succeed in Iraq with Businessiraq.com.
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Your article helped me a lot, is there any more related content? Thanks!
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Your article helped me a lot, is there any more related content? Thanks!
A code promo 1xBet est un moyen populaire pour les parieurs d’obtenir des bonus exclusifs sur la plateforme de paris en ligne 1xBet. Ces codes promotionnels offrent divers avantages tels que des bonus de dépôt, des paris gratuits, et des réductions spéciales pour les nouveaux joueurs ainsi que les utilisateurs réguliers.code 1xbet télécharger
I truly enjoy examining on this web site, it has got wonderful articles. “Never fight an inanimate object.” by P. J. O’Rourke.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable information to work on. You’ve done a formidable job and our whole community will be grateful to you.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Your article helped me a lot, is there any more related content? Thanks!
Good – I should certainly pronounce, impressed with your web site. I had no trouble navigating through all the tabs as well as related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your customer to communicate. Nice task..
Super-Duper site! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
obviously like your website but you have to check the spelling on quite a few of your posts. Several of them are rife with spelling issues and I to find it very bothersome to tell the reality nevertheless I?ll surely come back again.
F*ckin? tremendous issues here. I?m very glad to peer your post. Thank you so much and i am having a look ahead to contact you. Will you please drop me a e-mail?
An fascinating discussion is price comment. I think that it’s best to write extra on this topic, it may not be a taboo topic but generally persons are not enough to talk on such topics. To the next. Cheers
Hello There. I found your blog using msn. This is an extremely well written article. I?ll make sure to bookmark it and come back to read more of your useful info. Thanks for the post. I?ll definitely comeback.
I’m curious to find out what blog system you are working with? I’m having some small security problems with my latest website and I would like to find something more secure. Do you have any suggestions?
Great write-up, I?m normal visitor of one?s web site, maintain up the nice operate, and It’s going to be a regular visitor for a long time.
Thanks for your publication. What I want to say is that when searching for a good on-line electronics retail outlet, look for a website with full information on important factors such as the privacy statement, safety measures details, payment options, along with terms and also policies. Constantly take time to look at help in addition to FAQ segments to get a better idea of how a shop works, what they are capable of doing for you, and ways in which you can make use of the features.
Right now it looks like WordPress is the best blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog?
Thank you, I have recently been looking for info approximately this topic for a while and yours is the best I’ve discovered so far. But, what concerning the bottom line? Are you positive concerning the source?
I believe that avoiding ready-made foods could be the first step for you to lose weight. They might taste excellent, but ready-made foods have very little nutritional value, making you consume more in order to have enough power to get with the day. If you’re constantly feeding on these foods, transferring to whole grain products and other complex carbohydrates will make you to have more vitality while taking in less. Thanks alot : ) for your blog post.
Heya i?m for the first time here. I came across this board and I in finding It really helpful & it helped me out a lot. I hope to present one thing again and aid others such as you helped me.
Hello! I’m at work surfing around your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the excellent work!
Thank you, your article surprised me, there is such an excellent point of view. Thank you for sharing, I learned a lot.
Please let me know if you’re looking for a article author for your blog. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some material for your blog in exchange for a link back to mine. Please blast me an e-mail if interested. Many thanks!
magnificent post, very informative. I wonder why the other experts of this sector don’t understand this. You must continue your writing. I am sure, you’ve a huge readers’ base already!
you’re really a good webmaster. The site loading speed is incredible. It seems that you are doing any unique trick. In addition, The contents are masterwork. you’ve done a magnificent job on this topic!
Searching for trusted roof installation in Lancaster? Roof Installation Pros provides expert services across all roofing styles. Their experienced team guarantees strong, lasting installations that enhance your home’s protection and market value. Excellent service, always on time and within budget.
Searching for trusted roof installation in Lancaster? Roof Installation Pros provides expert services across all roofing styles. Their experienced team guarantees strong, lasting installations that enhance your home’s protection and market value. Excellent service, always on time and within budget.
When it comes to roof installation in Lancaster, Roof Installation Pros stands out for quality and reliability. Their expert team works with all roof types, delivering strong, protective installations that add value. Highly rated for affordable, on-time, and professional roofing work.
Get reliable roof installation services in Lancaster with Roof Installation Pros. Whether it’s a new roof or a replacement, their experienced crew delivers quality craftsmanship that lasts. Known for fair pricing and dependable results that boost home value—your roof is in safe hands.
For dependable and expert roof installation services in Lancaster, Roof Installation Pros is your go-to choice. They specialize in all roofing types, delivering lasting solutions that safeguard your property and boost its value. Count on them for affordable, high-quality, and on-time service.
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
One thing I have actually noticed is there are plenty of beliefs regarding the lenders intentions while talking about home foreclosure. One delusion in particular is the fact the bank desires your house. The bank wants your hard earned dollars, not your home. They want the amount of money they loaned you with interest. Preventing the bank will only draw some sort of foreclosed final result. Thanks for your publication.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Hi, i think that i saw you visited my web site thus i came to ?return the favor?.I’m attempting to find things to improve my web site!I suppose its ok to use some of your ideas!!
Wow, this article is mind-blowing! The author has done a tremendous job of presenting the information in an engaging and enlightening manner. I can’t thank her enough for providing such precious insights that have definitely enhanced my knowledge in this topic. Hats off to him for crafting such a masterpiece!
What i don’t understood is if truth be told how you are now not really a lot more neatly-liked than you may be right now. You are very intelligent. You know thus considerably with regards to this matter, produced me in my opinion believe it from so many numerous angles. Its like men and women aren’t involved except it?s something to do with Girl gaga! Your own stuffs nice. Always handle it up!
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
I like the helpful information you supply for your articles. I?ll bookmark your blog and test again right here frequently. I am fairly certain I?ll be informed many new stuff proper right here! Best of luck for the next!
Hello there! Would you mind if I share your blog with my myspace group? There’s a lot of folks that I think would really enjoy your content. Please let me know. Many thanks
okmark your weblog and check again here frequently. I am quite sure I?ll learn a lot of new stuff right here! Good luck for the next!
Hey there! Do you use Twitter? I’d like to follow you if that would be ok. I’m absolutely enjoying your blog and look forward to new posts.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Hello, Neat post. There is an issue along with your site in internet explorer, could test this? IE nonetheless is the market chief and a good section of other people will leave out your magnificent writing because of this problem.
Greetings from Idaho! I’m bored to tears at work so I decided to check out your website on my iphone during lunch break. I really like the info you provide here and can’t wait to take a look when I get home. I’m surprised at how fast your blog loaded on my cell phone .. I’m not even using WIFI, just 3G .. Anyways, excellent site!
Thank you for the auspicious writeup. It in truth used to be a entertainment account it. Look complex to far brought agreeable from you! However, how could we be in contact?
I love your wp template, where did you obtain it through?
virtual poker with friends uk, party sky casino sweepstake; Alfredo,
united states and united statesn online casinos 2021 real money, or starburst slots uk
whoah this blog is magnificent i love reading your posts. Keep up the great work! You know, a lot of people are looking around for this info, you can help them greatly.
I will right away grab your rss as I can not find your e-mail subscription link or newsletter service. Do you have any? Please let me know in order that I could subscribe. Thanks.
I was looking at some of your articles on this site and I think this site is rattling informative! Keep putting up.
Just want to say your article is as astonishing. The clearness in your post is just great and i could assume you’re an expert on this subject. Fine with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please keep up the enjoyable work.
he blog was how do i say it… relevant, finally something that helped me. Thanks
Thanks for your article. What I want to comment on is that while searching for a good online electronics store, look for a web-site with entire information on important factors such as the level of privacy statement, security details, payment options, and also other terms as well as policies. Usually take time to browse the help plus FAQ segments to get a better idea of the way the shop is effective, what they are able to do for you, and in what way you can take full advantage of the features.
Thanks a lot for providing individuals with an extraordinarily breathtaking possiblity to read from here. It is often very fantastic and also full of a good time for me personally and my office peers to search your site particularly 3 times every week to find out the latest stuff you will have. And definitely, I’m just certainly satisfied with your spectacular knowledge you serve. Certain 2 points in this article are in truth the simplest I have ever had.
This is undoubtedly one of the finest articles I’ve read on this topic! The author’s thorough knowledge and zeal for the subject shine through in every paragraph. I’m so thankful for coming across this piece as it has enriched my understanding and sparked my curiosity even further. Thank you, author, for taking the time to produce such a phenomenal article!
We absolutely love your blog and find a lot of your post’s to be precisely what I’m looking for. Would you offer guest writers to write content available for you? I wouldn’t mind creating a post or elaborating on a lot of the subjects you write about here. Again, awesome website!
I have noticed that online diploma is getting favorite because accomplishing your college degree online has developed into popular solution for many people. A large number of people have not necessarily had an opportunity to attend a normal college or university nevertheless seek the increased earning possibilities and a better job that a Bachelors Degree gives. Still other folks might have a qualification in one field but would choose to pursue a thing they already have an interest in.
I think one of your advertisements triggered my internet browser to resize, you may well want to put that on your blacklist.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://www.binance.com/de-CH/register?ref=UM6SMJM3
affordablecanvaspaintings.com.au is Australia Popular Online 100 percent Handmade Art Store. We deliver Budget Handmade Canvas Paintings, Abstract Art, Oil Paintings, Artwork Sale, Acrylic Wall Art Paintings, Custom Art, Oil Portraits, Pet Paintings, Building Paintings etc. 1000+ Designs To Choose From, Highly Experienced Artists team, Up-to 50 percent OFF SALE and FREE Delivery Australia, Sydney, Melbourne, Brisbane, Adelaide, Hobart and all regional areas. We ship worldwide international locations. Order Online Your Handmade Art Today.