New answers tagged

0

you need to check in the file Magento_Checkout\js\view\progress-bar.js here navigateTo function is there, where you can put your log and check you are on your custom step or not


0

you can add code in the js file Magento_Checkout\js\view\progress-bar.js in this file function navigateTo is there, where you can add your custom code


0

There must be a cart rule. Please recheck your backend.


0

Coming back after a year, I don't have this issue anymore. I can't exactly explain the final solution but regarding the fastcgi parameters, I can tell that the following params work fine and are also proven by our hoster. fastcgi_buffers 16 256k; fastcgi_buffer_size 256k;


0

As I know, Magento default doesn't support different tax levels for different storeviews. This kind of extension may help: Magento 2 Tax Per Store View https://bsscommerce.com/magento-2-tax-per-store-view-extension.html Sincerely.


0

These are static variables, they are the same across all classes and do not require an object to be initiated to run. I think you need to analyze how these values are used in the code before you make an override like this. I suspect the variables in MessageProcessor are used from a static context like MessageProcessor::$actionsMail and then an override like ...


1

Try to set it to production mode that sometimes solves problems like you are having: php bin/magento deploy:mode:set production then it generated all static content that is needed.


0

@user15020 : Yes, I agree with you not only Magento but its the same issue with mySQL passwords as well. May be those special charcters are meant to be used by programming languages or SQL queries themselves and when its encountered in password strings, it creates issues


1

You should create a .less file for styling the email templates. Here are the steps: On your custom variable, add a class for the anchor tag. Ex: <a class="anchor-style" href="https://customer-support-page">CUSTOMER SUPPORT</a> In your frontend theme, create a _email-extend.less file. Example path: app/design/frontend/Doina/...


0

Inspect tab and look for id (button) and tab section div class or id. <script> require(['jquery'], function ($) { "use strict"; $(document).ready(function () { if ($(".tab_section_class").html().length <= 0) { $("#tab_button_id").hide(); } }); }); I this will fulfill your need in ...


0

You need to create Router.php in your Controller, get any URL and manipulate in as you want. For your understanding, I'm attaching a code snippet of match function inside Router.php. If you find any trouble understanding it, you can ask. public function match(RequestInterface $request): ?ActionInterface{ $identifier = trim($request->getPathInfo(), ...


0

I faced such error, and having investigated this question it was found out that the problem was that in the third-party module (which place in app/code or vendor/) which uses a patch to add attributes with method $eavSetup->addAttribute(), uses for class the interface \Magento\Framework\Setup\Patch\SchemaPatchInterface instead \Magento\Framework\Setup\...


0

Delete all files in the pub/static directory except the .htaccess file. Then modify two files: vendor/magento/framework/Filesystem/DriverInterface.php line 20 const WRITEABLE_DIRECTORY_MODE = 0755; line 25 const WRITEABLE_FILE_MODE = 0644; to make it temporarily set 0755 0644 permissions. Then refresh magento cache.


0

I am just speculating here.. The error is related to quantity not being set in an array that comes from the data source, this is most likely related to the MSI functionality as it was new in 2.3. If you are not using MSI with multiple stocks you could start to try to disable it, you can follow the instructions on the devdoc for this: https://devdocs.magento....


1

If you intend to use the checkmo payment method I think the cleanest way is to create a preference for \Magento\OfflinePayments\Model\Checkmo and override canUseCheckout method and return false. This way you do not have to write any observer or logic in it, it is already handled by Magento standard functionality. It is also minimal code: app/code/...


1

I have created a minimal payment module tonight: in etc folder, place a config.xml file like below <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> ...


0

you are looking into wrong direction, best practice is to remove modules, and strip off all the extra from theme. customers dont need all the bloated functionality. this what makes magento 2 slow: https://github.com/magenx/Magento-2-server-installation/blob/master/composer_replace if you run this to check how many waste you have. modules you dont use, but ...


1

Using search criteria it will look like this: public function __construct( \Magento\Sales\Api\OrderRepositoryInterface $orderRepository, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder ) { $this->orderRepository = $orderRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; } ...


0

Assuming your code works, change the observer like this to check area code as well. app/code/Gta/AdminPay/Observer/PaymentMethodAvailable.php <?php namespace Gta\AdminPay\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\Framework\App\ObjectManager; class PaymentMethodAvailable ...


1

1.Log in to Admin Panel 2.Navigate to Stores > Attributes > Product 3.Find your brand attribute and go to the Attribute Properties of your brand attribute 4. Set the "NO" to "Values Required"


0

Below Code use in top of module's registration.php file. require_once BP . "/magmi/plugins/inc/magmi_datasource.php"; require_once BP . "/magmi/integration/inc/productimport_datapump.php"; In Class file. $dp = new \Magmi_ProductImport_DataPump(); $dp->beginImportSession("default", 'magmi mode');


0

I just needed to place the target="_blank" like so <form id="annex" method="POST" target="_blank" action="checkbutton/index/display"> <input name='monkey' type="hidden" value="<?= $block->getProduct()->getSku(); ?>"/> <button type="submit" class=...


0

Override templates: minicart : /vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html and create a plugin for the function getItemData() of the class vendor/magento/module-checkout/CustomerData/AbstractItem.php di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...


0

You can find more info about this issue here: https://github.com/magento/magento2/issues/24942 To fix issue, you don't need to remove HashGenerator row in vendor/magento/module-store/etc/di.xml, just set sortOrder="1000 for it, so it will look like: <argument name="storeSwitchers" xsi:type="array"> <item ...


0

Try this CREATE OR REPLACE VIEW `inventory_stock_1` AS select distinct `legacy_stock_status`.`product_id` AS `product_id`, `legacy_stock_status`.`website_id` AS `website_id`, `legacy_stock_status`.`stock_id` AS `stock_id`, `legacy_stock_status`.`qty` AS `quantity`, `legacy_stock_status`.`stock_status` AS `is_salable`, `product`.`sku` AS `sku` from ( `...


0

The problem comes from that Magento internally works with 4 decimals. And depending which calculation algoritm you select in backend it calculates the quote_item price_incl_tax differently. E.g. when you have Tax Calculation Method Based On = Total or Row total 6.67*1.20 = 8.004 => 8.00 on the product pages it becomes correct but beneath the price it ...


0

There are many different ways to do this, here is one approach: Create your own module with the skeleton files Include your own javascript by appending to checkout_index_index.xml Listen to changes on the postcode fields and fetch your information when it changes. Detailed steps: 1. Skeleton files app/code/StackExchange/Postcode/etc/module.xml <?xml ...


0

Following worked for me. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $storeID = $storeManager->getStore()->getStoreId(); $storenumber= $objectManager->get('Magento\Variable\Model\Variable')->setStoreId($storeID)->loadByCode('...


0

Create a event file: events.xml File: app/code/[Vendor]/[modulename]/etc/frontend/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="customer_register_success"> <...


0

Once check the your product image path at frontend side, it's take the path in pub/media/catalog/product/cache or not. if it's not take the path of pub/media/catalog/product/cache then it's display the your original product image from path: pub/media/catalog/product


0

Magento uses the file called view.xml which is maintained at the theme level of the application. So for example, if you are using the default theme luma you should find the view.xml in vendor/magento/theme-frontend-luma/etc/view.xml In this file, you would see node inside the node. The dimension of the images is maintained here under the node. The id ...


1

controller_action_predispatch_cms_index_index is the Home page predispatch & it is called always whenever the homepage hit by a User or it is called at the time of logout after a few seconds, when user come back to the homepage. And this is not logical to redirect the same action But sometimes there is a requirement when we need to do this. In Short ...


1

Seems like you want to redirect Home page's cms page to Website index php means redirect to xyz.com/home to xyz.com. First, lets understand the router logic for these pages. When You have hit xyz.com/home it called the Cms router Magento\Cms\Controller\Router and which hit the \Magento\Cms\Controller\Page\View action Where, You have hit xyz.com/ its does ...


0

Try This Code <?php namespace VendoreName\ModuleName\Observer; use Magento\Framework\Event\ObserverInterface; class YourObserverName implements ObserverInterface { protected $_storeManager; public function __construct( ........................................................ \Magento\Store\Model\StoreManagerInterface $...


0

Your solution 2 did not work ? what $Url returns ? Did you try to put '/' instead of 'home' ? if you put 'home' it calls the cms page called 'home'.


0

protected $responseFactory; protected $url; public function __construct( ... \Magento\Framework\App\ResponseFactory $responseFactory, \Magento\Framework\UrlInterface $url ... ) { $this->responseFactory = $responseFactory; $this->redirect = $redirect; $this->url = $url; } public function execute(\Magento\Framework\Event\...


0

Add this in your en_AU csv translation file "Review","your translation" "Details","your translation" "More Information","your translation" After run the magento commands


1

No,alternative is available right now. By using a simple get() and set() function to a class, you can pass to any where at same page. A good example is given by our Dear @vinai at his a module at github. https://github.com/Vinai/module-current-product-example The class: https://github.com/Vinai/module-current-product-example/blob/master/Registry/...


0

I don't know your exact use case, so I'll give an example for product only. What you can do is check if the request has any parameters. If you're dealing with a product page for example, you could get the entity id of the product and then load it via the repository class. Product page example: <?php declare(strict_types=1); namespace Your\Namespace; use ...


0

you can try Faceted navigation : https://bsscommerce.com/magento-2-layered-navigation-extension.html Pagination :https://bsscommerce.com/magento-2-infinite-scroll-extension.html


0

app/design/frontend/Theme/Magento_Catalog/layout/catalog_product_view.xml <?xml version="1.0"?> <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";; xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock ...


0

Try This Code app/code/VendoreName/ModuleName/view/frontend/layout default.xml <?xml version="1.0"?> <page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <...


1

Reference Link Yes there is. The event you're looking for is controller_action_predispatch_checkout_cart_couponPost This is generic event that is dispatched before the action class that adds/removes the coupon is called. As this is the same event for both add and remove you can add the following code at the top of your observer method to check if this is a ...


0

<referenceContainer name="page.messages" remove="true" /> Add this in app/design/frontend/[your theme]/Magento_Theme/layout/default.xml


1

Hi please follow this official fix as this has also been raised on git https://github.com/magento/magento2/commit/2d1f8ca5d13c626000b34002704de9e0a99d3d99


0

This should help you: <?php if ($_product->getTypeId() == 'bundle') { $finalPrice = $_product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue(); $orgPrice = $_product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue(); } elseif ($_product->getTypeId() == 'grouped') { $...


1

I have just created a plugin to upload files to server via graphql. You can checkout here: https://github.com/huykon/magento-graphql-uploader


1

Ok try it like this create a file search_request.xml in vendor/module/etc directory now just copy the entire node <request query="quick_search_container" index="catalogsearch_fulltext"> from here vendor/Magento/CatalogSearch/etc/search_request.xml now look for this line <queryReference clause="should" ref="search&...


0

<block class="Company\ProductLabel\Block\Productlabel" name="product.label" template="Company_ProductLabel::productlabel.phtml" cacheable="false" /> Try this..


2

You can use this below way : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $storeID = $storeManager->getStore()->getStoreId(); $objectManager->get('Magento\Variable\Model\Variable')->setStoreId($storeID)->loadByCode('...


Top 50 recent answers are included