Order.id not found
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 44
- Joined: 05 Oct 2019, 06:42
Order.id not found
Hi Aimeos,
I am trying to get the order by id i.e order id 1. But it is throwing an exception -:
Aimeos\MShop\Exception
Item with ID "1" in "order.id" not found
My code-:
$context = app( 'aimeos.context' )->get();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'order' )->uses(
['order/base', 'order/base/address', 'order/base/coupon',
'order/base/product', 'order/base/service'] );
echo "<pre>";
print_r($cntl->get('1'));
die;
I have checked that the order with order id 1 exists and also checked the database table.
I am trying to get the order by id i.e order id 1. But it is throwing an exception -:
Aimeos\MShop\Exception
Item with ID "1" in "order.id" not found
My code-:
$context = app( 'aimeos.context' )->get();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'order' )->uses(
['order/base', 'order/base/address', 'order/base/coupon',
'order/base/product', 'order/base/service'] );
echo "<pre>";
print_r($cntl->get('1'));
die;
I have checked that the order with order id 1 exists and also checked the database table.
Re: Order.id not found
You must be logged in as customer who created the order to retrieve its order details.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 48
- Joined: 30 Apr 2023, 12:46
Re: Order.id not found
Code: Select all
{
//in webhook contraller
$context = app('aimeos.context')->get();
$manager = \Aimeos\MShop::create($context, 'order');
$order = $manager->get($orderId);
}
Is it possible to retrieve an order without requiring user login? , Because it's system callbacks ( webhook )
Re: Order.id not found
Your code is correct and should return the order if the ID exists and if the site ID matches with the one from the context locale object (check the last condition).alababdiy wrote: ↑06 Jun 2024, 10:38Code: Select all
{ //in webhook contraller $context = app('aimeos.context')->get(); $manager = \Aimeos\MShop::create($context, 'order'); $order = $manager->get($orderId); }
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 48
- Joined: 30 Apr 2023, 12:46
Re: Order.id not found
Is there a way to force $context to set a specific site ID so I can limit my search to orders within that site or all sites?
i try to make reset order SiteID on $context by this line
$context->setLocale( app( 'aimeos.locale' )->getBackend( $context, $siteID ) );
but still showing Item with ID "XXX" in "order.id" not found
[ UPDATE , SOLVED ]
I should pass $siteCode instead $siteID :
$context->setLocale( app( 'aimeos.locale' )->getBackend( $context, $siteCode ) );
i try to make reset order SiteID on $context by this line
$context->setLocale( app( 'aimeos.locale' )->getBackend( $context, $siteID ) );
but still showing Item with ID "XXX" in "order.id" not found
[ UPDATE , SOLVED ]
I should pass $siteCode instead $siteID :
$context->setLocale( app( 'aimeos.locale' )->getBackend( $context, $siteCode ) );