change Product Prices in the Catalog view based on location/zip code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 anno tempo fa
Hi,

can someone share ideas about this case. I've modified nopcommerce and added a new widget/partial view to the catalog view.  Basically, when user presses on a category (on top of the site) I display my custom view asking user about zip code and this is a mandatory input before any products can be shown.  User enters a value and presses a button and then I load available products for this zip code and prices should be adjusted as well.  

The problem I have, I don't understand how can I pass the user entered zip code on the catalog view to my custom PriceCalculationService in order to adjust the price.  I cannot save this zip code in the user profile. Because user should be able to enter any zip code he wants in the product catalog and refresh products to see what's available in the area.

Thank you in advance!
1 anno tempo fa
You can override the action method for that controller to pass extra datas/query parameters then use that query parameter ex: ZipCode to the model factory then filter products according to the zip code then use your custom price calculation service during the model prepares.
1 anno tempo fa
I have few questions based on your requirement,
1. Can a customer provide different different zip code on different different category? Or it is applicable for whole site?
2. How are you keeping pricing per zip code?
3. If a customer add same product on cart using different zip code, how do you want to handle the situation?

Ideal situation based suggestion,
Assuming: Customer will provide only one zipcode while visiting the site, there will be an option to change the zip code, if they change zipcode, you may show a warning that, your price might get changed. In this way you may keep zipcode as an customer attribute. And the complexity will be less.
Now coming into price calculation, if you maintain per product per zip code pricing and then override the price calculation service and retrieve current customer zipcode on that service then you can easily retrieve price for that product for that customer provided zipcode.

But if you need to keep zipcode on category level not for whole site, you have to think in different way.
1 anno tempo fa
"1. Can a customer provide different different zip code on different different category? Or it is applicable for whole site?"
yes, customers even can change the zip code on fly after checking the products list available for the zip code. It's not for a site it's for a current catalog "search". It's like services available for a specific zip codes for specific adjusted prices.
Example:
1. you pick a category: "Repairs".
2. Category opens up: and you asked to provide a zip code and press search.
3. only products available for this zip code and only from vendors available in this area are displayed and prices adjusted for the zip code
4. user can add it to the cart OR change the zip code and press search again.

"2. How are you keeping pricing per zip code?"
it's a table, it's a combination of vendor + zip code = adjusted price for an area.

"3. If a customer add same product on cart using different zip code, how do you want to handle the situation?"
technically it's a two different products with two different prices.
1 anno tempo fa
a comment for
""If a customer add same product on cart using different zip code, how do you want to handle the situation?"
it's not really different products. it's the same service but with different price that depends on the user input
1 anno tempo fa
What is your ProductCategory map structure?
nopCommerce allow a product might have multiple category. Is it same in your side?
If yes, then i must say, i can't give you a solution in this approach.

if you can say that, your product will have only one category mapped to it.
Then, there is a possible solution but not standard solution,
You can keep a table like CustomerId,CategoryId,ZipCode
then you may use this table on product calculation service.

I would love to you give you another suggestions. Not sure if it suits your business requirement or not.
Create a group product with name "Repairs"
Now, for every vendor create child product where they will name the product by zipcode and provide specific price (default nop). Then map those child products to that group product.
Now, modify group product details page, and provide list and search functionality on all child products. It will make your job easy and no need of price calculation override will be needed.

We have experience of developing similar, feel free to reach us if you need more help.
1 anno tempo fa
relusion wrote:
... how can I pass the user entered zip code on the catalog view to my custom PriceCalculationService in order to adjust the price.  ...


Generic Attributes.  
Example:
KeyGroup: Customer
Key: CategoryZipCodes
Value:  ...JSON string...  (e.g a List of your "tracking" class - e.g. Category, Zip.  Then you can Serialize/Deserialize it)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.