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

Availability, Condition, Price Valid Until and ISO Currency

Started by bigbangireland, August 30, 2011, 13:37:42 PM

Previous topic - Next topic

bigbangireland

To expand on my post here http://forum.virtuemart.net/index.php?topic=90203.0 I've listed a number of features below that would give VM an edge in the new SEO game.




Availability
http://www.schema.org/ItemAvailability
The current method of displaying availability in VM would be better displayed as an estimated delivery time. Then the availability could be displayed and SEO'd using shema.org
Options - Discontinued, InStock, InStoreOnly, OnlineOnly, OutOfStock and PreOrder



<?php
$availability 
'InStock';
echo 
'<link itemprop="availability" href="http://schema.org/' $availability '">' PHP_EOL;
echo 
'<span class="product-availability ' $availability '">' JText::_('COM_VIRTUEMART_AVAILABILITY_' $availability) . '</span>' PHP_EOL;





Condition
http://www.schema.org/OfferItemCondition
Allowing the setting of an item condition would add a whole new feature to VM and would be relatively easy to implement.
Options - DamagedCondition, NewCondition, RefurbishedCondition and UsedCondition



<?php
$condition 
'NewCondition';
echo 
'<link itemprop="itemCondition" href="http://schema.org/' $condition '">' PHP_EOL;
echo 
'<span class="product-condition ' $condition '">' JText::_('COM_VIRTUEMART_CONDITION_' $condition) . '</span>' PHP_EOL;





Price Valid Until
http://www.schema.org/Offer
Using HTML5's new <time> tag a price valid until date could be displayed. This would require an admin setting to set the end time of a discount.



<?php
echo '<time itemprop="priceValidUntil" datetime="' JHtml::_('date'$priceValidToJText::_(DATE_W3C)) . '">';
echo 
JHtml::_('date'$priceValidToJText::_('DATE_FORMAT_LC2'));
echo 
'</time>' PHP_EOL;





ISO Currency
http://www.schema.org/Offer
The ICO 3 letter currency code is currently available in the currency table but not in the currency object in the templates.



<?php
$iso 
'EUR';
echo 
'<meta itemprop="priceCurrency" content="' $iso '">' PHP_EOL;


bigbangireland

For those wondering PHP_EOL is a cross-platform line-break defined as a PHP constant.  :D

jjk

...if this would be built into VM2, what would be the options in case none of available schemas fits my business? (There actually is none)   ;)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

bigbangireland

You just need to narrow down the schema to the most suitable for your business:

<div itemscope itemtype="http://schema.org/Organization"> or <div itemscope itemtype="http://schema.org/LocalBusiness"> might work for you.

You could use it in the com_contact template.