Sometimes we may not be able to call an event in an external module. So this happens due to some event or observer may be functioning for default function.in order to override these observers or events we need to create an external module with a di.xml file here we can give preference to the observer… Continue reading Overriding an Existing Observer and Event
Tag: Magento
Magento 2: How to save form data to sales_order_item table from .phtml file of adminhtml in magento 2?
This can be done with a ajax controller[Vendor]/[module]/view/adminhtml/templates/order/view/tab/info.phtml [Vendor]/[module]/Controller/Adminhtml/Test/Save.phpon the controller [Vendor]/[module]/view/adminhtml/layout/routes.xml [Vendor]/[module]/view/adminhtml/layout/sales_order_view.xml
Method to Show Address Fields in Registration Form in Magento 2
To show the address fields in the registration form Add below code in your customer_account_create.xml file This will the address fields on the registration form
Magento 2 Pre-order and Backorder
A pre-order is used for the products that haven’t been released yet. A backorder option is available for items that are out-of-stock, but have been in stock lately. Magento doesn’t have a pre-order feature by default. So to make it work on your website, you need either an extension for that or a customization. To… Continue reading Magento 2 Pre-order and Backorder
Backorder Functionality-Magento
Backorders in Magento 2 Backorders functionality is supported by Magento 2 out-of-the-box. Go to Stores – Configuration – Catalog – Inventory – Product Stock Options tab. In the ‘Backorders’ section select the necessary option: No backorders disables backorders in your store; Allow Qty Below 0 shows the product as In Stock even when the product reaches qty = 0;… Continue reading Backorder Functionality-Magento
Add Custom developments to add to cart
This is based on the event happening before adding a product to the cart. Using this event we may modify the qty and price of the product if the requirements are pointed out. This can be achieved with a help of a module Create a module with etc/frontend/di.xml After that create an observer to modify… Continue reading Add Custom developments to add to cart
Magento Uninstall Database using terminal
To reinitialize the Magento 2 database with defaults, you can use the setup:install command with the –use-sample-data option. This command will remove all existing data from the database and install the Magento 2 sample data along with the default configuration. Remove all existing data from the database by running the following command: Run the following… Continue reading Magento Uninstall Database using terminal
Bigpost Integration with Magento 2
BigPost is a shipping carrier that provides a REST API for developers to integrate their shipping services into e-commerce platforms. To integrate BigPost API with Magento, you can follow these general steps: -Obtain API credentials: You need to register with BigPost and obtain API credentials such as API Key, API Secret, and Merchant ID. -Install… Continue reading Bigpost Integration with Magento 2
Append options to a select tag from an API response
Here is an example to append options to a select tag from an API response in jquery foreach This can be also done by foreach on php but sometimes we may need js or jquery to append data upon some conditions.
Magento 2 api – How to get layer navigation filters available in rest api?
get layer navigation data available in product collection ( current category , search product ) . To get layer navigation from the API Sample Output will be :