Show Price After Login for Magento2 module allows the store owner to display product price and “Add to cart” button after login. The Product price and “Add to cart” button will not display until the customer does not log in to the Magento2 Store. The admin can select multiple customer groups who can view the price and add to cart button. Show price after login module can further be customized according to product priority also. The Admin can set customized title for “Add to Cart” button & redirecting URL for the users who can’t view the price and Add to Cart button. This is a wonderful stand-alone module for Magento2.
Features of Show Price After Login for Magento2
- The admin can set the Show Price After Login module status as Yes or No.
- The admin can select multiple customer groups who can view the prices and add to cart button from the configuration.
- Show price after login can also be configured according to the product configuration/general configuration.
- The admin can further select multiple customer groups who can view prices of specific products.
- Price and add to cart button will not display until the customer does not log in.
- The customer can’t add the product to cart without login.
- This module also works with tier price.
- This module works with multi-store and multi-website of Magento2.
- The codes are open source so it can be customized easily.
Installation of Show Price After Login for Magento2
Customers will get a zip folder and they have to extract the contents of this zip folder on their system. The extracted folder has an src folder, inside the src folder you have the app folder. You need to transfer this app folder into the Magento2 root directory on the server as shown below.
If you have downloaded the module from Magento Connect then unzip the respective extension zip and create Webkul(vendor) then ShowPriceAfterLogin(module) name folder inside your magento root directory as app/code/Webkul/ShowPriceAfterLogin and then move all module’s files inside /app/code/Webkul/ShowPriceAfterLogin/ folder in magento root directory.
After the upload, you can see the folders in your Magento2 Root Directory.
After the successful installation, you have to run these commands in the Magento2 root directory:
Second Command – php bin/magento setup:di:compile
Third Command – php bin/magento setup:static-content:deploy
Configuration of Multi-Lingual Support
For the multilingual support, the admin will navigate through Store->Configuration->General ->Locale Options and select the locale as German (the language into which admin want to translate his store content).
Magento2 Show Price After Login Language Translation
If a user wants to translate their module from English to German then they need to follow the path app/code/Webkul/ShowPriceAfterLogin/i18n in their unzipped Magento Marketplace folder and will get a CSV file with name “en_US.csv”. Now they will rename that CSV as “de_DE.csv” and translate all right side content after the comma in the German language. After editing the CSV, save it and then upload it to the path app/code/Webkul/ShowPriceAfterLogin/i18n where they have installed Magento2 on their server. The module will get translated in the German Language. It supports both theLTRand RTL languages.
After successfully installing this module, navigate through Stores->Configuration->Show Price After Login.
General Settings: The admin can select customers groups here. Only selected customer groups able to view price after login.
Add to Cart label: In this section, the admin can change the label for “Add to Cart” button and set the URL of the label button.
Configuration Priority: The admin can select either Product Configuration or General Configuration. If Product Configuration selected then the product based configuration will work else general Configuration will work.
If the admin has set the configuration priority as “Product Configuration”, then show price after login feature can further be customized for specific products.
Now to set Show Price After Login for products, navigate through Products->Catalog->Click on Product->Show Price After Login section.
Enabled – Set this option as Yes for showing prices and add to cart button only to selected users of the group.
Allowed Customer Groups – Select the customer group(s) who can view the price and add to cart button of this product.
Add to Cart Label Enable/Disable – Select Yes, if you want to show a customized label button on the product page for users who cannot view the price.
Title – Enter the name of the button label.
Redirect URL – Enter the URL of the redirect page for the button.
Click Save button to save your changes.
Show Price After Login for Magento2 at front-end
Now let us see the workflow of this module on the Product Page, Search Page & Category Page.
At the product page, the customer will not able to see Price and add to cart button. They will see “Please Login To View Price” button like the image below.
Now if a customer who is already Logged In but belongs to a different customer group, a message will be shown instead of price and add to cart button. From the screenshot below you can see that the short message is being displayed on the product page as ” Logged in customer group not allowed to View Price”.
Add to Cart Label and Redirect URL can be used instead of the default message for the users who cannot view the price and add to cart button.
On the Search page, when a customer searches any product and if that customer is not login, then they cannot see product price & Add to Cart button.
After login, the customer can see product price at the search page.
On hovering over the products, the customer can also see “Add To Cart” button on the search page.
When the customer is not login and if they go to the Category Page, then they will not see Product Price & Add To Cart Button.
When a Logged In customer belongs to a different customer group, it will see the following default message instead of price and add to cart button.
From the screenshot below you can see the Add to Cart Label and Redirect URL Link is being used instead of default message.
After login, the customer can see product price at the Category page. On hovering over the products, the customer can also see “Add To Cart” button on the Category page.
That’s all for the Show Price After Login for Magento2 still have any issue feel free to add a ticket and let us know your views to make the module better https://webkul.uvdesk.com/