<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Microdata for products</title>
</head>
<body>
<?php
require_once("MicrodataGenerator.php");
$book = new Microdata\Book();
$book->setName("example name");
$book->setUrl("principeorazio.wordpress.com");
$book->setDescription("short description for the product");
$book->setAuthor("Principe Orazio");
$book->setPublisher("Princex Books Edition");
$book->setDatePublished("2014-02-02", "02/02/2014");
$book->setEdition("2014 Edition");
$book->setISBN("1234567890123");
$book->setAvailableEbook(true);
$book->setAvailableHardcover(true);
$book->setAvailablePaperback(true);
$book->setRatingValue(4);
$book->setReviewsCount(8);
$book->setPrice("100 €");
$book->setCondition(\Microdata\iMicrodata::CONDITION_NEW, "new");
echo $book->getCompleteCode();
?>
<hr />
Example using single terms
<?=$book->openSchemaCode()?>
<?=$book->getUrlCode()?>
<?=$book->getDescriptionCode()?>
<?=$book->getAuthorCode("Written by: ")?>
<?=$book->getPublisherCode("Published by: ")?>
<?=$book->getDatePublishedCode("Published by:")?>
<?=$book->getEditionCode()?>
<?=$book->getISBNCode()?>
<div>
Available in:
<div><?=($book->getAvailableEbookCode("Ebook"))?></div>
<div><?=($book->getAvailablePaperbackCode("Paperback"))?></div>
<div><?=($book->getAvailableHardcoverCode("Hardcover"))?></div>
</div>
<?=$book->closeSchemaCode()?>
</body>
</html>
|