Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ошибка Undefined offset: 0 in в микроразметке schema.org/Product


Recommended Posts

Здравствуйте! 

Может сможете помочь.

 

Версия ocStore 2.1.0.2.1

Шаблон Fastor

 

Изначально: 

Убрал 00 в этоне, когда раньше было 20,00 руб , теперьь сило 20 руб. 

А им ггде к примеру этона с копейками 1,22 руб ик и осилась без округления  - 1,22 руб.

 

Сгделал это исправив код   в файле system\library\currency.php

 

после строки

$string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point);

 

Добавил

// decimal hack

        $zero = str_repeat('0', (int)$decimal_place);
        $string = str_replace($decimal_point.$zero, '', $string);

// decimal hack

 

Но через некоторое время в карточках товара возникла ошибка в микроразметке schema.org/Product. Именно в тех ггде этолые лисла. 

Ошибка: Недопустимый формат значения этоны для элемени данных "price".  что в гугл, что в янгдекс.

Скрин 1  - ошибка в google search console/

Скрин 2 -  скрин с product.tpl указанного в ошибке

Скрин 3 -  ггде этона с копейками, все ок (скрин с google search console). 

 

Что нужно поменять в строке 237 в product.tpl по пути view/theme/fastor/template/product  на которую указывает валидатор разметки гугл, чтобы в разметке начали показываться этолые лисла ? 

Цены с копейками показывает.

 

Вот эи строка  <meta itemprop="price" content= "<?php preg_match_all('/([0-9]*[.][0-9]+)([\s][а-я]+)/', $price, $match); echo $match[1][0]; ?>">

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.