Solution We can use the foreach to update the multiple invoices array. On the constructor use the function On the execute function foreach each invoice and set the value. So through this, we can update multiple invoices. Thank you.
Category: Magento
How to display custom amount in order summary in admin Magento 2?
1. sales_order_view.xml 2.Totals.php
How to fix issue related to the calendar
When we click on the calendar first and select some date. After that when we click anywhere on the page the calendar will be opened. To fix, this issue we need to write CSS for the main div of the calendar field.Position: relative; By this, we can fix the issue.
Why can’t one switch back to the default mode on Magento 2?
To switch back to default mode, open:- app/etc/env.php And change:- ‘MAGE_MODE’ => ‘developer’, Back to:- ‘MAGE_MODE’ => ‘default’, And re-deploy static files again. reference:https://magento.stackexchange.com/questions/112523/why-cant-one-switch-back-to-the-default-mode-on-magento-2
How to stringify the items Array in main.js and store it in localStorage:
JSON.stringify will only convert value type property, array and objects.
Load price phtml file in magento2
we have to get product price HTML using Magento 2 below way, we have to create a block Vendor\Module\Block\Product. PHP and get your product object and call the below function in your template file. protected $resultLayout; public function __construct(\Magento\Framework\View\Result\Layout $resultLayout) {$this->resultLayout = $resultLayout;} public function getProductPriceHtml(\Magento\Catalog\Model\Product $product){/** @var \Magento\Framework\Pricing\Render $priceRender */$priceRender = $this->resultLayout->getLayout()->getBlock(\Magento\Framework\Pricing\Render::class);if (!$priceRender) {$priceRender… Continue reading Load price phtml file in magento2
Getting Base URL Inside KnockoutJS .html File
This will redirect to the checkout page by opening a new tab. This will redirect to the checkout page without opening a new tab. Other examples:-
The visible function from the knockout template to knockout js
The way to link the visible function from the template and js file Thank you.
On the checkout get the customer’s details on the js file
The customer data can be received on the js file using the method ‘Magento_Customer/js/model/customer’ Using this we can fetch the customer data on the checkout js. Thank you.
Get product details by product id in Magento 2
create a block and write the following code on it,