<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ use MagentoFrameworkPricingAmountAmountFactory; ?> <?php /** @var MagentoCatalogPricingRenderFinalPriceBox $block */ /** ex: MagentoCatalogPricingPriceRegularPrice */ /** @var MagentoFrameworkPricingPricePriceInterface $priceModel */ $priceModel = $block->getPriceType(‘regular_price’); /** ex: MagentoCatalogPricingPriceFinalPrice */ /** @var MagentoFrameworkPricingPricePriceInterface $finalPriceModel */ $finalPriceModel = $block->getPriceType(‘final_price’); $idSuffix = $block->getIdSuffix() ? $block->getIdSuffix()… Continue reading Magento Show only tier prices for Level Customer- No promotional prices
Category: Magento
How can I show product flags in SwissUp ProLabels based on customer groups in Magento?
Log in to your Magento Admin Panel. Navigate to SwissUp > ProLabels. Select the label you want to edit. In the label settings, look for the Customer Groups option. Choose the specific customer groups you want the label to be visible for. Save the changes and clear the cache if necessary.
How can I block access to a specific category in Magento 2 for users who are not logged in or belong to a specific customer group using an observer?
Add an Observer for Category Restriction events.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <event name=”controller_action_predispatch_catalog_category_view”> <observer name=”restrict_category_access_observer” instance=”JJRestrictPageObserverRestrictCategoryAccess”/> </event> </config> Implement the Observer to Block the Category RestrictCategoryAccess.php <?php namespace JJRestrictPageObserver; use MagentoFrameworkEventObserver; use MagentoFrameworkEventObserverInterface;… Continue reading How can I block access to a specific category in Magento 2 for users who are not logged in or belong to a specific customer group using an observer?
How to remove a category from being displayed in Magento 2 for users who are not logged in or belong to a specific customer group using an observer?*
Step 1: Define the Event Observer <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Event/etc/events.xsd”> <event name=”catalog_category_collection_load_after”> <observer name=”restrict_category_observer” instance=”JJRestrictPageObserverRestrictCategory”/> </event> </config> Step 2: Implement the Observer <?php namespace JJRestrictPageObserver; use MagentoFrameworkEventObserver; use MagentoFrameworkEventObserverInterface; use MagentoCustomerModelSession as CustomerSession;… Continue reading How to remove a category from being displayed in Magento 2 for users who are not logged in or belong to a specific customer group using an observer?*
How can I remove a specific navigation link (e.g., ‘Hot Sale’) for guest users and for logged-in users who are not in a specific customer group, by overriding the Swissup NavigationPro template in Magento 2?
Step 1: Create the Override Directory Swissup’s menu.phtml is located at: vendor/swissup/module-navigationpro/view/frontend/templates/menu.phtml To override it in your custom theme (JJ), create the required directory: mkdir -p szco/app/design/frontend/JJ/Swissup_Navigationpro/templates/ Step 2: Copy the menu.phtml File Copy the original menu.phtml from the module to your theme: cp szco/vendor/swissup/module-navigationpro/view/frontend/templates/menu.phtml szco/app/design/frontend/JJ/Swissup_Navigationpro/templates/menu.phtml Step 3: Modify menu.phtml to Remove “Hot Sale” for… Continue reading How can I remove a specific navigation link (e.g., ‘Hot Sale’) for guest users and for logged-in users who are not in a specific customer group, by overriding the Swissup NavigationPro template in Magento 2?
Creating a Magento 2 Order Invoice in NetSuite Connector
You can create an invoice in Magento 2 when a fulfillment syncs from NetSuite Connector. To create an invoice in Magento 2 from NetSuite Connector: Log in to app.farapp.com. Select the Magento 2 connector and the relevant account. Go to Settings > Orders. The Order Settings page opens. Click Advanced Options. Check the Trigger Magento to Create Invoices… Continue reading Creating a Magento 2 Order Invoice in NetSuite Connector
Repost a missed scheduled post using commandline in WordPress
If you have access to the server and WP-CLI: Run the following command to trigger the cron job: bash Copy code wp cron event run –due-now This will execute all missed scheduled posts.
Repost a missed scheduled post manually in WordPress
Method 1: Manually Publishing the Missed Post Log in to the WordPress Admin Panel. Go to Posts > All Posts. Find the missed scheduled post (it will be marked as “Missed Schedule” or in the Scheduled status with a past date). Quick Edit or open the post in the editor. Change the Publish date to… Continue reading Repost a missed scheduled post manually in WordPress
Create a Cart Price Rule programmatically via Magento 2’s REST API
1. API Endpoint Use the following endpoint to create a cart price rule: bash Copy code POST /V1/salesRules 2. Request Payload Here’s an example of the JSON payload to create a cart price rule: json Copy code { “rule”: { “name”: “Buy 3 Get Discount”, “description”: “Discount applied when purchasing 3 specific items”, “is_active”: true,… Continue reading Create a Cart Price Rule programmatically via Magento 2’s REST API
How to set a discount in Magento2
Step 1: Create a New Shopping Cart Price Rule Log in to the Magento 2 Admin Panel. Go to Marketing > Promotions > Cart Price Rules. Click Add New Rule. Step 2: Configure Rule Information Rule Information: Rule Name: Enter a descriptive name (e.g., “Buy 3 Get Discount”). Description: Optionally, describe the rule for internal… Continue reading How to set a discount in Magento2