How to Remove SORT BY “Price” Option in Magento 2?

Step 1: Create a di.xml file at the below path appcodeVendorExtensionetc <?xml version=”1.0″?>   <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”>       <type name=”MagentoCatalogModelConfig”>         <plugin name=”RemovePriceOption” type=”VendorExtensionPluginModelConfig”/>     </type>   </config> Step 2: After that, create Config.php in the following path VendorExtensionPluginModel And then add the code as follows <?php   namespace VendorExtensionPluginModel;   class Config {     public function afterGetAttributeUsedForSortByArray(MagentoCatalogModelConfig $catalogConfig, $options)     {         unset($options[‘price’]);         return $options;… Continue reading How to Remove SORT BY “Price” Option in Magento 2?

Email Template in Magetno for the order id and Item Grid Structure

Here is the Email template for the Order email with the order Id and the orders item grids {{template config_path=”design/email/header_template”}} <table>   <tr class=”email-intro”>     <td>       <p class=”greeting”>{{trans “%customer_name,” customer_name=$order_data.customer_name}}</p>       <p>      {{trans “Thank you for your web order from the SZCO website.Your web order ID is “}}{{var order.increment_id}}.         {{trans “Once your package ships we will send you… Continue reading Email Template in Magetno for the order id and Item Grid Structure

How to restrict access to specific Magento 2 categories based on category name when a user is not logged in?

To restrict access to certain categories in Magento 2 based on category names when the user is not logged in, you can implement an observer that listens to the controller_action_predispatch_catalog_category_view event. Here’s a step-by-step guide to achieve this: Create an Observer Class (RestrictCategoryAccess.php): This observer checks if the accessed category matches a specific name (Hot… Continue reading How to restrict access to specific Magento 2 categories based on category name when a user is not logged in?

Published
Categorized as Magento

How to restrict access to a specific CMS page in Magento 2 based on customer login status?

To restrict access to a specific CMS page in Magento 2 based on whether the customer is logged in or not, you can implement an observer that listens to the controller_action_predispatch_cms_page_view event. Here’s how you can achieve this: Create an Observer Class (RestrictPage.php): This observer checks if the accessed CMS page matches a specific identifier… Continue reading How to restrict access to a specific CMS page in Magento 2 based on customer login status?

Published
Categorized as Magento

How to create an Admin tab in Magento 2 to display customers without website access, and implement it in the admin > customers section?

To create an Admin tab in Magento 2 that displays customers without website access and integrate it into the admin > customers section, you’ll need to follow these steps: Create Block for Grid Display (Grid.php): This block extends MagentoBackendBlockWidgetGridExtended to display a grid of customers who are not approved (based on your custom attribute is_approved).… Continue reading How to create an Admin tab in Magento 2 to display customers without website access, and implement it in the admin > customers section?

Published
Categorized as Magento

How can Magento 2 restrict access to specified categories based on customer login status?

Magento 2 can restrict access to specific categories by leveraging observers and event handling. Here’s how you can achieve this: 1)Create an Observer: Create a custom observer class that implements MagentoFrameworkEventObserverInterface. This observer will listen to the controller_action_predispatch_catalog_category_view event. <?php namespace VendorModuleObserver; use MagentoFrameworkEventObserverInterface; use MagentoFrameworkAppRequestInterface; use MagentoFrameworkAppResponseRedirectInterface; use MagentoCustomerModelSession as CustomerSession; class RestrictCategoryAccess implements… Continue reading How can Magento 2 restrict access to specified categories based on customer login status?

Published
Categorized as Magento

NetSuite to Adobe Commerce Customer/Contact Sync – Sample Code

/**  * @NApiVersion 2.1  * @NScriptType UserEventScript  */ /*******************************************************************************************************  * Corp Design  *  * CDUS-4073 : NetSuite – Adobe Commerce Two Way Customer/Contact Sync  *  * *****************************************************************************************************  *  * Author: Jobin and Jismi IT Services  *  * Date Created : 20-May-2024  *  *Description : This User Event script is developed to sync the customers and… Continue reading NetSuite to Adobe Commerce Customer/Contact Sync – Sample Code

Published
Categorized as Magento

How to zip a folder from terminal

Navigate to the project folder Run the command for zip package installation sudo apt-get install zip To zip folder, run the command zip -r compressed_filename.zip foldername

Published
Categorized as Magento

Depolyment commands in Magento2

The Magento deployment commands are below. php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f

Published
Categorized as Magento