What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello. I need to fetch orders using customn filters. I also need payment information. Why there is n
Hello. I need to fetch orders using customn filters. I also need payment information. Why there is no relation to spy_sales_payment table in src/Orm/Zed/Sales
?
And how can I properly add joining with this table?
Thanks.
Comments
-
hey alex π π
0 -
Hi Andreas
0 -
I am not tooo close to all that, but my assumption is that in spryker ootb, different payment type is typically represented by different order state machine being used/assigned to order (order items)
0 -
on previous projects, we changed that to have few state machine processes dealing with different payment types and stored a reference to payment information
0 -
I believe though that payment information is stored somewhere for orders, canβt remember where π
0 -
βfetch orders using custom filtersβ: thatβs for which layer? yves? zed?
0 -
I need orders for zed.
Yes i know that there can be different state machines and etc.. But i'm didn't create any new state machines.
Just using OOTB functionality. I can join with everything (spy_sales_shipment, spy_sales_order_items etc) but not with payment. They put shipment relations intosrc/Orm/Zed/Sales
but Pyament relations went somehow tosrc/Orm/Zed/Payment
. And there is a relation tospy_sales_payment
table. As for me it looks weird.
And when using\Orm\Zed\Sales\Persistence\SpySalesOrderQuery
i can't join tospy_sales_payment
table. But in this table there is foreign key toorder_id
0 -
Join methods are generated here
\Orm\Zed\Sales\Persistence\Base\SpySalesOrderQuery
. But since there is no relation to payment - this method doesn't exist0 -
Hi @U0145CP9Q6Q if you want to join with payments, then you should be looking fo SpySalesOrderQuery and itβs payment-related methods
0 -
order itself doesnβt have foreign key to payment, but payment does. Thatβs why relation and model methods should be present
0 -
hi @UKJSE6T47. That is what i'm talking about.
Methods should be present in\Orm\Zed\Sales\Persistence\Base\SpySalesOrderQuery
but they don't.0 -
Maybe i need to regenerate smth? or maybe you have another options
0 -
@U0145CP9Q6Q hmmm, can you try something, I think I found an issue
0 -
please check SpySalesOrderQuery::useOrderQuery()
0 -
it seems that the php relation name in propel schema was wrongly named
0 -
exactly
0 -
this is the reason, should be named after βPaymentβ instead.
0 -
changing that on Spryker side will mean a major update. But we will see what we can do here.
0 -
so should be SalesOrder?
0 -
or what is the correct variant?
0 -
I think you donβt need to change anything. Just use for now
useOrderQuery()
method. If you like, you can introduce βusePaymentQuery()β and other similar one-s in your Orm\Zed\Sales\Persistence\SpySalesOrderQuery and push it to your code base, that will help you to avoid further confusement0 -
plus I donβt think you can overwrite phpName and refPhpName properties coming from core on project level..
0 -
ok. thanks. also another question since you are here so far.
I need also shippng cost. I see that you havespy_sales_shipment
table. But there is only name. On item level I also don't see anything. How can i get the shipping cost for order? I see shipping costs only inspy_shipment_method_price
. But this is not related to sales as for me0 -
I'm using
joinWithSpySalesShipment
but it gives me everything except shipping costs0 -
In spryker, shipping costs are added to the expenses, which you can find in spy_sales_order_total.order_expense_total
0 -
if you need more granular information about expenses (especially if you have multi-shipment or another expenses), you can check the spy_sales_expense table. There you have βtypeβ column that can give you an idea about what kind of expense it is
0 -
thanks
0 -
@UKJSE6T47 again about
useOrderQuery
method. It will return to me the instance ofSpySalesPaymentQuery
. So the result will contain only payment data but not order's data. How to make it to be in result ofSpySalesOrderQuery
?0 -
It should look like this, approx.
$ordersQuery ->useOrderQuery() -> withColumn(SpySalesPaymentTableMap::COL_ID_PAYMENT, 'payment_id') ->endUse() ->find() ->toArray()
0 -
the formatting is crap.. You can find lots of examples in spryker core code, by searching for β->useβ in the code base
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random