How to remove the [+ £] price adjustment text from the drop down list

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Can anyone point me in the right direction as where i can remove the [+£2.00] text that appears in a drop down list when a price adjustment is added.

This seems to be confusing my users, what i would like to do is add the total cost in the text i apply for the attribute,

i.e.

Standard price of a 19mm width product is £6.50

with a price adjustment of 0.50p for 25mm

would be entered in the drop down list as

25mm £7.00

this is less confusing for users than [+0.50p]

I can see that the presentation of this is being renderd by the product variants in grid user control but cant work out where i can edit it to not display this, obviously i still want it to add the adjustment to the price but not display it in the text box.

Any advice on this would be greatly appreciated?

Many thanks

Liam
13 лет назад
The file you are looking for is /modules/ProductAttributes.ascx.cs.

Based on v1.8 (it is similar in other versions) on or around line 137 you will see a line like this:

{
            pvaValueName += string.Format(" [+{0}]", PriceHelper.FormatPrice(priceAdjustment, false, false));
          }


You can change it to this and it will do what you are asking for.

{
             pvaValueName += string.Format(" {0}", PriceHelper.FormatPrice(priceAdjustmentBase + priceAdjustment, false, false));
         }


A couple of notes:

1. This file uses case switches.  Line 147 is for the dropdownlist control.  You will need to duplicate this method for each of the controls (cases) you want this behavior to exhibit.

2. I checked to make sure that the totals added to cart are correct after changing this.  They appear to be.

3.  Finally, the cart will list the products by base price and then add in the attribute value so you may want to think about changing that to match the behavior on the product description page.

Hope this helps.

t
13 лет назад
Hi Trevor

Thanks for the reply thats great, im assuming the code will have to be recomplied for the changes to take place, i will therefore try it later this evening and post the outcome, once again many thanks for taking the time out to help it is much appreciated.

Regards

Liam
13 лет назад
Hi Liam,

Yes you would need to recompile the code (although not always but that is another topic).

Hope it works.

t
13 лет назад
Hi Again Joe

Ive tested this and seem to be getting strange results,

For example

For a product with a base cost of £6.50, the following values are being rendered

Price adjustments of

£0.50 are being shown as £1.00 instead of £7.00 in the drop down list
£2.50 are being shown as £5.00 instead of £9.00
£3.50 are being shown as £7.00 instead of £10.00
£6.00 is being shown as £12.00 instead of £12.50
£18.50 is being shown as £37.00 instead of £25.00
£38.50 is being shown as £77.00 instead of £45.00

however when the items are added to the cart the correct values are showing i.e for item 2 above,

£6.50 + (2.50) = £9.00 is displayed in the cart

This is the line of code i used


pvaValueName += string.Format(" {0}", PriceHelper.FormatPrice(priceAdjustmentBase + priceAdjustment, false, false));


Do you have any ideas on why this is happening?

Many thanks

Liam
13 лет назад
After further testing it seems that the

variable priceAdjustmentBase is the same value as the priceAdjustment hence it doubling all the values instead of adding the adjustment to the base cost of teh product.

i understand that the variable needs to be the base cost of the product just not sure what variable thats stored in.
13 лет назад
I am not sure what your code looks like but in testing I had a product with a base price of $25 and a attribute adjustment of $10.  This made the adjustment price dispaly $35 which I believe is what you wanted.

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