Donation Product Setup - Combining Customer Enters Price and Attributes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
I have a donation product where I would like to present the customer with a few pre-defined donation amounts ($10, $25, $100) along with an option to enter a different amount.

I've created product attributes that increment the price by $10, $25 and $100. This works perfectly until I also enable the "Customer Enters Price" option on the product variant. Once I enable that option, then the customer can enter their own donation amount, but the the preselected amounts don't carry through to the cart.

Has anyone else setup a donation product that allows for this scenario?

Thanks!

Mike
13 年 前
'Customer enters price' products don't support attributes. You'll need to modify the source code in order to change this behaviour (PriceHelper.GetUnitPrice method)
11 年 前
Hi Andrei,

I'm totally new to nopcommerce (I'm using version 2.6) and I have the same issue as Mike .  

Do you mind providing more insight on how a new product type (e.g. donation) can be created so that modifying the PriceHelper.GetUnitPrice method only affects that "donation" product?

Thanks,
max
11 年 前
any update on this. has anyone built this yet?
11 年 前
jteck wrote:
any update on this. has anyone built this yet?


This is what I did in v2.65.

1. Modified GetUnitPrice (as Andrei Suggested) locate in this file:
Libraries\Nop.Services\Catalog\PriceCalculationService.cs

2. I updated:
finalPrice = shoppingCartItem.CustomerEnteredPrice;

to:
finalPrice = shoppingCartItem.CustomerEnteredPrice + attributesTotalPrice;


Hope this helps.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.