OroCommerce Forums

Covering OroCommerce topics, including community updates and company announcements.

Forums OroCommerce Problem customizing dialog for new action

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

  • Creator
    Topic
  • #38456

    Mauro Chojrin
    Participant

    Hi:

    This is a follow up of https://forum.oroinc.com/orocommerce/topic/can-i-add-actions-to-orders-screen.

    I’m working through the creation of a new custom action and I’m having a few issues.

    For the moment, what’s most important to me is to show a dialog when the action button is clicked (The button is showing correctly) to let the user enter a value I will later use for actually executing the action.

    My configuration looks like this:

    When I click the button, I see that the action is being triggered (There’s a post being made via ajax to http://localhost:8000/admin/ajax/operation/execute/leeway_record_payment_operation?entityClass=Oro\Bundle\OrderBundle\Entity\Order&entityId[id]=8&route=oro_order_view).

    Thanks.

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

    You can use Ajax Requests icon at the Symfony Toolbar to see the profiler for the given post request. There may be an error message, that will help you to find an issue.

    Also note, to display a dialog it is required to define a form parameters.

    #38463

    Mauro Chojrin
    Participant

    Hi Andrey:

    Thanks for your help. I don’t think I have the dev tools installed (I’m running on the VM but on prod environment).

    Anyway, your comment about the form parameters gave me an idea that helped me: I looked at vendor/oro/commerce/src/Oro/Bundle/OrderBundle/Resources/config/oro/actions.yml and copied most of the configuration from the oro_order_shipping_trackings_change: section.

    Now I see a modal opening :).

    Haven’t figured out the rest yet but I think I’m on track.

    Thanks!

    #38510

    Mauro Chojrin
    Participant

    I managed to work this through. Thank you!

    I’ll leave my configuration here in case it helps someone (actions.yml):

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