New answers tagged

0

Try this <?php $prams = ['id' => 10, 'str2' => 'value2',]; ?> <a href="<?php echo $this->getUrl('catalog/product/edit', ['_current' => true, '_use_rewrite' => true, '_query' => $prams]); ?>" />


0

Try this code <?xml version="1.0" encoding="UTF-8"?> <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name="...


0

When you save data into system configuration value are store in core_config_data. So that time you need to check module status by using \Magento\Framework\Module\Manager. protected $moduleManager; public function __construct( ... \Magento\Framework\Module\Manager $moduleManager, .... ) { ... $this->moduleManager = $moduleManager; ...


0

Hide Add To Cart app\code\Vendorename\Modulename\etc di.xml <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Model\Product"&...


0

I figured it out. It was not saving because the mage2gen generator added wrong values for the ID in the files, because my table name ends with _quote and it took it to make quote_id to the ID key..., but I am already using quote_id as a field, so it does not work out... Company/Shipping/Model/ResourceModel/Quote/Collection.php Company/Shipping/Model/...


1

It might be related to your: db_schema.xml Try to add: <column xsi:type="int" name="id" nullable="false" unsigned="true" comment="ID" identity="true"/> Adding identity="true" If you check e.g. this example you see they have it on their primary key: https://devdocs.magento.com/...


0

I am not sure about sample modules. But for developing your own payment module Magento provides good documentation in the dev docs: https://devdocs.magento.com/guides/v2.4/payments-integrations/base-integration/integration-intro.html


1

system.xml: <field id="methodTitle" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Method title</label> <comment><![CDATA[Method title comment]]></comment> <...


0

I figured out that HTML is already allowed. But there was a place in the template where the HTML is getting escaped, so I thought html is not allowed. I am also rewriting the method getStoreConfig in the file where I am loading the settings from the system.xml to make it whitelist the tags <div><br><strong><span><b><p><...


0

This doesn't appear to be a Docker issue but rather a Linux vs OSX file naming issue. This post describes the problem Link After building new module with new names it is working. SponsoredArtistsController > Sponsoredartistscontroller


0

I had the same issue and it is fixed. I saw the image has data-amsrc attribute. it is added by amasty "Google Page Speed Optimizer" module. There is config in admin to ignore images contain certain classes. in my case, this module also added style display:block to all images in my site. I change config Lazy Load Script => Native JavaScript Lazy ...


0

What I did was following Hamendra advice but calling the function again at the end basically, not before: require(['jquery', 'lazyLoad', 'lazyLoadPlugins'], function($) { ... $(document).ready(function($) { $('.owl-carousel').on('changed.owl.carousel', function(event) { window.mgzLazyload(); }); }); $(window).load(...


1

May be the issue the lazyload function gets called before initialization of jquery. Try $(window).load() method.


0

Make sure your module files are not in inside of an folder in Zip. Put your module files in Root of your ZIP file. Wrong way: Abc.zip > MyModule > Module Files Correct way: Abc.zip > Module Files If above doesn't help, please share your file structure of zip file.


0

If you want to send a completely different email then create one more email template as you did for the customer to admin. If you want to change Dear to Dear then Pass var to the email template accordingly. Use try to use call .phtml file in template and then set condition accordingly.


0

In my case, It seemed that Magento DocBlockReflection could not find the API interface and class since it was in the root folder of my Plugin, I added my interface in the Api folder and my class in the Model folder and it worked!


0

I assume you are using mac? If so, this is tipycally a sync issue between your local and the container. quick fix worth trying: try to stop and restart your container. another fix (possibly more optimised) is to mount the generated folder so that docker does not try to sync it. This would speed up your docker setup in fact. The generated line should give ...


0

The issue was some of the 'type' variables dont seem to work, if I use 'label' it works fine foreach ($config['actions'] as $action) { if (('cancel' != $action['type']) and ('hold_order' != $action['type']) and ('unhold_order' != $action['type']) and ('Print Invoices' != $action['label']) and ('print_shipping_label' != $action['type']) and ('...


0

Try this link in Add than run Uninstall Script File: app/code/Vendor/Module/Setup/Uninstall.php https://www.mageplaza.com/magento-2-module-development/magento-2-how-to-create-sql-setup-script.html


0

If the module is related to product edit page than You need to remove attribute/Field from the attribute set Go to Store > attributes > Atttibute set > open perticular attribute set and drag and drop the module's field/attribute to unassigned attributes


0

Add this to default.xml <referenceBlock name="product.info.addto" remove="true"/>


0

I have used HTML in my code using &lt; and &gt; and it is working fine. No <!CDATA> required for this Sample code: <comment> &lt;strong&gt;Heading:&lt;/strong&gt; &lt;br&gt; Text line one here &lt;br&gt; Text line two here &lt;br&gt; Text line three here </comment>


0

First of all you can't add PHP code in html file. You can add or change email logo from admin. Please prefer this link Magento DevDocs for Email Templates Steps to upload logo from admin is :: Magento Admin > CONTENT > Design > Configuration > Select your store scope > > Save Configuration If this helps you then hit like. Thank you Hiren ...


0

For the ui form you can refer the below code to add tabs <?xml version="1.0"?> <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <argument name="data" xsi:type="array"> <item name=...


1

Make sure you have a file inside the web folder of your module You can refer below example. Ex. file placed in below path app/code/Vendorname/Core/view/frontend/web/images/pic.png Then you can use the $this->getViewFileUrl('Vendorname_Core::images/pic.png') if not still not load then you can verify that images is deployed in the pub/static with the same ...


1

You can try this way .. <img src="<?php echo $this->getViewFileUrl('Vendorname_Core::images/image.png'); ?>" /> and image directory like : Vendorname/Core/view/frontend/web/images/image.png then run below commands rm -rf var/di/* generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/* ...


0

Firstly i would suggest you create your own module. In the module create the following classes : Under Namespace\ModuleName\Block\Adminhtml\Product\Edit\Action\Attribute\Tab create the class Tab -> <?php declare(strict_types=1); namespace Namespace\ModuleName\Block\Adminhtml\Product\Edit\Action\Attribute\Tab; use Magento\Backend\Block\Widget\Tab\...


Top 50 recent answers are included