OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce How to filter orders by payment status for custom actions

This topic contains 3 replies, has 2 voices, and was last updated by  Mauro Chojrin 4 months, 2 weeks ago.

  • Creator
    Topic
  • #38458

    Mauro Chojrin
    Participant

    Hi:

    This thread is related to https://forum.oroinc.com/orocommerce/topic/can-i-add-actions-to-orders-screen.

    I’d like to show this action only for orders not fully paid.

    I was looking at the attributes for the order in oro/commerce/src/Oro/Bundle/OrderBundle/Entity/Order.php but I can’t see any direct way to access the PaymentStatus.

    I see there’s a table storing the payment status (oro_payment_status) but I’m not sure how to use it in the action configuration.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #38461
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    To hide an action you can use “preconditions”.
    For example, you can check actions.yml at OrderBundle.
    You can fetch the payment status from the database the same way it is fetched at the datagrid by using “@find_entity” in “preactions”.

    #38514

    Mauro Chojrin
    Participant

    Hi Andrey:

    Thanks again :)

    I believe the link to actions.yml was broken, here’s the correct reference: https://github.com/oroinc/orocommerce/blob/master/src/Oro/Bundle/OrderBundle/Resources/config/oro/actions.yml.

    I’ve been doing some experiments with this but I can’t seem to work it out… the problem I have now is that I need to issue a query using an AND.

    This is the configuration I have so far:

    This isn’t actually for the filter but I think it’s the same issue (I’m trying to use this query to populate the popup where the user is supposed to enter the details of the new payment transaction).

    I tried different options but I believe I’m missing the correct syntax for the and…

    I am getting every payment transaction (instead of just the ones related to the order I’m editing…)

    Thanks

    #38528

    Mauro Chojrin
    Participant

    Ok, so I finally got this thing working. The answer I was looking for was here.

    My configuration now looks like this:

    Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No