Hello
is there any way I can override the createPriceDiv() function with a plugin or somehow without editing the helper file or should I go with priceDisplay() function and simple html to wrap the price?
I'm trying to this because I would like to add an extra class for prices based on different conditions.
imho last parameter of pricediv is doing this.
Maybe I'm missing something but as I see the last param is forcenolabel, the name is used as class.
public function createPriceDiv($name,$description,$product_price,$priceOnly=false,$switchSequel=false,$quantity = 1.0,$forceNoLabel=false)
Oh and I'm using 2.0.24, sorry if it's implemented in a newer version like 'a', 'b', 'c' than I will update to the latest.
hmm you are right. Seems missing. Lets see what the other templaters say.
I would do the function like this:
This function would output something like this:
<div class="custom-class">
JText....
<span data-price="preSalesWithTax" class="custom-class"> 3,99 Euro </span>
</div>
With the parameter you should be able to define the div class which wraps the whole thing and the class which holds the price int numbers.
The javascript should be changed and select the data field within the tag - not the class name. This way people / templater can assign class names they want and the javascript still works to update prices.
This is 100% flexible and perfect for customization without breaking the javascript price update functionality ;-)