New answers tagged

0

The preferred way is to do it via plugin. In etc/di.xml add <type name="Magento\Quote\Model\Quote\Address\ToOrderAddress"> <plugin name="split_shipping_convert_address" type="{Vendorname}\{Modulename}\Plugin\Quote\Address\ToOrderAddress"/> </type> and than create class <?php namespace {Vendor}\{Modulename}\Plugin\Quote\...


0

The exception handler for the actual error is failing. It expects a previous exception, but there is none. The actual error is the exec method being disabled by php.ini disabled_functions. $disabled = explode(',', str_replace(' ', ',', ini_get('disable_functions'))); if (in_array('exec', $disabled)) { throw new Exception\...


0

I guess there is no need to overwrite the root template file. Just listen to "layout_generate_blocks_after" event <event name="layout_generate_blocks_after"> <observer name="sgecom_seo_html_lang" instance="SgEcom\Seo\Observer\Frontend\HtmlLang" /> </event> In your observer : use Magento\Framework\Event\Observer; use ...


0

Trying to unlock admin settings locked out can sometimes become an episode of chasing one's own tail, I mean never ending and takes you round and round! I found modifying values of locked fields using CLI very easy. Please refer this: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-config-mgmt-set.html


0

I know this is super late, but for anyone running into this, my answer here might help: https://magento.stackexchange.com/a/313072/88690


0

When in doubt, delete everything. Cache and vendor folder included and things might turn out ok again.


0

You should be able to get the same result but much less verbose and without rewriting the whole model using plugin. Vendor/Module/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"> <type name="Magento\Catalog\...


0

public function __construct( \Magento\Store\Model\Website $websiteModel .......... ) { $this->_websiteModel = $websiteModel; } public function getWebsiteName($websiteId) { $collection = $this->_websiteModel->load($websiteId,'website_id'); return $collection->getName(); }


0

The design theme contained the following declaration: <block class="\Magento\Framework\View\Element\Template" name="earos.pdp.after" template="Magento_Catalog::product/view/footer.phtml"/> You need to change it to: <block class="Magento\Framework\View\Element\Template" name="earos.pdp.after" template="Magento_Catalog::product/view/footer.phtml"/&...


0

If I remember correct, that observer event gets quote before it is saved. So you taking quote, that is not yet saved in database (if added +1 quantity, it wont be in that observer quote). Saving quote is done after that event. So I think it is not good for you in general, because you will miss real quantity. I suggest to use plugin for it. Also, for adding ...


0

Use below code to get order id by order increment id in Magento 2. <?php namespace Package\Module\Model; use Magento\Sales\Model\OrderFactory; class Test { /** * @var OrderFactory */ protected $orderFactory; /** * @param \Magento\Sales\Model\OrderFactory $orderFactory */ public function __construct( ...


1

You are missing your template file which is referenced in https://github.com/techbertu/Offline_Payment/blob/master/view/frontend/web/js/view/payment/method-renderer/offlinepayment-method.js Look at the code of the module-offline-payments like you described. They are all using a template from module-offline-payments/web/template/payment/... so you would ...


0

In Magento 2.3.4: copy file vendor/magento/theme-frontend-luma/Magento_LayeredNavigation/templates/layer/view.phtml to /Magento_LayeredNavigation/templates/layer/view.phtml Find <?php if ($filter->getItemsCount()) : ?> Replace with <?php if ($filter->getItemsCount() && get_class($filter) != \Magento\CatalogSearch\Model\Layer\Filter\...


Top 50 recent answers are included