News:

Support the VirtueMart project and become a member

Main Menu

createPriceDiv other methods?

Started by rayge, March 01, 2012, 19:10:06 PM

Previous topic - Next topic

rayge

Im trying to see if i can grab the numerical price without any styling or currency symbol so that i can USE it in an IF statement to see if a product that is normally X price is on sale at Y price. Although i could strip out the HTML and the $, this is FAR from a proper situation in order to do evaluations on.

on a side note Although the idea of using createPriceDiv is a nice idea i would recommend using something liek this:

A function to display the selected currency symbol whether by default in the cart config.
A function to display the prices without any divs or currency symbols.
this will allow us to easily handle coding to do what is needed on the front end for display possibilities as well as validating certian related criteria.

The only issue with this is  if there is a function to allow the user to change to his/her currency that might be different from the cart default we then just make sure it is in a session / cookie and validate it.

Hope this makes sense and someone can chime in on this.

THANKS

UPDATE:
I found this $this->currency->getSymbol(); for the symbol atleast but it doesnt solve the issue with getting jsut the number by itself.

$product->prices is an array set. but it doesnt seem to handle Discount Type like it shows in the admin for final price. if you put in Discounted Price you will see that number in the array set though. so this could still be an issue for anyone using the Discount Type Rules.

If anyone has anything to add to this please do so!

I Use: Joomla 3.4.1 & VM 3.0.9

Milbo

you should use vmdebug('my data',$this) in the product edit view. I think you miss some data, which is already there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/