Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    If you are using a template that incorporates the DG REVIEWS function, you can do an edit to:-

    /includes/templates/your_custom_template/templates/tpl_dgReview.php

    ... and this will embed Google-verified REVIEWS Structured Data Markup.

    (This is a reviews feature I have in PICAFLOR AZUL westminster_new - so it could be in other templates by this author.)

    SEE in the code for:-
    <!-- BEGIN ADDITION OF REVIEWS STRUCTURED DATA - SCHEMA.ORG -->

    Then edit / replace the text through to:-
    <!-- END ADDITION OF REVIEWS STRUCTURED DATA - SCHEMA.ORG -->

    PHP Code:
    <?php 
    // dgReviews v 1.01
    //Modified to work with version v1.3.6  of the dgcart
    // This is a quick down and dirty mod to add product reviews onto the product info page
    // by MichaelDuvall.com
    // Modified by Anne (Picaflor-Azul.com) for Winchester Responisve v. 1.0
    ?>
        <!-- bof: dgReviews-->
    <div class="pi-reviews">
    <?php
    //change this constant to change the title for the customer reviews
      
    $review_title 'Customer Reviews';
      
     
    $review_status " and r.status = '1'";
      
    /* This is where you change the parameter value to output 1000 charaters or equivelent */
      
    $reviews_query_raw "select r.reviews_id, left(rd.reviews_text, 1000) as reviews_text,
                                   r.reviews_rating, r.date_added, r.customers_name
                            from " 
    TABLE_REVIEWS " r, " TABLE_REVIEWS_DESCRIPTION " rd
                            where r.products_id = '" 
    . (int)$_GET['products_id'] . "'
                            and r.reviews_id = rd.reviews_id
                            and rd.languages_id = '" 
    . (int)$_SESSION['languages_id'] . "'" .
                            
    $review_status "
                            order by r.reviews_id desc"
    ;

      
    $reviews_split = new splitPageResults($reviews_query_rawMAX_DISPLAY_NEW_REVIEWS);

      if (
    $reviews_split->number_of_rows 0) {
        if ((
    PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
    ?>
      <?php 
      
    if ($reviews->fields['count'] > 0) {
      }
      
    ?>
      
      <div class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div>
    <br/>
      <div class="forward"><?php echo TEXT_RESULT_PAGE ' ' $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''main_page'))); ?></div>
      <br class="clearBoth" />  
     <?php
        
    }

        
    $reviews $db->Execute($reviews_split->sql_query);

        while (!
    $reviews->EOF) {
    ?>
      <?php // change the class name here to reflect your CSS page ?>


    <!-- BEGIN ADDITION OF REVIEWS STRUCTURED DATA - SCHEMA.ORG -->
    <div class="pi-reviews-wrapper" itemprop="review" itemscope itemtype="http://schema.org/Review">  
    <meta itemprop="itemReviewed" itemscope itemtype="http://schema.org/Product">
    <meta itemprop="name" content="<?php echo $products_name?>">
    <div class="pi-reviews-left">
    <div class="review-date" itemprop="datePublished" content="<?php echo sprintf($reviews->fields['date_added']); ?>"><?php echo sprintf(zen_date_short($reviews->fields['date_added'])); ?></div>
    <div class="review-name"><?php echo sprintf(zen_output_string_protected($reviews->fields['customers_name'])); ?></div>
    <meta itemscope itemtype="http://schema.org/Person" itemprop="author" content="<?php echo sprintf(zen_output_string_protected($reviews->fields['customers_name'])); ?>">
    <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
    <meta itemprop="worstRating" content="1">
    <div class="rating"><meta itemprop="ratingValue" content= "<?php echo  sprintf($reviews->fields['reviews_rating']); ?>">
    <?php echo  sprintf(zen_image(DIR_WS_TEMPLATE_IMAGES 'stars_' $reviews->fields['reviews_rating'] . '.png'sprintf(TEXT_OF_5_STARS$reviews->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS$reviews->fields['reviews_rating']))  . '</div><meta itemprop="bestRating" content="5"></div></div><div class="pi-reviews-right" itemprop="description"><p>' zen_break_string(zen_output_string_protected(stripslashes($reviews->fields['reviews_text'])), 35''); ?></p>
    </div>
    <div class="clearBoth"></div></div>
    <!-- END ADDITION OF REVIEWS STRUCTURED DATA - SCHEMA.ORG -->

     
    <?php
          $reviews
    ->MoveNext();
        }
    ?>
    <?php
      
    } else {

    echo 
    TEXT_FIRST_REVIEW '<a href="' zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITEzen_get_all_get_params(array())) . '">' TEXT_FIRST_REVIEW_WRITE '</a>';
    ?>
     
    <?php
      
    }

      if ((
    $reviews_split->number_of_rows 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
    ?>

    <div id="productReviewLink" class="buttonRow"><?php echo '<a href="' zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITEzen_get_all_get_params(array())) . '">' zen_image_button(BUTTON_IMAGE_WRITE_REVIEWBUTTON_WRITE_REVIEW_ALT) . '</a>'?></div>

        <div class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div>
      <br/>
        <div><?php echo TEXT_RESULT_PAGE ' ' $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKSzen_get_all_get_params(array('page''info''main_page'))); ?></div>
     
    <?php
      
    }
    ?>
    </div>
    <!-- eof dgreviews -->
    <?php //this is the end of dgReview?>
    TEST at: https://search.google.com/structured-data/testing-tool
    19 years a Zencart User

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Bear in mind, the structured data markup appears only when there is a review being rendered on the product info page.

    (This influences Search Engines in awarding "stars" to search results - so it makes sense to include it. Research shows people are 40% more likely to click on a site if the reviews stars are good - four or more.)
    19 years a Zencart User

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    ...Now... if this could be done in json/ld it would be even better.

    Hi Melanie (Prough)... perhaps you could get this into json????
    19 years a Zencart User

  4. #4
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Quote Originally Posted by schoolboy View Post
    ...Now... if this could be done in json/ld it would be even better.

    Hi Melanie (Prough)... perhaps you could get this into json????
    I have it ready in json I'll post the files later, as I'm am not near my pc right now .

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    See Zen-Cart-Structured-Data-using-Json
    You can use the all files, or just the ones you like

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Thanks a ton for this... Really valuable stuff - every zencart operator should install & configure... I really appreciate the work you put into this.
    19 years a Zencart User

  7. #7
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Quote Originally Posted by Design75 View Post
    See Zen-Cart-Structured-Data-using-Json
    You can use the all files, or just the ones you like
    Excellent stuff! Would be good to do all the configuration and data in the Admin at some stage.

    Cheers / Frank

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    I've mixed up everything I could find to do a new plugin here that is intended to work on all pages, with products and reviews:
    https://www.zen-cart.com/showthread....tter&p=1326156
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #9
    Join Date
    Oct 2009
    Posts
    21
    Plugin Contributions
    0

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Quote Originally Posted by Design75 View Post
    See Zen-Cart-Structured-Data-using-Json
    You can use the all files, or just the ones you like
    Hello all!

    I installed Designs75 Json Structured Data. Thank you!

    All ok except when i am running search.google.com/test/rich-results - i am getting an error from google: Parsing error: Missing ',' or '}'

    The error points to the image part in jscript_structured_data_product.php

    The line that generates the error is:

    "image": "<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ) . '/' . DIR_WS_IMAGES . zen_get_products_image((int)$_GET['products_id']); ?>",

    The output generated by the script is:

    "image": "https://www.vapori.ro//images/<img src="bmz_cache/d/dbd47353f10d2c834f3dd24491f6bfc0.image.91x100.jpg" alt="Aramax POWER, 5000 mAh - Negru + 100 ml Lichid Gratuit" title=" Aramax POWER, 5000 mAh - Negru + 100 ml Lichid Gratuit " width="91" height="100" />",

    Google structured test say that the part where "bmz_cache" starts should contain ',' or '}'

    Can you please help me out with this?

    Thank you in advance!
    Janos

  10. #10
    Join Date
    Oct 2009
    Posts
    21
    Plugin Contributions
    0

    Default Re: Strutured Data Markup for CUSTOMER PRODUCT REVIEWS - schema.org

    Here is the rich test with the error provided by google:

    https://search.google.com/test/rich-...Nt-_u6rObfsXJA

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Google Plus One Button from Numinix and Schema.org itemprops
    By phil99 in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 28 Feb 2013, 04:35 PM
  2. Translating my mysql data to zen schema
    By bihon in forum General Questions
    Replies: 0
    Last Post: 14 Dec 2009, 04:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR