Attribute Negative Price Adjustment

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 年 前
I'm not seeing a way to do a negative price adjustment based on the selection of an attribute value. The system does not allow a negative $ amount to be entered into the price adjustment field. Anyone know a way to make negative adjustments?

Thanks,

Darrell
14 年 前
you mean that if choosing.. "black color" the price goes down?

if so.. i supose you could put black color as default and the price for eg would be 10.. but if you choose red color, the price goes up-


it's what you are asking?
14 年 前
Yes, that's what I am asking. But for this particular product, it would not be logical to start with the lowest cost attribute.
13 年 前
I have a client who would also like to be able to do this. Will it affect anything down the line if I modify the validation in the admin site to allow negative values?

Thanks in advance.
13 年 前
Hi,

I've made some changes to the code that seem to be working, however I recommend you do  some further testing with this... However, from what I see, it makes the adjustment all the way to checkout. The only thing I don't like is how it displays the negative adjustment, but that can be easily worked out. Example: Black [-(30.00)] looks a little funny to me... I would change the formatting like [-30.00] if it were me.

Good Luck.

Jose

NopCommerceStore\Administration\Modules\ProductVariantAttributeValues.ascx

Line 60... Change to:
MinimumValue="-999999" MaximumValue="999999" ValidationGroup="ProductVariantAttributeValue"

Line 70... Change to:
MinimumValue="-999999" MaximumValue="999999" ValidationGroup="ProductVariantAttributeValue"

Line 180... Change to:
MinimumValue="-999999" MaximumValue="999999" RangeErrorMessage="<% $NopResources:Admin.ProductVariantAttributeValues.New.PriceAdjustment.RangeErrorMessage %>"

Line 194... Change to:
MinimumValue="-999999" MaximumValue="999999" RangeErrorMessage="<% $NopResources:Admin.ProductVariantAttributeValues.New.WeightAdjustment.RangeErrorMessage %>"

Libraries\Nop.BusinessLogic\Tax\TaxManager.cs

Line 478... Change to this to comment the line out:
//price = decimal.Zero;

NopCommerceStore\Modules\ProductAttributes.ascx.cs

Line 139... Add another If statement to handle negative numbers...

                                          
if (priceAdjustmentBase > decimal.Zero)
   {
           pvaValueName += string.Format(" [+{0}]", PriceHelper.FormatPrice(priceAdjustment, false, false));
    }
                                            
//PCTech Mod (This is the if statement I added to handle negative numbers)
if (priceAdjustmentBase < decimal.Zero)
   {
           pvaValueName += string.Format(" [-{0}]", PriceHelper.FormatPrice(priceAdjustment, false, false));
   }
13 年 前
Hi, I have looking for something like this in order to create a way for first installment. so have anyone have this code implemented already in there site without  error on the check out?
13 年 前
Thanks you PCTech.. I try it and it work like a charm! :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.