} // check if reviews service is active if (isset($lC_Services) && $lC_Services->isStarted('reviews')) { ?> <div class="content-products-info-reviews-container large-margin-bottom"> <label class="content-products-info-reviews-rating-label with-padding-no-top-bottom"><?php echo $lC_Language->get('average_rating'); ?> </label> <span class="content-products-info-reviews-rating margin-right"><?php echo lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $lC_Product->getData('reviews_average_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $lC_Product->getData('reviews_average_rating'))); ?> </span> <?php $Qreviews = lC_Reviews::getListing($lC_Product->getID()); if ($lC_Reviews->getTotal($lC_Product->getID()) > 0) { echo '<span><a href="' . lc_href_link(FILENAME_PRODUCTS, 'reviews&' . $lC_Product->getKeyword()) . '">(' . $lC_Language->get('more_information') . ')</a></span>' . "\n"; } else { echo '<span><a href="' . lc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $lC_Product->getKeyword()) . '">(' . $lC_Language->get('text_write_review_first') . '</a>)</span>' . "\n"; } ?> </div> <?php } // reviews service check if ($lC_Product->hasVariants()) { ?> <div id="content-products-info-variants-container"> <?php
@package catalog::templates::content @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @copyright Template built on DevKit http://www.bootstraptor.com under GPL license @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: reviews.php v1.0 2013-08-08 datazen $ */ ?> <!--content/products/reviews.php start--> <div class="row"> <div class="col-sm-12 col-lg-12"> <h1><?php echo $lC_Template->getPageTitle(); ?> </h1> <?php echo lC_Reviews::getListingOutput(); ?> <div class="button-set"> <form action="<?php echo lc_href_link(FILENAME_DEFAULT, null, 'AUTO'); ?> " method="post"><button onclick="$(this).closest('form').submit();" class="pull-right btn btn-lg btn-primary" type="submit"><?php echo $lC_Language->get('button_continue'); ?> </button></form> </div> </div> </div> <!--content/products/reviews.php end-->
<?php /** @package catalog::templates::content @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @copyright Template built on DevKit http://www.bootstraptor.com under GPL license @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: reviews_info.php v1.0 2013-08-08 datazen $ */ $Qreviews = lC_Reviews::getEntry($_GET[$lC_Template->getModule()]); ?> <!--content/products/reviews_info.php start--> <div class="row"> <div class="col-sm-12 col-lg-12 clearfix"> <h1 class="no-margin-top"><?php echo $lC_Language->get('reviews_heading'); ?> </h1> <div class="row"> <div class="col-sm-4 col-lg-4 large-padding-left"> <div class="thumbnail align-center large-padding-top"> <?php echo lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="img-responsive content-product-reviews-image-src"', 'small')); ?> <div class="caption"> <h3 style="line-height:1.1;"> <?php echo lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Product->getTitle()); ?>
?> <div class="content-product-reviews-container"> <h3 class="no-margin-top"><?php echo $lC_Template->getPageTitle(); ?> </h3> <?php if ($lC_Product->getData('reviews_average_rating') > 0) { ?> <div class="content-product-reviews-rating margin-bottom"><?php echo $lC_Language->get('average_rating') . ' ' . lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $lC_Product->getData('reviews_average_rating') . '.png', sprintf($lC_Language->get('rating_of_5_stars'), $lC_Product->getData('reviews_average_rating'))); ?> </div> <?php echo lC_Reviews::getListingOutput($lC_Product->getID()); ?> <?php } ?> </div> </div> </div> </div> <div class="col-sm-12 col-lg-12 clearfix"> <div class="button-set"> <?php if ($lC_Reviews->is_enabled === true) { ?>
protected function _process($id) { global $lC_Language, $lC_MessageStack, $lC_Customer, $lC_Reviews; $data = array('products_id' => $id); if ($lC_Customer->isLoggedOn()) { $data['customer_id'] = $lC_Customer->getID(); $data['customer_name'] = $lC_Customer->getName(); } else { $data['customer_id'] = '0'; $data['customer_name'] = $_POST['customer_name']; } if (strlen(trim($_POST['review'])) < REVIEW_TEXT_MIN_LENGTH) { $lC_MessageStack->add('reviews', sprintf($lC_Language->get('js_review_text'), REVIEW_TEXT_MIN_LENGTH)); } else { $data['review'] = $_POST['review']; } if ($_POST['rating'] < 1 || $_POST['rating'] > 5) { $lC_MessageStack->add('reviews', $lC_Language->get('js_review_rating')); } else { $data['rating'] = $_POST['rating']; } if ($lC_MessageStack->size('reviews') < 1) { if ($lC_Reviews->is_moderated === true) { $data['status'] = '0'; $lC_MessageStack->add('reviews', $lC_Language->get('success_review_moderation'), 'success'); } else { $data['status'] = '1'; $lC_MessageStack->add('reviews', $lC_Language->get('success_review_new'), 'success'); } lC_Reviews::saveEntry($data); lc_redirect(lc_href_link(FILENAME_PRODUCTS, 'reviews&' . $id)); } }