Version Notes
* Add better error handling and notifications to Nosto account OAuth cycle
* Add support for bundle products with fixed pricing
* Add support for using "tag1", "tag2" and "tag3" properties in Nosto product
tagging and product update API
* Add support for Nosto partner code in account creation API
* Add support for overriding meta data models
* Fix bug in cart/order item name tagging while running Magento Dev Mode
* Fix bug in product export while having product flat tables enabled
* Fix bug in order confirmation API when payment provider is no longer available
Download this release
Release Info
Developer | Nosto |
Extension | Nosto_Tagging |
Version | 2.6.0 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.6.0
- app/code/community/Nosto/Tagging/Block/Adminhtml/Iframe.php +4 -1
- app/code/community/Nosto/Tagging/Block/Cart.php +9 -37
- app/code/community/Nosto/Tagging/Block/Order.php +3 -4
- app/code/community/Nosto/Tagging/Block/Product.php +4 -5
- app/code/community/Nosto/Tagging/Helper/Account.php +4 -2
- app/code/community/Nosto/Tagging/Helper/Data.php +11 -0
- app/code/community/Nosto/Tagging/Helper/Oauth.php +2 -1
- app/code/community/Nosto/Tagging/Helper/Price.php +13 -8
- app/code/community/Nosto/Tagging/Model/Meta/Account.php +21 -63
- app/code/community/Nosto/Tagging/Model/Meta/Account/Billing.php +0 -10
- app/code/community/Nosto/Tagging/Model/Meta/Account/Iframe.php +0 -40
- app/code/community/Nosto/Tagging/Model/Meta/Account/Owner.php +0 -30
- app/code/community/Nosto/Tagging/Model/Meta/Oauth.php +0 -20
- app/code/community/Nosto/Tagging/Model/Meta/Order.php +54 -57
- app/code/community/Nosto/Tagging/Model/Meta/Order/Buyer.php +12 -12
- app/code/community/Nosto/Tagging/Model/Meta/Order/Item.php +78 -108
- app/code/community/Nosto/Tagging/Model/Meta/Product.php +203 -139
- app/code/community/Nosto/Tagging/Model/Observer.php +6 -3
- app/code/community/Nosto/Tagging/Model/Product.php +45 -0
- app/code/community/Nosto/Tagging/Model/Resource/Product/Collection.php +46 -0
- app/code/community/Nosto/Tagging/controllers/Adminhtml/NostoController.php +2 -0
- app/code/community/Nosto/Tagging/controllers/ExportController.php +10 -8
- app/code/community/Nosto/Tagging/controllers/OauthController.php +2 -1
- app/code/community/Nosto/Tagging/etc/config.xml +1 -1
- app/code/community/Nosto/Tagging/etc/system.xml +2 -2
- app/design/frontend/base/default/template/nostotagging/product.phtml +16 -9
- lib/nosto/php-sdk/src/classes/NostoAccount.php +15 -3
- lib/nosto/php-sdk/src/classes/export/NostoExportProductCollection.php +23 -6
- lib/nosto/php-sdk/src/classes/operation/NostoOperationProduct.php +43 -6
- lib/nosto/php-sdk/src/interfaces/NostoProductInterface.php +9 -1
- lib/nosto/php-sdk/src/interfaces/account/NostoAccountMetaDataInterface.php +8 -0
- package.xml +13 -5
app/code/community/Nosto/Tagging/Block/Adminhtml/Iframe.php
CHANGED
@@ -66,10 +66,13 @@ class Nosto_Tagging_Block_Adminhtml_Iframe extends Mage_Adminhtml_Block_Template
|
|
66 |
$session = Mage::getSingleton('adminhtml/session');
|
67 |
if ($session !== null) {
|
68 |
$nostoMessage = $session->getData('nosto_message');
|
69 |
-
if (
|
70 |
if (isset($nostoMessage['type'], $nostoMessage['code'])) {
|
71 |
$params['message_type'] = $nostoMessage['type'];
|
72 |
$params['message_code'] = $nostoMessage['code'];
|
|
|
|
|
|
|
73 |
}
|
74 |
$session->setData('nosto_message', null);
|
75 |
}
|
66 |
$session = Mage::getSingleton('adminhtml/session');
|
67 |
if ($session !== null) {
|
68 |
$nostoMessage = $session->getData('nosto_message');
|
69 |
+
if (!empty($nostoMessage)) {
|
70 |
if (isset($nostoMessage['type'], $nostoMessage['code'])) {
|
71 |
$params['message_type'] = $nostoMessage['type'];
|
72 |
$params['message_code'] = $nostoMessage['code'];
|
73 |
+
if (isset($nostoMessage['text'])) {
|
74 |
+
$params['message_text'] = $nostoMessage['text'];
|
75 |
+
}
|
76 |
}
|
77 |
$session->setData('nosto_message', null);
|
78 |
}
|
app/code/community/Nosto/Tagging/Block/Cart.php
CHANGED
@@ -35,11 +35,6 @@
|
|
35 |
*/
|
36 |
class Nosto_Tagging_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
|
37 |
{
|
38 |
-
/**
|
39 |
-
* @var Mage_Sales_Model_Quote_Item[] Cached items in cart.
|
40 |
-
*/
|
41 |
-
protected $_items;
|
42 |
-
|
43 |
/**
|
44 |
* Render shopping cart content as hidden meta data if the module is
|
45 |
* enabled for the current store.
|
@@ -72,31 +67,6 @@ class Nosto_Tagging_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
|
|
72 |
return parent::_toHtml();
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* Returns all visible cart items.
|
77 |
-
* Fixed price bundle products are not supported.
|
78 |
-
*
|
79 |
-
* @return Mage_Sales_Model_Quote_Item[]
|
80 |
-
*/
|
81 |
-
public function getItems()
|
82 |
-
{
|
83 |
-
if (!$this->_items) {
|
84 |
-
$items = array();
|
85 |
-
foreach (parent::getItems() as $item) {
|
86 |
-
/** @var Mage_Sales_Model_Quote_Item $item */
|
87 |
-
$product = $item->getProduct();
|
88 |
-
if ($product->getTypeId() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE
|
89 |
-
&& (int)$product->getPriceType() === Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED
|
90 |
-
) {
|
91 |
-
continue;
|
92 |
-
}
|
93 |
-
$items[] = $item;
|
94 |
-
}
|
95 |
-
$this->_items = $items;
|
96 |
-
}
|
97 |
-
return $this->_items;
|
98 |
-
}
|
99 |
-
|
100 |
/**
|
101 |
* Returns the product id for a quote item.
|
102 |
* Always try to find the "parent" product ID if the product is a child of
|
@@ -154,13 +124,15 @@ class Nosto_Tagging_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
|
|
154 |
// products own name alone.
|
155 |
if (count($parentIds) === 1) {
|
156 |
$attributes = $item->getBuyRequest()->getData('super_attribute');
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
164 |
}
|
165 |
}
|
166 |
}
|
35 |
*/
|
36 |
class Nosto_Tagging_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
|
37 |
{
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* Render shopping cart content as hidden meta data if the module is
|
40 |
* enabled for the current store.
|
67 |
return parent::_toHtml();
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
/**
|
71 |
* Returns the product id for a quote item.
|
72 |
* Always try to find the "parent" product ID if the product is a child of
|
124 |
// products own name alone.
|
125 |
if (count($parentIds) === 1) {
|
126 |
$attributes = $item->getBuyRequest()->getData('super_attribute');
|
127 |
+
if (is_array($attributes)) {
|
128 |
+
foreach ($attributes as $id => $value) {
|
129 |
+
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */
|
130 |
+
$attribute = Mage::getModel('catalog/resource_eav_attribute')
|
131 |
+
->load($id);
|
132 |
+
$label = $attribute->getSource()->getOptionText($value);
|
133 |
+
if (!empty($label)) {
|
134 |
+
$optNames[] = $label;
|
135 |
+
}
|
136 |
}
|
137 |
}
|
138 |
}
|
app/code/community/Nosto/Tagging/Block/Order.php
CHANGED
@@ -62,10 +62,9 @@ class Nosto_Tagging_Block_Order extends Mage_Checkout_Block_Success
|
|
62 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
63 |
/** @var Mage_Sales_Model_Order $order */
|
64 |
$order = Mage::getModel('sales/order')->load($orderId);
|
65 |
-
$meta
|
66 |
-
|
67 |
-
|
68 |
-
}
|
69 |
return $meta;
|
70 |
}
|
71 |
}
|
62 |
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
63 |
/** @var Mage_Sales_Model_Order $order */
|
64 |
$order = Mage::getModel('sales/order')->load($orderId);
|
65 |
+
/** @var Nosto_Tagging_Model_Meta_Order $meta */
|
66 |
+
$meta = Mage::getModel('nosto_tagging/meta_order');
|
67 |
+
$meta->loadData($order);
|
|
|
68 |
return $meta;
|
69 |
}
|
70 |
}
|
app/code/community/Nosto/Tagging/Block/Product.php
CHANGED
@@ -56,11 +56,8 @@ class Nosto_Tagging_Block_Product extends Mage_Catalog_Block_Product_Abstract
|
|
56 |
*/
|
57 |
protected function _toHtml()
|
58 |
{
|
59 |
-
$product = $this->getProduct();
|
60 |
if (!Mage::helper('nosto_tagging')->isModuleEnabled()
|
61 |
|| !Mage::helper('nosto_tagging/account')->existsAndIsConnected()
|
62 |
-
|| ($product->getTypeId() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE
|
63 |
-
&& (int)$product->getPriceType() === Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED)
|
64 |
) {
|
65 |
return '';
|
66 |
}
|
@@ -76,8 +73,10 @@ class Nosto_Tagging_Block_Product extends Mage_Catalog_Block_Product_Abstract
|
|
76 |
public function getMetaProduct()
|
77 |
{
|
78 |
if ($this->_product === null) {
|
79 |
-
|
80 |
-
$
|
|
|
|
|
81 |
}
|
82 |
return $this->_product;
|
83 |
}
|
56 |
*/
|
57 |
protected function _toHtml()
|
58 |
{
|
|
|
59 |
if (!Mage::helper('nosto_tagging')->isModuleEnabled()
|
60 |
|| !Mage::helper('nosto_tagging/account')->existsAndIsConnected()
|
|
|
|
|
61 |
) {
|
62 |
return '';
|
63 |
}
|
73 |
public function getMetaProduct()
|
74 |
{
|
75 |
if ($this->_product === null) {
|
76 |
+
/** @var Nosto_Tagging_Model_Meta_Product $model */
|
77 |
+
$model = Mage::getModel('nosto_tagging/meta_product');
|
78 |
+
$model->loadData($this->getProduct());
|
79 |
+
$this->_product = $model;
|
80 |
}
|
81 |
return $this->_product;
|
82 |
}
|
app/code/community/Nosto/Tagging/Helper/Account.php
CHANGED
@@ -173,7 +173,8 @@ class Nosto_Tagging_Helper_Account extends Mage_Core_Helper_Abstract
|
|
173 |
*/
|
174 |
public function getMetaData(Mage_Core_Model_Store $store)
|
175 |
{
|
176 |
-
$meta
|
|
|
177 |
$meta->loadData($store);
|
178 |
return $meta;
|
179 |
}
|
@@ -191,7 +192,8 @@ class Nosto_Tagging_Helper_Account extends Mage_Core_Helper_Abstract
|
|
191 |
*/
|
192 |
public function getIframeUrl(Mage_Core_Model_Store $store, NostoAccount $account = null, array $params = array())
|
193 |
{
|
194 |
-
$meta
|
|
|
195 |
$meta->loadData($store);
|
196 |
return Nosto::helper('iframe')->getUrl($meta, $account, $params);
|
197 |
}
|
173 |
*/
|
174 |
public function getMetaData(Mage_Core_Model_Store $store)
|
175 |
{
|
176 |
+
/** @var Nosto_Tagging_Model_Meta_Account $meta */
|
177 |
+
$meta = Mage::getModel('nosto_tagging/meta_account');
|
178 |
$meta->loadData($store);
|
179 |
return $meta;
|
180 |
}
|
192 |
*/
|
193 |
public function getIframeUrl(Mage_Core_Model_Store $store, NostoAccount $account = null, array $params = array())
|
194 |
{
|
195 |
+
/** @var Nosto_Tagging_Model_Meta_Account_Iframe $meta */
|
196 |
+
$meta = Mage::getModel('nosto_tagging/meta_account_iframe');
|
197 |
$meta->loadData($store);
|
198 |
return Nosto::helper('iframe')->getUrl($meta, $account, $params);
|
199 |
}
|
app/code/community/Nosto/Tagging/Helper/Data.php
CHANGED
@@ -44,6 +44,17 @@ class Nosto_Tagging_Helper_Data extends Mage_Core_Helper_Abstract
|
|
44 |
*/
|
45 |
const XML_PATH_IMAGE_VERSION = 'nosto_tagging/image_options/image_version';
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
/**
|
48 |
* Builds a tagging string of the given category including all its parent
|
49 |
* categories.
|
44 |
*/
|
45 |
const XML_PATH_IMAGE_VERSION = 'nosto_tagging/image_options/image_version';
|
46 |
|
47 |
+
/**
|
48 |
+
* @inheritdoc
|
49 |
+
*/
|
50 |
+
public function quoteEscape($data, $addSlashes = false)
|
51 |
+
{
|
52 |
+
if ($addSlashes === true) {
|
53 |
+
$data = addslashes($data);
|
54 |
+
}
|
55 |
+
return htmlspecialchars($data, ENT_QUOTES, null, false);
|
56 |
+
}
|
57 |
+
|
58 |
/**
|
59 |
* Builds a tagging string of the given category including all its parent
|
60 |
* categories.
|
app/code/community/Nosto/Tagging/Helper/Oauth.php
CHANGED
@@ -46,7 +46,8 @@ class Nosto_Tagging_Helper_Oauth extends Mage_Core_Helper_Abstract
|
|
46 |
*/
|
47 |
public function getMetaData(Mage_Core_Model_Store $store)
|
48 |
{
|
49 |
-
$meta
|
|
|
50 |
$meta->loadData($store);
|
51 |
return $meta;
|
52 |
}
|
46 |
*/
|
47 |
public function getMetaData(Mage_Core_Model_Store $store)
|
48 |
{
|
49 |
+
/** @var Nosto_Tagging_Model_Meta_Oauth $meta */
|
50 |
+
$meta = Mage::getModel('nosto_tagging/meta_oauth');
|
51 |
$meta->loadData($store);
|
52 |
return $meta;
|
53 |
}
|
app/code/community/Nosto/Tagging/Helper/Price.php
CHANGED
@@ -47,27 +47,27 @@ class Nosto_Tagging_Helper_Price extends Mage_Core_Helper_Abstract
|
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
-
* Gets the unit price for a product model.
|
51 |
*
|
52 |
* @param Mage_Catalog_Model_Product $product the product model.
|
53 |
*
|
54 |
* @return float
|
55 |
*/
|
56 |
-
public function
|
57 |
{
|
58 |
-
return $this->_getProductPrice($product);
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
-
* Get the final price for a product model.
|
63 |
*
|
64 |
* @param Mage_Catalog_Model_Product $product the product model.
|
65 |
*
|
66 |
* @return float
|
67 |
*/
|
68 |
-
public function
|
69 |
{
|
70 |
-
return $this->_getProductPrice($product, true);
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -75,10 +75,11 @@ class Nosto_Tagging_Helper_Price extends Mage_Core_Helper_Abstract
|
|
75 |
*
|
76 |
* @param Mage_Catalog_Model_Product $product the product model.
|
77 |
* @param bool $finalPrice if final price.
|
|
|
78 |
*
|
79 |
* @return float
|
80 |
*/
|
81 |
-
protected function _getProductPrice($product, $finalPrice = false)
|
82 |
{
|
83 |
$price = 0;
|
84 |
|
@@ -118,6 +119,10 @@ class Nosto_Tagging_Helper_Price extends Mage_Core_Helper_Abstract
|
|
118 |
break;
|
119 |
}
|
120 |
|
121 |
-
|
|
|
|
|
|
|
|
|
122 |
}
|
123 |
}
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* Gets the unit price for a product model including taxes.
|
51 |
*
|
52 |
* @param Mage_Catalog_Model_Product $product the product model.
|
53 |
*
|
54 |
* @return float
|
55 |
*/
|
56 |
+
public function getProductPriceInclTax($product)
|
57 |
{
|
58 |
+
return $this->_getProductPrice($product, false, true);
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
+
* Get the final price for a product model including taxes.
|
63 |
*
|
64 |
* @param Mage_Catalog_Model_Product $product the product model.
|
65 |
*
|
66 |
* @return float
|
67 |
*/
|
68 |
+
public function getProductFinalPriceInclTax($product)
|
69 |
{
|
70 |
+
return $this->_getProductPrice($product, true, true);
|
71 |
}
|
72 |
|
73 |
/**
|
75 |
*
|
76 |
* @param Mage_Catalog_Model_Product $product the product model.
|
77 |
* @param bool $finalPrice if final price.
|
78 |
+
* @param bool $inclTax if tax is to be included.
|
79 |
*
|
80 |
* @return float
|
81 |
*/
|
82 |
+
protected function _getProductPrice($product, $finalPrice = false, $inclTax = true)
|
83 |
{
|
84 |
$price = 0;
|
85 |
|
119 |
break;
|
120 |
}
|
121 |
|
122 |
+
if ($inclTax) {
|
123 |
+
return Mage::helper('tax')->getPrice($product, $price, true);
|
124 |
+
} else {
|
125 |
+
return $price;
|
126 |
+
}
|
127 |
}
|
128 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Account.php
CHANGED
@@ -113,20 +113,16 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
113 |
$this->_ownerLanguageCode = substr(
|
114 |
Mage::app()->getLocale()->getLocaleCode(), 0, 2
|
115 |
);
|
116 |
-
$this->_owner = new Nosto_Tagging_Model_Meta_Account_Owner();
|
117 |
-
$this->_owner->loadData($store);
|
118 |
-
$this->_billing = new Nosto_Tagging_Model_Meta_Account_Billing();
|
119 |
-
$this->_billing->loadData($store);
|
120 |
-
}
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
$
|
|
|
130 |
}
|
131 |
|
132 |
/**
|
@@ -139,16 +135,6 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
139 |
return $this->_title;
|
140 |
}
|
141 |
|
142 |
-
/**
|
143 |
-
* Sets the account name.
|
144 |
-
*
|
145 |
-
* @param string $name the account name.
|
146 |
-
*/
|
147 |
-
public function setName($name)
|
148 |
-
{
|
149 |
-
$this->_name = $name;
|
150 |
-
}
|
151 |
-
|
152 |
/**
|
153 |
* The name of the account to create.
|
154 |
* This has to follow the pattern of
|
@@ -172,16 +158,6 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
172 |
return 'magento';
|
173 |
}
|
174 |
|
175 |
-
/**
|
176 |
-
* Sets the store front page url.
|
177 |
-
*
|
178 |
-
* @param string $url the front page url.
|
179 |
-
*/
|
180 |
-
public function setFrontPageUrl($url)
|
181 |
-
{
|
182 |
-
$this->_frontPageUrl = $url;
|
183 |
-
}
|
184 |
-
|
185 |
/**
|
186 |
* Absolute url to the front page of the shop for which the account is
|
187 |
* created for.
|
@@ -193,16 +169,6 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
193 |
return $this->_frontPageUrl;
|
194 |
}
|
195 |
|
196 |
-
/**
|
197 |
-
* Sets the store currency ISO (ISO 4217) code.
|
198 |
-
*
|
199 |
-
* @param string $code the currency ISO code.
|
200 |
-
*/
|
201 |
-
public function setCurrencyCode($code)
|
202 |
-
{
|
203 |
-
$this->_currencyCode = $code;
|
204 |
-
}
|
205 |
-
|
206 |
/**
|
207 |
* The 3-letter ISO code (ISO 4217) for the currency used by the shop for
|
208 |
* which the account is created for.
|
@@ -214,16 +180,6 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
214 |
return $this->_currencyCode;
|
215 |
}
|
216 |
|
217 |
-
/**
|
218 |
-
* Sets the store language ISO (ISO 639-1) code.
|
219 |
-
*
|
220 |
-
* @param string $languageCode the language ISO code.
|
221 |
-
*/
|
222 |
-
public function setLanguageCode($languageCode)
|
223 |
-
{
|
224 |
-
$this->_languageCode = $languageCode;
|
225 |
-
}
|
226 |
-
|
227 |
/**
|
228 |
* The 2-letter ISO code (ISO 639-1) for the language used by the shop for
|
229 |
* which the account is created for.
|
@@ -235,16 +191,6 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
235 |
return $this->_languageCode;
|
236 |
}
|
237 |
|
238 |
-
/**
|
239 |
-
* Sets the owner language ISO (ISO 639-1) code.
|
240 |
-
*
|
241 |
-
* @param string $languageCode the language ISO code.
|
242 |
-
*/
|
243 |
-
public function setOwnerLanguageCode($languageCode)
|
244 |
-
{
|
245 |
-
$this->_ownerLanguageCode = $languageCode;
|
246 |
-
}
|
247 |
-
|
248 |
/**
|
249 |
* The 2-letter ISO code (ISO 639-1) for the language of the account owner
|
250 |
* who is creating the account.
|
@@ -286,4 +232,16 @@ class Nosto_Tagging_Model_Meta_Account extends Mage_Core_Model_Abstract implemen
|
|
286 |
{
|
287 |
return $this->_signUpApiToken;
|
288 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
}
|
113 |
$this->_ownerLanguageCode = substr(
|
114 |
Mage::app()->getLocale()->getLocaleCode(), 0, 2
|
115 |
);
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
/** @var Nosto_Tagging_Model_Meta_Account_Owner $owner */
|
118 |
+
$owner = Mage::getModel('nosto_tagging/meta_account_owner');
|
119 |
+
$owner->loadData($store);
|
120 |
+
$this->_owner = $owner;
|
121 |
+
|
122 |
+
/** @var Nosto_Tagging_Model_Meta_Account_Billing $billing */
|
123 |
+
$billing = Mage::getModel('nosto_tagging/meta_account_billing');
|
124 |
+
$billing->loadData($store);
|
125 |
+
$this->_billing = $billing;
|
126 |
}
|
127 |
|
128 |
/**
|
135 |
return $this->_title;
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
/**
|
139 |
* The name of the account to create.
|
140 |
* This has to follow the pattern of
|
158 |
return 'magento';
|
159 |
}
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
/**
|
162 |
* Absolute url to the front page of the shop for which the account is
|
163 |
* created for.
|
169 |
return $this->_frontPageUrl;
|
170 |
}
|
171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
/**
|
173 |
* The 3-letter ISO code (ISO 4217) for the currency used by the shop for
|
174 |
* which the account is created for.
|
180 |
return $this->_currencyCode;
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
/**
|
184 |
* The 2-letter ISO code (ISO 639-1) for the language used by the shop for
|
185 |
* which the account is created for.
|
191 |
return $this->_languageCode;
|
192 |
}
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
/**
|
195 |
* The 2-letter ISO code (ISO 639-1) for the language of the account owner
|
196 |
* who is creating the account.
|
232 |
{
|
233 |
return $this->_signUpApiToken;
|
234 |
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Optional partner code for Nosto partners.
|
238 |
+
* The code is issued by Nosto to partners only.
|
239 |
+
*
|
240 |
+
* @return string|null the partner code or null if none exist.
|
241 |
+
*/
|
242 |
+
public function getPartnerCode()
|
243 |
+
{
|
244 |
+
// todo: implement partner code storage.
|
245 |
+
return null;
|
246 |
+
}
|
247 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Account/Billing.php
CHANGED
@@ -58,16 +58,6 @@ class Nosto_Tagging_Model_Meta_Account_Billing extends Mage_Core_Model_Abstract
|
|
58 |
$this->_country = $store->getConfig('general/country/default');
|
59 |
}
|
60 |
|
61 |
-
/**
|
62 |
-
* Sets the account billing details country ISO (ISO 3166-1 alpha-2) code.
|
63 |
-
*
|
64 |
-
* @param string $country the country ISO code.
|
65 |
-
*/
|
66 |
-
public function setCountry($country)
|
67 |
-
{
|
68 |
-
$this->_country = $country;
|
69 |
-
}
|
70 |
-
|
71 |
/**
|
72 |
* The 2-letter ISO code (ISO 3166-1 alpha-2) for billing details country.
|
73 |
*
|
58 |
$this->_country = $store->getConfig('general/country/default');
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
/**
|
62 |
* The 2-letter ISO code (ISO 3166-1 alpha-2) for billing details country.
|
63 |
*
|
app/code/community/Nosto/Tagging/Model/Meta/Account/Iframe.php
CHANGED
@@ -151,16 +151,6 @@ class Nosto_Tagging_Model_Meta_Account_Iframe extends Mage_Core_Model_Abstract i
|
|
151 |
return $this->_platform;
|
152 |
}
|
153 |
|
154 |
-
/**
|
155 |
-
* Sets the first name of the admin user.
|
156 |
-
*
|
157 |
-
* @param string $firstName the first name.
|
158 |
-
*/
|
159 |
-
public function setFirstName($firstName)
|
160 |
-
{
|
161 |
-
$this->_firstName = $firstName;
|
162 |
-
}
|
163 |
-
|
164 |
/**
|
165 |
* The first name of the user who is loading the config iframe.
|
166 |
*
|
@@ -171,16 +161,6 @@ class Nosto_Tagging_Model_Meta_Account_Iframe extends Mage_Core_Model_Abstract i
|
|
171 |
return $this->_firstName;
|
172 |
}
|
173 |
|
174 |
-
/**
|
175 |
-
* Sets the last name of the admin user.
|
176 |
-
*
|
177 |
-
* @param string $lastName the last name.
|
178 |
-
*/
|
179 |
-
public function setLastName($lastName)
|
180 |
-
{
|
181 |
-
$this->_lastName = $lastName;
|
182 |
-
}
|
183 |
-
|
184 |
/**
|
185 |
* The last name of the user who is loading the config iframe.
|
186 |
*
|
@@ -191,16 +171,6 @@ class Nosto_Tagging_Model_Meta_Account_Iframe extends Mage_Core_Model_Abstract i
|
|
191 |
return $this->_lastName;
|
192 |
}
|
193 |
|
194 |
-
/**
|
195 |
-
* Sets the email address of the admin user.
|
196 |
-
*
|
197 |
-
* @param string $email the email address.
|
198 |
-
*/
|
199 |
-
public function setEmail($email)
|
200 |
-
{
|
201 |
-
$this->_email = $email;
|
202 |
-
}
|
203 |
-
|
204 |
/**
|
205 |
* The email address of the user who is loading the config iframe.
|
206 |
*
|
@@ -211,16 +181,6 @@ class Nosto_Tagging_Model_Meta_Account_Iframe extends Mage_Core_Model_Abstract i
|
|
211 |
return $this->_email;
|
212 |
}
|
213 |
|
214 |
-
/**
|
215 |
-
* Sets the language ISO code.
|
216 |
-
*
|
217 |
-
* @param string $code the ISO code.
|
218 |
-
*/
|
219 |
-
public function setLanguageIsoCode($code)
|
220 |
-
{
|
221 |
-
$this->_languageIsoCode = $code;
|
222 |
-
}
|
223 |
-
|
224 |
/**
|
225 |
* The 2-letter ISO code (ISO 639-1) for the language of the user who is
|
226 |
* loading the config iframe.
|
151 |
return $this->_platform;
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
/**
|
155 |
* The first name of the user who is loading the config iframe.
|
156 |
*
|
161 |
return $this->_firstName;
|
162 |
}
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
/**
|
165 |
* The last name of the user who is loading the config iframe.
|
166 |
*
|
171 |
return $this->_lastName;
|
172 |
}
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
/**
|
175 |
* The email address of the user who is loading the config iframe.
|
176 |
*
|
181 |
return $this->_email;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
/**
|
185 |
* The 2-letter ISO code (ISO 639-1) for the language of the user who is
|
186 |
* loading the config iframe.
|
app/code/community/Nosto/Tagging/Model/Meta/Account/Owner.php
CHANGED
@@ -72,16 +72,6 @@ class Nosto_Tagging_Model_Meta_Account_Owner extends Mage_Core_Model_Abstract im
|
|
72 |
$this->_email = $user->getEmail();
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* Sets the first name of the account owner.
|
77 |
-
*
|
78 |
-
* @param string $firstName the first name.
|
79 |
-
*/
|
80 |
-
public function setFirstName($firstName)
|
81 |
-
{
|
82 |
-
$this->_firstName = $firstName;
|
83 |
-
}
|
84 |
-
|
85 |
/**
|
86 |
* The first name of the account owner.
|
87 |
*
|
@@ -92,16 +82,6 @@ class Nosto_Tagging_Model_Meta_Account_Owner extends Mage_Core_Model_Abstract im
|
|
92 |
return $this->_firstName;
|
93 |
}
|
94 |
|
95 |
-
/**
|
96 |
-
* Sets the last name of the account owner.
|
97 |
-
*
|
98 |
-
* @param string $lastName the last name.
|
99 |
-
*/
|
100 |
-
public function setLastName($lastName)
|
101 |
-
{
|
102 |
-
$this->_lastName = $lastName;
|
103 |
-
}
|
104 |
-
|
105 |
/**
|
106 |
* The last name of the account owner.
|
107 |
*
|
@@ -112,16 +92,6 @@ class Nosto_Tagging_Model_Meta_Account_Owner extends Mage_Core_Model_Abstract im
|
|
112 |
return $this->_lastName;
|
113 |
}
|
114 |
|
115 |
-
/**
|
116 |
-
* Sets the email address of the account owner.
|
117 |
-
*
|
118 |
-
* @param string $email the email address.
|
119 |
-
*/
|
120 |
-
public function setEmail($email)
|
121 |
-
{
|
122 |
-
$this->_email = $email;
|
123 |
-
}
|
124 |
-
|
125 |
/**
|
126 |
* The email address of the account owner.
|
127 |
*
|
72 |
$this->_email = $user->getEmail();
|
73 |
}
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
/**
|
76 |
* The first name of the account owner.
|
77 |
*
|
82 |
return $this->_firstName;
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
/**
|
86 |
* The last name of the account owner.
|
87 |
*
|
92 |
return $this->_lastName;
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
/**
|
96 |
* The email address of the account owner.
|
97 |
*
|
app/code/community/Nosto/Tagging/Model/Meta/Oauth.php
CHANGED
@@ -120,16 +120,6 @@ class Nosto_Tagging_Model_Meta_Oauth extends Mage_Core_Model_Abstract implements
|
|
120 |
return $this->_redirectUrl;
|
121 |
}
|
122 |
|
123 |
-
/**
|
124 |
-
* Sets the redirect url.
|
125 |
-
*
|
126 |
-
* @param string $url the url.
|
127 |
-
*/
|
128 |
-
public function setRedirectUrl($url)
|
129 |
-
{
|
130 |
-
$this->_redirectUrl = $url;
|
131 |
-
}
|
132 |
-
|
133 |
/**
|
134 |
* The 2-letter ISO code (ISO 639-1) for the language the OAuth2 server
|
135 |
* uses for UI localization.
|
@@ -140,14 +130,4 @@ class Nosto_Tagging_Model_Meta_Oauth extends Mage_Core_Model_Abstract implements
|
|
140 |
{
|
141 |
return $this->_languageIsoCode;
|
142 |
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Sets the language ISO code.
|
146 |
-
*
|
147 |
-
* @param string $code the ISO code.
|
148 |
-
*/
|
149 |
-
public function setLanguageIsoCode($code)
|
150 |
-
{
|
151 |
-
$this->_languageIsoCode = $code;
|
152 |
-
}
|
153 |
}
|
120 |
return $this->_redirectUrl;
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
/**
|
124 |
* The 2-letter ISO code (ISO 639-1) for the language the OAuth2 server
|
125 |
* uses for UI localization.
|
130 |
{
|
131 |
return $this->_languageIsoCode;
|
132 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Order.php
CHANGED
@@ -82,6 +82,60 @@ class Nosto_Tagging_Model_Meta_Order extends Mage_Core_Model_Abstract implements
|
|
82 |
$this->_init('nosto_tagging/meta_order');
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
/**
|
86 |
* The unique order number identifying the order.
|
87 |
*
|
@@ -142,61 +196,4 @@ class Nosto_Tagging_Model_Meta_Order extends Mage_Core_Model_Abstract implements
|
|
142 |
{
|
143 |
return $this->_orderStatus;
|
144 |
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* Loads the order info from a Magento order model.
|
148 |
-
*
|
149 |
-
* @param Mage_Sales_Model_Order $order the order model.
|
150 |
-
*/
|
151 |
-
public function loadData(Mage_Sales_Model_Order $order)
|
152 |
-
{
|
153 |
-
$this->_orderNumber = $order->getId();
|
154 |
-
$this->_createdDate = $order->getCreatedAt();
|
155 |
-
|
156 |
-
$method = $order->getPayment()->getMethodInstance();
|
157 |
-
$this->_paymentProvider = $method->getCode();
|
158 |
-
|
159 |
-
$this->_orderStatus = new Nosto_Tagging_Model_Meta_Order_Status();
|
160 |
-
$this->_orderStatus->loadData($order);
|
161 |
-
|
162 |
-
$this->_buyer = new Nosto_Tagging_Model_Meta_Order_Buyer();
|
163 |
-
$this->_buyer->loadData($order);
|
164 |
-
|
165 |
-
/** @var $item Mage_Sales_Model_Order_Item */
|
166 |
-
foreach ($order->getAllVisibleItems() as $item) {
|
167 |
-
/** @var Mage_Catalog_Model_Product $product */
|
168 |
-
$product = Mage::getModel('catalog/product')
|
169 |
-
->load($item->getProductId());
|
170 |
-
if ($product->getTypeId() === Mage_Catalog_Model_Product_Type::TYPE_BUNDLE
|
171 |
-
&& (int)$product->getPriceType() === Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED
|
172 |
-
) {
|
173 |
-
continue;
|
174 |
-
}
|
175 |
-
$orderItem = new Nosto_Tagging_Model_Meta_Order_Item();
|
176 |
-
$orderItem->loadData($item);
|
177 |
-
$this->_items[] = $orderItem;
|
178 |
-
}
|
179 |
-
|
180 |
-
if ($this->includeSpecialItems) {
|
181 |
-
if (($discount = $order->getDiscountAmount()) > 0) {
|
182 |
-
$orderItem = new Nosto_Tagging_Model_Meta_Order_Item();
|
183 |
-
$orderItem->setProductId(-1);
|
184 |
-
$orderItem->setQuantity(1);
|
185 |
-
$orderItem->setName('Discount');
|
186 |
-
$orderItem->setUnitPrice($discount);
|
187 |
-
$orderItem->setCurrencyCode($order->getOrderCurrencyCode());
|
188 |
-
$this->_items[] = $orderItem;
|
189 |
-
}
|
190 |
-
|
191 |
-
if (($shippingInclTax = $order->getShippingInclTax()) > 0) {
|
192 |
-
$orderItem = new Nosto_Tagging_Model_Meta_Order_Item();
|
193 |
-
$orderItem->setProductId(-1);
|
194 |
-
$orderItem->setQuantity(1);
|
195 |
-
$orderItem->setName('Shipping and handling');
|
196 |
-
$orderItem->setUnitPrice($shippingInclTax);
|
197 |
-
$orderItem->setCurrencyCode($order->getOrderCurrencyCode());
|
198 |
-
$this->_items[] = $orderItem;
|
199 |
-
}
|
200 |
-
}
|
201 |
-
}
|
202 |
}
|
82 |
$this->_init('nosto_tagging/meta_order');
|
83 |
}
|
84 |
|
85 |
+
/**
|
86 |
+
* Loads the order info from a Magento order model.
|
87 |
+
*
|
88 |
+
* @param Mage_Sales_Model_Order $order the order model.
|
89 |
+
*/
|
90 |
+
public function loadData(Mage_Sales_Model_Order $order)
|
91 |
+
{
|
92 |
+
$this->_orderNumber = $order->getId();
|
93 |
+
$this->_createdDate = $order->getCreatedAt();
|
94 |
+
$this->_paymentProvider = $order->getPayment()->getMethod();
|
95 |
+
|
96 |
+
/** @var Nosto_Tagging_Model_Meta_Order_Status $orderStatus */
|
97 |
+
$orderStatus = Mage::getModel('nosto_tagging/meta_order_status');
|
98 |
+
$orderStatus->loadData($order);
|
99 |
+
$this->_orderStatus = $orderStatus;
|
100 |
+
|
101 |
+
/** @var Nosto_Tagging_Model_Meta_Order_Buyer $orderBuyer */
|
102 |
+
$orderBuyer = Mage::getModel('nosto_tagging/meta_order_buyer');
|
103 |
+
$orderBuyer->loadData($order);
|
104 |
+
$this->_buyer = $orderBuyer;
|
105 |
+
|
106 |
+
/** @var $item Mage_Sales_Model_Order_Item */
|
107 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
108 |
+
/** @var Nosto_Tagging_Model_Meta_Order_Item $orderItem */
|
109 |
+
$orderItem = Mage::getModel('nosto_tagging/meta_order_item');
|
110 |
+
$orderItem->loadData($item);
|
111 |
+
$this->_items[] = $orderItem;
|
112 |
+
}
|
113 |
+
|
114 |
+
if ($this->includeSpecialItems) {
|
115 |
+
if (($discount = $order->getDiscountAmount()) > 0) {
|
116 |
+
/** @var Nosto_Tagging_Model_Meta_Order_Item $orderItem */
|
117 |
+
$orderItem = Mage::getModel('nosto_tagging/meta_order_item');
|
118 |
+
$orderItem->loadSpecialItemData(
|
119 |
+
'Discount',
|
120 |
+
$discount,
|
121 |
+
$order->getOrderCurrencyCode()
|
122 |
+
);
|
123 |
+
$this->_items[] = $orderItem;
|
124 |
+
}
|
125 |
+
|
126 |
+
if (($shippingInclTax = $order->getShippingInclTax()) > 0) {
|
127 |
+
/** @var Nosto_Tagging_Model_Meta_Order_Item $orderItem */
|
128 |
+
$orderItem = Mage::getModel('nosto_tagging/meta_order_item');
|
129 |
+
$orderItem->loadSpecialItemData(
|
130 |
+
'Shipping and handling',
|
131 |
+
$shippingInclTax,
|
132 |
+
$order->getOrderCurrencyCode()
|
133 |
+
);
|
134 |
+
$this->_items[] = $orderItem;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* The unique order number identifying the order.
|
141 |
*
|
196 |
{
|
197 |
return $this->_orderStatus;
|
198 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Order/Buyer.php
CHANGED
@@ -59,6 +59,18 @@ class Nosto_Tagging_Model_Meta_Order_Buyer extends Mage_Core_Model_Abstract impl
|
|
59 |
$this->_init('nosto_tagging/meta_order_buyer');
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* Gets the first name of the user who placed the order.
|
64 |
*
|
@@ -88,16 +100,4 @@ class Nosto_Tagging_Model_Meta_Order_Buyer extends Mage_Core_Model_Abstract impl
|
|
88 |
{
|
89 |
return $this->_email;
|
90 |
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Loads the buyer info from a Magento order model.
|
94 |
-
*
|
95 |
-
* @param Mage_Sales_Model_Order $order the order model.
|
96 |
-
*/
|
97 |
-
public function loadData(Mage_Sales_Model_Order $order)
|
98 |
-
{
|
99 |
-
$this->_firstName = $order->getCustomerFirstname();
|
100 |
-
$this->_lastName = $order->getCustomerLastname();
|
101 |
-
$this->_email = $order->getCustomerEmail();
|
102 |
-
}
|
103 |
}
|
59 |
$this->_init('nosto_tagging/meta_order_buyer');
|
60 |
}
|
61 |
|
62 |
+
/**
|
63 |
+
* Loads the buyer info from a Magento order model.
|
64 |
+
*
|
65 |
+
* @param Mage_Sales_Model_Order $order the order model.
|
66 |
+
*/
|
67 |
+
public function loadData(Mage_Sales_Model_Order $order)
|
68 |
+
{
|
69 |
+
$this->_firstName = $order->getCustomerFirstname();
|
70 |
+
$this->_lastName = $order->getCustomerLastname();
|
71 |
+
$this->_email = $order->getCustomerEmail();
|
72 |
+
}
|
73 |
+
|
74 |
/**
|
75 |
* Gets the first name of the user who placed the order.
|
76 |
*
|
100 |
{
|
101 |
return $this->_email;
|
102 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Order/Item.php
CHANGED
@@ -70,107 +70,6 @@ class Nosto_Tagging_Model_Meta_Order_Item extends Mage_Core_Model_Abstract imple
|
|
70 |
$this->_init('nosto_tagging/meta_order_item');
|
71 |
}
|
72 |
|
73 |
-
/**
|
74 |
-
* The unique identifier of the purchased item.
|
75 |
-
* If this item is for discounts or shipping cost, the id can be 0.
|
76 |
-
*
|
77 |
-
* @return string|int
|
78 |
-
*/
|
79 |
-
public function getProductId()
|
80 |
-
{
|
81 |
-
return $this->_productId;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Sets the unique identifier for the item.
|
86 |
-
*
|
87 |
-
* @param string|int $id the product id.
|
88 |
-
*/
|
89 |
-
public function setProductId($id)
|
90 |
-
{
|
91 |
-
$this->_productId = $id;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* The quantity of the item included in the order.
|
96 |
-
*
|
97 |
-
* @return int the quantity.
|
98 |
-
*/
|
99 |
-
public function getQuantity()
|
100 |
-
{
|
101 |
-
return $this->_quantity;
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Sets the item quantity.
|
106 |
-
*
|
107 |
-
* @param int $qty the quantity.
|
108 |
-
*/
|
109 |
-
public function setQuantity($qty)
|
110 |
-
{
|
111 |
-
$this->_quantity = $qty;
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* The name of the item included in the order.
|
116 |
-
*
|
117 |
-
* @return string the name.
|
118 |
-
*/
|
119 |
-
public function getName()
|
120 |
-
{
|
121 |
-
return $this->_name;
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Sets the item name.
|
126 |
-
*
|
127 |
-
* @param string $name the item name.
|
128 |
-
*/
|
129 |
-
public function setName($name)
|
130 |
-
{
|
131 |
-
$this->_name = $name;
|
132 |
-
}
|
133 |
-
|
134 |
-
/**
|
135 |
-
* The unit price of the item included in the order.
|
136 |
-
*
|
137 |
-
* @return float the unit price.
|
138 |
-
*/
|
139 |
-
public function getUnitPrice()
|
140 |
-
{
|
141 |
-
return $this->_unitPrice;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Sets the item unit price.
|
146 |
-
*
|
147 |
-
* @param float $price the item unit price.
|
148 |
-
*/
|
149 |
-
public function setUnitPrice($price)
|
150 |
-
{
|
151 |
-
$this->_unitPrice = $price;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* The 3-letter ISO code (ISO 4217) for the item currency.
|
156 |
-
*
|
157 |
-
* @return string the currency ISO code.
|
158 |
-
*/
|
159 |
-
public function getCurrencyCode()
|
160 |
-
{
|
161 |
-
return $this->_currencyCode;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Sets the items currency code (ISO 4217).
|
166 |
-
*
|
167 |
-
* @param string $code the currency ISO code.
|
168 |
-
*/
|
169 |
-
public function setCurrencyCode($code)
|
170 |
-
{
|
171 |
-
$this->_currencyCode = $code;
|
172 |
-
}
|
173 |
-
|
174 |
/**
|
175 |
* Loads the item info from the Magento order item model.
|
176 |
*
|
@@ -186,6 +85,24 @@ class Nosto_Tagging_Model_Meta_Order_Item extends Mage_Core_Model_Abstract imple
|
|
186 |
$this->_currencyCode = strtoupper($order->getOrderCurrencyCode());
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
/**
|
190 |
* Returns the product id for a quote item.
|
191 |
* Always try to find the "parent" product ID if the product is a child of
|
@@ -243,13 +160,15 @@ class Nosto_Tagging_Model_Meta_Order_Item extends Mage_Core_Model_Abstract imple
|
|
243 |
// products own name alone.
|
244 |
if (count($parentIds) === 1) {
|
245 |
$attributes = $item->getBuyRequest()->getData('super_attribute');
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
|
|
253 |
}
|
254 |
}
|
255 |
}
|
@@ -298,4 +217,55 @@ class Nosto_Tagging_Model_Meta_Order_Item extends Mage_Core_Model_Abstract imple
|
|
298 |
|
299 |
return $name;
|
300 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
}
|
70 |
$this->_init('nosto_tagging/meta_order_item');
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
/**
|
74 |
* Loads the item info from the Magento order item model.
|
75 |
*
|
85 |
$this->_currencyCode = strtoupper($order->getOrderCurrencyCode());
|
86 |
}
|
87 |
|
88 |
+
/**
|
89 |
+
* Loads the "special item" info from provided data.
|
90 |
+
* A "special item" is an item that is included in an order but does not
|
91 |
+
* represent an item being bough, e.g. shipping fees, discounts etc.
|
92 |
+
*
|
93 |
+
* @param string $name the name of the item.
|
94 |
+
* @param float|int|string $unitPrice the unit price of the item.
|
95 |
+
* @param string $currencyCode the currency code for the item unit price.
|
96 |
+
*/
|
97 |
+
public function loadSpecialItemData($name, $unitPrice, $currencyCode)
|
98 |
+
{
|
99 |
+
$this->_productId = -1;
|
100 |
+
$this->_quantity = 1;
|
101 |
+
$this->_name = (string)$name;
|
102 |
+
$this->_unitPrice = $unitPrice;
|
103 |
+
$this->_currencyCode = strtoupper($currencyCode);
|
104 |
+
}
|
105 |
+
|
106 |
/**
|
107 |
* Returns the product id for a quote item.
|
108 |
* Always try to find the "parent" product ID if the product is a child of
|
160 |
// products own name alone.
|
161 |
if (count($parentIds) === 1) {
|
162 |
$attributes = $item->getBuyRequest()->getData('super_attribute');
|
163 |
+
if (is_array($attributes)) {
|
164 |
+
foreach ($attributes as $id => $value) {
|
165 |
+
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */
|
166 |
+
$attribute = Mage::getModel('catalog/resource_eav_attribute')
|
167 |
+
->load($id);
|
168 |
+
$label = $attribute->getSource()->getOptionText($value);
|
169 |
+
if (!empty($label)) {
|
170 |
+
$optNames[] = $label;
|
171 |
+
}
|
172 |
}
|
173 |
}
|
174 |
}
|
217 |
|
218 |
return $name;
|
219 |
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* The unique identifier of the purchased item.
|
223 |
+
* If this item is for discounts or shipping cost, the id can be 0.
|
224 |
+
*
|
225 |
+
* @return string|int
|
226 |
+
*/
|
227 |
+
public function getProductId()
|
228 |
+
{
|
229 |
+
return $this->_productId;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* The quantity of the item included in the order.
|
234 |
+
*
|
235 |
+
* @return int the quantity.
|
236 |
+
*/
|
237 |
+
public function getQuantity()
|
238 |
+
{
|
239 |
+
return $this->_quantity;
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* The name of the item included in the order.
|
244 |
+
*
|
245 |
+
* @return string the name.
|
246 |
+
*/
|
247 |
+
public function getName()
|
248 |
+
{
|
249 |
+
return $this->_name;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* The unit price of the item included in the order.
|
254 |
+
*
|
255 |
+
* @return float the unit price.
|
256 |
+
*/
|
257 |
+
public function getUnitPrice()
|
258 |
+
{
|
259 |
+
return $this->_unitPrice;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* The 3-letter ISO code (ISO 4217) for the item currency.
|
264 |
+
*
|
265 |
+
* @return string the currency ISO code.
|
266 |
+
*/
|
267 |
+
public function getCurrencyCode()
|
268 |
+
{
|
269 |
+
return $this->_currencyCode;
|
270 |
+
}
|
271 |
}
|
app/code/community/Nosto/Tagging/Model/Meta/Product.php
CHANGED
@@ -94,7 +94,11 @@ class Nosto_Tagging_Model_Meta_Product extends Nosto_Tagging_Model_Base implemen
|
|
94 |
/**
|
95 |
* @var array the tags for the product.
|
96 |
*/
|
97 |
-
protected $_tags = array(
|
|
|
|
|
|
|
|
|
98 |
|
99 |
/**
|
100 |
* @var array the categories the product is located in.
|
@@ -151,6 +155,193 @@ class Nosto_Tagging_Model_Meta_Product extends Nosto_Tagging_Model_Base implemen
|
|
151 |
);
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
/**
|
155 |
* Returns the absolute url to the product page in the shop frontend.
|
156 |
*
|
@@ -244,7 +435,7 @@ class Nosto_Tagging_Model_Meta_Product extends Nosto_Tagging_Model_Base implemen
|
|
244 |
/**
|
245 |
* Returns the tags for the product.
|
246 |
*
|
247 |
-
* @return array the tags array, e.g. array("winter", "shoe").
|
248 |
*/
|
249 |
public function getTags()
|
250 |
{
|
@@ -302,147 +493,20 @@ class Nosto_Tagging_Model_Meta_Product extends Nosto_Tagging_Model_Base implemen
|
|
302 |
}
|
303 |
|
304 |
/**
|
305 |
-
*
|
306 |
-
*
|
307 |
-
* @param Mage_Catalog_Model_Product $product the product model.
|
308 |
-
* @param Mage_Core_Model_Store|null $store the store to get the product data for.
|
309 |
-
*/
|
310 |
-
public function loadData(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store = null)
|
311 |
-
{
|
312 |
-
if (is_null($store)) {
|
313 |
-
$store = Mage::app()->getStore();
|
314 |
-
}
|
315 |
-
|
316 |
-
// Unset the cached url first, as it won't include the `___store` param
|
317 |
-
// if it's cached. We need to define the specific store view in the url
|
318 |
-
// in case the same domain is used for all sites.
|
319 |
-
$this->_url = $product
|
320 |
-
->unsetData('url')
|
321 |
-
->getUrlInStore(
|
322 |
-
array(
|
323 |
-
'_nosid' => true,
|
324 |
-
'_ignore_category' => true,
|
325 |
-
'_store' => $store->getCode(),
|
326 |
-
)
|
327 |
-
);
|
328 |
-
|
329 |
-
$this->_productId = $product->getId();
|
330 |
-
$this->_name = $product->getName();
|
331 |
-
$this->_imageUrl = $this->buildImageUrl($product, $store);
|
332 |
-
|
333 |
-
$this->_price = Mage::helper('tax')->getPrice(
|
334 |
-
$product,
|
335 |
-
Mage::helper('nosto_tagging/price')->getProductFinalPrice($product),
|
336 |
-
true
|
337 |
-
);
|
338 |
-
$this->_listPrice = Mage::helper('tax')->getPrice(
|
339 |
-
$product,
|
340 |
-
Mage::helper('nosto_tagging/price')->getProductPrice($product),
|
341 |
-
true
|
342 |
-
);
|
343 |
-
$this->_currencyCode = $store->getCurrentCurrencyCode();
|
344 |
-
$this->_availability = $product->isAvailable()
|
345 |
-
? self::PRODUCT_IN_STOCK
|
346 |
-
: self::PRODUCT_OUT_OF_STOCK;
|
347 |
-
|
348 |
-
if (Mage::helper('core')->isModuleEnabled('Mage_Tag')) {
|
349 |
-
$tagCollection = Mage::getModel('tag/tag')
|
350 |
-
->getCollection()
|
351 |
-
->addPopularity()
|
352 |
-
->addStatusFilter(Mage_Tag_Model_Tag::STATUS_APPROVED)
|
353 |
-
->addProductFilter($product->getId())
|
354 |
-
->setFlag('relation', true)
|
355 |
-
->addStoreFilter($store->getId())
|
356 |
-
->setActiveFilter();
|
357 |
-
foreach ($tagCollection as $tag) {
|
358 |
-
$this->_tags[] = $tag->getName();
|
359 |
-
}
|
360 |
-
}
|
361 |
-
|
362 |
-
if (!$product->canConfigure()) {
|
363 |
-
$this->_tags[] = self::PRODUCT_ADD_TO_CART;
|
364 |
-
}
|
365 |
-
|
366 |
-
$this->_categories = $this->getProductCategories($product);
|
367 |
-
$this->_shortDescription = (string)$product->getShortDescription();
|
368 |
-
$this->_description = (string)$product->getDescription();
|
369 |
-
$this->_brand = $product->getManufacturer()
|
370 |
-
? (string)$product->getAttributeText('manufacturer')
|
371 |
-
: '';
|
372 |
-
|
373 |
-
$this->_datePublished = $product->getCreatedAt();
|
374 |
-
}
|
375 |
-
|
376 |
-
/**
|
377 |
-
* Return array of categories for the product.
|
378 |
-
* The items in the array are strings combined of the complete category
|
379 |
-
* path to the products own category.
|
380 |
-
*
|
381 |
-
* Structure:
|
382 |
-
* array (
|
383 |
-
* /Electronics/Computers
|
384 |
-
* )
|
385 |
-
*
|
386 |
-
* @param Mage_Catalog_Model_Product $product the product model.
|
387 |
*
|
388 |
-
* @return
|
389 |
*/
|
390 |
-
public function
|
391 |
{
|
392 |
-
$
|
393 |
-
|
394 |
-
|
395 |
-
$categoryCollection = $product->getCategoryCollection();
|
396 |
-
foreach ($categoryCollection as $category) {
|
397 |
-
$categoryString = Mage::helper('nosto_tagging')
|
398 |
-
->buildCategoryString($category);
|
399 |
-
if (!empty($categoryString)) {
|
400 |
-
$data[] = $categoryString;
|
401 |
-
}
|
402 |
-
}
|
403 |
}
|
404 |
-
|
405 |
-
|
406 |
-
}
|
407 |
-
|
408 |
-
/**
|
409 |
-
* Builds the product absolute image url for the store and returns it.
|
410 |
-
* The image version is primarily taken from the store config, but falls
|
411 |
-
* back the the base image if nothing is configured.
|
412 |
-
*
|
413 |
-
* @param Mage_Catalog_Model_Product $product the product model.
|
414 |
-
* @param Mage_Core_Model_Store $store the store model.
|
415 |
-
*
|
416 |
-
* @return null|string
|
417 |
-
*/
|
418 |
-
protected function buildImageUrl(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store)
|
419 |
-
{
|
420 |
-
$url = null;
|
421 |
-
/** @var Nosto_Tagging_Helper_Data $helper */
|
422 |
-
$helper = Mage::helper('nosto_tagging');
|
423 |
-
$imageVersion = $helper->getProductImageVersion($store);
|
424 |
-
$img = $product->getData($imageVersion);
|
425 |
-
$img = $this->isValidImage($img) ? $img : $product->getData('image');
|
426 |
-
if ($this->isValidImage($img)) {
|
427 |
-
// We build the image url manually in order get the correct base
|
428 |
-
// url, even if this product is populated in the backend.
|
429 |
-
$baseUrl = rtrim($store->getBaseUrl('media'), '/');
|
430 |
-
$file = str_replace(DS, '/', $img);
|
431 |
-
$file = ltrim($file, '/');
|
432 |
-
$url = $baseUrl.'/catalog/product/'.$file;
|
433 |
}
|
434 |
-
return $
|
435 |
-
}
|
436 |
-
|
437 |
-
/**
|
438 |
-
* Checks if the given image file path is valid.
|
439 |
-
*
|
440 |
-
* @param string $image the image file path.
|
441 |
-
*
|
442 |
-
* @return bool
|
443 |
-
*/
|
444 |
-
protected function isValidImage($image)
|
445 |
-
{
|
446 |
-
return (!empty($image) && $image !== 'no_selection');
|
447 |
}
|
448 |
}
|
94 |
/**
|
95 |
* @var array the tags for the product.
|
96 |
*/
|
97 |
+
protected $_tags = array(
|
98 |
+
'tag1' => array(),
|
99 |
+
'tag2' => array(),
|
100 |
+
'tag3' => array(),
|
101 |
+
);
|
102 |
|
103 |
/**
|
104 |
* @var array the categories the product is located in.
|
155 |
);
|
156 |
}
|
157 |
|
158 |
+
/**
|
159 |
+
* Loads the product info from a Magento product model.
|
160 |
+
*
|
161 |
+
* @param Mage_Catalog_Model_Product $product the product model.
|
162 |
+
* @param Mage_Core_Model_Store|null $store the store to get the product data for.
|
163 |
+
*/
|
164 |
+
public function loadData(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store = null)
|
165 |
+
{
|
166 |
+
if (is_null($store)) {
|
167 |
+
$store = Mage::app()->getStore();
|
168 |
+
}
|
169 |
+
|
170 |
+
/** @var Nosto_Tagging_Helper_Price $priceHelper */
|
171 |
+
$priceHelper = Mage::helper('nosto_tagging/price');
|
172 |
+
|
173 |
+
$this->_url = $this->buildUrl($product, $store);
|
174 |
+
$this->_productId = $product->getId();
|
175 |
+
$this->_name = $product->getName();
|
176 |
+
$this->_imageUrl = $this->buildImageUrl($product, $store);
|
177 |
+
$this->_price = $priceHelper->getProductFinalPriceInclTax($product);
|
178 |
+
$this->_listPrice = $priceHelper->getProductPriceInclTax($product);
|
179 |
+
$this->_currencyCode = $store->getCurrentCurrencyCode();
|
180 |
+
$this->_availability = $product->isAvailable()
|
181 |
+
? self::PRODUCT_IN_STOCK
|
182 |
+
: self::PRODUCT_OUT_OF_STOCK;
|
183 |
+
$this->_categories = $this->buildCategories($product);
|
184 |
+
|
185 |
+
// Optional properties.
|
186 |
+
|
187 |
+
if ($product->hasData('short_description')) {
|
188 |
+
$this->_shortDescription = $product->getData('short_description');
|
189 |
+
}
|
190 |
+
if ($product->hasData('description')) {
|
191 |
+
$this->_description = $product->getData('description');
|
192 |
+
}
|
193 |
+
if ($product->hasData('manufacturer')) {
|
194 |
+
$this->_brand = $product->getAttributeText('manufacturer');
|
195 |
+
}
|
196 |
+
if (($tags = $this->buildTags($product, $store)) !== array()) {
|
197 |
+
$this->_tags['tag1'] = $tags;
|
198 |
+
}
|
199 |
+
if ($product->hasData('created_at')) {
|
200 |
+
$this->_datePublished = $product->getData('created_at');
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Builds the "tag1" tags.
|
206 |
+
*
|
207 |
+
* These include any "tag/tag" model names linked to the product, as well
|
208 |
+
* as a special "add-to-cart" tag if the product can be added to the
|
209 |
+
* cart directly without any choices, i.e. it is a non-configurable simple
|
210 |
+
* product.
|
211 |
+
* This special tag can then be used in the store frontend to enable a
|
212 |
+
* "add to cart" button in the product recommendations.
|
213 |
+
*
|
214 |
+
* @param Mage_Catalog_Model_Product $product the product model.
|
215 |
+
* @param Mage_Core_Model_Store $store the store model.
|
216 |
+
*
|
217 |
+
* @return array
|
218 |
+
*/
|
219 |
+
protected function buildTags(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store)
|
220 |
+
{
|
221 |
+
$tags = array();
|
222 |
+
|
223 |
+
if (Mage::helper('core')->isModuleEnabled('Mage_Tag')) {
|
224 |
+
$tagCollection = Mage::getModel('tag/tag')
|
225 |
+
->getCollection()
|
226 |
+
->addPopularity()
|
227 |
+
->addStatusFilter(Mage_Tag_Model_Tag::STATUS_APPROVED)
|
228 |
+
->addProductFilter($product->getId())
|
229 |
+
->setFlag('relation', true)
|
230 |
+
->addStoreFilter($store->getId())
|
231 |
+
->setActiveFilter();
|
232 |
+
foreach ($tagCollection as $tag) {
|
233 |
+
/** @var Mage_Tag_Model_Tag $tag */
|
234 |
+
$tags[] = $tag->getName();
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
if (!$product->canConfigure()) {
|
239 |
+
$tags[] = self::PRODUCT_ADD_TO_CART;
|
240 |
+
}
|
241 |
+
|
242 |
+
return $tags;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Builds the absolute store front url for the product page.
|
247 |
+
*
|
248 |
+
* The url includes the "___store" GET parameter in order for the Nosto
|
249 |
+
* crawler to distinguish between stores that do not have separate domains
|
250 |
+
* or paths.
|
251 |
+
*
|
252 |
+
* @param Mage_Catalog_Model_Product $product the product model.
|
253 |
+
* @param Mage_Core_Model_Store $store the store model.
|
254 |
+
*
|
255 |
+
* @return string
|
256 |
+
*/
|
257 |
+
protected function buildUrl(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store)
|
258 |
+
{
|
259 |
+
// Unset the cached url first, as it won't include the `___store` param
|
260 |
+
// if it's cached. We need to define the specific store view in the url
|
261 |
+
// in case the same domain is used for all sites.
|
262 |
+
$product->unsetData('url');
|
263 |
+
return $product
|
264 |
+
->getUrlInStore(
|
265 |
+
array(
|
266 |
+
'_nosid' => true,
|
267 |
+
'_ignore_category' => true,
|
268 |
+
'_store' => $store->getCode(),
|
269 |
+
)
|
270 |
+
);
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Builds the product absolute image url for the store and returns it.
|
275 |
+
* The image version is primarily taken from the store config, but falls
|
276 |
+
* back the the base image if nothing is configured.
|
277 |
+
*
|
278 |
+
* @param Mage_Catalog_Model_Product $product the product model.
|
279 |
+
* @param Mage_Core_Model_Store $store the store model.
|
280 |
+
*
|
281 |
+
* @return null|string
|
282 |
+
*/
|
283 |
+
protected function buildImageUrl(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store)
|
284 |
+
{
|
285 |
+
$url = null;
|
286 |
+
/** @var Nosto_Tagging_Helper_Data $helper */
|
287 |
+
$helper = Mage::helper('nosto_tagging');
|
288 |
+
$imageVersion = $helper->getProductImageVersion($store);
|
289 |
+
$img = $product->getData($imageVersion);
|
290 |
+
$img = $this->isValidImage($img) ? $img : $product->getData('image');
|
291 |
+
if ($this->isValidImage($img)) {
|
292 |
+
// We build the image url manually in order get the correct base
|
293 |
+
// url, even if this product is populated in the backend.
|
294 |
+
$baseUrl = rtrim($store->getBaseUrl('media'), '/');
|
295 |
+
$file = str_replace(DS, '/', $img);
|
296 |
+
$file = ltrim($file, '/');
|
297 |
+
$url = $baseUrl.'/catalog/product/'.$file;
|
298 |
+
}
|
299 |
+
return $url;
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Return array of categories for the product.
|
304 |
+
* The items in the array are strings combined of the complete category
|
305 |
+
* path to the products own category.
|
306 |
+
*
|
307 |
+
* Structure:
|
308 |
+
* array (
|
309 |
+
* /Electronics/Computers
|
310 |
+
* )
|
311 |
+
*
|
312 |
+
* @param Mage_Catalog_Model_Product $product the product model.
|
313 |
+
*
|
314 |
+
* @return array
|
315 |
+
*/
|
316 |
+
protected function buildCategories(Mage_Catalog_Model_Product $product)
|
317 |
+
{
|
318 |
+
$data = array();
|
319 |
+
|
320 |
+
/** @var Nosto_Tagging_Helper_Data $helper */
|
321 |
+
$helper = Mage::helper('nosto_tagging');
|
322 |
+
$categoryCollection = $product->getCategoryCollection();
|
323 |
+
foreach ($categoryCollection as $category) {
|
324 |
+
$categoryString = $helper->buildCategoryString($category);
|
325 |
+
if (!empty($categoryString)) {
|
326 |
+
$data[] = $categoryString;
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
+
return $data;
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Checks if the given image file path is valid.
|
335 |
+
*
|
336 |
+
* @param string $image the image file path.
|
337 |
+
*
|
338 |
+
* @return bool
|
339 |
+
*/
|
340 |
+
protected function isValidImage($image)
|
341 |
+
{
|
342 |
+
return (!empty($image) && $image !== 'no_selection');
|
343 |
+
}
|
344 |
+
|
345 |
/**
|
346 |
* Returns the absolute url to the product page in the shop frontend.
|
347 |
*
|
435 |
/**
|
436 |
* Returns the tags for the product.
|
437 |
*
|
438 |
+
* @return array the tags array, e.g. array('tag1' => array("winter", "shoe")).
|
439 |
*/
|
440 |
public function getTags()
|
441 |
{
|
493 |
}
|
494 |
|
495 |
/**
|
496 |
+
* Returns the full product description,
|
497 |
+
* i.e. both the "short" and "normal" descriptions concatenated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
*
|
499 |
+
* @return string the full descriptions.
|
500 |
*/
|
501 |
+
public function getFullDescription()
|
502 |
{
|
503 |
+
$descriptions = array();
|
504 |
+
if (!empty($this->_shortDescription)) {
|
505 |
+
$descriptions[] = $this->_shortDescription;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
}
|
507 |
+
if (!empty($this->_description)) {
|
508 |
+
$descriptions[] = $this->_description;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
}
|
510 |
+
return implode(' ', $descriptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
}
|
512 |
}
|
app/code/community/Nosto/Tagging/Model/Observer.php
CHANGED
@@ -100,7 +100,8 @@ class Nosto_Tagging_Model_Observer
|
|
100 |
continue;
|
101 |
}
|
102 |
|
103 |
-
$model
|
|
|
104 |
$model->loadData($product, $store);
|
105 |
|
106 |
// Only send product update if we have all required
|
@@ -146,7 +147,8 @@ class Nosto_Tagging_Model_Observer
|
|
146 |
continue;
|
147 |
}
|
148 |
|
149 |
-
$model
|
|
|
150 |
$model->setProductId($product->getId());
|
151 |
|
152 |
try {
|
@@ -177,7 +179,8 @@ class Nosto_Tagging_Model_Observer
|
|
177 |
try {
|
178 |
/** @var Mage_Sales_Model_Order $mageOrder */
|
179 |
$mageOrder = $observer->getEvent()->getOrder();
|
180 |
-
$order
|
|
|
181 |
$order->loadData($mageOrder);
|
182 |
/** @var NostoAccount $account */
|
183 |
$account = Mage::helper('nosto_tagging/account')
|
100 |
continue;
|
101 |
}
|
102 |
|
103 |
+
/** @var Nosto_Tagging_Model_Meta_Product $model */
|
104 |
+
$model = Mage::getModel('nosto_tagging/meta_product');
|
105 |
$model->loadData($product, $store);
|
106 |
|
107 |
// Only send product update if we have all required
|
147 |
continue;
|
148 |
}
|
149 |
|
150 |
+
/** @var Nosto_Tagging_Model_Meta_Product $model */
|
151 |
+
$model = Mage::getModel('nosto_tagging/meta_product');
|
152 |
$model->setProductId($product->getId());
|
153 |
|
154 |
try {
|
179 |
try {
|
180 |
/** @var Mage_Sales_Model_Order $mageOrder */
|
181 |
$mageOrder = $observer->getEvent()->getOrder();
|
182 |
+
/** @var Nosto_Tagging_Model_Meta_Order $order */
|
183 |
+
$order = Mage::getModel('nosto_tagging/meta_order');
|
184 |
$order->loadData($mageOrder);
|
185 |
/** @var NostoAccount $account */
|
186 |
$account = Mage::helper('nosto_tagging/account')
|
app/code/community/Nosto/Tagging/Model/Product.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Nosto
|
22 |
+
* @package Nosto_Tagging
|
23 |
+
* @author Nosto Solutions Ltd <magento@nosto.com>
|
24 |
+
* @copyright Copyright (c) 2013-2015 Nosto Solutions Ltd (http://www.nosto.com)
|
25 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Product model that extends the Magento catalog product model.
|
30 |
+
* Used to define custom product collection in product exports to Nosto.
|
31 |
+
*
|
32 |
+
* @category Nosto
|
33 |
+
* @package Nosto_Tagging
|
34 |
+
* @author Nosto Solutions Ltd <magento@nosto.com>
|
35 |
+
*/
|
36 |
+
class Nosto_Tagging_Model_Product extends Mage_Catalog_Model_Product
|
37 |
+
{
|
38 |
+
/**
|
39 |
+
* @inheritdoc
|
40 |
+
*/
|
41 |
+
protected function _construct()
|
42 |
+
{
|
43 |
+
$this->_init('nosto_tagging/product');
|
44 |
+
}
|
45 |
+
}
|
app/code/community/Nosto/Tagging/Model/Resource/Product/Collection.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Nosto
|
22 |
+
* @package Nosto_Tagging
|
23 |
+
* @author Nosto Solutions Ltd <magento@nosto.com>
|
24 |
+
* @copyright Copyright (c) 2013-2015 Nosto Solutions Ltd (http://www.nosto.com)
|
25 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Product collection that extends the Magento catalog product collection.
|
30 |
+
* Used to disable flat collections in product exports to Nosto.
|
31 |
+
*
|
32 |
+
* @category Nosto
|
33 |
+
* @package Nosto_Tagging
|
34 |
+
* @author Nosto Solutions Ltd <magento@nosto.com>
|
35 |
+
*/
|
36 |
+
class Nosto_Tagging_Model_Resource_Product_Collection extends Mage_Catalog_Model_Resource_Product_Collection
|
37 |
+
{
|
38 |
+
/**
|
39 |
+
* @inheritdoc
|
40 |
+
*/
|
41 |
+
public function isEnabledFlat()
|
42 |
+
{
|
43 |
+
// Never use the flat collection.
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
}
|
app/code/community/Nosto/Tagging/controllers/Adminhtml/NostoController.php
CHANGED
@@ -57,10 +57,12 @@ class Nosto_Tagging_Adminhtml_NostoController extends Mage_Adminhtml_Controller_
|
|
57 |
if ($session !== null) {
|
58 |
$type = $this->getRequest()->getParam('message_type');
|
59 |
$code = $this->getRequest()->getParam('message_code');
|
|
|
60 |
if ($type !== null && $code !== null) {
|
61 |
$session->setData('nosto_message', array(
|
62 |
'type' => $type,
|
63 |
'code' => $code,
|
|
|
64 |
));
|
65 |
}
|
66 |
}
|
57 |
if ($session !== null) {
|
58 |
$type = $this->getRequest()->getParam('message_type');
|
59 |
$code = $this->getRequest()->getParam('message_code');
|
60 |
+
$text = $this->getRequest()->getParam('message_text');
|
61 |
if ($type !== null && $code !== null) {
|
62 |
$session->setData('nosto_message', array(
|
63 |
'type' => $type,
|
64 |
'code' => $code,
|
65 |
+
'text' => $text,
|
66 |
));
|
67 |
}
|
68 |
}
|
app/code/community/Nosto/Tagging/controllers/ExportController.php
CHANGED
@@ -49,6 +49,7 @@ class Nosto_tagging_ExportController extends Mage_Core_Controller_Front_Action
|
|
49 |
$pageSize = (int)$this->getRequest()->getParam('limit', 100);
|
50 |
$currentOffset = (int)$this->getRequest()->getParam('offset', 0);
|
51 |
$currentPage = ($currentOffset / $pageSize) + 1;
|
|
|
52 |
$orders = Mage::getModel('sales/order')
|
53 |
->getCollection()
|
54 |
->addFieldToFilter('store_id', Mage::app()->getStore()->getId())
|
@@ -59,7 +60,8 @@ class Nosto_tagging_ExportController extends Mage_Core_Controller_Front_Action
|
|
59 |
}
|
60 |
$collection = new NostoExportOrderCollection();
|
61 |
foreach ($orders as $order) {
|
62 |
-
$meta
|
|
|
63 |
// We don't need special items like shipping cost and discounts.
|
64 |
$meta->includeSpecialItems = false;
|
65 |
$meta->loadData($order);
|
@@ -79,7 +81,10 @@ class Nosto_tagging_ExportController extends Mage_Core_Controller_Front_Action
|
|
79 |
$pageSize = (int)$this->getRequest()->getParam('limit', 100);
|
80 |
$currentOffset = (int)$this->getRequest()->getParam('offset', 0);
|
81 |
$currentPage = ($currentOffset / $pageSize) + 1;
|
82 |
-
|
|
|
|
|
|
|
83 |
->getCollection()
|
84 |
->addStoreFilter(Mage::app()->getStore()->getId())
|
85 |
->addAttributeToSelect('*')
|
@@ -99,12 +104,9 @@ class Nosto_tagging_ExportController extends Mage_Core_Controller_Front_Action
|
|
99 |
}
|
100 |
$collection = new NostoExportProductCollection();
|
101 |
foreach ($products as $product) {
|
102 |
-
|
103 |
-
|
104 |
-
)
|
105 |
-
continue;
|
106 |
-
}
|
107 |
-
$meta = new Nosto_Tagging_Model_Meta_Product();
|
108 |
$meta->loadData($product);
|
109 |
$validator = new NostoValidator($meta);
|
110 |
if ($validator->validate()) {
|
49 |
$pageSize = (int)$this->getRequest()->getParam('limit', 100);
|
50 |
$currentOffset = (int)$this->getRequest()->getParam('offset', 0);
|
51 |
$currentPage = ($currentOffset / $pageSize) + 1;
|
52 |
+
/** @var Mage_Sales_Model_Resource_Order_Collection $orders */
|
53 |
$orders = Mage::getModel('sales/order')
|
54 |
->getCollection()
|
55 |
->addFieldToFilter('store_id', Mage::app()->getStore()->getId())
|
60 |
}
|
61 |
$collection = new NostoExportOrderCollection();
|
62 |
foreach ($orders as $order) {
|
63 |
+
/** @var Nosto_Tagging_Model_Meta_Order $meta */
|
64 |
+
$meta = Mage::getModel('nosto_tagging/meta_order');
|
65 |
// We don't need special items like shipping cost and discounts.
|
66 |
$meta->includeSpecialItems = false;
|
67 |
$meta->loadData($order);
|
81 |
$pageSize = (int)$this->getRequest()->getParam('limit', 100);
|
82 |
$currentOffset = (int)$this->getRequest()->getParam('offset', 0);
|
83 |
$currentPage = ($currentOffset / $pageSize) + 1;
|
84 |
+
// We use our own collection object to avoid issues with the product
|
85 |
+
// flat collection. It's missing required data by default.
|
86 |
+
/** @var Nosto_Tagging_Model_Resource_Product_Collection $products */
|
87 |
+
$products = Mage::getModel('nosto_tagging/product')
|
88 |
->getCollection()
|
89 |
->addStoreFilter(Mage::app()->getStore()->getId())
|
90 |
->addAttributeToSelect('*')
|
104 |
}
|
105 |
$collection = new NostoExportProductCollection();
|
106 |
foreach ($products as $product) {
|
107 |
+
/** @var Mage_Catalog_Model_Product $product */
|
108 |
+
/** @var Nosto_Tagging_Model_Meta_Product $meta */
|
109 |
+
$meta = Mage::getModel('nosto_tagging/meta_product');
|
|
|
|
|
|
|
110 |
$meta->loadData($product);
|
111 |
$validator = new NostoValidator($meta);
|
112 |
if ($validator->validate()) {
|
app/code/community/Nosto/Tagging/controllers/OauthController.php
CHANGED
@@ -103,7 +103,8 @@ class Nosto_tagging_OauthController extends Mage_Core_Controller_Front_Action
|
|
103 |
$this->_redirect(
|
104 |
'adminhtml/nosto/redirectProxy', array(
|
105 |
'message_type' => NostoMessage::TYPE_ERROR,
|
106 |
-
'message_code' =>
|
|
|
107 |
'store' => (int)Mage::app()->getStore()->getId(),
|
108 |
)
|
109 |
);
|
103 |
$this->_redirect(
|
104 |
'adminhtml/nosto/redirectProxy', array(
|
105 |
'message_type' => NostoMessage::TYPE_ERROR,
|
106 |
+
'message_code' => NostoMessage::CODE_ACCOUNT_CONNECT,
|
107 |
+
'message_text' => $desc,
|
108 |
'store' => (int)Mage::app()->getStore()->getId(),
|
109 |
)
|
110 |
);
|
app/code/community/Nosto/Tagging/etc/config.xml
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
<config>
|
30 |
<modules>
|
31 |
<Nosto_Tagging>
|
32 |
-
<version>2.
|
33 |
</Nosto_Tagging>
|
34 |
</modules>
|
35 |
<global>
|
29 |
<config>
|
30 |
<modules>
|
31 |
<Nosto_Tagging>
|
32 |
+
<version>2.6.0</version>
|
33 |
</Nosto_Tagging>
|
34 |
</modules>
|
35 |
<global>
|
app/code/community/Nosto/Tagging/etc/system.xml
CHANGED
@@ -39,11 +39,11 @@
|
|
39 |
<image_options translate="label">
|
40 |
<label>Image Options</label>
|
41 |
<frontend_type>text</frontend_type>
|
42 |
-
<sort_order>
|
43 |
<show_in_default>1</show_in_default>
|
44 |
<show_in_website>1</show_in_website>
|
45 |
<show_in_store>1</show_in_store>
|
46 |
-
<expanded>
|
47 |
<fields>
|
48 |
<image_version translate="label">
|
49 |
<label>Image Version</label>
|
39 |
<image_options translate="label">
|
40 |
<label>Image Options</label>
|
41 |
<frontend_type>text</frontend_type>
|
42 |
+
<sort_order>20</sort_order>
|
43 |
<show_in_default>1</show_in_default>
|
44 |
<show_in_website>1</show_in_website>
|
45 |
<show_in_store>1</show_in_store>
|
46 |
+
<expanded>0</expanded>
|
47 |
<fields>
|
48 |
<image_version translate="label">
|
49 |
<label>Image Version</label>
|
app/design/frontend/base/default/template/nostotagging/product.phtml
CHANGED
@@ -34,7 +34,6 @@
|
|
34 |
* @var $dateHelper Nosto_Tagging_Helper_Date
|
35 |
*/
|
36 |
$product = $this->getMetaProduct();
|
37 |
-
$currentCategory = $this->getCurrentCategory();
|
38 |
$helper = Mage::helper('nosto_tagging');
|
39 |
$priceHelper = Mage::helper('nosto_tagging/price');
|
40 |
$dateHelper = Mage::helper('nosto_tagging/date');
|
@@ -52,16 +51,24 @@ $dateHelper = Mage::helper('nosto_tagging/date');
|
|
52 |
<?php foreach ($product->getCategories() as $category): ?>
|
53 |
<span class="category"><?php echo $helper->escapeHtml($category); ?></span>
|
54 |
<?php endforeach; ?>
|
55 |
-
|
56 |
-
|
57 |
-
<?php
|
|
|
|
|
|
|
|
|
58 |
<span class="brand"><?php echo $helper->escapeHtml($product->getBrand()); ?></span>
|
59 |
<?php endif; ?>
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
<?php endforeach; ?>
|
|
|
|
|
|
|
64 |
</div>
|
65 |
-
<?php if (
|
66 |
-
<div class="nosto_category" style="display:none"><?php echo $helper->escapeHtml($
|
67 |
<?php endif; ?>
|
34 |
* @var $dateHelper Nosto_Tagging_Helper_Date
|
35 |
*/
|
36 |
$product = $this->getMetaProduct();
|
|
|
37 |
$helper = Mage::helper('nosto_tagging');
|
38 |
$priceHelper = Mage::helper('nosto_tagging/price');
|
39 |
$dateHelper = Mage::helper('nosto_tagging/date');
|
51 |
<?php foreach ($product->getCategories() as $category): ?>
|
52 |
<span class="category"><?php echo $helper->escapeHtml($category); ?></span>
|
53 |
<?php endforeach; ?>
|
54 |
+
<?php if ($product->getFullDescription()): ?>
|
55 |
+
<span class="description"><?php echo $helper->escapeHtml($product->getFullDescription()); ?></span>
|
56 |
+
<?php endif; ?>
|
57 |
+
<?php if ($product->getListPrice()): ?>
|
58 |
+
<span class="list_price"><?php echo $priceHelper->getFormattedPrice($product->getListPrice()); ?></span>
|
59 |
+
<?php endif; ?>
|
60 |
+
<?php if ($product->getBrand()): ?>
|
61 |
<span class="brand"><?php echo $helper->escapeHtml($product->getBrand()); ?></span>
|
62 |
<?php endif; ?>
|
63 |
+
<?php foreach ($product->getTags() as $type => $tags): ?>
|
64 |
+
<?php foreach ($tags as $tag): ?>
|
65 |
+
<span class="<?php echo $helper->quoteEscape($type); ?>"><?php echo $helper->escapeHtml($tag); ?></span>
|
66 |
+
<?php endforeach; ?>
|
67 |
<?php endforeach; ?>
|
68 |
+
<?php if ($product->getDatePublished()): ?>
|
69 |
+
<span class="date_published"><?php echo $dateHelper->getFormattedDate($product->getDatePublished()); ?></span>
|
70 |
+
<?php endif; ?>
|
71 |
</div>
|
72 |
+
<?php if ($this->getCurrentCategory()): ?>
|
73 |
+
<div class="nosto_category" style="display:none"><?php echo $helper->escapeHtml($this->getCurrentCategory()); ?></div>
|
74 |
<?php endif; ?>
|
lib/nosto/php-sdk/src/classes/NostoAccount.php
CHANGED
@@ -87,12 +87,24 @@ class NostoAccount extends NostoObject implements NostoAccountInterface, NostoVa
|
|
87 |
'last_name' => $meta->getOwner()->getLastName(),
|
88 |
'email' => $meta->getOwner()->getEmail(),
|
89 |
),
|
90 |
-
'billing_details' => array(
|
91 |
-
'country' => strtoupper($meta->getBillingDetails()->getCountry()),
|
92 |
-
),
|
93 |
'api_tokens' => array(),
|
94 |
);
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
foreach (NostoApiToken::$tokenNames as $name) {
|
97 |
$params['api_tokens'][] = 'api_'.$name;
|
98 |
}
|
87 |
'last_name' => $meta->getOwner()->getLastName(),
|
88 |
'email' => $meta->getOwner()->getEmail(),
|
89 |
),
|
|
|
|
|
|
|
90 |
'api_tokens' => array(),
|
91 |
);
|
92 |
|
93 |
+
// Add optional billing details if the required data is set.
|
94 |
+
$billingDetails = array(
|
95 |
+
'country' => strtoupper($meta->getBillingDetails()->getCountry())
|
96 |
+
);
|
97 |
+
if (!empty($billingDetails['country'])) {
|
98 |
+
$params['billing_details'] = $billingDetails;
|
99 |
+
}
|
100 |
+
|
101 |
+
// Add optional partner code if one is set.
|
102 |
+
$partnerCode = $meta->getPartnerCode();
|
103 |
+
if (!empty($partnerCode)) {
|
104 |
+
$params['partner_code'] = $partnerCode;
|
105 |
+
}
|
106 |
+
|
107 |
+
// Request all available API tokens for the account.
|
108 |
foreach (NostoApiToken::$tokenNames as $name) {
|
109 |
$params['api_tokens'][] = 'api_'.$name;
|
110 |
}
|
lib/nosto/php-sdk/src/classes/export/NostoExportProductCollection.php
CHANGED
@@ -47,21 +47,38 @@ class NostoExportProductCollection extends NostoProductCollection implements Nos
|
|
47 |
$array = array();
|
48 |
/** @var NostoProductInterface $item */
|
49 |
foreach ($this->getArrayCopy() as $item) {
|
50 |
-
$
|
51 |
'url' => $item->getUrl(),
|
52 |
'product_id' => $item->getProductId(),
|
53 |
'name' => $item->getName(),
|
54 |
'image_url' => $item->getImageUrl(),
|
55 |
'price' => Nosto::helper('price')->format($item->getPrice()),
|
56 |
-
'list_price' => Nosto::helper('price')->format($item->getListPrice()),
|
57 |
'price_currency_code' => strtoupper($item->getCurrencyCode()),
|
58 |
'availability' => $item->getAvailability(),
|
59 |
-
'tags' => $item->getTags(),
|
60 |
'categories' => $item->getCategories(),
|
61 |
-
'description' => $item->getShortDescription().'<br/>'.$item->getDescription(),
|
62 |
-
'brand' => $item->getBrand(),
|
63 |
-
'date_published' => Nosto::helper('date')->format($item->getDatePublished()),
|
64 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
return json_encode($array);
|
67 |
}
|
47 |
$array = array();
|
48 |
/** @var NostoProductInterface $item */
|
49 |
foreach ($this->getArrayCopy() as $item) {
|
50 |
+
$data = array(
|
51 |
'url' => $item->getUrl(),
|
52 |
'product_id' => $item->getProductId(),
|
53 |
'name' => $item->getName(),
|
54 |
'image_url' => $item->getImageUrl(),
|
55 |
'price' => Nosto::helper('price')->format($item->getPrice()),
|
|
|
56 |
'price_currency_code' => strtoupper($item->getCurrencyCode()),
|
57 |
'availability' => $item->getAvailability(),
|
|
|
58 |
'categories' => $item->getCategories(),
|
|
|
|
|
|
|
59 |
);
|
60 |
+
|
61 |
+
// Optional properties.
|
62 |
+
|
63 |
+
if ($item->getFullDescription()) {
|
64 |
+
$data['description'] = $item->getFullDescription();
|
65 |
+
}
|
66 |
+
if ($item->getListPrice()) {
|
67 |
+
$data['list_price'] = Nosto::helper('price')->format($item->getListPrice());
|
68 |
+
}
|
69 |
+
if ($item->getBrand()) {
|
70 |
+
$data['brand'] = $item->getBrand();
|
71 |
+
}
|
72 |
+
foreach ($item->getTags() as $type => $tags) {
|
73 |
+
if (is_array($tags) && count($tags) > 0) {
|
74 |
+
$data[$type] = $tags;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
if ($item->getDatePublished()) {
|
78 |
+
$data['date_published'] = Nosto::helper('date')->format($item->getDatePublished());
|
79 |
+
}
|
80 |
+
|
81 |
+
$array[] = $data;
|
82 |
}
|
83 |
return json_encode($array);
|
84 |
}
|
lib/nosto/php-sdk/src/classes/operation/NostoOperationProduct.php
CHANGED
@@ -163,26 +163,63 @@ class NostoOperationProduct
|
|
163 |
/**
|
164 |
* Converts the product object into an array and returns it.
|
165 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
* @param NostoProductInterface $product the object.
|
167 |
* @return array the newly created array.
|
168 |
*/
|
169 |
protected function getProductAsArray(NostoProductInterface $product)
|
170 |
{
|
171 |
-
|
172 |
'url' => $product->getUrl(),
|
173 |
'product_id' => $product->getProductId(),
|
174 |
'name' => $product->getName(),
|
175 |
'image_url' => $product->getImageUrl(),
|
176 |
'price' => Nosto::helper('price')->format($product->getPrice()),
|
177 |
-
'list_price' => Nosto::helper('price')->format($product->getListPrice()),
|
178 |
'price_currency_code' => strtoupper($product->getCurrencyCode()),
|
179 |
'availability' => $product->getAvailability(),
|
180 |
-
'tag1' => $product->getTags(),
|
181 |
'categories' => $product->getCategories(),
|
182 |
-
'description' => $product->getShortDescription().'<br/>'.$product->getDescription(),
|
183 |
-
'brand' => $product->getBrand(),
|
184 |
-
'date_published' => Nosto::helper('date')->format($product->getDatePublished()),
|
185 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
|
188 |
/**
|
163 |
/**
|
164 |
* Converts the product object into an array and returns it.
|
165 |
*
|
166 |
+
* Example:
|
167 |
+
*
|
168 |
+
* array(
|
169 |
+
* 'url' => 'http://www.example.com/product/CANOE123',
|
170 |
+
* 'product_id' => 'CANOE123',
|
171 |
+
* 'name' => 'ACME Foldable Canoe',
|
172 |
+
* 'image_url' => 'http://www.example.com/product/images/CANOE123.jpg',
|
173 |
+
* 'price' => '1269.00',
|
174 |
+
* 'price_currency_code' => 'EUR',
|
175 |
+
* 'availability' => 'InStock',
|
176 |
+
* 'categories' => array('/Outdoor/Boats/Canoes', '/Sales/Boats'),
|
177 |
+
* 'description' => 'This foldable canoe is easy to travel with.',
|
178 |
+
* 'list_price' => '1299.00',
|
179 |
+
* 'brand' => 'ACME',
|
180 |
+
* 'tag1' => array('Men'),
|
181 |
+
* 'tag2' => array('Foldable'),
|
182 |
+
* 'tag3' => array('Brown', 'Black', 'Orange'),
|
183 |
+
* 'date_published' => '2011-12-31'
|
184 |
+
* )
|
185 |
+
*
|
186 |
* @param NostoProductInterface $product the object.
|
187 |
* @return array the newly created array.
|
188 |
*/
|
189 |
protected function getProductAsArray(NostoProductInterface $product)
|
190 |
{
|
191 |
+
$data = array(
|
192 |
'url' => $product->getUrl(),
|
193 |
'product_id' => $product->getProductId(),
|
194 |
'name' => $product->getName(),
|
195 |
'image_url' => $product->getImageUrl(),
|
196 |
'price' => Nosto::helper('price')->format($product->getPrice()),
|
|
|
197 |
'price_currency_code' => strtoupper($product->getCurrencyCode()),
|
198 |
'availability' => $product->getAvailability(),
|
|
|
199 |
'categories' => $product->getCategories(),
|
|
|
|
|
|
|
200 |
);
|
201 |
+
|
202 |
+
// Optional properties.
|
203 |
+
|
204 |
+
if ($product->getFullDescription()) {
|
205 |
+
$data['description'] = $product->getFullDescription();
|
206 |
+
}
|
207 |
+
if ($product->getListPrice()) {
|
208 |
+
$data['list_price'] = Nosto::helper('price')->format($product->getListPrice());
|
209 |
+
}
|
210 |
+
if ($product->getBrand()) {
|
211 |
+
$data['brand'] = $product->getBrand();
|
212 |
+
}
|
213 |
+
foreach ($product->getTags() as $type => $tags) {
|
214 |
+
if (is_array($tags) && count($tags) > 0) {
|
215 |
+
$data[$type] = $tags;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
if ($product->getDatePublished()) {
|
219 |
+
$data['date_published'] = Nosto::helper('date')->format($product->getDatePublished());
|
220 |
+
}
|
221 |
+
|
222 |
+
return $data;
|
223 |
}
|
224 |
|
225 |
/**
|
lib/nosto/php-sdk/src/interfaces/NostoProductInterface.php
CHANGED
@@ -98,7 +98,7 @@ interface NostoProductInterface
|
|
98 |
/**
|
99 |
* Returns the tags for the product.
|
100 |
*
|
101 |
-
* @return array the tags array, e.g. array("winter", "shoe").
|
102 |
*/
|
103 |
public function getTags();
|
104 |
|
@@ -123,6 +123,14 @@ interface NostoProductInterface
|
|
123 |
*/
|
124 |
public function getDescription();
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
/**
|
127 |
* Returns the product brand name.
|
128 |
*
|
98 |
/**
|
99 |
* Returns the tags for the product.
|
100 |
*
|
101 |
+
* @return array the tags array, e.g. array('tag1' => array("winter", "shoe")).
|
102 |
*/
|
103 |
public function getTags();
|
104 |
|
123 |
*/
|
124 |
public function getDescription();
|
125 |
|
126 |
+
/**
|
127 |
+
* Returns the full product description,
|
128 |
+
* i.e. both the "short" and "normal" descriptions concatenated.
|
129 |
+
*
|
130 |
+
* @return string the full descriptions.
|
131 |
+
*/
|
132 |
+
public function getFullDescription();
|
133 |
+
|
134 |
/**
|
135 |
* Returns the product brand name.
|
136 |
*
|
lib/nosto/php-sdk/src/interfaces/account/NostoAccountMetaDataInterface.php
CHANGED
@@ -110,4 +110,12 @@ interface NostoAccountMetaDataInterface
|
|
110 |
* @return string the API token.
|
111 |
*/
|
112 |
public function getSignUpApiToken();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
110 |
* @return string the API token.
|
111 |
*/
|
112 |
public function getSignUpApiToken();
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Optional partner code for Nosto partners.
|
116 |
+
* The code is issued by Nosto to partners only.
|
117 |
+
*
|
118 |
+
* @return string|null the partner code or null if none exist.
|
119 |
+
*/
|
120 |
+
public function getPartnerCode();
|
121 |
}
|
package.xml
CHANGED
@@ -1,18 +1,26 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Nosto_Tagging</name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Personalization for Magento</summary>
|
10 |
<description>Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.</description>
|
11 |
-
<notes>*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<authors><author><name>Nosto</name><user>nosto</user><email>magento@nosto.com</email></author></authors>
|
13 |
-
<date>2015-07-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Nosto"><dir name="Tagging"><dir name="Block"><file name="Addtocart.php" hash="61d645e5cc9e54a5170ae03797f0426a"/><dir name="Adminhtml"><file name="Iframe.php" hash="9b089bb3cd733de7a9e7caf2b46793c2"/><file name="Wizard.php" hash="f98931a1a6e327c0d05e43b73063f672"/></dir><file name="Cart.php" hash="9f4a64499d572780d82d4a1d50cb7880"/><file name="Category.php" hash="177a5d8d9f1ba9e246d149c228c3aec8"/><file name="Customer.php" hash="d35777ca399244e4fb441456320f8ad7"/><file name="Element.php" hash="e5b12bb118b92eb7075ff7a6e16e0eba"/><file name="Embed.php" hash="e8b628b6bc49fb865697552300d08526"/><file name="Meta.php" hash="1f761e731214b7572ef139d9e0577ea1"/><file name="Order.php" hash="1666d552e61768cfd35860b9472feced"/><file name="Product.php" hash="261cd58ad94daa82d1cf2188179278c0"/></dir><dir name="Helper"><file name="Account.php" hash="631bc5302664889d6784270a1b129f2e"/><file name="Customer.php" hash="92da4f0ae6c2aef635b837635cd74238"/><file name="Data.php" hash="9fcbd75579c671f1ae84d989f936755a"/><file name="Date.php" hash="1a108a4ec8169b73411b6c11b86a1d80"/><file name="Oauth.php" hash="08f096ef785d64225ec71d7e2e99f534"/><file name="Price.php" hash="4c21321d10f40c6f985bd934b174a17c"/><file name="Url.php" hash="289294904d246c56e4de96798927a7f6"/></dir><dir name="Model"><file name="Base.php" hash="c0b3c4a6f68a0b707bf85ceff50e3c4b"/><dir name="Container"><file name="Cart.php" hash="20d2936693361999575f1e6ac56f2e40"/><file name="Customer.php" hash="b03bca89845b6c939521add8df1f7e9a"/></dir><file name="Customer.php" hash="6d992a43a75f29836ed1450e130df560"/><dir name="Meta"><dir name="Account"><file name="Billing.php" hash="d09b6b6ddc543201ec9485db9bb0a260"/><file name="Iframe.php" hash="f26a7ef337d86cb83c687ba2e0beb45b"/><file name="Owner.php" hash="801c33bbf04bcfbe133654770909d1df"/></dir><file name="Account.php" hash="c01a324111528339ddd71f0046b95ecc"/><file name="Oauth.php" hash="761b0dd6cede8122c715d077b010b927"/><dir name="Order"><file name="Buyer.php" hash="633c6de58a46128bb594d6580d3ffa46"/><file name="Item.php" hash="ba8a2782d3e7ef577deb47a0c9825afa"/><file name="Status.php" hash="37520c32630aa4bf14d8213f39e80a4b"/></dir><file name="Order.php" hash="1f166cb28ff71ea092203f6fd0c91696"/><file name="Product.php" hash="9cdb3f3980a66167f83f4ea643d82566"/></dir><file name="Observer.php" hash="64b7cf2c54b7322839570c039de29911"/><dir name="Resource"><dir name="Customer"><file name="Collection.php" hash="0c99b46d5108a6fe31cad1190d8ef47c"/></dir><file name="Customer.php" hash="f92e4e5334b5e3493e8f04664b20f105"/><file name="Setup.php" hash="506b08bcb10cbe74e95812c5f646429f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Image.php" hash="d1fcc96aab01342627b96edf6fad1dd1"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="NostoController.php" hash="6d0825f3190db7734637368c262d3c83"/></dir><file name="ExportController.php" hash="2de4f180d194344563dbfb4e53a80958"/><file name="OauthController.php" hash="e57a2578535e711ce1bdcb78e3fa1983"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7ea210738a77630f299a14b442f3b8d0"/><file name="cache.xml" hash="e874fbbf2eb89b325deb1a62afbcfb4d"/><file name="config.xml" hash="3c8a5bc333c1145e4055204ad9508dec"/><file name="system.xml" hash="1c96c631b30ae296bb23a4f87137de77"/></dir><dir name="sql"><dir name="tagging_setup"><file name="mysql4-install-1.2.0.php" hash="3cbc52834c44870859562eec7969b9fd"/><file name="mysql4-upgrade-1.1.7-1.2.0.php" hash="0d8eb7990461a9d4b74b479120067aeb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="nostotagging"><file name="iframe.phtml" hash="c81931adf855a4893e0cf2dc60c390cb"/><file name="wizard.phtml" hash="3f92e94e5ee3d3cd9906a6b0942a3a1b"/></dir></dir><dir name="layout"><file name="nostotagging.xml" hash="29eb82c1a28e9c4d398239c765a3f5fd"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="nostotagging"><file name="addtocart.phtml" hash="e8776f59ec4c7c7b6eea2fae9d56e2a4"/><file name="cart.phtml" hash="3c4e80cdcebf63c56dc14a6594e167b8"/><dir name="category"><file name="view.phtml" hash="fc09e2770ad6281ec96c8e92accc01f1"/></dir><file name="category.phtml" hash="81f36742cb4e3adbf9f692cc8f0ea8a8"/><file name="customer.phtml" hash="e9bc92bb7f7df989cc706c7eaee3614a"/><file name="element.phtml" hash="e1d38981789e632a3607ccf2e171f0cb"/><file name="embed.phtml" hash="9193ddd1ae373b68c53f8364f511b0a5"/><file name="meta.phtml" hash="c1b862a4993503fae420fb0eba194b00"/><file name="order.phtml" hash="e15b11ff1cb20aafaab0dc134ddd1a9b"/><file name="product.phtml" hash="412b7bd9ed43981f056132ea37719aab"/></dir></dir><dir name="layout"><file name="nostotagging.xml" hash="8adc3eecf5f90feffabee29d6308912b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Nosto_Tagging.xml" hash="1705cb7e6db28388662ef52882d61701"/></dir></target><target name="magelib"><dir name="nosto"><dir name="php-sdk"><dir name="src"><dir name="classes"><file name="Nosto.php" hash="c595c5f646f6e513b6604848f8d10118"/><file name="NostoAccount.php" hash="3c7a82174cf700370e144c79573c7fd9"/><file name="NostoCipher.php" hash="a3d7d148311aa0319387c0918e5e26dc"/><file name="NostoDotEnv.php" hash="90b23c1b02095c9368372f1d5346c3f9"/><file name="NostoMessage.php" hash="5933eadd2ad08427010b0bf16657266b"/><file name="NostoObject.php" hash="187808f0c55d02294d41e9395f4c5d58"/><file name="NostoOrderConfirmation.php" hash="2a3fd5efb196bc0dcb7ad57fb61a81d0"/><file name="NostoProductReCrawl.php" hash="f370c539409dd74fc98b7aa1ea0f6387"/><file name="NostoValidator.php" hash="2096ddc9979ec77f8f0b1ec58b459329"/><dir name="api"><file name="NostoApiRequest.php" hash="37db50c0d35ff9a848afe6a4bb871b6f"/><file name="NostoApiToken.php" hash="2febdbec0fd3609162845aa678b36b38"/></dir><dir name="collection"><file name="NostoCollection.php" hash="35cea0282628354413f629062b58663a"/><file name="NostoOrderCollection.php" hash="db6f517948c1258e1521ceb1ce49d477"/><file name="NostoProductCollection.php" hash="3ae29dbbcb7effa234fa83461d3e6901"/></dir><dir name="exception"><file name="NostoException.php" hash="c4610fb70278d01bd85bc83b8e74df30"/><file name="NostoHttpException.php" hash="dabf4298746db898c8fe709ea9e25818"/></dir><dir name="export"><file name="NostoExportOrderCollection.php" hash="91bdd99a2be75be062fe5c7cde1803e4"/><file name="NostoExportProductCollection.php" hash="84349c0a7080a4f154c2d9e29d4e621f"/><file name="NostoExporter.php" hash="72ad0af4bce8e57ada5a29e3634df94f"/></dir><dir name="helper"><file name="NostoHelper.php" hash="f4ca6c78e047fec93c32b7eb822b0692"/><file name="NostoHelperDate.php" hash="081a2d8bfec710f2baa52192a99a2658"/><file name="NostoHelperIframe.php" hash="303668f25103c245396b43811a15c28d"/><file name="NostoHelperPrice.php" hash="ee9f217dc1b8e0fc679fb56ca3fd3ca1"/></dir><dir name="http"><file name="NostoHttpRequest.php" hash="2c5b96a56d33b33e334d4d3772c2b14d"/><file name="NostoHttpRequestAdapter.php" hash="d8bf8e5db44ad982b655372529f4d88c"/><file name="NostoHttpRequestAdapterCurl.php" hash="945a4357578f91291d09f1e2850da580"/><file name="NostoHttpRequestAdapterSocket.php" hash="88f57e6d98de2ac652a235e2786f0be7"/><file name="NostoHttpResponse.php" hash="9982d3ed15bfcc8f0147b2b4cc400223"/></dir><dir name="oauth"><file name="NostoOAuthClient.php" hash="2672d9de80d23c91776d97b9803d01b4"/><file name="NostoOAuthToken.php" hash="f81c1c1e5c4fc2010162d8f69de2cb33"/></dir><dir name="operation"><file name="NostoOperationProduct.php" hash="cd305ae242e6c79d8ec1ed77c316f52b"/></dir></dir><file name="config.inc.php" hash="b46a56f8d61ff2cf69cedb4281719e00"/><dir name="interfaces"><file name="NostoExportCollectionInterface.php" hash="63c833c17fe43ce48b45e0f552313a8b"/><file name="NostoOAuthClientMetaDataInterface.php" hash="75a82417bfc27cd82e41ea9810d31428"/><file name="NostoProductInterface.php" hash="110aabc704bed12ddacc304d6d1e1529"/><file name="NostoValidatableInterface.php" hash="57ad8b28225344127843b97049f5868d"/><dir name="account"><file name="NostoAccountInterface.php" hash="063da0d25a5420f4e727938467c078f3"/><file name="NostoAccountMetaDataBillingDetailsInterface.php" hash="ef31f0c3b41591fd76f85a25021f0fe4"/><file name="NostoAccountMetaDataIframeInterface.php" hash="c739e6a3ef39a308df6852361f2fd1d7"/><file name="NostoAccountMetaDataInterface.php" hash="7395de56fb4e3a1831bc5f7cfeffed8d"/><file name="NostoAccountMetaDataOwnerInterface.php" hash="4c037b8cb1b529c16c91f25cce2b0ed7"/></dir><dir name="order"><file name="NostoOrderBuyerInterface.php" hash="890884e45bcca61f96f0f98cda40b6c1"/><file name="NostoOrderInterface.php" hash="d341b4faf020bfca01336c5d60ca5e48"/><file name="NostoOrderPurchasedItemInterface.php" hash="e33b94290465eea80d614db35144b75a"/><file name="NostoOrderStatusInterface.php" hash="8c89cf4296629b635f52b53a9b800b1f"/></dir></dir><dir name="js"><file name="NostoIframe.min.js" hash="5fd9f5b418dd796c469aaa0c58b34aaa"/><dir name="src"><file name="NostoIframe.js" hash="ca03585215f846258d2dbb58724e48fa"/></dir></dir><dir name="libs"><dir name="phpseclib"><dir name="crypt"><file name="NostoCryptAES.php" hash="7f16ec6fa7eefa011a27acf4506a3b57"/><file name="NostoCryptBase.php" hash="c78432d428ad8a70be832f91261d4c42"/><file name="NostoCryptRandom.php" hash="eb21a56b9cf6e6ef0b220620dd4d0ebe"/><file name="NostoCryptRijndael.php" hash="9c728d06c0249f8bc24a7c61606ccc89"/></dir></dir></dir><file name=".env.example" hash="42aa9514d8b3f65e9df96b0df601f63c"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="nosto"><file name="NostoAdmin.js" hash="0119fb333233f1f0fa70f4167fb014ef"/><file name="NostoIframe.min.js" hash="5fd9f5b418dd796c469aaa0c58b34aaa"/><file name="iframeresizer.min.js" hash="163b065c9dd702dc364913a951b81fee"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.2.0</max></package></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Nosto_Tagging</name>
|
4 |
+
<version>2.6.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Personalization for Magento</summary>
|
10 |
<description>Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.</description>
|
11 |
+
<notes>* Add better error handling and notifications to Nosto account OAuth cycle
|
12 |
+
* Add support for bundle products with fixed pricing
|
13 |
+
* Add support for using "tag1", "tag2" and "tag3" properties in Nosto product
|
14 |
+
tagging and product update API
|
15 |
+
* Add support for Nosto partner code in account creation API
|
16 |
+
* Add support for overriding meta data models
|
17 |
+
* Fix bug in cart/order item name tagging while running Magento Dev Mode
|
18 |
+
* Fix bug in product export while having product flat tables enabled
|
19 |
+
* Fix bug in order confirmation API when payment provider is no longer available</notes>
|
20 |
<authors><author><name>Nosto</name><user>nosto</user><email>magento@nosto.com</email></author></authors>
|
21 |
+
<date>2015-07-30</date>
|
22 |
+
<time>09:31:38</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="Nosto"><dir name="Tagging"><dir name="Block"><file name="Addtocart.php" hash="61d645e5cc9e54a5170ae03797f0426a"/><dir name="Adminhtml"><file name="Iframe.php" hash="d60e2221e6689b2ab2da9263897f6a6b"/><file name="Wizard.php" hash="f98931a1a6e327c0d05e43b73063f672"/></dir><file name="Cart.php" hash="c1c707dad76c98d807d5160b90c06ac6"/><file name="Category.php" hash="177a5d8d9f1ba9e246d149c228c3aec8"/><file name="Customer.php" hash="d35777ca399244e4fb441456320f8ad7"/><file name="Element.php" hash="e5b12bb118b92eb7075ff7a6e16e0eba"/><file name="Embed.php" hash="e8b628b6bc49fb865697552300d08526"/><file name="Meta.php" hash="1f761e731214b7572ef139d9e0577ea1"/><file name="Order.php" hash="32115070d380e654f093da11dd6e4d85"/><file name="Product.php" hash="ac7b85e6d03d94d03c59416b622b0039"/></dir><dir name="Helper"><file name="Account.php" hash="40eb62dd1718741b2064d4a440f46b2f"/><file name="Customer.php" hash="92da4f0ae6c2aef635b837635cd74238"/><file name="Data.php" hash="c50b9b5a694fdd0401748741de97f6ab"/><file name="Date.php" hash="1a108a4ec8169b73411b6c11b86a1d80"/><file name="Oauth.php" hash="9ecbea9e8411501cabe780e0511a1d05"/><file name="Price.php" hash="d37f4b50feb5cfe0a83f46327d243636"/><file name="Url.php" hash="289294904d246c56e4de96798927a7f6"/></dir><dir name="Model"><file name="Base.php" hash="c0b3c4a6f68a0b707bf85ceff50e3c4b"/><dir name="Container"><file name="Cart.php" hash="20d2936693361999575f1e6ac56f2e40"/><file name="Customer.php" hash="b03bca89845b6c939521add8df1f7e9a"/></dir><file name="Customer.php" hash="6d992a43a75f29836ed1450e130df560"/><dir name="Meta"><dir name="Account"><file name="Billing.php" hash="353e807f832a37591bf7359857044ca1"/><file name="Iframe.php" hash="731e2bf424e1b9d4e00d403f55a87b54"/><file name="Owner.php" hash="d86a8ceb0ef573793f829990dd48ab3c"/></dir><file name="Account.php" hash="8df7024533e1cf657b407c49fb19a3c5"/><file name="Oauth.php" hash="0863271d8a3db0de93525f0e64308f1c"/><dir name="Order"><file name="Buyer.php" hash="3b8e57e195e214ed3324967684614745"/><file name="Item.php" hash="90dbec8a0201ccd8fbca3e10f2c362ad"/><file name="Status.php" hash="37520c32630aa4bf14d8213f39e80a4b"/></dir><file name="Order.php" hash="7844be08fe7f3f5310c18f352a952a5e"/><file name="Product.php" hash="40cf899477bac2f9916b030af8885e5e"/></dir><file name="Observer.php" hash="58bf4eb430d8a74fbb1ac5c68750c30c"/><file name="Product.php" hash="3630a2a688f013b296d1865e6f32e1d2"/><dir name="Resource"><dir name="Customer"><file name="Collection.php" hash="0c99b46d5108a6fe31cad1190d8ef47c"/></dir><file name="Customer.php" hash="f92e4e5334b5e3493e8f04664b20f105"/><dir name="Product"><file name="Collection.php" hash="7566a7f4483a00c923bac2fbea173abd"/></dir><file name="Setup.php" hash="506b08bcb10cbe74e95812c5f646429f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Image.php" hash="d1fcc96aab01342627b96edf6fad1dd1"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="NostoController.php" hash="fd43fd322ea1f8d6b7db6d716250f71e"/></dir><file name="ExportController.php" hash="e20f49db51535241ed1857c2a86e077e"/><file name="OauthController.php" hash="e2ad2e3bcb5323e860154af78c2b0e98"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7ea210738a77630f299a14b442f3b8d0"/><file name="cache.xml" hash="e874fbbf2eb89b325deb1a62afbcfb4d"/><file name="config.xml" hash="f8c154da340736d9b28ff5054e2b099d"/><file name="system.xml" hash="7deba6544a09d7af8c07e6b5edc0975a"/></dir><dir name="sql"><dir name="tagging_setup"><file name="mysql4-install-1.2.0.php" hash="3cbc52834c44870859562eec7969b9fd"/><file name="mysql4-upgrade-1.1.7-1.2.0.php" hash="0d8eb7990461a9d4b74b479120067aeb"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="nostotagging"><file name="iframe.phtml" hash="c81931adf855a4893e0cf2dc60c390cb"/><file name="wizard.phtml" hash="3f92e94e5ee3d3cd9906a6b0942a3a1b"/></dir></dir><dir name="layout"><file name="nostotagging.xml" hash="29eb82c1a28e9c4d398239c765a3f5fd"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="nostotagging"><file name="addtocart.phtml" hash="e8776f59ec4c7c7b6eea2fae9d56e2a4"/><file name="cart.phtml" hash="3c4e80cdcebf63c56dc14a6594e167b8"/><dir name="category"><file name="view.phtml" hash="fc09e2770ad6281ec96c8e92accc01f1"/></dir><file name="category.phtml" hash="81f36742cb4e3adbf9f692cc8f0ea8a8"/><file name="customer.phtml" hash="e9bc92bb7f7df989cc706c7eaee3614a"/><file name="element.phtml" hash="e1d38981789e632a3607ccf2e171f0cb"/><file name="embed.phtml" hash="9193ddd1ae373b68c53f8364f511b0a5"/><file name="meta.phtml" hash="c1b862a4993503fae420fb0eba194b00"/><file name="order.phtml" hash="e15b11ff1cb20aafaab0dc134ddd1a9b"/><file name="product.phtml" hash="9df3ff9f6e363e478d7fd68bd09827b1"/></dir></dir><dir name="layout"><file name="nostotagging.xml" hash="8adc3eecf5f90feffabee29d6308912b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Nosto_Tagging.xml" hash="1705cb7e6db28388662ef52882d61701"/></dir></target><target name="magelib"><dir name="nosto"><dir name="php-sdk"><dir name="src"><dir name="classes"><file name="Nosto.php" hash="c595c5f646f6e513b6604848f8d10118"/><file name="NostoAccount.php" hash="c422a7f104c5ebc6eac9d83986280579"/><file name="NostoCipher.php" hash="a3d7d148311aa0319387c0918e5e26dc"/><file name="NostoDotEnv.php" hash="90b23c1b02095c9368372f1d5346c3f9"/><file name="NostoMessage.php" hash="5933eadd2ad08427010b0bf16657266b"/><file name="NostoObject.php" hash="187808f0c55d02294d41e9395f4c5d58"/><file name="NostoOrderConfirmation.php" hash="2a3fd5efb196bc0dcb7ad57fb61a81d0"/><file name="NostoProductReCrawl.php" hash="f370c539409dd74fc98b7aa1ea0f6387"/><file name="NostoValidator.php" hash="2096ddc9979ec77f8f0b1ec58b459329"/><dir name="api"><file name="NostoApiRequest.php" hash="37db50c0d35ff9a848afe6a4bb871b6f"/><file name="NostoApiToken.php" hash="2febdbec0fd3609162845aa678b36b38"/></dir><dir name="collection"><file name="NostoCollection.php" hash="35cea0282628354413f629062b58663a"/><file name="NostoOrderCollection.php" hash="db6f517948c1258e1521ceb1ce49d477"/><file name="NostoProductCollection.php" hash="3ae29dbbcb7effa234fa83461d3e6901"/></dir><dir name="exception"><file name="NostoException.php" hash="c4610fb70278d01bd85bc83b8e74df30"/><file name="NostoHttpException.php" hash="dabf4298746db898c8fe709ea9e25818"/></dir><dir name="export"><file name="NostoExportOrderCollection.php" hash="91bdd99a2be75be062fe5c7cde1803e4"/><file name="NostoExportProductCollection.php" hash="33986c8767922da98aa90f03759dbc0f"/><file name="NostoExporter.php" hash="72ad0af4bce8e57ada5a29e3634df94f"/></dir><dir name="helper"><file name="NostoHelper.php" hash="f4ca6c78e047fec93c32b7eb822b0692"/><file name="NostoHelperDate.php" hash="081a2d8bfec710f2baa52192a99a2658"/><file name="NostoHelperIframe.php" hash="303668f25103c245396b43811a15c28d"/><file name="NostoHelperPrice.php" hash="ee9f217dc1b8e0fc679fb56ca3fd3ca1"/></dir><dir name="http"><file name="NostoHttpRequest.php" hash="2c5b96a56d33b33e334d4d3772c2b14d"/><file name="NostoHttpRequestAdapter.php" hash="d8bf8e5db44ad982b655372529f4d88c"/><file name="NostoHttpRequestAdapterCurl.php" hash="945a4357578f91291d09f1e2850da580"/><file name="NostoHttpRequestAdapterSocket.php" hash="88f57e6d98de2ac652a235e2786f0be7"/><file name="NostoHttpResponse.php" hash="9982d3ed15bfcc8f0147b2b4cc400223"/></dir><dir name="oauth"><file name="NostoOAuthClient.php" hash="2672d9de80d23c91776d97b9803d01b4"/><file name="NostoOAuthToken.php" hash="f81c1c1e5c4fc2010162d8f69de2cb33"/></dir><dir name="operation"><file name="NostoOperationProduct.php" hash="37e24121df779ead75e028b15a3fe226"/></dir></dir><file name="config.inc.php" hash="b46a56f8d61ff2cf69cedb4281719e00"/><dir name="interfaces"><file name="NostoExportCollectionInterface.php" hash="63c833c17fe43ce48b45e0f552313a8b"/><file name="NostoOAuthClientMetaDataInterface.php" hash="75a82417bfc27cd82e41ea9810d31428"/><file name="NostoProductInterface.php" hash="64a9e110a97ebd8be690664ce5b8e371"/><file name="NostoValidatableInterface.php" hash="57ad8b28225344127843b97049f5868d"/><dir name="account"><file name="NostoAccountInterface.php" hash="063da0d25a5420f4e727938467c078f3"/><file name="NostoAccountMetaDataBillingDetailsInterface.php" hash="ef31f0c3b41591fd76f85a25021f0fe4"/><file name="NostoAccountMetaDataIframeInterface.php" hash="c739e6a3ef39a308df6852361f2fd1d7"/><file name="NostoAccountMetaDataInterface.php" hash="5adf0a5ed876348a05028a3ff111bf79"/><file name="NostoAccountMetaDataOwnerInterface.php" hash="4c037b8cb1b529c16c91f25cce2b0ed7"/></dir><dir name="order"><file name="NostoOrderBuyerInterface.php" hash="890884e45bcca61f96f0f98cda40b6c1"/><file name="NostoOrderInterface.php" hash="d341b4faf020bfca01336c5d60ca5e48"/><file name="NostoOrderPurchasedItemInterface.php" hash="e33b94290465eea80d614db35144b75a"/><file name="NostoOrderStatusInterface.php" hash="8c89cf4296629b635f52b53a9b800b1f"/></dir></dir><dir name="js"><file name="NostoIframe.min.js" hash="5fd9f5b418dd796c469aaa0c58b34aaa"/><dir name="src"><file name="NostoIframe.js" hash="ca03585215f846258d2dbb58724e48fa"/></dir></dir><dir name="libs"><dir name="phpseclib"><dir name="crypt"><file name="NostoCryptAES.php" hash="7f16ec6fa7eefa011a27acf4506a3b57"/><file name="NostoCryptBase.php" hash="c78432d428ad8a70be832f91261d4c42"/><file name="NostoCryptRandom.php" hash="eb21a56b9cf6e6ef0b220620dd4d0ebe"/><file name="NostoCryptRijndael.php" hash="9c728d06c0249f8bc24a7c61606ccc89"/></dir></dir></dir><file name=".env.example" hash="42aa9514d8b3f65e9df96b0df601f63c"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="nosto"><file name="NostoAdmin.js" hash="0119fb333233f1f0fa70f4167fb014ef"/><file name="NostoIframe.min.js" hash="5fd9f5b418dd796c469aaa0c58b34aaa"/><file name="iframeresizer.min.js" hash="163b065c9dd702dc364913a951b81fee"/></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.9.2.0</max></package></required></dependencies>
|
26 |
</package>
|