[Skip to main content](#vessel-content)

#   News function Microdata with your hikashop

##

- **[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")**
- [![lxwfr's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32293.png)](/forum/user/32293-lxwfr "View lxwfr's Profile") Topic Author
- [ Offline](/forum/user/32293-lxwfr)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
- [](https://www.alexonbalangue.me)
-

11 years 5 months ago [\#200905](#200905) by [lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")  *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#200905 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")* was created by *[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")*

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : 5.5.x
-- Error-message(debug-mod must be tuned on) -- : not a problem

Hello,
Can you add microdata with your component available on [ ](https://docs.joomla.org/Microdata)[ docs.joomla.org/Microdata](https://docs.joomla.org/Microdata)

it easy to but for news version from your component i always change that..

Thank regards

---

-- Website: [ www.alexonbalangue.me](http://www.alexonbalangue.me), [ www.livingxworld.com](http://www.livingxworld.com)
-- HikaShop version -- : Free latest
-- Joomla version -- : 3.5.X
-- PHP version -- : 7.0.4

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 5 months ago [\#200926](#200926) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#200926 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")*

Hi,

Microdatas are present in HikaShop thanks to the plugin "system / hikashopproducttag".
It add the itemprop/itemscope and itemtype attributes on the products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")**
- [![lxwfr's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32293.png)](/forum/user/32293-lxwfr "View lxwfr's Profile") Topic Author
- [ Offline](/forum/user/32293-lxwfr)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
- [](https://www.alexonbalangue.me)
-

11 years 5 months ago [\#201019](#201019) by [lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")  Replied by *[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")* on topic *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#201019 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")*

i saw and activate this plg purge all cache/logs, i see the sources code on front-end not show.
i see too the source code the plg have dooble defined. line 9 to line 11.
But only for product pages this plg..

[ ![Capture2.jpg](/forum/attachment/24271) ](/forum/attachment/24271 "Capture2.jpg")

Why not edit from this folder
&gt; /www/components/com_hikashop/views/****
&gt; /www/components/com_hikashop/views/product/tmpl/default.php

For simplie without preg_replace use directly with this libreary of joomla.in your component.

thanks again

---

-- Website: [ www.alexonbalangue.me](http://www.alexonbalangue.me), [ www.livingxworld.com](http://www.livingxworld.com)
-- HikaShop version -- : Free latest
-- Joomla version -- : 3.5.X
-- PHP version -- : 7.0.4

- [ ![Capture2.jpg](/forum/attachment/24271) ](/forum/attachment/24271 "Capture2.jpg") [ ](/forum/attachment/24271?download=1 "Capture2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14269
-
-

11 years 5 months ago [\#201026](#201026) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#201026 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")*

Hi,

We don't add the microdata directly in the view so that it will work even with template overrides of the product page.

If you don't see the microdata with the latest version, it might be because of a bug that we already fixed in the plugin.
Download again the install package of HikaShop and install it again on your website and it will add the patch to the plugin.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")**
- [![lxwfr's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32293.png)](/forum/user/32293-lxwfr "View lxwfr's Profile") Topic Author
- [ Offline](/forum/user/32293-lxwfr)

Less More

- Posts: 13
- Thank you received: 0
-
-
-
- [](https://www.alexonbalangue.me)
-

11 years 5 months ago [\#201115](#201115) by [lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")  Replied by *[lxwfr](/forum/user/32293-lxwfr "View lxwfr's Profile")* on topic *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#201115 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")*

only product pages not categories or/and other pages too its work well but have a error
see

[ ![Capture1.jpg](/forum/attachment/24292) ](/forum/attachment/24292 "Capture1.jpg")

- dooble ID + end code "&gt;" have dooble quote ' " "

or i make it contribution for microdata than use plugin or so...

---

-- Website: [ www.alexonbalangue.me](http://www.alexonbalangue.me), [ www.livingxworld.com](http://www.livingxworld.com)
-- HikaShop version -- : Free latest
-- Joomla version -- : 3.5.X
-- PHP version -- : 7.0.4

- [ ![Capture1.jpg](/forum/attachment/24292) ](/forum/attachment/24292 "Capture1.jpg") [ ](/forum/attachment/24292?download=1 "Capture1.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 5 months ago [\#201133](#201133) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[News function Microdata with your hikashop](/forum/33-customers/876812-news-function-microdata-with-your-hikashop#201133 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : 5.5.x -- Error-message(debug-mod must be tuned on) -- : not a problem  Hello, Can you add microdata with your component available on  it easy to but for news version from your component i always change that..  Thank regards")*

Hi,

Please use that code, or check if the code you currently have is the same. Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt; &lt;?php class plgSystemHikashopproducttag extends JPlugin { function onHikashopBeforeDisplayView(&amp;$view){ $option = JRequest::getString('option'); $ctrl = JRequest::getString('ctrl'); $task = JRequest::getString('task'); if ($option!='com_hikashop'&#124;&#124;$ctrl!='product'&#124;&#124;$task!='show') return; ob_start(); } function onHikashopAfterDisplayView(&amp;$view){ $option = JRequest::getString('option'); $ctrl = JRequest::getString('ctrl'); $task = JRequest::getString('task'); if ($option!='com_hikashop'&#124;&#124;$ctrl!='product'&#124;&#124;$task!='show') return; $config =&amp; hikashop_config(); $default_params = $config-&gt;get('default_params'); $product_page = ob_get_clean(); $product_page_parts = explode('class="hikashop_product_page ', $product_page); if(!empty($product_page_parts[1])){ $product_page_parts[1] = 'itemscope itemtype="http://schema.org/Product" class="hikashop_product_page ' .$product_page_parts[1]; //name $pattern='/id="hikashop_product_name_main"/'; $replacement='id="hikashop_product_name_main" itemprop="name"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //price if($default_params['show_price'] == 1){ $currency_id = hikashop_getCurrency(); $null = null; $currencyClass = hikashop_get('class.currency'); $currencies = $currencyClass-&gt;getCurrencies($currency_id,$null); $data=$currencies[$currency_id]; //DIV offer $pattern='/&lt;span id="hikashop_product_price_main" class="hikashop_product_price_main"&gt;/'; $replacement= '&lt;div itemprop="offers" itemscope itemtype="http://schema.org/Offer"&gt;&lt;span id="hikashop_product_price_main" class="hikashop_product_price_main"&gt;&lt;meta itemprop="priceCurrency" content="'.$data-&gt;currency_code.'" /&gt;'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //EO DIV offer $pattern='/&lt;(span&#124;div) id="(hikashop_product_weight_main&#124;hikashop_product_width_main&#124;hikashop_product_length_main&#124;hikashop_product_height_main&#124;hikashop_product_characteristics&#124;hikashop_product_options&#124;hikashop_product_custom_item_info&#124;hikashop_product_price_with_options_main&#124;hikashop_product_quantity_main)"/'; $replacement='&lt;/div&gt; &lt;$1 id="$2"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //itemprop $pattern='/class="hikashop_product_price_main"(.*)class="hikashop_product_price hikashop_product_price_0/msU'; $replacement='class="hikashop_product_price_main" $1 itemprop="price" class="hikashop_product_price hikashop_product_price_0'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); } //vote == review $pattern='/id="hikashop_product_vote_listing"/'; $replacement='id="hikashop_product_vote_listing" itemscope itemtype="http://schema.org/Review"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); if(strpos($product_page_parts[1],'class="hika_comment_listing_empty"')==false){ $pattern='/class="ui-corner-all hika_comment_listing"/'; $replacement='class="ui-corner-all hika_comment_listing" itemprop="review" itemscope itemtype="http://schema.org/Review"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); } // Comment $pattern='/class="hikashop_vote_listing_comment"/'; $replacement='class="hikashop_vote_listing_comment" itemprop="description"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); $pattern='/class="hika_comment_listing_content"/'; $replacement='class="hika_comment_listing_content" itemprop="description"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); //Comment - Author $pattern='/class="hikashop_vote_listing_username"/'; $replacement='class="hikashop_vote_listing_username" itemprop="author"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); $pattern='/class="hika_vote_listing_username"/'; $replacement='class="hika_vote_listing_username" itemprop="author"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); //Product description $pattern='/class="hikashop_product_description_main"/'; $replacement='class="hikashop_product_description_main" itemprop="description"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //Product rate $pattern='/class="hikashop_vote_stars"/'; $replacement='class="hikashop_vote_stars" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //Product image $pattern='/id="hikashop_main_image"/'; $replacement='id="hikashop_main_image" itemprop="image"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1]); //$ratevalue=JRequest::getVar("nb_star"); $ratemax=JRequest::getVar("nb_max_star");//nbmax $raterounded=JRequest::getVar("rate_rounded");//moy $pattern='/(&lt;span\s+class="hikashop_total_vote")/iUs'; $replacement = '&lt;span style="display:none" itemprop="ratingValue"&gt;'.$raterounded.'&lt;/span&gt;&lt;span style="display:none" itemprop="bestRating"&gt;'.$ratemax.'&lt;/span&gt;$1 itemprop="reviewCount"'; $product_page_parts[1] = preg_replace($pattern,$replacement,$product_page_parts[1],1); //new dbug($product_page_parts[1]); } foreach($product_page_parts as $parts){ echo $parts; } } }

I don't see errors in that code, and I was not able to reproduce the issue on my local.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84NzY4MTItbmV3cy1mdW5jdGlvbi1taWNyb2RhdGEtd2l0aC15b3VyLWhpa2FzaG9wP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.253 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
