News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Product's price & details and RDF-Microdata implementation: feature request

Started by SteP[IT], March 03, 2015, 08:32:10 AM

Previous topic - Next topic

SteP[IT]

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
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

AH

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
Regards
A

Joomla 4.4.5
php 8.1

SteP[IT]

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....
J 3.9.2 - VM 3.4.3

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

AH

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
Regards
A

Joomla 4.4.5
php 8.1