Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow easy selection of products/categories/customers/... in custom backend forms #971

Closed
bgalileo opened this issue Jan 14, 2015 · 8 comments
Assignees
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@bgalileo
Copy link

In Magento 1, there is no easy way to add a user-friendly product, category or customer selection widget to a custom form. There are ways to add the product, category, cms page and cms block chooser widgets to your form, but the process is neither well-documented nor obvious, and a customer chooser widget simply doesn't exist.

Since you often need to link information with specific customers, products or categories in custom modules, it should be easy to add a form element which allows the user to select one or multiple product/category/user IDs via the corresponding grids, which are then submitted together with the form.

@bgalileo
Copy link
Author

Ideally, there would be an easy way to load any grid in a lightbox, let the user select one or multiple entries and then save the selected IDs in a hidden form element, but I don't know whether that's feasible.

@verklov
Copy link
Contributor

verklov commented Jan 22, 2015

@bgalileo, could you please provide some specific use case for us? We can hardly understand what are your steps and what you expect to achieve. Thank you!

@bgalileo
Copy link
Author

Scenario: I'm writing a module which allows defining customer-specific prices for products. So I needed to create a backend form where backend users select a customer, select a product and enter a price. To achieve that, I had to:

  • Create two subclasses of Mage_Adminhtml_Block_Widget_Grid which load the appropriate collections and set a rowClickCallback on those grids.
  • Create to more actions in my controller for those two grids.
  • Create a phtml file and add some JS to it which handles the row clicks.

If you want to enable backend users to change the selected product/customer later, even more custom JS is required.

I think that such a common task shouldn't require that much manual work. Instead, there should be an easier way to add a product/customer/… selector to a Mage_Adminhtml_Block_Widget_Form, like the following module provides:
https://github.com/Jarlssen/Jarlssen_ChooserWidget

@verklov
Copy link
Contributor

verklov commented Jan 26, 2015

Got your point @bgalileo. Thank you for the clarification and additional information provided! We created the ticket for this improvement in the product backlog and will process it according to the priorities.

Internal ticket: MAGETWO-33049

@verklov verklov closed this as completed Jan 26, 2015
@vpelipenko vpelipenko added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PS and removed Progress: needs update labels Feb 23, 2015
@vpelipenko vpelipenko reopened this Feb 23, 2015
@quynhvv
Copy link

quynhvv commented Feb 17, 2016

Hi guys,
How we can make a chooser button in a custom form in back-end to choose the categories?

@nobuttsalex
Copy link

Yes I am wanting to do the same, need to create a widget where multiple categories can be selected. I want to include the same category selector that is on the create product form. It must be possible to do it with the functionality that is already in M2 but cannot find how to use it.
m2categoriesselector

@GianniPDF
Copy link

GianniPDF commented Jun 10, 2016

@nobuttsalex I managed to de that with
$categories = $fieldsetData->addField(
'categories',
'Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Category',
[
'name' => 'categories',
'label' => __('Categories'),
'required' => TRUE,
]
);

and adding < css src="Magento_Catalog::catalog/category-selector.css"/ > to your layout.

but having troubles trying to add the SKU Chooser like the one in Cart price rules

@vkorotun vkorotun removed the PS label Aug 4, 2016
@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

magento-team pushed a commit that referenced this issue Mar 27, 2017
magento-engcom-team added a commit that referenced this issue Oct 31, 2019
…ile called in static block #960 #971

 - Merge Pull Request magento/graphql-ce#971 from XxXgeoXxX/graphql-ce:2.3-devlop#960
 - Merged commits:
   1. b94085e
   2. 0ee4cdd
   3. 30eebde
   4. 6295376
   5. 106f398
magento-engcom-team pushed a commit that referenced this issue Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

10 participants