New answers tagged

2

I had the same problem. I accidentially created registration.xml instead of registration.php


0

You have to use the id of the option as parameter for setManufacturer. If you don't know the ids you can retrieve first all the options for the manufacturer attribute and create an array where the key is the label and the value is the id. Something like this (all needs to happen in a class) /** * @var \Magento\Catalog\Api\...


1

You can override product view report in your custom module using following way: /app/code/Vendor/Module/registration.php <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, '...


0

Try this way Created a link in .phtml file for Paypal Express: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface'); $baseurl = $storeManager->getStore()->getBaseUrl(); $paypalexpress = $baseurl.'paypal/express/start/button/1/'; <div id="button"&...


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() )...


0

Check the below code for your reference. Pass your collection/data through the config variable and get it when your component initialize. <?php $collection = 'Store collection in this variable and pass on customCollection variable'; ?> <div id="component-Id" data-bind="scope:'customComponent'"> <script type="text/x-magento-init"> ...


2

To mass update product attributes, use updateAttributes method, which is faster and better than looping through all the products and save each one of them. Inject the model class Magento\Catalog\Model\Product\Action in your Observer class and add the code below to update your product attributes // $productIds is an array of product Ids array(1,2,3,...) // ...


3

Edit "app/design/frontend/Vendor/Theme_Name/Magento_Search/templates/form.mini.phtml" file and add your select field after the input field like below - <div class="control"> <input id="search" data-mage-init='{"quickSearch":{ "formSelector":"#search_mini_form", "url":"<?= $block->escapeUrl($helper->...


1

You need to create an INVOICE and thats all. When you create the invoice Amount Due will become paid (Your admin user has just to create the invoice once order is created, or you can create it programatically so he does not take that step) NOTE : Why don't you just use check / money order method ? Do your custom method have specific logic? Before invoice :...


0

Please try below code from new custom module(Uninstall.php): namespace Vendor\Modulename\Setup; use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\UninstallInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Catalog\Model\Product; ...


0

I too faced with this issue and below is the solution worked for me: I observed that running: php bin/magento indexer:reindex design_config_grid Gave below result: Design Config Grid index is locked by another reindex process. Skipping. So to get that fixed i ran: php bin/magento indexer:reindex design_config_grid And this fixed the issue.


0

If you need just dynamic data at the cart or checkout page 1.create etc/frontend/di.xml file <?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\Checkout\Model\CompositeConfigProvider"> &...


Top 50 recent answers are included