From 5c1f5ac8bffdb233d310422a241c84a8f0c8bf51 Mon Sep 17 00:00:00 2001 From: Lito Date: Mon, 20 Sep 2021 09:33:35 +0200 Subject: [PATCH] Updated MetProduct style --- src/Eusonlito/LaravelMeta/Tags/MetaProduct.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Eusonlito/LaravelMeta/Tags/MetaProduct.php b/src/Eusonlito/LaravelMeta/Tags/MetaProduct.php index f8bb1a0..441acfc 100644 --- a/src/Eusonlito/LaravelMeta/Tags/MetaProduct.php +++ b/src/Eusonlito/LaravelMeta/Tags/MetaProduct.php @@ -12,7 +12,9 @@ public static function tagDefault($key, $values) if (!is_array($values)) { return; } + $html = ''; + foreach($values as $key => $value) { if (in_array($key, self::$available, true)) { $html .= ''; @@ -20,19 +22,20 @@ public static function tagDefault($key, $values) } return $html; - } public static function propertyTag ($key) { $tag = 'product:'; + switch ($key) { + case 'amount': case 'price': $tag .= 'price:amount'; - break; + break; case 'currency': $tag .= 'price:currency'; - break; + break; } return $tag;