Skip to content

Commit

Permalink
Merge pull request #121 from Nosto/release/1.2.5
Browse files Browse the repository at this point in the history
Release 1.2.5
  • Loading branch information
liangde-chen authored Aug 14, 2017
2 parents 8b62751 + 546197f commit 5a1f407
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ class Shopware_Plugins_Frontend_NostoTagging_Bootstrap extends Shopware_Componen
{

const PLATFORM_NAME = 'shopware';
const PLUGIN_VERSION = '1.2.4';
const PLUGIN_VERSION = '1.2.5';
const MENU_PARENT_ID = 23; // Configuration
const NEW_ENTITY_MANAGER_VERSION = '5.0.0';
const NEW_ATTRIBUTE_MANAGER_VERSION = '5.2.0';
const SUPPORT_SHOW_REVIEW_SUB_SHOP_ONLY_VERSION = '5.3.0';
const PLATFORM_UI_VERSION = '1';
const PAGE_TYPE_FRONT_PAGE = 'front';
const PAGE_TYPE_CART = 'cart';
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased][unreleased]

## [1.2.5]
- Add support for Shopware 5.3

## [1.2.4]
- Make order status handling compatible with Shopware < 5.1

Expand Down Expand Up @@ -139,7 +142,8 @@ recommendations
- Initial beta-release


[unreleased]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.4...develop
[unreleased]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.5...develop
[1.2.5]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.4...1.2.5
[1.2.4]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.3...1.2.4
[1.2.3]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.2...1.2.3
[1.2.2]: https://github.com/nosto/nosto-shopware-plugin/compare/1.2.1...1.2.2
Expand Down
26 changes: 23 additions & 3 deletions Components/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

use Shopware\Models\Article\Article as Article;
use Shopware\Models\Shop\Shop as Shop;
use Shopware_Plugins_Frontend_NostoTagging_Bootstrap as NostoBootstrap;
use Shopware_Plugins_Frontend_NostoTagging_Components_Helper_Image as ImageHelper;
use Shopware_Plugins_Frontend_NostoTagging_Components_Helper_Price as PriceHelper;
use Shopware_Plugins_Frontend_NostoTagging_Components_Helper_Tag as TagHelper;
Expand Down Expand Up @@ -378,14 +379,33 @@ public function assignId(\Shopware\Models\Article\Article $article)
*/
protected function amendRatingsAndReviews(Article $article, Shop $shop)
{
//From shopware 5.3, it is possible to display product votes only in sub shop where they posted
$showSubshopReviewOnly = false;
$showSubshopReivewOnlySupported = version_compare(
Shopware::VERSION,
NostoBootstrap::SUPPORT_SHOW_REVIEW_SUB_SHOP_ONLY_VERSION,
'>='
);
if ($showSubshopReivewOnlySupported) {
$showSubshopReviewOnly = Shopware()->Config()->get('displayOnlySubShopVotes');
}

$voteCount = 0;
$votes = array();
$voteSum = 0;
foreach ($article->getVotes() as $vote) {
if ($showSubshopReviewOnly) {
$shopForVote = $vote->getShop();
if ($shopForVote !== null
&& $shop !== null
&& $shopForVote->getId() != $shop->getId()
) {
continue;
}
}
++$voteCount;
$votes[] = $vote->getPoints();
$voteSum += $vote->getPoints();
}
if ($voteCount > 0) {
$voteSum = array_sum($votes);
$voteAvg = round($voteSum / $voteCount, 1);
$this->setRatingValue($voteAvg);
$this->setReviewCount($voteCount);
Expand Down
2 changes: 1 addition & 1 deletion Views/frontend/plugins/nosto_tagging/checkout/finish.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{block name="frontend_index_content" append}
<div class="nosto_element" id="thankyou-nosto-1"></div>
<div class="nosto_element" id="thankyou-nosto-2"></div>
{if isset($nostoOrder) && is_object($nostoOrder)}
{if isset($nostoOrder) && $nostoOrder}
<div class="nosto_purchase_order" style="display:none">
<span class="order_number">{$nostoOrder->getOrderNumber()|escape:'htmlall':'UTF-8'}</span>
<span class="order_status_code">{$nostoOrder->getOrderStatus()->getCode()|escape:'htmlall':'UTF-8'}</span>
Expand Down
4 changes: 2 additions & 2 deletions Views/frontend/plugins/nosto_tagging/detail/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="nosto_element" id="nosto-page-product1"></div>
<div class="nosto_element" id="nosto-page-product2"></div>
<div class="nosto_element" id="nosto-page-product3"></div>
{if isset($nostoProduct) && is_object($nostoProduct)}
{if isset($nostoProduct) && $nostoProduct}
<div class="nosto_product" style="display: none">
<span class="url">{$nostoProduct->getUrl()|escape:'htmlall':'UTF-8'}</span>
<span class="product_id">{$nostoProduct->getProductId()|escape:'htmlall':'UTF-8'}</span>
Expand Down Expand Up @@ -74,7 +74,7 @@
{/if}
</div>
{/if}
{if isset($nostoCategory) && is_object($nostoCategory)}
{if isset($nostoCategory) && $nostoCategory}
<div class="nosto_category"
style="display:none">{$nostoCategory->getCategoryPath()|escape:'htmlall':'UTF-8'}</div>
{/if}
Expand Down
6 changes: 3 additions & 3 deletions Views/frontend/plugins/nosto_tagging/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{/if}
{/block}
{block name="frontend_index_content" append}
{if isset($nostoCustomer) && is_object($nostoCustomer)}
{if isset($nostoCustomer) && $nostoCustomer}
<div class="nosto_customer" style="display:none">
{if isset($nostoHcid) && !empty($nostoHcid)}
<span class="hcid">{$nostoHcid|escape:'htmlall':'UTF-8'}</span>
Expand All @@ -133,7 +133,7 @@
{if isset($nostoHcid) && !empty($nostoHcid)}
<span class="hcid">{$nostoHcid|escape:'htmlall':'UTF-8'}</span>
{/if}
{if isset($nostoCart) && is_object($nostoCart)}
{if isset($nostoCart) && $nostoCart}
{foreach from=$nostoCart->getLineItems() item=lineItem}
<div class="line_item">
<span class="product_id">{$lineItem->getProductId()|escape:'htmlall':'UTF-8'}</span>
Expand All @@ -145,7 +145,7 @@
{/foreach}
{/if}
</div>
{if isset($nostoPageType) && is_scalar($nostoPageType)}
{if isset($nostoPageType) && is_string($nostoPageType)}
<div class="nosto_page_type"
style="display:none">{$nostoPageType|escape:'htmlall':'UTF-8'}</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion Views/frontend/plugins/nosto_tagging/listing/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{block name="frontend_index_content" append}
<div class="nosto_element" id="nosto-page-category1"></div>
<div class="nosto_element" id="nosto-page-category2"></div>
{if isset($nostoCategory) && is_object($nostoCategory)}
{if isset($nostoCategory) && $nostoCategory}
<div class="nosto_category"
style="display:none">{$nostoCategory->getCategoryPath()|escape:'htmlall':'UTF-8'}</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion Views/frontend/plugins/nosto_tagging/search/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

{block name="frontend_index_content" append}
<div class="nosto_element" id="nosto-page-search2"></div>
{if isset($nostoSearch) && is_object($nostoSearch)}
{if isset($nostoSearch) && $nostoSearch}
<div class="nosto_search_term"
style="display:none">{$nostoSearch->getSearchTerm()|escape:'htmlall':'UTF-8'}</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": [
"BSD-3-Clause"
],
"version": "1.2.4",
"version": "1.2.5",
"require": {
"php": ">=5.5.0",
"nosto/php-sdk": "1.16.3"
Expand Down

0 comments on commit 5a1f407

Please sign in to comment.