Skip to content

Replace buttons added as widget_button with widget_container buttons in Catalog/Product/Edit#5624

Open
B3Hana wants to merge 2 commits into
OpenMage:mainfrom
B3Hana:button-override
Open

Replace buttons added as widget_button with widget_container buttons in Catalog/Product/Edit#5624
B3Hana wants to merge 2 commits into
OpenMage:mainfrom
B3Hana:button-override

Conversation

@B3Hana
Copy link
Copy Markdown
Contributor

@B3Hana B3Hana commented Jun 2, 2026

Description (*)

It is currently not possible to add, remove or change buttons in the catalog/product/edit form without overriding/changing the edit.phtml, as all buttons are added as widget_button and then rendered by reference.

With the Mage_Adminhtml_Block_Widget_Container->getButtonsHtml() it is possible (but definitly needs some more events) to change the buttons without overriding the template itself, via an observer. (controller_action_layout_render_before_adminhtml_catalog_product_edit)

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

Listen to the event and add a button to the product_edit.
(Mage::app()->getLayout()->getBlock('product_edit');)

Questions or comments

I changed the internal layout id of the close button from "back_button" to "close_button" and the "save_and_edit_button" to "save-edit_button" as this are the constants provided by the widget_container class.
I didn't notice a problem, but I probably didn't check every possible configuration there is.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All automated tests passed successfully (all builds are green, SonarCloud checks are not required to merge)

@github-actions github-actions Bot added Component: Catalog Relates to Mage_Catalog Template : admin Relates to admin template Component: Adminhtml Relates to Mage_Adminhtml labels Jun 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

@B3Hana B3Hana marked this pull request as ready for review June 2, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Adminhtml Relates to Mage_Adminhtml Component: Catalog Relates to Mage_Catalog phpstan Template : admin Relates to admin template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant