Sometimes when we are posting some values to Netsuite through their API, the API is triggered twice because we may posting the params to the response as the same response from NetSuite. Avoid printing the params in the response. Try this instead of :
Author: Bibin Johnson
Observer to remove all cart items based on a condition
Sometimes when we submit a quote we may need to reset the cart with clearing all submitted quote fields, So we need to use an event Observer code to remove all items Repos must be added in the observer to get the data
Observer to block qty update in the minicart based on a condition
Here we can implement a observer to block minicart to update qty based on condition firing a event before <event name=”checkout_cart_update_items_before”> Observer code:-
Disable Cache for Category TopMenu
Updates from NS to the category header or name will not be worked on the real-time so for that, the layout should be having cacheable false setting. We can achieve the option in the following method.Create a custom module for the changes app/code/VendorName/ModuleName/registration.php app/code/VendorName/ModuleName/etc/module.xml app/code/VendorName/ModuleName/etc/di.xml app/code/VendorName/ModuleName/Block/Html/Topmenu.php
Add bundle Items with a checkbox option to cart programmatically
Here we are checking the product type and adding the product to the cart programmatically based on the bundle item as the checkbox item.
Add custom column filter in customer grid collection in Magento 2
STEP 1Create a di.xml file inside the app/code/Vendor/Module/etc/ directory. And add the below-mentioned code in this file. STEP 2 Create Collection.php file inside the app/code/Vendor/Module/Model/ResourceModel/CustomerGrid/ directory.
All You Need To Know About Magento 2 Multi Source Inventory
Multi Source Inventory (MSI) was introduced in Magento 2.3.0. This is actually a huge leap for the Magento community as it dramatically improves Inventory Management by allowing the merchants to control inventory for single or multiple sources and sales channels. SourcesThis is the primary element of the new inventory. A source is a place where… Continue reading All You Need To Know About Magento 2 Multi Source Inventory
Getting Visual Swatchs on Phtml file for products
Viewing the visual swatches for the simple products in PLP and PDP pages . This is custom functionility to make the simple product to config by addin the related products with same property but with different color,size and attributes. Here it is done with a object but always convert the object manager to a block… Continue reading Getting Visual Swatchs on Phtml file for products
Magento 2.4 Custom form validation mage error duplication
Mage error component is duplicating error warnings on form inputs. Steps to reproduce-Submit blank login form;-Fill the input and submit again;-Remove the input field and submit blank form again.-Click one more time on submit button. Solution:- When we write a js for the submission of the please confirm that the form is valid or not.… Continue reading Magento 2.4 Custom form validation mage error duplication
Adding a new field to API calls (Extension Attributes)
For adding a new field to the API call as an extension attribute we need to create a Plugin Firstly Create extension_attributes.xml inside the etc for your module here I’m adding a request quote id field to the sales order table. Create a webapi_rest folder and di.xml to initialize the plugin webapi_rest/di.xml now create a… Continue reading Adding a new field to API calls (Extension Attributes)