Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #548 from Nosto/release/4.0.0
Browse files Browse the repository at this point in the history
Release/4.0.0
  • Loading branch information
olsi-qose authored Mar 2, 2020
2 parents ac5efa1 + 4e2f2f8 commit 30de615
Show file tree
Hide file tree
Showing 29 changed files with 35 additions and 2,238 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 4.0.0
* Remove Nosto category personalization feature from this extension
* Remove product indexer
* Fix an issue where the product's category was encoded twice

### 3.11.4
* Fix category tagging not being rendered on product detail page
* Fix an issue when rendering category tagging for categories in which parents are hidden
Expand Down
1 change: 0 additions & 1 deletion app/code/community/Nosto/Tagging/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ NOSTO_API_BASE_URL=https://api.nosto.com
NOSTO_OAUTH_BASE_URL=https://my.nosto.com/oauth
NOSTO_WEB_HOOK_BASE_URL=https://my.nosto.com
NOSTO_IFRAME_ORIGIN_REGEXP=(https:\/\/(.*)\.hub\.nosto\.com)|(https:\/\/my\.nosto\.com)
NOSTO_RECOMMENDATION_API_TIMEOUT=0.5
NOSTO_PRODUCT_API_WAIT_TIMEOUT=120
6 changes: 2 additions & 4 deletions app/code/community/Nosto/Tagging/Block/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ protected function _toHtml()
$nostoProduct = $this->getMetaProduct();
if ($nostoProduct instanceof Nosto_AbstractObject) {
return $nostoProduct->toHtml();
} else {
return '';
}
return '';
}

/**
Expand Down Expand Up @@ -94,8 +93,7 @@ public function getMetaProduct()
$store = $dataHelper->getStore();
$model = Nosto_Tagging_Model_Meta_Product_Builder::build(
$this->getProduct(),
$store,
$dataHelper->getUseProductIndexer($store)
$store
);
if ($model instanceof Nosto_Tagging_Model_Meta_Product) {
$this->_product = $model;
Expand Down
103 changes: 0 additions & 103 deletions app/code/community/Nosto/Tagging/Block/Product/List/Toolbar.php

This file was deleted.

13 changes: 0 additions & 13 deletions app/code/community/Nosto/Tagging/Helper/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,4 @@ public function getAllStoreViewsWithNostoAccount()
return $storesWithNosto;
}

/**
* Returns the id of the first store that has nosto installed
*
* @return int|null
*/
public function getFirstNostoStoreId()
{
$storesWithNosto = $this->getAllStoreViewsWithNostoAccount();
if (!empty($storesWithNosto) && $storesWithNosto[0] instanceof Mage_Core_Model_Store) {
return $storesWithNosto[0]->getId();
}
return null;
}
}
95 changes: 0 additions & 95 deletions app/code/community/Nosto/Tagging/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,6 @@ class Nosto_Tagging_Helper_Data extends Mage_Core_Helper_Abstract
*/
const XML_PATH_USE_PRODUCT_API = 'nosto_tagging/general/use_product_api';

/**
* Path to store config for using the product Indexer or not
*/
const XML_PATH_USE_PRODUCT_INDEXER = 'nosto_tagging/general/use_product_indexer';

/**
* Path to store config for automatically update catalog price rule changes
*/
const XML_PATH_UPDATE_CATALOG_PRICE_RULES = 'nosto_tagging/general/update_catalog_price_rules';

/**
* Path to store config for sending customer data to Nosto or not
*/
Expand All @@ -127,11 +117,6 @@ class Nosto_Tagging_Helper_Data extends Mage_Core_Helper_Abstract
*/
const XML_PATH_RESTORE_CART_LOCATION = 'nosto_tagging/general/restore_cart_location';

/**
* Path to store config for indexer allowed memory percentage
*/
const XML_PATH_INDEXER_MEMORY = 'nosto_tagging/general/indexer_memory';

/**
* Path to store config for custom fields
*/
Expand All @@ -157,11 +142,6 @@ class Nosto_Tagging_Helper_Data extends Mage_Core_Helper_Abstract
*/
const XML_PATH_USE_LOW_STOCK = 'nosto_tagging/general/use_low_stock';

/**
* Path to setting if personalized category sorting is enabled
*/
const XML_PATH_USE_PERSONALIZED_CATEGORY_SORTING = 'nosto_tagging/general/personalized_category_sorting';

/**
* @var boolean the path for setting for product urls
*/
Expand Down Expand Up @@ -528,28 +508,6 @@ public function getUseProductApi($store = null)
return (bool)Mage::getStoreConfig(self::XML_PATH_USE_PRODUCT_API, $store);
}

/**
* Returns on/off setting for product indexer
*
* @param Mage_Core_Model_Store|null $store the store model or null.
* @return bool
*/
public function getUseProductIndexer($store = null)
{
return (bool)Mage::getStoreConfig(self::XML_PATH_USE_PRODUCT_INDEXER, $store);
}

/**
* Returns on/off setting for automatic catalog price rule updates
*
* @param Mage_Core_Model_Store|null $store the store model or null.
* @return bool
*/
public function getUseAutomaticCatalogPriceRuleUpdates($store = null)
{
return (bool)Mage::getStoreConfig(self::XML_PATH_UPDATE_CATALOG_PRICE_RULES, $store);
}

/**
* Returns on/off setting for sending customer data to Nosto
*
Expand Down Expand Up @@ -651,17 +609,6 @@ public function getSendAddToCartEvent($store)
return false;
}

/**
* Returns on/off setting for using personalized category sorting
*
* @param Mage_Core_Model_Store|null $store the store model or null.
* @return boolean
*/
public function getUsePersonalizedCategorySorting($store = null)
{
return (bool)Mage::getStoreConfig(self::XML_PATH_USE_PERSONALIZED_CATEGORY_SORTING, $store);
}

/**
* Returns exchange rate cron frequency
*
Expand Down Expand Up @@ -718,18 +665,6 @@ public function getRestoreCartRedirectLocation($store = null)
return Mage::getStoreConfig(self::XML_PATH_RESTORE_CART_LOCATION, $store);
}

/**
* Return the percentage of allowed memory for the indexer
*
* @param Mage_Core_Model_Store|null $store the store model or null.
*
* @return string
*/
public function getIndexerMemoryPercentage($store = null)
{
return Mage::getStoreConfig(self::XML_PATH_INDEXER_MEMORY, $store);
}

/**
* Set the ratings and reviews provider
*
Expand Down Expand Up @@ -811,36 +746,6 @@ public function getExtensionVersion()
return $version;
}

/**
* Returns boolean if all stores use product indexer
*
* @return bool
*/
public function getAllStoresUseProductIndexer()
{
foreach ($this->getAllStoreViews() as $store) {
if (!$this->getUseProductIndexer($store)) {
return false;
}
}

return true;
}

/**
* Returns an array with Nosto settings
*
* @param null $store
* @return Mage_Core_Model_Store[]
*/
public function getNostoStoreConfig($store = null)
{
if ($store === null) {
$store = $this->getStore();
}
return Mage::getStoreConfig('nosto_tagging', $store);
}

/**
* Wrapper to return the current store
*
Expand Down
19 changes: 0 additions & 19 deletions app/code/community/Nosto/Tagging/Helper/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,6 @@ public static function info($message, array $attributes = null)
);
}

/**
* Logs a message along with the memory consumption
*
* @param $message
* @return bool
*/
public function logWithMemoryConsumption($message)
{
return self::info(
sprintf(
'%s [mem usage: %sM / %s] [realmem: %sM]',
$message,
Nosto_Util_Memory::getConsumption(),
Nosto_Util_Memory::getTotalMemoryLimit(),
Nosto_Util_Memory::getRealConsumption()
)
);
}

/**
* Writes warning into the log
*
Expand Down
31 changes: 0 additions & 31 deletions app/code/community/Nosto/Tagging/Helper/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,35 +465,4 @@ public function getTaggingCurrencyCode($currentCurrencyCode, Mage_Core_Model_Sto
return $taggingCurrencyCode;
}

/**
* Gets productIds with active catalog price rules
*
* @return array
*/
public function getProductIdsWithActivePriceRules()
{
/* @var Mage_CatalogRule_Model_Resource_Rule_Collection $rules */
$rules = Mage::getModel('catalogrule/rule')->getCollection();
/** @var Mage_Core_Model_Date $dateModel */
$dateModel = Mage::getSingleton('core/date');
$date = $dateModel->gmtDate();
$rules
->addIsActiveFilter()
->addFieldToFilter(
'from_date', array(
array('lt' => $date),
array('null' => true)
)
);
$ids = array();
/* @var Mage_CatalogRule_Model_Rule $rule*/
foreach ($rules as $rule) {
if ($rule->getIsActive()) {
$matchingProductIds = $rule->getResource()->getRuleProductIds($rule->getId());
$ids = array_merge($matchingProductIds, $ids);
}
}

return array_unique($ids);
}
}
Loading

0 comments on commit 30de615

Please sign in to comment.