New answers tagged

1

app/code/Cm/Module/etc/di.xml <type name="Magento\SalesRule\Model\Rule\DataProvider"> <plugin name="data_provider_custom" type="Cm\Module\Plugin\Dataprovider" sortOrder="1" disabled="false"/> </type> app\code\Cm\Module\Plugin\Dataprovider.php <?php namespace Cm\Module\Plugin\Rule; /** * Class DataProvider */ class DataProvider ...


0

So using the test template (I should've tested it before posting) the JS alert is showing as expected. I had specific JS issues with the other JS I was trying to render, but the source still doesn't show the script tag, which is what led me to think this is where it was broken. This could be a good place for custom widget JS discussion, or determining best ...


0

The parameter you need to use when initializing the form needs to be "id" rather than "field_id": /** @var \Magento\Framework\Data\Form $form */ $form = $this->_formFactory->create(['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]);


1

I have created a similar feature to assign category via popup. My Custom Product Grid (below) where I have inserted a modal with ui-grid with opens on click on the column category. You can use insertForm instead of insertListing (mymodule_mycategory_listing) for your form. Product Grid: <?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="...


0

Please try to create your custom module to override sales block. also, please check with below url which is very helpful to you how to override https://webkul.com/blog/overriding-rewriting-classes-magento2/ and add block with extends <?php namespace Vendorname\Modulename\Block\Adminhtml\Order; use Magento\Framework\View\Element\Template; class View ...


0

To remove ship button in admin order view page app/code/Vendor/Module/etc/adminhtml/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Backend\Block\Widget\Button\Toolbar"> &...


1

For adminarea you should use \Magento\Backend\App\Action instead of \Magento\Framework\App\Action\Action class Index extends \Magento\Backend\App\Action


0

Create a column similar to this in your ui component for the grid page or update the already existing one with options and config nodes just as below. <column name="some_name"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">Magento\Cms\Ui\Component\Listing\Column\Cms\Options</item> &...


1

Add a new column called Stock while creating the order in the admin need to override the class \Magento\Sales\Block\Adminhtml\Order\Create\Search\Grid and add column qty_in_stock Follow below step to create custom module to add custom column. Step 1) magento/app/code/Venodr/SalesordercreategridStock/registration.php <?php \Magento\Framework\...


0

Below Is a Default Class it only Export that Data which are show in your Admin Grid not Export your whole data <exportButton class="Magento\Ui\Component\ExportButton"> If you want all Data you have create a Custom Export Button that export your all data. edit in your Ui-Component file where Admin Grid Show [vendor_name] \ [module_name] \view\...


0

I crate a Admin Grid using Ui-Component. edit in your Ui-Component file where Admin Grid Show [vendor_name] \ [module_name] \view\adminhtml\ui_component Add this code to add button in Admin Grid Ui-ComponentFIleName.xml <item name="buttons" xsi:type="array"> <item name="import" xsi:type="array"> <item name="name" xsi:type="...


1

Adding to the above answer, u can also just overwrite the getOptions Method from the extended \Magento\Framework\View\Element\Html\Select and return the toOptionArray Method of an existing SourceModel. Incase u just want to have a select inside of an AbstractFieldArray that is based on a SourceModel. For example the Yesno Sourcemodel: <?php namespace ...


2

I found a solution for when edit a ui-component form dependent field are appear. use a initialize function to show a dependent field on load a form initialize: function () { this._super(); this.onUpdate(this.value()); return this; }, view/adminhtml/web/js/applyoptions.js define([ 'underscore', '...


3

You first should change the namespace for controller's action namespace Vendor\Module\Controller\Adminhtml\ConfigMenu; //Capital for first letter You should change your action in the menu.xml: <add id="Vendor_Module::menu_item" title="Configuration" module="Vendor_Module" sortOrder="10" parent="Vendor_Module::menu" action="siftMenu/...


1

Try below event Magento 2 :- <event name="customer_save_after_data_object"> <observer name="customer_save_after_observer" instance="Vendor\Sales\Observer\CustomereditPost" /> </event> Magento 1 : - <config> <adminhtml> <events> <adminhtml_customer_save_after> <...


2

For overriding vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml file you need to create a module. Create sales_order_view.xml at app/code/Your_VendorName/Your_ModuleName/view/adminhtml/layout/sales_order_view.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...


0

First Step: Path of the XML OSCP/ModuleName/view/adminhtml/layout/sales_order_view.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="column_name"> <...


5

I follow this steps to add UI fileuploader component in admin form I use UI fileuploader component to upload an icon for my FAQ extension. You can take reference from here: https://github.com/mageprince/magento2-FAQ 1) Add field in admin_form.xml(Admin Form) <field name="icon"> <argument name="data" xsi:type="array"> <item ...


Top 50 recent answers are included