Extend/Change Orders in admin

Help for integrating the Laravel package
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!
ajrmzcs
Posts: 20
Joined: 09 Jul 2018, 21:59

Re: Extend/Change Orders in admin

Post by ajrmzcs » 13 Aug 2018, 15:28

Hi there,

Thanks for your response, as I mentioned we extended orders in admin to list orders from order_base table (unique orders) instead of invoices from order table... For this, we changed in our ext. mhsop.php like this:

'order' => [
'manager' => [
// 'name' => 'MyStandard',
'base' => [
'name' => 'MyStandard',
'standard' => [
'search' => [

'ansi' => '
SELECT mord.baseid AS "order.base.id", mordba."siteid" AS "order.base.siteid",
mordba."sitecode" AS "order.base.sitecode", mordba."customerid" AS "order.base.customerid",
mordba."langid" AS "order.base.languageid", mordba."currencyid" AS "order.base.currencyid",
mordba."price" AS "order.base.price", mordba."costs" AS "order.base.costs",
mordba."rebate" AS "order.base.rebate", mordba."tax" AS "order.base.taxvalue",
mordba."taxflag" AS "order.base.taxflag", mordba."comment" AS "order.base.comment",
mordba."status" AS "order.base.status", mordba."mtime" AS "order.base.mtime",
mordba."editor" AS "order.base.editor", mordba."ctime" AS "order.base.ctime",
mord.id AS "order.id", mordbaad.email AS "order.base.address.email",
mord.statuspayment AS "order.statuspayment", mord.statusdelivery AS "order.statusdelivery",
mordba.siteid AS "order.base.siteid", (mordba.price + mordba.costs) As "order.base.total",
mordbaad.lastname AS "order.base.address.billinglastname"
FROM mshop_order_base mordba INNER JOIN mshop_order mord
ON mordba.id = mord.baseid INNER JOIN
(SELECT baseid, email, firstname, lastname, siteid from mshop_order_base_address WHERE mshop_order_base_address.type=\'payment\')
AS mordbaad on mordba.id = mordbaad.baseid
WHERE :cond
/*-orderby*/ ORDER BY :order /*orderby-*/
LIMIT :size OFFSET :start
'
]
]
]
]

As you can see we are adding the mord.baseid AS "order.base.id" in the query. With this query we list unique orders along with order total (price + cost) and payment last name. This is working fine on admin panel.

We had to add the getBaseId() method on ext/myext/lib/custom/src/MShop/Order/Item/Base/MyStandard.php which extends regular Order Standard.php in Aimeos\MShop\Order\Item\Base; along with other getters for our query...

I know it's a lot... but can you share another hint in where I can fix this bug.

Thank you very much.

Regards,

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Extend/Change Orders in admin

Post by aimeos » 15 Aug 2018, 14:31

You say, you've added a getBaseId() method to your order base item. That's wrong because the "order.base.id" property must be returned by getId() instead and that may be your problem.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply