Uses of checkout_before event in Magento

The “checkout_before” event is triggered just before the checkout process starts in Magento. It allows you to perform custom actions or modifications before the customer proceeds to the checkout. Some common use cases for the “checkout_before” event include: Validating or modifying cart items based on specific conditions or requirements. Applying custom pricing rules or discounts… Continue reading Uses of checkout_before event in Magento

Published
Categorized as Magento

How to create the customfield for product?

Login to Magento Admin>Store>Attributes>Product On the Product Attributes page, you can see by default that Magento gives us pre-defined attributes. Let me create a new attribute. Click on Add New Attribute Now we need to fill out details in the New Product Attribute and then Save. Let’s explain the fields: Default Label:Label text attributes that recognize… Continue reading How to create the customfield for product?

Published
Categorized as Magento

How to get Magento 2 customer group ID

To get logged in customer group id directly in phtml without using Dependency Injection, You can use the object manager to get group id in your phtml file. Using Dependency Injection app/code/Vendor/Module/Block/CustomBlock.php Now, you can use the functions in your phtml file as follows. <?php $customer= $block->getLayout()->createBlock(‘JJ\LoggedOut\Block\CustomerGroupId’); $group = $customer->getCustomerGroupId();?>

Published
Categorized as Magento

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