New answers tagged

0

Declare this event name(custom_observer_name) in controller execute method $this->_eventManager->dispatch( 'custom_observer_name', [$this->getRequest()->getParams()] );


1

Your overwrite looks good. Problem is where you send email. You maybe missing following part: $transport->setTemplateVars([]) OR $template->setVars([]); [Update] Replace addAttachment method by following code: /** * @param $body * @param $mimeType * @param $disposition * @param $encoding * @param null $filename * @return $this */ public ...


2

try Following way... $order = Mage::getSingleton('sales/order')->loadByIncrementId($orderId); $order->getGrandTotal();


0

Basically we get order total amount like this : $order = Mage::getModel("sales/order")->loadByIncrementId($orderId); // get order $order->getGrandTotal();


0

I got solution for this. So sharing here: You have to extend backend model file in your custom module like below: In system.xml, update code as below for input type="file" <field id="customfile" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0"> ...


0

Content > Design > Configuration > Select your theme > you see Header text input fields


0

There are not the filters by product attribute_id and store_id in the query. It is the reason for result has several rows for each product. Also, the order can be contains many products - you can use GROUP_CONCAT for compose all product name in one row for each order. If you don't want to show all order's products for the order row you can add $this->...


0

I have create a module for telenor sms api. It will send an sms to the customer when place an order. you can Download the module Here


1

I suggest you use implement extension attribute for this field at here. See how to use Extension attribute. https://devdocs.magento.com/guides/v2.3/extension-dev-guide/extension_attributes/adding-attributes.html Make your field as an extension attribute of data interface Magento\Quote\Api\Data\CartItemInterface Create extension_attributes.xml at app/code/...


2

please include your nusoap.php inside lib folder, (for example ) : magento_root_folder/lib/nusoap/nusoap.php so it can be called with this code part : require_once Mage::getBaseDir().DS.'lib'.DS.'nusoap'.DS.'nusoap.php'; $client = new nusoap_client(...); hope this help


1

Overriding only getOptionArray() is not just enough because if you see in Magento\Catalog\Model\Product\Visibility at line 107, 120 & 134, getOptionArray() is called with self.Self will always call the original method rather than new one, hence you simply need to copy and paste getAllOption(), getAllOptions() & getOptionText() in your overridden ...


0

It should be the same. You should take a look at the Sales rule module. vendor/magento/module-sales-rule/view/frontend/layout/checkout_index_index.xml


2

If you are trying to retrieve custom options and their values for one time you can use mysql query else you can have your own kind of implementations based on the below sql. mysql> select t4.title as 'Custom Option', t3.Custom_Option_Values from (select t2.option_id, t1.option_type_id,t1.title as 'Custom_Option_Values' from ...


2

I found this solution: $tableName = $this->_resourceConnection->getTableName('catalog_product_option_type_title'); $connection = $this->_resourceConnection->getConnection(); $query = "SELECT * FROM " . $tableName; $resultOptions = $connection->fetchAll($query);


0

I can't give you the exact solution as it sounds like you have specific requirements. But you need to do something like the following How to Create Custom Form in Magento2 Frontend?


1

If you want to limit the collection that shows within the grid when using the UI component, you need to look at the DataProvider class. There are methods in there which allow you to add "filters" that are always present (e.g. limiting rows to only those within a specific store). For example, I have a custom module that keeps a history of changes made within ...


0

You to try to create a custom component and inject your custom component in checkout as described below. Step 1 ) File : My_Module\view\frontend\layout\checkout_index_index.xml <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/...


0

Assuming you are using XAMPP, first, change localhost to 127.0.0.1 or your unit IP address If in case the admin panel is not accessible, you can go to your database and go to core_config_data table, then locate web/secure/base_url and web/unsecure/base_url and change value of localhost from there. If you face an error after the changes above: You can ...


0

Try to replace your <script> tag with below code <script type="text/x-magento-init" /> Refer: https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/javascript/js_init.html


0

Use below code , its a working copy Move both the files inside test folder in root directory test/test.php <?php require __DIR__ . '../../app/bootstrap.php'; require dirname(__FILE__) . '/customScript.php'; $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); $app = $bootstrap->createApplication('customScript'); $bootstrap-...


0

After testing, you're wrong here: require DIR . '../../app/bootstrap.php'; Need to change to require __DIR__ . '/../app/bootstrap.php'; See in pub/index.php as a good example. Full code test/index.php <?php require __DIR__ . '/../app/bootstrap.php'; require dirname(__FILE__) . '/Test.php'; $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $...


0

Execute Your Custom Script Like This:- In Browser :- localhost/yoursite/test/filename.php Using Command :- php -f test/yourfilename.php


0

I've used dataTables before in frontend theme. Not that different to what you have tried. Just for clarity here's what I ended up with. require(['jquery', 'jquery.dataTables'], function($, DataTable) { app/design/frontend/Vendor/Theme/Magento_Theme/requirejs-config.js { "jquery.dataTables": "Magento_Theme/js/jquery.dataTables.min" }, ...


Top 50 recent answers are included