New answers tagged

0

Here is an example, module name here is Rendyep_CustomModule, change it accordingly. Create app/code/Rendyep/CustomModule/view/adminhtml/ui_component/product_listing.xml <?xml version="1.0" encoding="utf-8"?> <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/...


0

What worked for me was changing to Client side less compilation found in: Stores > Configuration > Advanced > Developer > Frontend Development Workflow Also make sure your store is in developer mode. php bin/magento deploy:mode:set developer


0

I do not recommend that you use object manager but this is how to get the cart sub total within your controller $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); // get quote items collection $itemsCollection = $cart->getQuote()->getSubtotal();


0

You can use method getCustomerSession() in \Magento\Checkout\Model\Cart to get customer data. $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); $customerId = $cart->getCustomerSession()->getCustomerId();


1

This should be the right code: $customerSession = $objectManager->create("Magento\Customer\Model\Session"); echo $customerSession->getCustomerId(); By using this great code it should work. Therefore, the customer ID will get returned to you.


0

Create File In MassiveArt/ShoppingCart/view/frontend/layout/default.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <referenceContainer name="minicart.addons"> <block class="MassiveArt\ShoppingCart\Block\ButtonGet" name="...


0

You need to include select2.js on front-end using define or RequiredJs As sample JS code define define(['jquery', 'Namespace_ModuleName/js/select2path'], function($){ $('.control-select2').select2({}); }); requirejs on phtml file require(['jquery', 'Namespace_ModuleName/js/select2path'],function($){ $('.control-select2').select2({}); }); ...


0

Please give writable permissions to app/etc. Since you are enabling the new module, your config.php file must have write permission to do changes which reside in app/etc directory. Please run the command. chmod -R 777 app/etc/


0

First you need a conflict detector extension like this https://github.com/magefan/module-conflict-detector This will give you an idea on which extension has priority over your block. Then you will have to rework the module that has current priority to extend the other module block logic. Then if you are overriding the same method(s) you will have to ...


0

The issue happen with me. I fixed the issue by edit code on block form (example: app/code/local/Leric/Blog/Block/Manage/Blog/Edit/Form.php) Add 'enctype' => 'multipart/form-data' to form: $form = new Varien_Data_Form( array( 'id' => 'edit_form', 'action' => $this->getUrl('*/*/save', array('id' => $this->...


0

It is not recommended to use the preferences except in rare case. Instead of preferences always prefer to create a plugin. You can create a after plugin on a public function getPrice() in both the module. And assign the sort order to the plugin which you want to execute first. Refer this to create plugin: https://www.mageplaza.com/magento-2-module-...


0

I found a solution. There was dependency problem with \Magento\Framework\Currency $currency. When I run the UpgradeData without this line, it works.


0

You can try this code: public function getCustomerId(){ $session = $this->objectManager->get('Magento\Customer\Model\Session'); return $session->getCustomer()->getId(); } Here, firstly you need to check customer is logged in or not: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $...


2

Please try with below code... $customerSession = $objectManager->create("Magento\Customer\Model\Session"); echo $customerSession->getCustomerId(); I hope its work for you.


0

The core supposed to check the en_US instead of just en. Check your codes wherein the locale is specified as en only and changed it to en_US


0

So I had a conflict between a 3rd party "FollowUp Email" extension and Temando_Shipping showing the error: Missing required argument $offset of Temando\Shipping\Rest\Request\ListRequest. So decided to disable Temando shipping and found this thread. Disabling Temando Shipping actually fixed the issue and the extension works fine now. And well, I said let'...


0

Waqar Ali's answer is almost correct. The registration.php file is missing: <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_ModuleName', __DIR__ ); and the Vendor/ModuleName/Block/Button.php file needs to define namespace: namespace Vendor\ModuleName\Block; Don't to ...


6

Create a Custom Module as Follows Vendor\ModuleName\registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_ModuleName', __DIR__ ); then Vendor\ModuleName\etc\module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...


0

instead of $logger->info($address->getEmail()); use this line $logger->info($order->getCustomerEmail());


0

You can get guest customer email by using following $shippingAddress = $quote->getShippingAddress(); $logger->info($shippingAddress->getEmail()); Hope this solution works for you


0

You need to just add the permission to Magento var, generated & pub folder. Just hit the below cmd in Magento root directory. sudo chmod -R 0777 pub/* generated/* var/*


1

Check module.xml file of your module which you created at last. This error generally occurs because of this file only.


1

Yes you can. You need to create module xml in in app/etc/modules/Mycompanyname_Categorystep.xml <?xml version="1.0"?> <config> <modules> <Mycompanyname_Categorystep> <active>true</active> <codePool>local</codePool> <version>0.1.0</version> </...


0

The issue due to Disk Space not enough to run the deploy on Cloud Server. Hence we couldn't disable the module.


1

I would recommend running the php bin/magento module:disable command in a local checkout of your code to ensure that the proper module name is used as it is possible it is not matching approrpiately. This will add the MyCompany_MyModule => 0 to the config.php. After that, git add/commit the updated config.php and it should be disabled!


0

Try this: //$objectManager is an instance of \Magento\Framework\ObjectManagerInterface $session = $objectManager->create('Magento\Checkout\Model\Session'); $shipping = $session->_getCheckoutSession()->getQuote()->getShippingAddress(); $methods = $shipping->getGroupedAllShippingRates();


0

I recommend that you add this to your composer.json and run composer install "require": { [...] }, "replace": { "temando/module-shipping-m2": "*", }, "config": { [...] That should remove extension and trigger a composer dump-autoload But basically remove the unwanted extension Without it in place I can't see any ...


1

Thank you so much Sukumar, your answer totally saved me a lot of time. I have put it in a convenient SQL request: DELETE FROM eav_attribute WHERE attribute_code IN ( 'shipperhq_shipping_group', 'shipperhq_warehouse', 'shipperhq_shipping_fee', 'shipperhq_handling_fee', 'shipperhq_volume_weight', 'shipperhq_declared_value', 'shipperhq_dim_group', '...


0

For this case, the composer.json only requires "magento/product-community-edition": "2.3.3" The composer.lock file contains "magento/product-community-edition" with a dependency on dotmailer-magento2-extension at a fixed version. So, unless there's a new version of magento community, no upgrade will happen. Also, the package source for dotmailer-magento2-...


1

It looks like this module moved to magento official repo (Member of MSP Security Suite) and now name is different. So You can remove old module. New one: msp_twofactorauth Please read: https://github.com/magespecialist/m2-MSP_TwoFactorAuth - there is a note here and this is official repo now: https://github.com/magento/magespecialist_TwoFactorAuth


0

Try to disable using command line command :- php bin/magento module:disable My_Module


2

please try this code:- CompanyName/ModuleName/etc/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"> <preference for="Magento\SalesSequence\Model\Sequence" type="CompanyName\ModuleName\Model\Sequence" /> </...


1

Modify Magentsales\Modulesequence\Model\SalesSequence\Sequence.php <?php namespace Magentsales\Modulesequence\Model\SalesSequence; use Magento\SalesSequence\Model\Meta; use Magento\Framework\App\ResourceConnection as AppResource; class Sequence extends \Magento\SalesSequence\Model\Sequence { /** * @var string */ private $...


3

You can check below link 1) https://meetanshi.com/blog/generate-pdf-programmatically-magento-2/ 2) Magento 2: Convert HTML code into PDF file and Download? 3) https://webkul.com/blog/generate-pdf-programmatically-magento2/


0

Depending on what you are doing there are other options https://github.com/DominicWatts/CsvUpload/blob/446ba3c80fc7f9136e7bdf6bda859c0e5d327ed0/view/adminhtml/templates/index/submit.phtml#L2 <a href="<?= $block->escapeUrl($block->getViewFileUrl('Xigen_CsvUpload::template.csv'));?>" target="_blank"><?= $block->escapeHtml(__("CSV ...


0

Please see this thread it may help: https://github.com/magento/magento2/issues/18248


0

Also, if you need an html tag to be displayed as plain text in comment - replace < with &lt; and > with &gt; E.g.: <comment><![CDATA[Some comment with tag as plain text - &lt;rating&gt;4.3&lt;/rating&gt;]]></comment> The above will be displayed as Some comment with tag as plain text - <rating>4.3</...


Top 50 recent answers are included