VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: SteP[IT] on March 03, 2015, 08:32:10 AM

Title: Product's price & details and RDF-Microdata implementation: feature request
Post by: SteP[IT] on March 03, 2015, 08:32:10 AM
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
Title: Re: Product's price & details and RDF-Microdata implementation: feature request
Post by: AH on March 03, 2015, 09:38:43 AM
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.php

Consider 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
Title: Re: Product's price & details and RDF-Microdata implementation: feature request
Post by: SteP[IT] on March 03, 2015, 09:52:46 AM
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....
Title: Re: Product's price & details and RDF-Microdata implementation: feature request
Post by: AH on March 03, 2015, 10:31:38 AM
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