Overview
- The Letscms PinCodeBasedProductPrice module is an essential tool for Magento 2 merchants who wish to offer dynamic pricing based on customer location. By allowing users to enter their pincode or zipcode, merchants can display specific prices for different regions, effectively tailoring their offerings to meet local market demands. This module is particularly useful for businesses that deal with varied shipping costs, taxes, or localized promotions.
Key Benefits
- The Letscms PinCodeBasedProductPrice module is an essential tool for Magento 2 merchants who wish to offer dynamic pricing based on customer location. By allowing users to enter their pincode or zipcode, merchants can display specific prices for different regions, effectively tailoring their offerings to meet local market demands. This module is particularly useful for businesses that deal with varied shipping costs, taxes, or localized promotions.
Optimized Pricing Strategies:
- Enables businesses to adjust prices according to local demand, competition, and logistical considerations, enhancing profitability.
Improved Customer Experience:
- Customers see accurate pricing that reflects their location, reducing surprises during checkout and increasing satisfaction:
Enhanced Regional Relevance:
- By engaging with local markets effectively, businesses can improve conversion rates and foster customer loyalty.
Target Audience
This module is designed for:
eCommerce Store Owners:
- Who wish to enhance user experience and optimize pricing strategies.
Developers:
- Seeking to integrate flexible pricing solutions into existing Magento setups.
Preparation:
- Before starting the installation, ensure that your Magento environment meets the following prerequisites:
System Requirements:
- PHP Version: 7.4 or higher is recommended.
- Composer: Must be installed for dependency management.
- Database Backup: Backup your database and files to prevent data loss during installation..
Magento 2 module installation. Here's a detailed guide on how to proceed:
Magento 2 module Installation
Step 1:Extract the Zip File:
- Extract the contents of the zip file to a temporary directory on your computer.
Step 2: Copy Files to Magento Root Directory:
- Copy all files and folders from the extracted zip file.
- Paste the copied files into the Upload the extracted files to the app/code/Letscms/PinCodeBasedProductPrice directory in your Magento root.
Step 3: Open Terminal or CMD:
- Change your working directory to the Magento root directory using the following command:
-
you need to run the following commands to install and activate the module:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
Verify Installation:
Troubleshooting:
- Permissions Issue: Ensure the app/code directory and its contents have the correct permissions set for your web server user.
-
Magento Cache: If you encounter issues, try clearing Magento caches and reindexing:
php bin/magento indexer:reindex
php bin/magento cache:clean
Single Product Pricing
To manage pincode-specific pricing for individual products, follow these steps:
Access Product Edit Page:
- Navigate to Catalog > Products in the Magento Admin Panel
- Select the product you wish to edit.
Locate Pincode Pricing Section:
- Scroll down to find the PinCode section within the product settings.
Add Pincode-Based Prices:
- Enter the desired pincode in the designated field.
- Input the corresponding price for that pincode.
- Click the Add button (if applicable) to save this pricing entry.
Repeat for Additional Pincodes:
- If your product needs pricing for multiple pincodes, repeat the entry process for each relevant pincode.
Save Changes:
- After entering all pincode-based prices, click Save to apply the settings to the product.
CSV Import
To efficiently manage pincode pricing for multiple products, use the CSV import feature:
Prepare Your CSV File:
Create a CSV file that includes the following headers
- Product_Id:The Id of the product.
- Pincode:The pincode for which the price applies
- Price:The price for the specified pincode.
Example of CSV Format:
pincode |
product_id |
price |
123456 |
101 |
9999 |
987654 |
102 |
1099 |
Ensure that there are no additional spaces or formatting errors in your CSV file.
Navigate to Import Section:
In the Admin Panel, go to System > Import.
Select Entity Type:
Choose PinCodeProductPrice as the entity type for the import.
Upload Your CSV File
Click the Choose File button and select your prepared CSV file.
After selecting the file, click on Check Data to validate the import
Import Data
If validation is successful, you will see a message indicating that the data is valid.
Click Import to update the pincode-based prices for multiple products simultaneously
Pincode Entry Pop-Up
Upon Store Visit:
- When customers visit your store, a pop-up window prompts them to enter their pincode.
- This pop-up is designed to grab the user's attention and encourage them to provide their location for accurate pricing.
Session Management:
- Once the user enters their pincode and submits it, the value is saved in their session.
- The pop-up will not reappear for the same session, streamlining the user experience
Location Widget:
After entering their pincode, users will see a location widget on the frontend:.
Location Display:
- A widget appears in the top right corner of the page displaying the entered pincode.
- This provides users with a constant reminder of their selected location.
Update Location Feature::
- An Update Location button allows users to change their pincode if needed.
- Clicking this button will reopen the pincode entry pop-up, enabling users to input a new pincode..
Pincode-Based Pricing:
The core feature of the module is the ability to display pincode-specific pricing:
Dynamic Pricing Updates:
- After a user enters their pincode, product prices on each product page automatically update to reflect pincode-based pricing.
- This ensures that customers see accurate pricing based on their location.
Cart and Checkout Integration:
- When users add products to their cart, the displayed prices will remain pincode-based.
- During the checkout process, users can change their shipping address's pincode, which dynamically updates product prices on the payment method screen.
Shipping Address Changes:
- If users modify the shipping address during checkout, the system recalcul
Pincode Validation:
Validating User Input
A critical aspect of enhancing user experience is ensuring that the pincode entered by customers is valid:
Format Check:
- The module validates the format of the entered pincode based on standard practices for the geographical region.
- Users are immediately informed if their input does not conform to expected formats, prompting them to re-enter a valid pincode.
Database Verification:
- If applicable, the module can cross-reference the entered pincode against a predefined list of valid pincodes.
- If the entered pincode does not exist in the database, a notification is shown, advising the user to check their input.
To ensure the pincode entry pop-up aligns with your store's branding, the Pin Code Based Product Price module allows customization of its appearance directly in the Admin Panel.
Admin Configuration Fields
Within Stores > Configuration > PinCodeBasedProductPrice, the following options are available:
- Background Color: Set a color, e.g., #c223c2, to match your store’s theme.
- Text Color: Define a text color, such as #a6d41e, for readability.
- Button Color: Choose button colors like #b988b0 for styling consistency.
- Button Text Color: Use a contrast color, e.g., #ffffff, for button text.
- Background Color Opacity: Set the transparency level, e.g., 100%, for background visibility.
- Border Color: Customize the border to enhance pop-up appearance.
Save and Refresh:
Click Save Config at the top right to save your settings. To apply changes, clear the Magento cache (under System > Cache Management) or refresh the page where the pop-up appears.
To remove the module, run the following commands:
you need to run the following commands to install and activate the module:
php bin/magento module:disable Letscms_PinCodeBasedProductPrice
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush