Jak wyświetlić recenzje produktów OpenCart w wyszukiwarkach?

W OpenCart recenzje produktów nie są widoczne dla Google, ponieważ są ładowane za pomocą kodu Jquery. To nie jest dobre z punktu widzenia SEO, ponieważ recenzje produktów mogą pomóc kupcom

W Opencart,

Ten problem można naprawić na trzy następujące sposoby 3:

Metoda #1?You can use our Przejrzyj Incentive wtyczka, która nie tylko wyświetla oceny produktów w wynikach wyszukiwania Google, ale także wprowadza wymagane zmiany na stronie produktu OpenCart, dzięki czemu Google może zobaczyć wszystkie recenzje produktów i może je zaindeksować.

Metoda #2 Możesz wprowadzić wszystkie wymagane zmiany przez

  • Edytuj plik "/catalog/view/theme/your_theme/template/product/product.tpl"
  • Zastąp następujący kod

<div id = "review"> </ div>

z

<div id = "review"> <? php echo $ allreviews;?> </ div>

W tym samym pliku musisz również zastąpić

$ ('# review'). load ('index.php? route = product / product / review & product_id = <? php echo $ product_id;?>');

z

//$('#review').load('index.php?route=product/product/review&product_id=<?php echo $ product_id;?> ');

  • Teraz edytuj plik "catalog / controller / product / product.php"
  • Wyszukaj "$ this-> load-> model (" catalog / product ");" bez podwójnych cytatów i

$ result = $ this-> customreview ($ product_id); $ data ['allreviews'] = $ wynik;

Ponadto wyszukaj "public function index () {" bez podwójnych cudzysłowów i dodaj

publicview customreview ($ product_id) {$ this-> load-> language ("product / product"); $ this-> load-> model ("katalog / recenzja"); $ data ['text_no_reviews'] = $ this-> language-> get ('text_no_reviews'); if (isset ($ this-> request-> get ['page'])) {$ page = $ this-> request-> get ['page']; } else {$ page = 1; } $ data ['reviews'] = array (); $ review_total = $ this-> model_catalog_review-> getTotalReviewsByProductId ($ product_id); $ results = $ this-> model_catalog_review-> getReviewsByProductId ($ product_id, ($ strona – 1) * 5, 5); foreach ($ wyniki jako wynik $) {$ data ['recenzje'] [] = array ("autor" => $ wynik ['autor'], "tekst" => nl2br ($ wynik ['tekst']), 'rating' => (int) $ wynik ['rating'], 'date_added' => date ($ this-> language-> get ('date_format_short'), strtotime ($ result ['date_added']))); } $ pagination = new Pagination (); $ pagination-> total = $ review_total; $ pagination-> page = $ page; $ pagination-> limit = 5; $ pagination-> url = $ this-> url-> link ('product / product / review', 'product_id ='. $ product_id. '& page = {page}'); $ data ['pagination'] = $ pagination-> render (); $ data ['wyniki'] = sprintf ($ this-> language-> get ('text_pagination'), ($ review_total)? (($ strona – 1) * 5) + 1: 0, ((($ strona – 1) * 5)> ($ review_total – 5))? $ Review_total: (((($ strona – 1) * 5) + 5), $ review_total, ceil ($ review_total / 5)); if (file_exists (DIR_TEMPLATE. $ this-> config-> get ('config_template'). '/template/product/review.tpl')) {return $ this-> load-> view ($ this-> config-> get ('config_template'). '/template/product/review.tpl', $ data); } else {return $ this-> load-> view ('default / template / product / review.tpl', $ data); }}

#3 Metoda: Pobierz to?free module and install it on your store. Follow below instructions to install it.

  1. Wyciągnij pobrany plik zip.
  2. Prześlij plik xml z panelu Rozszerzenia> Strona instalatora rozszerzenia.
  3. Teraz odśwież zmiany

Jeśli napotkasz problem lub potrzebujesz pomocy w naprawieniu tego błędu, skontaktuj się z nami.

To również Cię zainteresuje:

Published by

Joe Parker

We boast of the best in the industry plugins for eCommerce systems and has years of experience working with eCommerce websites. We provide best plugins for platforms like - Magento, Prestashop, OpenCart and Shopify. We also provide custom module development and customization services for the website and modules.