For some (odd or not) reasons I'm in the needing of applying Microdata-RDF markups to VM3 product view. But the way the product data are now constructed makes difficult to do it without modifing core components.
At first, the prices: they are now pre-formatted by core functions, and it's impossible to override them without modifying core functions itselves.
Then customfields: in the same way, they are built by adding div/tags at the core-level, making impossible to modify the field tags without rewriting core components again.
My suggestion/request is to find a better way to divide field extraction and their formatting operation, splitting them in a way that makes possibile to rewrite them by overriding in the same way the template override works.
Waiting for you kindly reply/thought.
All the best
Regards
QuoteAt first, the prices: they are now pre-formatted by core functions, and it's impossible to override them without modifying core functions itselves.
Incorrect - price without formatting is easily achieved:
<?php echo round($product->prices['salesPrice'],2); ?>
QuoteMy suggestion/request is to find a better way to divide field extraction and their formatting operation, splitting them in a way that makes possibile to rewrite them by overriding in the same way the template override works.
Waiting for you kindly reply/thought.
You can modify how a customfield is displayed. using:-
components/com_virtuemart/sublayouts/customfields.phpConsider how you could use this as a starting point to create you own layout for a specific customfield data as rich snippet
Then include your code in a new product override
Thanks for the hint, I was not completely aware of that...
Can this also be applied to all price-related fields? i.e. total applied discount, final discounted price, etc.?
But it still remains "open" the customfields related question: right now it's not possibile to pre-prend/post-pend tags to field values, and also parsing them by content modification plugin....
QuoteCan this also be applied to all price-related fields? i.e. total applied discount, final discounted price, etc.?
yes this can be applied to all price elements
QuoteBut it still remains "open" the customfields related question: right now it's not possibile to pre-prend/post-pend tags to field values, and also parsing them by content modification plugin....
if you use an IDE e.g. phpstorm
You can set breakpoints to debug the code and view the variable data available - from that you will see what can be utilised - it is pretty straightforward