Developer forum

Forum » Ecommerce - Standard features » DBPrice Price tag extensions

DBPrice Price tag extensions

Adrian Ursu
Reply

Hi Guys,

I am trying to display the regular ListPrice/Onlineprice information for products in list andf detail page.

However, it looks like the price extension methods are not working for DBPrice.

I have tried GetValue("EcomProducts.DBPrice") and returns the value stored but since the value stored is without VAT and I want the value with VAT, I have tried GetValue("EcomProducts.DBPrice.PriceWithVAT") and also GetValue("EcomProducts.DBPrice.Price.PriceWithVAT"). None of those have returned anything else than a zero.

I am using 8.8.0.6

Thanks,

Adrian

 


Replies

 
Nicolai Høeg Pedersen
Reply

That tag is to display the data as is from the database - not going through the price extensions on purpose. It is not using currencies, conversions, taxes, vat, roundings or anything else. That is the entire idea of the tag.

One of the other price tags should have what you want.

BR Nicolai

 
Adrian Ursu
Reply

Hi Nicolai,

It makes sense. I see that DB Price is Double while the others are strings.

Nevertheless, I could not find a tag (using TemplateTags) to display what I am looking for.

I am using a ProductField based SalesDiscount to display the value from a field as the OnlinePrice.

Under these circumstances, I need to access somehow the original price.

What would be the proper tag for that, asuming that I might need to use the price extensions.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

I do not understand... Can I see a dump or something?

 
Adrian Ursu
Reply

http://screencast.com/t/r9qqVcTIs

 

I have a CustomField called OnlinePrice. I set a SalesDiscount of type ProductField and I select OnlinePrice as the source for the selling price.

On the page, I need to display the old price (ProductPrice) and the new price (OnlinePrice).

Because of the salesdiscount, the regular PriceTag returns the value from OnlinePrice (which is pretty ok) but I have no way of accessing the old value that is stored in ProductPrice field.

I hope this makes sense.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

My best idea is to add the ProductPrice to a custom field also and display the info from there...

 
Adrian Ursu
Reply

No way. Too many complications.

So far we have used the DBPrice tag but in this case we have a mixt scenario B2B/B2C and we store the price without VAT and we have to display the old price with VAT.

I have found a workaround by using the VAT percentage and calculate the old price based on the value returned by DBPrice.

It's not pretty, but it does the job.

You might want to consider having a dedicated tag for this scenario since this is not an unusual scenario. Any additional processing in a productList, will add problems to performance.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Well, if you are the first one in 10 years, it is a little unusual :-).

You might also be able to use the price matrix. It has something called "Info" that are prices that is just used for stuff like this.

 

You must be logged in to post in the forum