New answers tagged

1

Magento 2 uses Composer, a PHP dependency manager, to package components and product editions. Composer reads a composer.json file in Magento’s root directory to download third-party dependencies listed in the file. The Component Manager uses the composer.json file in an extension’s root directory to perform the following actions: The ...


1

Composer.json is used for the dependency manager for PHP. It also allows you to specify the project dependency for the module. The disadvantage of creating module without composer.json is suppose if you have depedency to third-party modules which you have added and then you give the package to another developer then he/she doesn't know which dependency you ...


0

I have fixed same issue with composer command. composer require ebizmarts/mailchimp-lib You can also download zip folder of library. https://api.github.com/repos/ebizmarts/mailchimp-lib/zipball/293960203ff1d834af5b2f2726f03063494a2265


0

You have to return the result redirect. Try this: public function execute(\Magento\Framework\Event\Observer $observer) { /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); //session is: \Magento\Customer\Model\Session if (!$this->...


1

here i create a widget module without contoller you can access it to insert widget in admin panel Vendor\Module\etc\registration.php registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_Module', __DIR__ ); Vendor\Module\etc\module.xml module.xml ...


2

I have cerated simple hello world module without controller Mag/HelloWorld/Block/HomePage.php <?php namespace Mag\HelloWorld\Block; class HomePage extends \Magento\Framework\View\Element\Template { public function getMessage() { $msg = "Hello World"; return $msg; } } Mag/HelloWorld/etc/module.xml <?xml version="1.0"?...


0

To create Hello World module in Magento 2. For Best Use PHP Storm To create Hello World module, you need to complete the following high-level steps: Best Practice Use PHP Storm Step 1: Create the folder of Hello World module Step 2: Create module Step 3: Register the Created Module Step 4: Enable the module Step 1: Create Folder of HelloWorld Name ...


0

I would like only to highlight that magento uses the word "recommended" regarding composer.json file (https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/composer-integration.html). May look a little confusing since many resources consider this file required. It is indeed required if we need to manage the module using composer. composer.json ...


0

Because Magento Sales Rules sale_rule_form.xml general fielset doesn't have a sortOrder I am forced to add like this: ... <fieldset name="general"> <settings> <item name="sortOrder" xsi:type="string">1</item> </settings> </fieldset> ... That way it will keep label/title at the top and the problem is sorted, Hooray!


0

You can refer to this artical: https://devdocs.magento.com/cloud/howtos/install-components.html


0

You can use plugin for this, like I have created a plugin where only when customer get unsubscribe from frontend then I have added some customization, for this I have added plugin for Magento\Newsletter\Model\Subscriber Class's unsubscribe() method with after plugin My code is, In di.xml <type name="Magento\Newsletter\Model\Subscriber"> <...


1

Please try the below step and check then. "version": "1.0.0" in composer file. setup_version="1.0.0" in module.xml If you want to direct change please follow. https://devdocs.magento.com/cloud/howtos/install-components.html and this one. https://www.magestore.com/magento-installation/how-to-update-magento-extension


1

If this module is paid extension then you can contact your extension provider in your case Mirasvit, you can log in with your credentials in Mirasvit MyAccount and download the latest version for SEO extension. If you haven't customized in your current module then you can simply replace an updated module in your app/code or if you customize in your current ...


0

I was having the same error, all my __constructs and Extending's are correct, if you are scratching your head wondering... why when I do: php bin/magento setup:upgrade it breaks everything and get this error, but then when I do: php bin/magento setup:di:compile the same code works fine afterwards, but then would break again if you do another: php ...


2

Option 1 Its been a while since I've worked on Magento 1 so excuse any mistakes. But to me it looks like your Model rewrite is invalid as current you are overwriting Mage_Core_Model_Export with your custom class which is extending the customer model. I would expect your rewrite to look something like the following (minus the comments i've added). <...


0

I tried to easy way Please check follow setps First open form.phtml file located in your theme /magento_root/app/design/frontend/VENDER_NAME/YOUR_THEME/Magento_Contact/templates/form.phtml, then add subject field to this contact form: <div class="field subject required"> <p id="file_error" class="message-error error message" style="display:none;"...


0

I don't think that cron job has tried to install any extension and site crashed. Extension will not installed automatically untill you run composer update or setup: upgrade command. It may be issue with reindexing. May be cronjob is set you reindexing. Try reindexing manually once. php bin/magento indexer:reindex I hope it will help you! Thanks.


0

For Compare this is correct https://magento.stackexchange.com/a/253236/15747 For Wishlist, you can simply disable the HTML output by adding "system > Websites > base > advanced > modules_disable_output" to etc/app/config.php This method avoids dependency issues as the module remains active but the output is disabled. Note: My example includes other ...


2

If you create a module the code of it will be available for people to copy/edit, you cant prevent this sadly, although you can make it harder. In terms of adding a access key, make sure your validation is performed by api requests to your own server rather than in the module it self. Then when it comes to protecting your module code you will need to encode/...


1

app/code/VendoreName/ModuleName/Setup InstallSchema.php <?php namespace VendoreName\ModuleName\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; class InstallSchema implements InstallSchemaInterface { public function install(...


3

1) I Assume you have created Model and Collection file associated with that tables. 2) In a Block PHP file constructor add one argument (Dependency Injection) like below and store it in a class member variable. public function __construct( Context $context, \Namespace\Modulename\Model\ModelNameFactory $modelNameFactory, array $data = array() )...


1

Based on the comments.... It looks like you have to versions of the same module. One in vendor and another one in app/code. Remove the one from app/code, and clear the cache. If you don't want to remove the module for some reason, you can just rename registration.php from the app/code module to anything else.


1

As of Magento 2.2 the admin System Configuration Panel "Advanced" has been removed. The following gives reference on how to disable a module's output. https://devdocs.magento.com/guides/v2.3/config-guide/config/disable-module-output.html


0

It seems like the menu.xml handles the following actions: add remove update Thus you can something like this to update an existing menu Customer Title change: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> ...


0

I found a solution for my problem I've started with a free module which allow us to manipulate the customer's attributes, but it doesnt apply in StoreFront at the checkout Step. This module is Clarion/Customer-Attribute and you can find it at https://marketplace.magento.com/clarion-customer-attribute.html At this point i needed the labels to be renamed in ...


0

Classy Llama did a good job on an article that shows multiple situations and how to override template files in each of them. https://www.classyllama.com/blog/template-override-m2 It helped me when I came to this thread looking for answers.


2

First, check or adjust the search settings as per your need. Few suggestions:- To have your product on the search results page, its Visibility setting must be Catalog, Search Adjust the Marketing > Search Terms. Enable Search Suggestions to Yes Make sure products are added to the current store and website. Mostly I add all the products to root category ...


0

I found a work around for this. It is by no means the "right" way to controle module output per store view but I could not find anything else that worked, app > etc > config.php: <?php if(getenv('HTTP_HOST')) { switch(getenv('HTTP_HOST')) { case 'dev1.domain.com': case 'staging1.domain.com': return [ '...


0

Here is an Aitoc extension. I didn't have a chance to try it myself but based on the description it should fit you.


0

I found solution. I uploaded image file successfully with AJAX. Answer is here. Filepath : app/code/Chirag/Userform/view/frontend/templates/insert.phtml <?php $blockObj= $block->getLayout()->createBlock('Chirag\Userform\Block\Insert'); echo $blockObj->getEventsTxt(); ?> <?php //echo "formm"; ?> <!-- <h3><a href="index/...


0

we had problem with a widget coming from MGS Megamenu (class MGS_Megamenu_Block_Product). Their widget extends Mage_Catalog_Block_Product that only is a dummy block that crashes if getPriceHtml is called in phtml template underlay. Maybe that block should extend rather Mage_Catalog_Block_Product_Abstract. We solved it by follow hack: // HACK //class ...


0

That looks like the correct way to use the i18n databind. But that doesn't always populate properly on the frontend unless static content has been deployed. It's relies on the translation json file create there and it doesn't always populate correctly in developer mode. Check the checkout html template files and such if you need to check the syntax.


0

I have way to add new attribute to your container. <container name="minicart-row" htmlTag="div" htmlClass="[container-class-name]"> so every container you define with a same class or deiffernet class as you need. now we need to add new attribute to this container <container name="minicart-row" htmlTag="div" htmlClass="minicart-wrapper"> so ...


0

You can try like this: <button click="datafill"> <span>__('I am the gift Receiver')</span> </button>


Top 50 recent answers are included