Skip to content

Commit

Permalink
Fix broken "}" tag
Browse files Browse the repository at this point in the history
Update review value
  • Loading branch information
imsamthomas committed Aug 9, 2016
1 parent 8c02f90 commit 3d34309
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 73 deletions.
48 changes: 24 additions & 24 deletions view/frontend/templates/page/head/opengraph/product.phtml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<!--Open Graph Protocol for Facebook by Mageplaza SEO-->
<?php if($block->getRegistry('current_product')): ?>
<?php $product = $block->getRegistry('current_product'); ?>
<meta property="og:title" content="<?php echo ($product->getName()); ?>" />
<meta property="og:type" content="product" />
<!-- <meta property="og:image" content="--><?php //echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?><!--" />-->
<meta property="og:url" content="<?php echo $block->getRegistry('product')->getProductUrl(); ?>" />
<meta property="og:description" content="<?php echo trim(strip_tags($product->getShortDescription())); ?>" />
<meta property="og:site_name" content="<?php echo $block->getBusinessName(); ?>" />
<meta property="product:price:amount" content="<?php echo $product->getPrice(); ?>" />
<meta property="product:price:currency" content="<?php echo $block->getCurrency(); ?>" />
<meta property="product:availability" content="<?php echo $product->isAvailable() ? $this->__('In stock'): $this->__('Out of stock'); ?>" />
<meta property="product:retailer_item_id" content="<?php echo $product->getSku() ?>" />
<?php if($product->getSpecialPrice() AND $product->getPrice() != $product->getSpecialPrice()):?>
<meta property="product:sale_price:amount" content="<?php echo $product->getSpecialPrice();?> " />
<meta property="product:sale_price:currency" content="<?php //echo $currency;?>" />
<meta property="product:sale_price_dates:start" content="<?php echo $product->getSpecialFromDate();?>" />
<meta property="product:sale_price_dates:end" content="<?php echo $product->getSpecialToDate();?>" />
<?php endif;?>
<?php if ($block->getRegistry('current_product')): ?>
<?php $product = $block->getRegistry('current_product'); ?>
<meta property="og:title" content="<?php echo($product->getName()); ?>"/>
<meta property="og:type" content="product"/>
<!-- <meta property="og:image" content="--><?php //echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?><!--" />-->
<meta property="og:url" content="<?php echo $block->getRegistry('product')->getProductUrl(); ?>"/>
<meta property="og:description" content="<?php echo trim(strip_tags($product->getShortDescription())); ?>"/>
<meta property="og:site_name" content="<?php echo $block->getBusinessName(); ?>"/>
<meta property="product:price:amount" content="<?php echo $product->getPrice(); ?>"/>
<meta property="product:price:currency" content="<?php echo $block->getCurrency(); ?>"/>
<meta property="product:availability" content="<?php echo $product->isAvailable() ? $this->__('In stock') : $this->__('Out of stock'); ?>"/>
<meta property="product:retailer_item_id" content="<?php echo $product->getSku() ?>"/>
<?php if ($product->getSpecialPrice() AND $product->getPrice() != $product->getSpecialPrice()): ?>
<meta property="product:sale_price:amount" content="<?php echo $product->getSpecialPrice(); ?> "/>
<meta property="product:sale_price:currency" content="<?php //echo $currency;?>"/>
<meta property="product:sale_price_dates:start" content="<?php echo $product->getSpecialFromDate(); ?>"/>
<meta property="product:sale_price_dates:end" content="<?php echo $product->getSpecialToDate(); ?>"/>
<?php endif; ?>

<!-- Twitter Card By Mageplaza SEO-->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="<?php echo $block->getTwitterAccount(); ?>" />
<meta name="twitter:title" content="<?php echo $product->getName() ?>" />
<meta name="twitter:description" content="<?php echo trim(strip_tags($product->getShortDescription())); ?>" />
<!-- <meta name="twitter:image" content="--><?php //echo $block->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?><!--" />-->
<!-- Twitter Card By Mageplaza SEO-->
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="<?php echo $block->getTwitterAccount(); ?>"/>
<meta name="twitter:title" content="<?php echo $product->getName() ?>"/>
<meta name="twitter:description" content="<?php echo trim(strip_tags($product->getShortDescription())); ?>"/>
<!-- <meta name="twitter:image" content="--><?php //echo $block->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?><!--" />-->

<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@id": "<?php echo $_crumbInfo['link']; ?>",
"name": "<?php echo $_crumbInfo['label']; ?>"
}
<?php (!$_crumbInfo['last'])?> ,
<?php if(!$_crumbInfo['last']) echo ',';?>
<?php endforeach; ?>
}]

Expand Down
43 changes: 23 additions & 20 deletions view/frontend/templates/richsnippets/jsonld/product.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,46 @@
*/
?>

<?php if($block->getProduct()): ?>
<?php $product = $block->getProduct(); ?>
<!-- Product Rich Snippets by Mageplaza SEO-->
<script type="application/ld+json">
<?php if ($block->getProduct()): ?>
<?php $product = $block->getProduct(); ?>
<!-- Product Rich Snippets by Mageplaza SEO-->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"name": "<?php echo $product->getName();?>",
<!-- "image": "--><?php //echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?><!--",-->
"name": "<?php echo $product->getName(); ?>",
"description": "<?php echo trim(strip_tags($product->getShortDescription())); ?>",
<?php if($product->getMpn()):?>
"mpn": "<?php echo $product->getMpn();?>",
<?php if ($product->getMpn()): ?>
"mpn": "<?php echo $product->getMpn(); ?>",
<?php endif; ?>
"sku": "<?php echo $product->getSku();?>",
"url": "<?php echo $product->getProductUrl();?>",
"sku": "<?php echo $product->getSku(); ?>",
"url": "<?php echo $product->getProductUrl(); ?>"
<?php /*
TO-DO: Allow select brand attribute in configuration > Get attribute label
"brand": {
"@type": "Thing",
"name": "ACME"
},
*/?>
*/ ?>

<?php if($block->getReviewCount()):?>
<?php if ($block->getReviewCount()): ?>
,
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "<?php echo $block->getRatingSummary();?>",
"reviewCount": "<?php echo $block->getReviewCount();?>"
},
<?php endif;?>
"bestRating": 100,
"worstRating": 0,
"ratingValue": "<?php echo $block->getRatingSummary(); ?>",
"reviewCount": "<?php echo $block->getReviewCount(); ?>"
}
<?php endif; ?>

<?php if($product->getSpecialPrice() AND $product->getPrice() != $product->getSpecialPrice()):?>
<?php if ($product->getSpecialPrice() AND $product->getPrice() != $product->getSpecialPrice()): ?>
,
"offers": {
"@type": "Offer",
"priceCurrency": "<?php echo $block->getCurrency();?>",
"price": "<?php echo $product->getSpecialPrice();?>",
"priceValidUntil": "<?php echo $product->getSpecialToDate();?>",
"priceCurrency": "<?php echo $block->getCurrency(); ?>",
"price": "<?php echo $product->getSpecialPrice(); ?>",
"priceValidUntil": "<?php echo $product->getSpecialToDate(); ?>",
"availability": "http://schema.org/InStock",
<?php endif; ?>
}
Expand Down
28 changes: 0 additions & 28 deletions view/frontend/templates/richsnippets/microdata/product.phtml

This file was deleted.

0 comments on commit 3d34309

Please sign in to comment.