Version Notes
The extension integrates your store with Quartic platform.
Download this release
Release Info
Developer | QuarticON |
Extension | Quarticon_Quartic |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Api/Dump.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/History.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/History/Grid.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Grid.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Renderer/Input.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Renderer/Select.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Button.php +3 -2
- app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Placement.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Register.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Text.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Fieldset.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Urls.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Adminhtml/Urls/Grid.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Box.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Frame/Cart.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Frame/Category.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Frame/Home.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Frame/Product.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Getter/Cart.php +47 -0
- app/code/community/Quarticon/Quartic/Block/Getter/Order.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Getter/Product.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Products.php +0 -0
- app/code/community/Quarticon/Quartic/Block/Script.php +0 -0
- app/code/community/Quarticon/Quartic/Helper/Data.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Adapter/Writer.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Attribute.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Catalog.php +8 -4
- app/code/community/Quarticon/Quartic/Model/Client/AbstractCurl.php +15 -5
- app/code/community/Quarticon/Quartic/Model/Client/Api.php +17 -8
- app/code/community/Quarticon/Quartic/Model/Client/Resource/Curl.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Config.php +53 -2
- app/code/community/Quarticon/Quartic/Model/Cron.php +159 -0
- app/code/community/Quarticon/Quartic/Model/Frame.php +10 -0
- app/code/community/Quarticon/Quartic/Model/History.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Insert.php +1 -1
- app/code/community/Quarticon/Quartic/Model/Insert/Cart.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Insert/Category.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Insert/Home.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Insert/Product.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Maps.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/History.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/History/Collection.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/Maps.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/Maps/Collection.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/Placement.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Mysql4/Placement/Collection.php +0 -0
- app/code/community/Quarticon/Quartic/Model/Observer/Adminhtml.php +49 -23
- app/code/community/Quarticon/Quartic/Model/Observer/Frontend.php +6 -0
- app/code/community/Quarticon/Quartic/Model/Order.php +14 -5
- app/code/community/Quarticon/Quartic/Model/Placement.php +58 -12
- app/code/community/Quarticon/Quartic/Model/Placement/Cart.php +4 -3
- app/code/community/Quarticon/Quartic/Model/Placement/Category.php +4 -3
- app/code/community/Quarticon/Quartic/Model/Placement/Home.php +4 -3
- app/code/community/Quarticon/Quartic/Model/Placement/Product.php +4 -3
- app/code/community/Quarticon/Quartic/Model/Product.php +302 -92
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechildimage.php +17 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechildprice.php +17 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechilds.php +17 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurableprice.php +19 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Groupedchildimage.php +17 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Groupedprice.php +17 -0
- app/code/community/Quarticon/Quartic/Model/System/Config/Source/Visibility.php +19 -0
- app/code/community/Quarticon/Quartic/controllers/Adminhtml/ApiController.php +38 -8
- app/code/community/Quarticon/Quartic/controllers/Adminhtml/IndexController.php +0 -0
- app/code/community/Quarticon/Quartic/controllers/Adminhtml/MapsController.php +0 -0
- app/code/community/Quarticon/Quartic/controllers/FeedController.php +61 -7
- app/code/community/Quarticon/Quartic/controllers/FrameController.php +0 -0
- app/code/community/Quarticon/Quartic/etc/adminhtml.xml +0 -0
- app/code/community/Quarticon/Quartic/etc/config.xml +37 -1
- app/code/community/Quarticon/Quartic/etc/system.xml +185 -122
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-install-0.1.0.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-install-0.1.4.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.1.0-0.1.4.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.1.7-0.2.0.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.1-0.2.2.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.2-0.2.3.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.3-0.2.4.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.5-0.2.6.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.1-0.3.2.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.2-0.3.3.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.3-0.3.4.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.4-0.3.5.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.5-0.3.6.php +0 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.0.2-1.0.3.php +48 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.1.1-1.2.0.php +15 -0
- app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.2.0-1.2.3.php +15 -0
- app/design/adminhtml/default/default/layout/quartic.xml +0 -0
- app/design/adminhtml/default/default/template/quartic/api/dump.phtml +0 -0
- app/design/adminhtml/default/default/template/quartic/history.phtml +0 -0
- app/design/adminhtml/default/default/template/quartic/maps.phtml +0 -0
- app/design/adminhtml/default/default/template/quartic/system/config/button_register.phtml +0 -0
- app/design/adminhtml/default/default/template/quartic/urls.phtml +10 -10
- app/design/frontend/base/default/layout/quartic.xml +0 -0
- app/design/frontend/base/default/template/quartic/frame/cart.phtml +0 -0
- app/design/frontend/base/default/template/quartic/frame/category.phtml +0 -0
- app/design/frontend/base/default/template/quartic/frame/home.phtml +0 -0
- app/design/frontend/base/default/template/quartic/frame/product.phtml +0 -0
- app/design/frontend/base/default/template/quartic/getter/order.phtml +16 -16
- app/design/frontend/base/default/template/quartic/getter/product.phtml +9 -9
- app/design/frontend/base/default/template/quartic/products.phtml +89 -89
- app/design/frontend/base/default/template/quartic/products/slt_cart.phtml +0 -0
- app/design/frontend/base/default/template/quartic/products/slt_category.phtml +0 -0
- app/design/frontend/base/default/template/quartic/products/slt_home.phtml +0 -0
- app/design/frontend/base/default/template/quartic/products/slt_product.phtml +0 -0
- app/design/frontend/base/default/template/quartic/script.phtml +27 -27
- app/etc/modules/Quarticon_Quartic.xml +8 -8
- app/locale/pl_PL/Quarticon_Quartic.csv +20 -1
- package.xml +4 -4
- skin/adminhtml/default/default/images/quarticon-icon.png +0 -0
- skin/adminhtml/default/default/quartic.css +0 -0
app/code/community/Quarticon/Quartic/Block/Adminhtml/Api/Dump.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/History.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/History/Grid.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Grid.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Renderer/Input.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Maps/Renderer/Select.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Button.php
CHANGED
@@ -15,8 +15,9 @@ class Quarticon_Quartic_Block_Adminhtml_System_Config_Form_Field_Button extends
|
|
15 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
16 |
{
|
17 |
$this->setElement($element);
|
18 |
-
$
|
19 |
-
|
|
|
20 |
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
21 |
->setType('button')
|
22 |
->setLabel($element->getData('label'))
|
15 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
16 |
{
|
17 |
$this->setElement($element);
|
18 |
+
$store = $this->getRequest()->getParam('store');
|
19 |
+
$website = $this->getRequest()->getParam('website');
|
20 |
+
$url = $this->getUrl($element->getFieldConfig()->button_url, array('store'=>$store,'website' => $website));
|
21 |
$html = $this->getLayout()->createBlock('adminhtml/widget_button')
|
22 |
->setType('button')
|
23 |
->setLabel($element->getData('label'))
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Placement.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Register.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Field/Text.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/System/Config/Form/Fieldset.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Urls.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Adminhtml/Urls/Grid.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Box.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Frame/Cart.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Frame/Category.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Frame/Home.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Frame/Product.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Getter/Cart.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Quarticon_Quartic_Block_Getter_Cart extends Quarticon_Quartic_Block_Script
|
4 |
+
{
|
5 |
+
|
6 |
+
protected $_quote = null;
|
7 |
+
|
8 |
+
protected function getConfig()
|
9 |
+
{
|
10 |
+
return Mage::getModel('quartic/config');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function isActive()
|
14 |
+
{
|
15 |
+
return $this->getConfig()->isActive();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getCustomer()
|
19 |
+
{
|
20 |
+
return $this->getConfig()->getCustomer();
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getUser()
|
24 |
+
{
|
25 |
+
return $this->getConfig()->getSession()->getCustomer()->getId();
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getQuote()
|
29 |
+
{
|
30 |
+
if (null === $this->_quote) {
|
31 |
+
$this->_quote = Mage::getSingleton('checkout/session')->getQuote();
|
32 |
+
}
|
33 |
+
return $this->_quote;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getProductsCsv()
|
37 |
+
{
|
38 |
+
$items = $this->getQuote()->getAllItems();
|
39 |
+
$products = array();
|
40 |
+
foreach ($items as $item) {
|
41 |
+
if (!$item->getParentItemId()) {
|
42 |
+
$products[] = Mage::helper('quartic')->getProduct($item);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
return implode(',', $products);
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Quarticon/Quartic/Block/Getter/Order.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Getter/Product.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Products.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Block/Script.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Helper/Data.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Adapter/Writer.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Attribute.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Catalog.php
CHANGED
@@ -12,7 +12,7 @@ class Quarticon_Quartic_Model_Catalog extends Mage_Core_Model_Abstract
|
|
12 |
* @return array
|
13 |
*/
|
14 |
public function toOptionArray($isMultiselect = false)
|
15 |
-
{
|
16 |
if (!$this->_options) {
|
17 |
$this->_options = $this->prepareOptionArray();
|
18 |
}
|
@@ -33,8 +33,10 @@ class Quarticon_Quartic_Model_Catalog extends Mage_Core_Model_Abstract
|
|
33 |
*/
|
34 |
protected function prepareOptionArray()
|
35 |
{
|
|
|
|
|
36 |
$cache = Mage::app()->getCacheInstance();
|
37 |
-
$catalogs = $cache->load('quartic-catalogs-list');
|
38 |
if ($catalogs !== false) {
|
39 |
return unserialize($catalogs);
|
40 |
} else {
|
@@ -80,8 +82,10 @@ class Quarticon_Quartic_Model_Catalog extends Mage_Core_Model_Abstract
|
|
80 |
*/
|
81 |
protected function apiLoaded($data = array())
|
82 |
{
|
|
|
|
|
83 |
$cache = Mage::app()->getCacheInstance();
|
84 |
-
$cache->save(serialize($data), 'quartic-catalogs', array(), 30 * 24 * 3600);
|
85 |
$list = array();
|
86 |
foreach ($data as $catalog) {
|
87 |
$list[] = array(
|
@@ -89,7 +93,7 @@ class Quarticon_Quartic_Model_Catalog extends Mage_Core_Model_Abstract
|
|
89 |
'label' => $catalog['name'],
|
90 |
);
|
91 |
}
|
92 |
-
$cache->save(serialize($list), 'quartic-catalogs-list', array(), 30 * 24 * 3600);
|
93 |
return $list;
|
94 |
}
|
95 |
}
|
12 |
* @return array
|
13 |
*/
|
14 |
public function toOptionArray($isMultiselect = false)
|
15 |
+
{
|
16 |
if (!$this->_options) {
|
17 |
$this->_options = $this->prepareOptionArray();
|
18 |
}
|
33 |
*/
|
34 |
protected function prepareOptionArray()
|
35 |
{
|
36 |
+
$storeCode = Mage::app()->getRequest()->getParam('store');
|
37 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
38 |
$cache = Mage::app()->getCacheInstance();
|
39 |
+
$catalogs = $cache->load('quartic-catalogs-list-' . $storeId);
|
40 |
if ($catalogs !== false) {
|
41 |
return unserialize($catalogs);
|
42 |
} else {
|
82 |
*/
|
83 |
protected function apiLoaded($data = array())
|
84 |
{
|
85 |
+
$storeCode = Mage::app()->getRequest()->getParam('store');
|
86 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
87 |
$cache = Mage::app()->getCacheInstance();
|
88 |
+
$cache->save(serialize($data), 'quartic-catalogs-' . $storeId, array(), 30 * 24 * 3600);
|
89 |
$list = array();
|
90 |
foreach ($data as $catalog) {
|
91 |
$list[] = array(
|
93 |
'label' => $catalog['name'],
|
94 |
);
|
95 |
}
|
96 |
+
$cache->save(serialize($list), 'quartic-catalogs-list-' . $storeId, array(), 30 * 24 * 3600);
|
97 |
return $list;
|
98 |
}
|
99 |
}
|
app/code/community/Quarticon/Quartic/Model/Client/AbstractCurl.php
CHANGED
@@ -56,11 +56,15 @@ abstract class Quarticon_Quartic_Model_Client_AbstractCurl
|
|
56 |
*/
|
57 |
protected function getToken()
|
58 |
{
|
|
|
|
|
59 |
if (is_null($this->_token)) {
|
60 |
-
$
|
|
|
61 |
}
|
62 |
if (!is_null($this->_token)) {
|
63 |
-
$
|
|
|
64 |
if ($end < Mage::getModel('core/date')->timestamp()) {
|
65 |
return null;
|
66 |
}
|
@@ -74,11 +78,17 @@ abstract class Quarticon_Quartic_Model_Client_AbstractCurl
|
|
74 |
* @return string
|
75 |
* @throws \Exception
|
76 |
*/
|
77 |
-
protected function setToken($value, $end)
|
78 |
{
|
79 |
$this->_token = $value;
|
80 |
-
|
81 |
-
Mage::getSingleton('core/session')->
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
|
84 |
/**
|
56 |
*/
|
57 |
protected function getToken()
|
58 |
{
|
59 |
+
$storeCode = Mage::app()->getRequest()->getParam('store');
|
60 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
61 |
if (is_null($this->_token)) {
|
62 |
+
$temp = Mage::getSingleton('core/session')->getQuarticApiToken();
|
63 |
+
$this->_token = isset($temp[$storeId]) ? $temp[$storeId] : null;
|
64 |
}
|
65 |
if (!is_null($this->_token)) {
|
66 |
+
$temp2 = Mage::getSingleton('core/session')->getQuarticApiTokenExpires();
|
67 |
+
$end = $temp2[$storeId];
|
68 |
if ($end < Mage::getModel('core/date')->timestamp()) {
|
69 |
return null;
|
70 |
}
|
78 |
* @return string
|
79 |
* @throws \Exception
|
80 |
*/
|
81 |
+
protected function setToken($value, $end, $storeId)
|
82 |
{
|
83 |
$this->_token = $value;
|
84 |
+
|
85 |
+
$token = Mage::getSingleton('core/session')->getQuarticApiToken();
|
86 |
+
$token[$storeId] = $value;
|
87 |
+
Mage::getSingleton('core/session')->setQuarticApiToken($token);
|
88 |
+
|
89 |
+
$tokenExp = Mage::getSingleton('core/session')->setQuarticApiTokenExpires();
|
90 |
+
$tokenExp[$storeId] = $end;
|
91 |
+
Mage::getSingleton('core/session')->setQuarticApiTokenExpires($token);
|
92 |
}
|
93 |
|
94 |
/**
|
app/code/community/Quarticon/Quartic/Model/Client/Api.php
CHANGED
@@ -12,11 +12,11 @@ class Quarticon_Quartic_Model_Client_Api extends Quarticon_Quartic_Model_Client_
|
|
12 |
* @param string $resource
|
13 |
* @return array
|
14 |
*/
|
15 |
-
public function get($resource)
|
16 |
{
|
17 |
$token = $this->getToken();
|
18 |
if (empty($token)) {
|
19 |
-
$token = $this->requestToken();
|
20 |
}
|
21 |
$ret = $this->getClient()->get($resource . '?token=' . $token);
|
22 |
if (empty($ret)) {
|
@@ -105,10 +105,19 @@ class Quarticon_Quartic_Model_Client_Api extends Quarticon_Quartic_Model_Client_
|
|
105 |
* @return string
|
106 |
* @throws \Exception
|
107 |
*/
|
108 |
-
public function requestToken()
|
109 |
{
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
$ret = $this->getClient()
|
114 |
->post('login', array(
|
@@ -121,7 +130,7 @@ class Quarticon_Quartic_Model_Client_Api extends Quarticon_Quartic_Model_Client_
|
|
121 |
*/
|
122 |
//$end = Mage::getModel('core/date')->timestamp($ret['body']['data']['end_date']);
|
123 |
$end = Mage::getModel('core/date')->timestamp('+5 minutes');
|
124 |
-
$this->setToken($ret['body']['data']['token'], $end);
|
125 |
return $ret['body']['data']['token'];
|
126 |
} else {
|
127 |
throw new \Exception('Could not get token.');
|
@@ -131,10 +140,10 @@ class Quarticon_Quartic_Model_Client_Api extends Quarticon_Quartic_Model_Client_
|
|
131 |
/**
|
132 |
* Remove token to force re-login on ext request
|
133 |
*/
|
134 |
-
public function dropToken()
|
135 |
{
|
136 |
$end = Mage::getModel('core/date')->timestamp('-1 year');
|
137 |
-
$this->setToken(null, $end);
|
138 |
}
|
139 |
|
140 |
public function catalogType()
|
12 |
* @param string $resource
|
13 |
* @return array
|
14 |
*/
|
15 |
+
public function get($resource,$storeId = false)
|
16 |
{
|
17 |
$token = $this->getToken();
|
18 |
if (empty($token)) {
|
19 |
+
$token = $this->requestToken($storeId);
|
20 |
}
|
21 |
$ret = $this->getClient()->get($resource . '?token=' . $token);
|
22 |
if (empty($ret)) {
|
105 |
* @return string
|
106 |
* @throws \Exception
|
107 |
*/
|
108 |
+
public function requestToken($storeId = false)
|
109 |
{
|
110 |
+
if($storeId === false) {
|
111 |
+
$storeCode = Mage::app()->getRequest()->getParam('store');
|
112 |
+
if($storeCode) {
|
113 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
114 |
+
} else {
|
115 |
+
$storeId = 0;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
$symbol = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
120 |
+
$key = Mage::getStoreConfig("quartic/config/api_key", $storeId);
|
121 |
|
122 |
$ret = $this->getClient()
|
123 |
->post('login', array(
|
130 |
*/
|
131 |
//$end = Mage::getModel('core/date')->timestamp($ret['body']['data']['end_date']);
|
132 |
$end = Mage::getModel('core/date')->timestamp('+5 minutes');
|
133 |
+
$this->setToken($ret['body']['data']['token'], $end, $storeId);
|
134 |
return $ret['body']['data']['token'];
|
135 |
} else {
|
136 |
throw new \Exception('Could not get token.');
|
140 |
/**
|
141 |
* Remove token to force re-login on ext request
|
142 |
*/
|
143 |
+
public function dropToken($storeId)
|
144 |
{
|
145 |
$end = Mage::getModel('core/date')->timestamp('-1 year');
|
146 |
+
$this->setToken(null, $end,$storeId);
|
147 |
}
|
148 |
|
149 |
public function catalogType()
|
app/code/community/Quarticon/Quartic/Model/Client/Resource/Curl.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Config.php
CHANGED
@@ -8,16 +8,17 @@ class Quarticon_Quartic_Model_Config extends Mage_Core_Model_Config
|
|
8 |
return Mage::getSingleton('customer/session');
|
9 |
}
|
10 |
|
11 |
-
public function saveHash()
|
12 |
{
|
13 |
$hash = md5(microtime());
|
14 |
-
Mage::getModel('core/config')->saveConfig('quartic/config/hash', $hash,
|
15 |
}
|
16 |
|
17 |
public function getHash($store_id = null)
|
18 |
{
|
19 |
return Mage::getStoreConfig('quartic/config/hash', $store_id);
|
20 |
}
|
|
|
21 |
public function isDebug($store_id = null)
|
22 |
{
|
23 |
return (bool) Mage::getStoreConfig('quartic/config/debug', $store_id);
|
@@ -79,4 +80,54 @@ class Quarticon_Quartic_Model_Config extends Mage_Core_Model_Config
|
|
79 |
{
|
80 |
return (int) Mage::getStoreConfig('quartic/config/min_qty', $store_id);
|
81 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
8 |
return Mage::getSingleton('customer/session');
|
9 |
}
|
10 |
|
11 |
+
public function saveHash($area = 'default',$id = 0)
|
12 |
{
|
13 |
$hash = md5(microtime());
|
14 |
+
Mage::getModel('core/config')->saveConfig('quartic/config/hash', $hash, $area, $id);
|
15 |
}
|
16 |
|
17 |
public function getHash($store_id = null)
|
18 |
{
|
19 |
return Mage::getStoreConfig('quartic/config/hash', $store_id);
|
20 |
}
|
21 |
+
|
22 |
public function isDebug($store_id = null)
|
23 |
{
|
24 |
return (bool) Mage::getStoreConfig('quartic/config/debug', $store_id);
|
80 |
{
|
81 |
return (int) Mage::getStoreConfig('quartic/config/min_qty', $store_id);
|
82 |
}
|
83 |
+
|
84 |
+
public function getVisibility($store_id = null)
|
85 |
+
{
|
86 |
+
return explode(',',Mage::getStoreConfig('quartic/config/visibility', $store_id));
|
87 |
+
}
|
88 |
+
|
89 |
+
public function getConfigurablePrice($store_id = null)
|
90 |
+
{
|
91 |
+
return (int) Mage::getStoreConfig('quartic/composite/configurable_price', $store_id);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function getShowConfigurableChilds($store_id = null)
|
95 |
+
{
|
96 |
+
return (int) Mage::getStoreConfig('quartic/composite/configurable_childs', $store_id);
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getConfigurableChildImage($store_id = null)
|
100 |
+
{
|
101 |
+
return (int) Mage::getStoreConfig('quartic/composite/configurable_child_image', $store_id);
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getConfigurableChildPrice($store_id = null)
|
105 |
+
{
|
106 |
+
return (int) Mage::getStoreConfig('quartic/composite/configurable_child_price', $store_id);
|
107 |
+
}
|
108 |
+
|
109 |
+
public function getConfigurableChildRedirect($store_id = null)
|
110 |
+
{
|
111 |
+
return (int) Mage::getStoreConfig('quartic/composite/configurable_child_redirect', $store_id);
|
112 |
+
}
|
113 |
+
|
114 |
+
public function getGroupedChildImage($store_id = null)
|
115 |
+
{
|
116 |
+
return (int) Mage::getStoreConfig('quartic/composite/grouped_child_image', $store_id);
|
117 |
+
}
|
118 |
+
|
119 |
+
public function getGroupedChildPrice($store_id = null)
|
120 |
+
{
|
121 |
+
return (int) Mage::getStoreConfig('quartic/composite/grouped_child_price', $store_id);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function getGroupedChildRedirect($store_id = null)
|
125 |
+
{
|
126 |
+
return (int) Mage::getStoreConfig('quartic/composite/grouped_child_redirect', $store_id);
|
127 |
+
}
|
128 |
+
|
129 |
+
public function getUseFileCache($store_id = null)
|
130 |
+
{
|
131 |
+
return (int) Mage::getStoreConfig('quartic/config/feed/product/use_file_cache', $store_id);
|
132 |
+
}
|
133 |
}
|
app/code/community/Quarticon/Quartic/Model/Cron.php
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Quarticon_Quartic_Model_Cron {
|
4 |
+
|
5 |
+
public function refreshProductsFeed()
|
6 |
+
{
|
7 |
+
$log = false;
|
8 |
+
if($log) Mage::log('Start',null,'quartic_cron.log',true);
|
9 |
+
if(!Mage::getModel('quartic/config')->getUseFileCache()) return false;
|
10 |
+
if($log) Mage::log('Next',null,'quartic_cron.log',true);
|
11 |
+
|
12 |
+
$stores = $this->getStoresFeedEnabled();
|
13 |
+
foreach($stores as $storeId) {
|
14 |
+
if($log) Mage::log('$storeId: ' . $storeId,null,'quartic_cron.log',true);
|
15 |
+
$filename = 'xmlOutput_' . $storeId . '.xml';
|
16 |
+
$filepath = Mage::getBaseDir('var') . "/quartic/" . $filename;
|
17 |
+
|
18 |
+
ob_start();
|
19 |
+
|
20 |
+
$writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
21 |
+
$writer->openUri('php://output');
|
22 |
+
$writer->startDocument('1.0', 'UTF-8');
|
23 |
+
$writer->setIndent(true);
|
24 |
+
$mem_writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
25 |
+
$mem_writer->openMemory();
|
26 |
+
$mem_writer->setIndent(true);
|
27 |
+
$writer->startElement('products');
|
28 |
+
$writer->writeAttribute('xmlns', "http://alpha.quarticon.com/docs/catalog/1.0/schema");
|
29 |
+
$writer->writeAttribute('xmlns:xsi', "http://www.w3.org/2001/XMLSchema-instance");
|
30 |
+
$writer->writeAttribute('xsi:schemaLocation', "http://quartic.pl/catalog/1.0/schema http://alpha.quarticon.com/docs/catalog/1.0/schema/quartic_catalog_1.0.xsd");
|
31 |
+
|
32 |
+
$time = microtime(true);
|
33 |
+
$products = array();
|
34 |
+
|
35 |
+
$data = array();
|
36 |
+
// for proper products data in collection set current store by param
|
37 |
+
Mage::app()->setCurrentStore($storeId);
|
38 |
+
/**
|
39 |
+
* @var Quarticon_Quartic_Model_Product $_product
|
40 |
+
*/
|
41 |
+
$_product = Mage::getModel('quartic/product');
|
42 |
+
$count = $_product->getCollectionCount();
|
43 |
+
if($log) Mage::log('$count: ' . $count,null,'quartic_cron.log',true);
|
44 |
+
|
45 |
+
$steps = ceil($count / $_product->getIterationStep($storeId));
|
46 |
+
if($log) Mage::log('$steps: ' . $steps,null,'quartic_cron.log',true);
|
47 |
+
for ($step = 1; $step <= $steps; $step++) {
|
48 |
+
if($log) Mage::log('$step1: ' . $step,null,'quartic_cron.log',true);
|
49 |
+
$products[$step] = $_product->getAll($step, $_product->getIterationStep($storeId));
|
50 |
+
}
|
51 |
+
$data['steps'] = $steps;
|
52 |
+
$data['products'] = $products;
|
53 |
+
$data['time'] = $time;
|
54 |
+
|
55 |
+
$cache = $data;
|
56 |
+
|
57 |
+
|
58 |
+
$steps = $cache['steps'];
|
59 |
+
$products = $cache['products'];
|
60 |
+
for ($step = 1; $step <= $steps; $step++) {
|
61 |
+
if($log) Mage::log('$step2: ' . $step,null,'quartic_cron.log',true);
|
62 |
+
$collection = $products[$step];
|
63 |
+
foreach ($collection as &$p) {
|
64 |
+
if($log) Mage::log('$productId: ' . $p['id'],null,'quartic_cron.log',true);
|
65 |
+
$mem_writer->startElement('product');
|
66 |
+
$mem_writer->writeElement('id', $p['id']);
|
67 |
+
$mem_writer->startElement('title');
|
68 |
+
$mem_writer->writeCData($p['title']);
|
69 |
+
$mem_writer->endElement();
|
70 |
+
$mem_writer->startElement('link');
|
71 |
+
$mem_writer->writeCData($p['link']);
|
72 |
+
$mem_writer->endElement();
|
73 |
+
if (isset($p['thumb'])) {
|
74 |
+
$mem_writer->startElement('thumb');
|
75 |
+
$mem_writer->writeCData($p['thumb']);
|
76 |
+
$mem_writer->endElement();
|
77 |
+
}
|
78 |
+
$mem_writer->writeElement('price', $p['price']);
|
79 |
+
if (isset($p['old_price'])) {
|
80 |
+
$mem_writer->writeElement('old_price', $p['old_price']);
|
81 |
+
}
|
82 |
+
if (isset($p['author'])) {
|
83 |
+
$mem_writer->startElement('author');
|
84 |
+
$mem_writer->writeCData($p['author']);
|
85 |
+
$mem_writer->endElement();
|
86 |
+
}
|
87 |
+
$mem_writer->writeElement('status', !empty($p['status']) ? '1' : '0');
|
88 |
+
$i = 0;
|
89 |
+
foreach ($p['categories'] as $categoryId => $categoryName) {
|
90 |
+
$i++;
|
91 |
+
$mem_writer->startElement('category_' . $i);
|
92 |
+
$mem_writer->writeAttribute('id', $categoryId);
|
93 |
+
$mem_writer->writeRaw($categoryName);
|
94 |
+
$mem_writer->endElement();
|
95 |
+
}
|
96 |
+
|
97 |
+
$i = 1;
|
98 |
+
while ($i <= 5) {
|
99 |
+
if (isset($p['custom' . $i])) {
|
100 |
+
$mem_writer->writeElement('custom' . $i, $p['custom' . $i]);
|
101 |
+
}
|
102 |
+
$i++;
|
103 |
+
}
|
104 |
+
|
105 |
+
$mem_writer->endElement();
|
106 |
+
unset($p);
|
107 |
+
}
|
108 |
+
|
109 |
+
$batch_xml_string = $mem_writer->outputMemory(true);
|
110 |
+
$writer->writeRaw($batch_xml_string);
|
111 |
+
unset($collection);
|
112 |
+
}
|
113 |
+
|
114 |
+
unset($mem_writer);
|
115 |
+
$writer->endElement();
|
116 |
+
$writer->endDocument();
|
117 |
+
|
118 |
+
|
119 |
+
$xmlContent = ob_get_contents();
|
120 |
+
ob_end_clean();
|
121 |
+
if($log) Mage::log('przed zapisem',null,'quartic_cron.log',true);
|
122 |
+
file_put_contents($filepath,$xmlContent);
|
123 |
+
if($log) Mage::log('po zapisie',null,'quartic_cron.log',true);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
public function getStoresFeedEnabled()
|
128 |
+
{
|
129 |
+
$core_resource = Mage::getSingleton('core/resource');
|
130 |
+
$tablename = $core_resource->getTableName('core_config_data');
|
131 |
+
$connection = $core_resource->getConnection('core_read');
|
132 |
+
$select = $connection->select()->from($tablename, array('scope', 'scope_id', 'path', 'value'));
|
133 |
+
$select->where('path="quartic/config/active"');
|
134 |
+
|
135 |
+
$result = array();
|
136 |
+
$rowset = $connection->fetchAll($select);
|
137 |
+
foreach($rowset as $row) {
|
138 |
+
if($row['value'] == 1) {
|
139 |
+
|
140 |
+
switch ($row['scope']) {
|
141 |
+
case 'default':
|
142 |
+
$result[] = Mage::app()->getDefaultStoreView()->getStoreId();
|
143 |
+
break;
|
144 |
+
|
145 |
+
case 'websites':
|
146 |
+
$result[] = Mage::app()->getWebsite($row['scope_id'])->getDefaultGroup()->getDefaultStoreId();
|
147 |
+
break;
|
148 |
+
|
149 |
+
default:
|
150 |
+
$result[] = $row['scope_id'];
|
151 |
+
break;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
$result = array_unique($result);
|
156 |
+
return $result;
|
157 |
+
}
|
158 |
+
|
159 |
+
}
|
app/code/community/Quarticon/Quartic/Model/Frame.php
CHANGED
@@ -31,6 +31,16 @@ class Quarticon_Quartic_Model_Frame extends Mage_Core_Model_Abstract
|
|
31 |
$frame = $this->getPlacementFrame();
|
32 |
$this->setData('frame', $frame);
|
33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
return $frame['body'];
|
35 |
}
|
36 |
|
31 |
$frame = $this->getPlacementFrame();
|
32 |
$this->setData('frame', $frame);
|
33 |
}
|
34 |
+
|
35 |
+
if($this->getFrameName() == 'cart') {
|
36 |
+
$quote = Mage::helper('checkout/cart')->getCart()->getQuote();
|
37 |
+
$items = $quote->getItemsCollection();
|
38 |
+
$ids = '';
|
39 |
+
foreach($items as $item) {
|
40 |
+
$ids .= ',' . $item->getProduct()->getId();
|
41 |
+
}
|
42 |
+
$frame['body'] = str_replace('class="','data-product="' . substr($ids,1) . '" class="',$frame['body']);
|
43 |
+
}
|
44 |
return $frame['body'];
|
45 |
}
|
46 |
|
app/code/community/Quarticon/Quartic/Model/History.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Insert.php
CHANGED
@@ -75,7 +75,7 @@ class Quarticon_Quartic_Model_Insert extends Mage_Core_Model_Abstract
|
|
75 |
* Convert it
|
76 |
*/
|
77 |
$places_config = array();
|
78 |
-
foreach ($places_config_raw as $k => $v) {
|
79 |
if (strpos($k, '_enabled') !== false) {
|
80 |
$k = str_replace('_enabled', '', $k);
|
81 |
$nk = 'enabled';
|
75 |
* Convert it
|
76 |
*/
|
77 |
$places_config = array();
|
78 |
+
if(is_array($places_config_raw)) foreach ($places_config_raw as $k => $v) {
|
79 |
if (strpos($k, '_enabled') !== false) {
|
80 |
$k = str_replace('_enabled', '', $k);
|
81 |
$nk = 'enabled';
|
app/code/community/Quarticon/Quartic/Model/Insert/Cart.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Insert/Category.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Insert/Home.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Insert/Product.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Maps.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/History.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/History/Collection.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/Maps.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/Maps/Collection.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/Placement.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Mysql4/Placement/Collection.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/Model/Observer/Adminhtml.php
CHANGED
@@ -17,16 +17,34 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
17 |
$config = Mage::getModel('core/config');
|
18 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
19 |
$api = Mage::getModel('quartic/client_api');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
/**
|
21 |
* Clean products feed cache
|
22 |
*/
|
23 |
$cache = Mage::app()->getCacheInstance();
|
24 |
-
$cache->cleanType('quartic-products');
|
25 |
|
26 |
/**
|
27 |
* Verify api connection
|
28 |
*/
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
|
31 |
$status = (
|
32 |
!empty($status_array['active']) &&
|
@@ -42,13 +60,14 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
42 |
/**
|
43 |
* Force fresh login
|
44 |
*/
|
45 |
-
$api->dropToken();
|
46 |
$ret = $api->requestToken();
|
47 |
} catch (Exception $e) {
|
48 |
/**
|
49 |
* If login failed, return error
|
50 |
*/
|
51 |
-
|
|
|
52 |
Mage::app()->getCacheInstance()->cleanType('config');
|
53 |
throw new Mage_Core_Exception(Mage::helper('quartic')->__('Could not log in. Check your credentials and try again.'));
|
54 |
}
|
@@ -57,11 +76,11 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
57 |
/**
|
58 |
* Set module status based on config and result
|
59 |
*/
|
60 |
-
$config->saveConfig('quartic/config/status', (int) $status,
|
61 |
$cache->cleanType('config');
|
62 |
|
63 |
if ($status) {
|
64 |
-
$cleared = $this->markRegistered($observer, $status_array['customer']);
|
65 |
} else {
|
66 |
$cleared = false;
|
67 |
}
|
@@ -79,7 +98,7 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
79 |
);
|
80 |
$helper->log(var_export(array('data' => $data), true));
|
81 |
$helper->log(var_export($api->post('pluginActivation', array('data' => $data)), true));
|
82 |
-
$config->saveConfig("quartic/config/registered/c_{$status_array['customer']}", 1,
|
83 |
Mage::app()->getCacheInstance()->cleanType('config');
|
84 |
} catch (Exception $e) {
|
85 |
$helper->log("Quartic activation failed: " . $e->getMessage());
|
@@ -95,9 +114,9 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
95 |
/**
|
96 |
* Synchronizuj katalog
|
97 |
*/
|
98 |
-
$cache->cleanType('quartic-products');
|
99 |
$data = array();
|
100 |
-
$data['url'] = Mage::getUrl('quartic/feed/products', array('hash' => $status_array['hash']));
|
101 |
$helper->log('PUT catalog');
|
102 |
$helper->log(var_export(array('data' => $data), true));
|
103 |
$helper->log(var_export($api->put('catalogs', $catalog_id, array('data' => $data)), true));
|
@@ -105,9 +124,9 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
105 |
/**
|
106 |
* Utwórz nowy
|
107 |
*/
|
108 |
-
$cache->cleanType('quartic-products');
|
109 |
$data = array(
|
110 |
-
'url' => Mage::getUrl('quartic/feed/products', array('hash' => $status_array['hash'])),
|
111 |
'name' => 'magento_' . time(),
|
112 |
'typeId' => $api->catalogType(),
|
113 |
);
|
@@ -116,7 +135,7 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
116 |
$new_catalog = $api->post('catalogs', array('data' => $data));
|
117 |
$helper->log(var_export($new_catalog, true));
|
118 |
$retData = current($new_catalog['body']['data']);
|
119 |
-
$config->saveConfig('quartic/config/catalog_id', $retData['id'],
|
120 |
$cache->cleanType('config');
|
121 |
}
|
122 |
}
|
@@ -128,17 +147,22 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
128 |
* @param string $qcustomer QON account login
|
129 |
* @return boolean True if data was cleared
|
130 |
*/
|
131 |
-
public function markRegistered(Varien_Event_Observer $observer, $qcustomer)
|
132 |
{
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
$cache = Mage::app()->getCacheInstance();
|
135 |
/* @var $api Mage_Core_Model_Config */
|
136 |
$config = Mage::getModel('core/config');
|
|
|
137 |
/**
|
138 |
* First login - save id
|
139 |
*/
|
140 |
if (empty($registered)) {
|
141 |
-
$config->saveConfig('quartic/config/registered/current', $qcustomer);
|
142 |
return false;
|
143 |
}
|
144 |
/*
|
@@ -148,20 +172,22 @@ class Quarticon_Quartic_Model_Observer_Adminhtml
|
|
148 |
/**
|
149 |
* Remove frames
|
150 |
*/
|
|
|
151 |
$frames = Mage::getModel('quartic/placement');
|
152 |
$collection = $frames->getCollection();
|
|
|
153 |
foreach ($collection as $item) {
|
154 |
$item->delete();
|
155 |
-
}
|
156 |
|
157 |
-
$config->deleteConfig('quartic/config/modified_placements');
|
158 |
-
$config->deleteConfig('quartic/config/catalog_id');
|
159 |
-
$config->deleteConfig('quartic/frames_homepage');
|
160 |
-
$config->deleteConfig('quartic/frames_category');
|
161 |
-
$config->deleteConfig('quartic/frames_product');
|
162 |
-
$config->deleteConfig('quartic/frames_cart');
|
163 |
|
164 |
-
$config->saveConfig('quartic/config/registered/current', $qcustomer);
|
165 |
|
166 |
$cache->cleanType('config');
|
167 |
return true;
|
17 |
$config = Mage::getModel('core/config');
|
18 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
19 |
$api = Mage::getModel('quartic/client_api');
|
20 |
+
$currentArea = 'default';
|
21 |
+
$currentAreaId = 0;
|
22 |
+
if($observer->getStore()) {
|
23 |
+
$storeId = Mage::getModel('core/store')->load($observer->getStore(), 'code')->getId();
|
24 |
+
$currentArea = 'stores';
|
25 |
+
$currentAreaId = $storeId;
|
26 |
+
} elseif($observer->getWebsite()) {
|
27 |
+
$websiteId = Mage::getModel('core/website')->load($observer->getWebsite(), 'code')->getId();
|
28 |
+
$storeId = Mage::app()->getWebsite($websiteId)->getDefaultGroup()->getDefaultStoreId();
|
29 |
+
$currentArea = 'websites';
|
30 |
+
$currentAreaId = $websiteId;
|
31 |
+
} else {
|
32 |
+
$storeId = Mage::app()->getDefaultStoreView()->getStoreId();
|
33 |
+
}
|
34 |
/**
|
35 |
* Clean products feed cache
|
36 |
*/
|
37 |
$cache = Mage::app()->getCacheInstance();
|
38 |
+
$cache->cleanType('quartic-products-' . $storeId);
|
39 |
|
40 |
/**
|
41 |
* Verify api connection
|
42 |
*/
|
43 |
+
if($currentArea == 'websites') {
|
44 |
+
$status_array = Mage::app()->getWebsite($currentAreaId)->getConfig('quartic/config');
|
45 |
+
} else {
|
46 |
+
$status_array = Mage::getStoreConfig("quartic/config", $observer->getStore());
|
47 |
+
}
|
48 |
|
49 |
$status = (
|
50 |
!empty($status_array['active']) &&
|
60 |
/**
|
61 |
* Force fresh login
|
62 |
*/
|
63 |
+
$api->dropToken($observer->getStore());
|
64 |
$ret = $api->requestToken();
|
65 |
} catch (Exception $e) {
|
66 |
/**
|
67 |
* If login failed, return error
|
68 |
*/
|
69 |
+
|
70 |
+
$config->saveConfig('quartic/config/status', 0, $currentArea, $currentAreaId);
|
71 |
Mage::app()->getCacheInstance()->cleanType('config');
|
72 |
throw new Mage_Core_Exception(Mage::helper('quartic')->__('Could not log in. Check your credentials and try again.'));
|
73 |
}
|
76 |
/**
|
77 |
* Set module status based on config and result
|
78 |
*/
|
79 |
+
$config->saveConfig('quartic/config/status', (int) $status, $currentArea, $currentAreaId);
|
80 |
$cache->cleanType('config');
|
81 |
|
82 |
if ($status) {
|
83 |
+
$cleared = $this->markRegistered($observer, $status_array['customer'], $currentArea, $currentAreaId);
|
84 |
} else {
|
85 |
$cleared = false;
|
86 |
}
|
98 |
);
|
99 |
$helper->log(var_export(array('data' => $data), true));
|
100 |
$helper->log(var_export($api->post('pluginActivation', array('data' => $data)), true));
|
101 |
+
$config->saveConfig("quartic/config/registered/c_{$status_array['customer']}", 1, $currentArea, $currentAreaId);
|
102 |
Mage::app()->getCacheInstance()->cleanType('config');
|
103 |
} catch (Exception $e) {
|
104 |
$helper->log("Quartic activation failed: " . $e->getMessage());
|
114 |
/**
|
115 |
* Synchronizuj katalog
|
116 |
*/
|
117 |
+
$cache->cleanType('quartic-products-' . $storeId);
|
118 |
$data = array();
|
119 |
+
$data['url'] = Mage::getUrl('quartic/feed/products', array('hash' => $status_array['hash'],'store' => $storeId,'_nosid' => true,'_store' => $storeId,'_type' =>'direct_link'));
|
120 |
$helper->log('PUT catalog');
|
121 |
$helper->log(var_export(array('data' => $data), true));
|
122 |
$helper->log(var_export($api->put('catalogs', $catalog_id, array('data' => $data)), true));
|
124 |
/**
|
125 |
* Utwórz nowy
|
126 |
*/
|
127 |
+
$cache->cleanType('quartic-products-' . $storeId);
|
128 |
$data = array(
|
129 |
+
'url' => Mage::getUrl('quartic/feed/products', array('hash' => $status_array['hash'],'store' => $storeId,'_nosid' => true,'_store' => $storeId,'_type' =>'direct_link')),
|
130 |
'name' => 'magento_' . time(),
|
131 |
'typeId' => $api->catalogType(),
|
132 |
);
|
135 |
$new_catalog = $api->post('catalogs', array('data' => $data));
|
136 |
$helper->log(var_export($new_catalog, true));
|
137 |
$retData = current($new_catalog['body']['data']);
|
138 |
+
$config->saveConfig('quartic/config/catalog_id', $retData['id'], $currentArea, $currentAreaId);
|
139 |
$cache->cleanType('config');
|
140 |
}
|
141 |
}
|
147 |
* @param string $qcustomer QON account login
|
148 |
* @return boolean True if data was cleared
|
149 |
*/
|
150 |
+
public function markRegistered(Varien_Event_Observer $observer, $qcustomer, $currentArea, $currentAreaId)
|
151 |
{
|
152 |
+
if($currentArea == 'websites') {
|
153 |
+
$registered = Mage::app()->getWebsite($currentAreaId)->getConfig('quartic/config/registered/current');
|
154 |
+
} else {
|
155 |
+
$registered = Mage::getStoreConfig("quartic/config/registered/current", $currentAreaId);
|
156 |
+
}
|
157 |
$cache = Mage::app()->getCacheInstance();
|
158 |
/* @var $api Mage_Core_Model_Config */
|
159 |
$config = Mage::getModel('core/config');
|
160 |
+
|
161 |
/**
|
162 |
* First login - save id
|
163 |
*/
|
164 |
if (empty($registered)) {
|
165 |
+
$config->saveConfig('quartic/config/registered/current', $qcustomer, $currentArea, $currentAreaId);
|
166 |
return false;
|
167 |
}
|
168 |
/*
|
172 |
/**
|
173 |
* Remove frames
|
174 |
*/
|
175 |
+
/*
|
176 |
$frames = Mage::getModel('quartic/placement');
|
177 |
$collection = $frames->getCollection();
|
178 |
+
$collection->addFieldToFilter('api_name', $qcustomer);
|
179 |
foreach ($collection as $item) {
|
180 |
$item->delete();
|
181 |
+
}*/
|
182 |
|
183 |
+
$config->deleteConfig('quartic/config/modified_placements', $qcustomer);
|
184 |
+
$config->deleteConfig('quartic/config/catalog_id', $qcustomer);
|
185 |
+
$config->deleteConfig('quartic/frames_homepage', $qcustomer);
|
186 |
+
$config->deleteConfig('quartic/frames_category', $qcustomer);
|
187 |
+
$config->deleteConfig('quartic/frames_product', $qcustomer);
|
188 |
+
$config->deleteConfig('quartic/frames_cart', $qcustomer);
|
189 |
|
190 |
+
$config->saveConfig('quartic/config/registered/current', $qcustomer, $currentArea, $currentAreaId);
|
191 |
|
192 |
$cache->cleanType('config');
|
193 |
return true;
|
app/code/community/Quarticon/Quartic/Model/Observer/Frontend.php
CHANGED
@@ -83,4 +83,10 @@ class Quarticon_Quartic_Model_Observer_Frontend
|
|
83 |
}
|
84 |
}
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
83 |
}
|
84 |
}
|
85 |
}
|
86 |
+
|
87 |
+
public function controllerFrontSendResponseBefore($observer)
|
88 |
+
{
|
89 |
+
$front = $observer->getFront();
|
90 |
+
$front->getResponse()->setHeader('Access-Control-Allow-Origin','api.quarticon.com,api.quartic.pl');
|
91 |
+
}
|
92 |
}
|
app/code/community/Quarticon/Quartic/Model/Order.php
CHANGED
@@ -57,24 +57,33 @@ class Quarticon_Quartic_Model_Order extends Mage_Core_Model_Abstract
|
|
57 |
return $this->_products_table;
|
58 |
}
|
59 |
|
60 |
-
public function getCollectionCount()
|
61 |
{
|
62 |
$sql = 'select count(*) as c from ' . $this->_getOrdersTable() . ' as o '
|
63 |
. 'left join ' . $this->_getOrderItemsTable() . ' as i '
|
64 |
. 'on(i.order_id = o.entity_id and i.parent_item_id is null) '
|
65 |
;
|
|
|
|
|
|
|
|
|
66 |
|
67 |
$q = $this->_getDB()->fetchRow($sql);
|
68 |
return $q['c'];
|
69 |
}
|
70 |
|
71 |
-
public function getAll($page_num = 1, $page_size = 10)
|
72 |
{
|
73 |
$sql = 'select o.increment_id, o.created_at, o.customer_id, i.product_id, i.sku, i.qty_ordered, i.price_incl_tax, i.product_type, p.sku as real_sku from ' . $this->_getOrdersTable() . ' as o '
|
74 |
. 'left join ' . $this->_getOrderItemsTable() . ' as i on(i.order_id = o.entity_id and i.parent_item_id is null) '
|
75 |
-
. 'left join ' . $this->_getProductsTable() . ' as p on(i.product_id = p.entity_id)
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
78 |
$collection = $this->_getDB()->fetchAll($sql);
|
79 |
foreach ($collection as $order) {
|
80 |
$o = array(
|
57 |
return $this->_products_table;
|
58 |
}
|
59 |
|
60 |
+
public function getCollectionCount($storeId = false)
|
61 |
{
|
62 |
$sql = 'select count(*) as c from ' . $this->_getOrdersTable() . ' as o '
|
63 |
. 'left join ' . $this->_getOrderItemsTable() . ' as i '
|
64 |
. 'on(i.order_id = o.entity_id and i.parent_item_id is null) '
|
65 |
;
|
66 |
+
if($storeId) {
|
67 |
+
$storeId = (int)$storeId;
|
68 |
+
$sql .= 'where o.store_id = ' . $storeId;
|
69 |
+
}
|
70 |
|
71 |
$q = $this->_getDB()->fetchRow($sql);
|
72 |
return $q['c'];
|
73 |
}
|
74 |
|
75 |
+
public function getAll($page_num = 1, $page_size = 10, $storeId = false)
|
76 |
{
|
77 |
$sql = 'select o.increment_id, o.created_at, o.customer_id, i.product_id, i.sku, i.qty_ordered, i.price_incl_tax, i.product_type, p.sku as real_sku from ' . $this->_getOrdersTable() . ' as o '
|
78 |
. 'left join ' . $this->_getOrderItemsTable() . ' as i on(i.order_id = o.entity_id and i.parent_item_id is null) '
|
79 |
+
. 'left join ' . $this->_getProductsTable() . ' as p on(i.product_id = p.entity_id)';
|
80 |
+
|
81 |
+
if($storeId) {
|
82 |
+
$storeId = (int)$storeId;
|
83 |
+
$sql .= ' where o.store_id = ' . $storeId;
|
84 |
+
}
|
85 |
+
|
86 |
+
$sql . ' order by i.item_id limit ' . (($page_num - 1) * $page_size) . ', ' . $page_size;
|
87 |
$collection = $this->_getDB()->fetchAll($sql);
|
88 |
foreach ($collection as $order) {
|
89 |
$o = array(
|
app/code/community/Quarticon/Quartic/Model/Placement.php
CHANGED
@@ -57,19 +57,20 @@ class Quarticon_Quartic_Model_Placement extends Mage_Core_Model_Abstract
|
|
57 |
*
|
58 |
* @return array
|
59 |
*/
|
60 |
-
public function apiLoad()
|
61 |
{
|
62 |
try {
|
63 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
64 |
$api = Mage::getModel('quartic/client_api');
|
65 |
-
|
|
|
66 |
} catch (Exception $e) {
|
67 |
return array(
|
68 |
'status' => 'error',
|
69 |
'message' => $e->getMessage()
|
70 |
);
|
71 |
}
|
72 |
-
return $this->apiLoaded($ret['body']['data']);
|
73 |
}
|
74 |
|
75 |
/**
|
@@ -78,17 +79,18 @@ class Quarticon_Quartic_Model_Placement extends Mage_Core_Model_Abstract
|
|
78 |
* @param array $data Decoded from json
|
79 |
* @return array Ids of placements: qon_id=>magento_id
|
80 |
*/
|
81 |
-
protected function apiLoaded($data = array())
|
82 |
{
|
83 |
$ret = array();
|
84 |
foreach ($data as $placement) {
|
85 |
try {
|
86 |
-
$ret[$placement['id']] = $this->saveReplace($placement);
|
87 |
} catch (Exception $e) {
|
88 |
Mage::logException($e);
|
89 |
}
|
90 |
}
|
91 |
-
Mage::getModel('core/config')->saveConfig('quartic/config/modified_placements',
|
|
|
92 |
Mage::app()->getCacheInstance()->cleanType('config');
|
93 |
return $ret;
|
94 |
}
|
@@ -98,14 +100,19 @@ class Quarticon_Quartic_Model_Placement extends Mage_Core_Model_Abstract
|
|
98 |
* @param type $placement
|
99 |
* @return type
|
100 |
*/
|
101 |
-
protected function saveReplace($placement)
|
102 |
{
|
103 |
-
$
|
104 |
-
$
|
105 |
-
|
|
|
|
|
|
|
|
|
106 |
$entity
|
107 |
->setData(array(
|
108 |
'id' => $check->getId(),
|
|
|
109 |
'qon_id' => $placement['id'],
|
110 |
'qon_parent_id' => $placement['parent_id'],
|
111 |
'parent_name' => $placement['parent_name'],
|
@@ -113,8 +120,47 @@ class Quarticon_Quartic_Model_Placement extends Mage_Core_Model_Abstract
|
|
113 |
'div_id' => $placement['div_id'],
|
114 |
'snippet' => $placement['snippet'],
|
115 |
));
|
116 |
-
|
117 |
-
->save();
|
|
|
|
|
118 |
return $entity->getId();
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
57 |
*
|
58 |
* @return array
|
59 |
*/
|
60 |
+
public function apiLoad($storeId)
|
61 |
{
|
62 |
try {
|
63 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
64 |
$api = Mage::getModel('quartic/client_api');
|
65 |
+
|
66 |
+
$ret = $api->get('placements',$storeId);
|
67 |
} catch (Exception $e) {
|
68 |
return array(
|
69 |
'status' => 'error',
|
70 |
'message' => $e->getMessage()
|
71 |
);
|
72 |
}
|
73 |
+
return $this->apiLoaded($ret['body']['data'], $storeId);
|
74 |
}
|
75 |
|
76 |
/**
|
79 |
* @param array $data Decoded from json
|
80 |
* @return array Ids of placements: qon_id=>magento_id
|
81 |
*/
|
82 |
+
protected function apiLoaded($data = array(), $storeId)
|
83 |
{
|
84 |
$ret = array();
|
85 |
foreach ($data as $placement) {
|
86 |
try {
|
87 |
+
$ret[$placement['id']] = $this->saveReplace($placement, $storeId);
|
88 |
} catch (Exception $e) {
|
89 |
Mage::logException($e);
|
90 |
}
|
91 |
}
|
92 |
+
Mage::getModel('core/config')->saveConfig('quartic/config/modified_placements',
|
93 |
+
Mage::getModel('core/date')->timestamp(), 'default', 0);
|
94 |
Mage::app()->getCacheInstance()->cleanType('config');
|
95 |
return $ret;
|
96 |
}
|
100 |
* @param type $placement
|
101 |
* @return type
|
102 |
*/
|
103 |
+
protected function saveReplace($placement, $storeId)
|
104 |
{
|
105 |
+
$apiName = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
106 |
+
$check = $this->getCollection()
|
107 |
+
->addFieldToFilter('api_name', $apiName)
|
108 |
+
->addFieldToFilter('qon_id', $placement['id'])
|
109 |
+
->getFirstItem();
|
110 |
+
|
111 |
+
$entity = $this;
|
112 |
$entity
|
113 |
->setData(array(
|
114 |
'id' => $check->getId(),
|
115 |
+
'api_name' => $apiName,
|
116 |
'qon_id' => $placement['id'],
|
117 |
'qon_parent_id' => $placement['parent_id'],
|
118 |
'parent_name' => $placement['parent_name'],
|
120 |
'div_id' => $placement['div_id'],
|
121 |
'snippet' => $placement['snippet'],
|
122 |
));
|
123 |
+
|
124 |
+
$entity->save();
|
125 |
+
|
126 |
+
$entity->save();
|
127 |
return $entity->getId();
|
128 |
}
|
129 |
+
|
130 |
+
public function getStoreId($allowAdmin = true)
|
131 |
+
{
|
132 |
+
$params = Mage::app()->getRequest()->getParams();
|
133 |
+
if(isset($params['store'])) {
|
134 |
+
$storeId = (is_numeric($params['store'])) ? (int)$params['store'] : Mage::getModel('core/store')->load($params['store'], 'code')->getId();
|
135 |
+
} elseif(isset($params['website'])) {
|
136 |
+
$website = (is_numeric($params['website'])) ? Mage::getModel('core/website')->load($params['website']) : Mage::getModel('core/website')->load($params['website'], 'code');
|
137 |
+
$storeId = $website->getDefaultGroup()->getDefaultStoreId();
|
138 |
+
} else {
|
139 |
+
$storeId = Mage::app()->getStore()->getId();
|
140 |
+
}
|
141 |
+
if($storeId == 0 && !$allowAdmin) $storeId = Mage::app()->getDefaultStoreView()->getStoreId();
|
142 |
+
|
143 |
+
return $storeId;
|
144 |
+
}
|
145 |
+
|
146 |
+
public function deleteAll($apiName = false)
|
147 |
+
{
|
148 |
+
$collection = $this->getCollection();
|
149 |
+
if($apiName) {
|
150 |
+
$collection->addFieldToFilter('api_name', $apiName);
|
151 |
+
}
|
152 |
+
|
153 |
+
try {
|
154 |
+
foreach ($collection as $item) {
|
155 |
+
$item->delete();
|
156 |
+
}
|
157 |
+
} catch (Exception $e) {
|
158 |
+
return array(
|
159 |
+
'status' => 'error',
|
160 |
+
'message' => $e->getMessage()
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
return true;
|
165 |
+
}
|
166 |
}
|
app/code/community/Quarticon/Quartic/Model/Placement/Cart.php
CHANGED
@@ -10,12 +10,13 @@ class Quarticon_Quartic_Model_Placement_Cart extends Quarticon_Quartic_Model_Pla
|
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
15 |
$options = $this->getCollection()
|
16 |
->addFieldToSelect('*')
|
|
|
17 |
->addFieldToFilter('parent_name', array('eq' => 'CartPage'))
|
18 |
-
//->addFieldToFilter('name', array('in' => $limit))
|
19 |
->loadData()
|
20 |
->toOptionArray(false);
|
21 |
return $options;
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
+
$storeId = $this->getStoreId();
|
14 |
+
$apiName = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
15 |
+
|
16 |
$options = $this->getCollection()
|
17 |
->addFieldToSelect('*')
|
18 |
+
->addFieldToFilter('api_name', $apiName)
|
19 |
->addFieldToFilter('parent_name', array('eq' => 'CartPage'))
|
|
|
20 |
->loadData()
|
21 |
->toOptionArray(false);
|
22 |
return $options;
|
app/code/community/Quarticon/Quartic/Model/Placement/Category.php
CHANGED
@@ -10,12 +10,13 @@ class Quarticon_Quartic_Model_Placement_Category extends Quarticon_Quartic_Model
|
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
15 |
$options = $this->getCollection()
|
16 |
->addFieldToSelect('*')
|
|
|
17 |
->addFilter('parent_name', array('eq' => 'CategoryPage'))
|
18 |
-
//->addFieldToFilter('name', array('in' => $limit))
|
19 |
->loadData()
|
20 |
->toOptionArray(false);
|
21 |
return $options;
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
+
$storeId = $this->getStoreId();
|
14 |
+
$apiName = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
15 |
+
|
16 |
$options = $this->getCollection()
|
17 |
->addFieldToSelect('*')
|
18 |
+
->addFieldToFilter('api_name', $apiName)
|
19 |
->addFilter('parent_name', array('eq' => 'CategoryPage'))
|
|
|
20 |
->loadData()
|
21 |
->toOptionArray(false);
|
22 |
return $options;
|
app/code/community/Quarticon/Quartic/Model/Placement/Home.php
CHANGED
@@ -10,12 +10,13 @@ class Quarticon_Quartic_Model_Placement_Home extends Quarticon_Quartic_Model_Pla
|
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
15 |
$options = $this->getCollection()
|
16 |
->addFieldToSelect('*')
|
|
|
17 |
->addFilter('parent_name', array('eq' => 'HomePage'))
|
18 |
-
//->addFieldToFilter('name', array('in' => $limit))
|
19 |
->loadData()
|
20 |
->toOptionArray(false);
|
21 |
return $options;
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
+
$storeId = $this->getStoreId();
|
14 |
+
$apiName = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
15 |
+
|
16 |
$options = $this->getCollection()
|
17 |
->addFieldToSelect('*')
|
18 |
+
->addFieldToFilter('api_name', $apiName)
|
19 |
->addFilter('parent_name', array('eq' => 'HomePage'))
|
|
|
20 |
->loadData()
|
21 |
->toOptionArray(false);
|
22 |
return $options;
|
app/code/community/Quarticon/Quartic/Model/Placement/Product.php
CHANGED
@@ -10,12 +10,13 @@ class Quarticon_Quartic_Model_Placement_Product extends Quarticon_Quartic_Model_
|
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
-
|
14 |
-
|
|
|
15 |
$options = $this->getCollection()
|
16 |
->addFieldToSelect('*')
|
|
|
17 |
->addFilter('parent_name', array('eq' => 'ProductPage'))
|
18 |
-
//->addFieldToFilter('name', array('in' => $limit))
|
19 |
->loadData()
|
20 |
->toOptionArray(false);
|
21 |
return $options;
|
10 |
*/
|
11 |
protected function prepareOptionArray()
|
12 |
{
|
13 |
+
$storeId = $this->getStoreId();
|
14 |
+
$apiName = Mage::getStoreConfig("quartic/config/customer", $storeId);
|
15 |
+
|
16 |
$options = $this->getCollection()
|
17 |
->addFieldToSelect('*')
|
18 |
+
->addFieldToFilter('api_name', $apiName)
|
19 |
->addFilter('parent_name', array('eq' => 'ProductPage'))
|
|
|
20 |
->loadData()
|
21 |
->toOptionArray(false);
|
22 |
return $options;
|
app/code/community/Quarticon/Quartic/Model/Product.php
CHANGED
@@ -5,13 +5,18 @@
|
|
5 |
class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
6 |
{
|
7 |
|
8 |
-
const
|
9 |
|
10 |
protected $default_attribute_set_id = null;
|
11 |
protected $_categories = array();
|
12 |
protected $_imagesUrl = null;
|
13 |
protected $_minQty = false;
|
14 |
protected $_config = null;
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
protected function getConfig()
|
17 |
{
|
@@ -21,18 +26,42 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
21 |
return $this->_config;
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
protected function _getCollection()
|
25 |
{
|
26 |
$_product = Mage::getModel('catalog/product');
|
27 |
-
$
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
$updated = Mage::app()->getRequest()->getParam('updated');
|
31 |
if ($updated) {
|
32 |
$collection->addAttributeToFilter('updated_at', array('gteq' => $updated));
|
33 |
}
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
protected function _addDisableFilters($collection)
|
@@ -40,6 +69,10 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
40 |
if (!$this->getConfig()->showDisabledProducts()) {
|
41 |
$collection->addFieldToFilter('status', array('eq' => 1));
|
42 |
}
|
|
|
|
|
|
|
|
|
43 |
return $collection;
|
44 |
}
|
45 |
|
@@ -48,11 +81,18 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
48 |
*/
|
49 |
protected function _addQtyField($collection)
|
50 |
{
|
|
|
|
|
51 |
if ($this->getConfig()->getMinQty()) {
|
52 |
$collection->joinField(
|
53 |
'qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', null, 'left'
|
54 |
);
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
56 |
return $collection;
|
57 |
}
|
58 |
|
@@ -66,29 +106,33 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
66 |
|
67 |
protected function _getFinalCollection($page_num = 1, $page_size = 10, $product_id = false)
|
68 |
{
|
|
|
69 |
|
70 |
$additional_attributes = $this->getMapping();
|
71 |
|
72 |
$collection = $this->_getCollection()
|
73 |
->setPage($page_num, $page_size)
|
74 |
-
->addAttributeToSelect('price')
|
75 |
-
->addAttributeToSelect('special_price')
|
76 |
-
->addAttributeToSelect('name')
|
77 |
-
->addAttributeToSelect('category_ids')
|
78 |
-
->addAttributeToSelect('visibility')
|
79 |
-
->addAttributeToSelect('status')
|
80 |
-
->addAttributeToSelect('
|
|
|
81 |
foreach ($additional_attributes as $code => $option) {
|
|
|
82 |
$collection->addAttributeToSelect($option);
|
83 |
}
|
84 |
if ($product_id) {
|
85 |
$collection->addFieldToFilter('entity_id', $product_id);
|
86 |
}
|
87 |
if ($this->getConfig()->addThumbs()) {
|
88 |
-
$collection->addAttributeToSelect('image');
|
89 |
}
|
90 |
$collection = $this->_addAdditionalAttributes($collection);
|
91 |
-
$collection = $this->
|
|
|
92 |
return $collection;
|
93 |
}
|
94 |
|
@@ -97,19 +141,67 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
97 |
$additional_attributes = $this->getMapping();
|
98 |
$collection = $this->_getFinalCollection($page_num, $page_size, false);
|
99 |
$offers = array();
|
100 |
-
$media = $this->getConfig()->addThumbs() ? $this->getMediaData($collection) : array();
|
101 |
-
if (!empty($media)) {
|
102 |
-
$this->_imagesUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product';
|
103 |
-
}
|
104 |
$product_items = $collection->getItems();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
foreach ($product_items as $id => $product) {
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
$collection->clear();
|
115 |
unset($collection);
|
@@ -126,7 +218,8 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
126 |
}
|
127 |
return false;
|
128 |
}
|
129 |
-
|
|
|
130 |
* Method that prepares one product to be appended to $offers table
|
131 |
*
|
132 |
* $product - product to be processed
|
@@ -134,9 +227,10 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
134 |
* $additional_attributes - definitions of additional product attributes
|
135 |
* $rewrite_url - URL that rewrites standard product URL. If null then no rewrite is executed
|
136 |
*/
|
137 |
-
|
138 |
-
protected function handleProductToGetOffer($product, $images, $additional_attributes = array())
|
139 |
{
|
|
|
|
|
140 |
$category_ids = array_slice($product->getCategoryIds(), 0, 6);
|
141 |
$map = $this->getMapping();
|
142 |
|
@@ -172,13 +266,12 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
172 |
}
|
173 |
if ($this->getConfig()->addThumbs()) {
|
174 |
try {
|
175 |
-
$offer['thumb'] = $product->
|
176 |
} catch (Exception $e) {
|
177 |
|
178 |
}
|
179 |
}
|
180 |
|
181 |
-
unset($images);
|
182 |
if (!empty($author_mapping)) {
|
183 |
$value = $product->getData($author_mapping);
|
184 |
if (!empty($value)) {
|
@@ -191,82 +284,132 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
191 |
}
|
192 |
unset($value);
|
193 |
}
|
194 |
-
|
|
|
|
|
195 |
unset($product);
|
196 |
return $offer;
|
197 |
}
|
198 |
-
|
|
|
199 |
* get attributes map for product feed via handleProductToGetOffer method
|
200 |
*
|
201 |
* @return Array
|
202 |
*
|
203 |
*/
|
204 |
-
|
205 |
public function getMapping()
|
206 |
{
|
207 |
-
$mapping
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
|
|
|
|
|
|
214 |
}
|
215 |
-
return $mapping;
|
216 |
}
|
217 |
|
218 |
-
|
219 |
-
* Gets media gallery for products;
|
220 |
-
*
|
221 |
-
* $param array|collection $_productCollection
|
222 |
-
* @return array
|
223 |
-
*/
|
224 |
-
public function getMediaData($_productCollection)
|
225 |
{
|
226 |
-
if
|
227 |
-
$
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
|
|
259 |
}
|
260 |
-
|
|
|
|
|
261 |
}
|
262 |
-
unset($_mediaGalleryData);
|
263 |
-
}
|
264 |
-
return $_mediaGalleryByProductId;
|
265 |
-
}
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
271 |
|
272 |
public function getPriceIncludingTax($product)
|
@@ -304,7 +447,11 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
304 |
*/
|
305 |
protected function _getStatus($product)
|
306 |
{
|
307 |
-
|
|
|
|
|
|
|
|
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -322,8 +469,24 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
322 |
return 0;
|
323 |
}
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
protected function getCategories($categoryIds)
|
326 |
{
|
|
|
327 |
$categories = array();
|
328 |
$categoryIdsToAdd = array();
|
329 |
foreach ($categoryIds as $categoryId) {
|
@@ -336,7 +499,7 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
336 |
if (!empty($categoryIdsToAdd)) {
|
337 |
$collection = Mage::getModel('catalog/category')
|
338 |
->getCollection()
|
339 |
-
->addAttributeToSelect('name')
|
340 |
->addAttributeToFilter('entity_id', $categoryIdsToAdd)
|
341 |
->setPage(0, count($categoryIdsToAdd));
|
342 |
foreach ($collection as $category) {
|
@@ -346,4 +509,51 @@ class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
|
346 |
}
|
347 |
return $categories;
|
348 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
}
|
5 |
class Quarticon_Quartic_Model_Product extends Mage_Core_Model_Abstract
|
6 |
{
|
7 |
|
8 |
+
const ITERATION_STEP_DEFAULT = 250;
|
9 |
|
10 |
protected $default_attribute_set_id = null;
|
11 |
protected $_categories = array();
|
12 |
protected $_imagesUrl = null;
|
13 |
protected $_minQty = false;
|
14 |
protected $_config = null;
|
15 |
+
protected $_collectedConfigurablePrices = array();
|
16 |
+
protected $_collectedGroupedPrices = array();
|
17 |
+
protected $joinType = 'inner';
|
18 |
+
protected $iterationStep = null;
|
19 |
+
protected $mapping = null;
|
20 |
|
21 |
protected function getConfig()
|
22 |
{
|
26 |
return $this->_config;
|
27 |
}
|
28 |
|
29 |
+
/**
|
30 |
+
* Number of products per feed query
|
31 |
+
* @param integer $store_id
|
32 |
+
*/
|
33 |
+
public function getIterationStep($store_id = null)
|
34 |
+
{
|
35 |
+
if (is_null($this->iterationStep)) {
|
36 |
+
$this->iterationStep = (int) Mage::getStoreConfig('quartic/config/feed/product/iteration_step', $store_id);
|
37 |
+
}
|
38 |
+
if (empty($this->iterationStep)) {
|
39 |
+
$this->iterationStep = self::ITERATION_STEP_DEFAULT;
|
40 |
+
}
|
41 |
+
return $this->iterationStep;
|
42 |
+
}
|
43 |
+
|
44 |
protected function _getCollection()
|
45 |
{
|
46 |
$_product = Mage::getModel('catalog/product');
|
47 |
+
$storeId = $this->_getStoreId();
|
48 |
+
|
49 |
+
$collection = $_product
|
50 |
+
->setStoreId($storeId)
|
51 |
+
->getCollection()
|
52 |
+
->addStoreFilter($storeId)
|
53 |
+
;
|
54 |
$updated = Mage::app()->getRequest()->getParam('updated');
|
55 |
if ($updated) {
|
56 |
$collection->addAttributeToFilter('updated_at', array('gteq' => $updated));
|
57 |
}
|
58 |
+
$productIds = Mage::app()->getRequest()->getParam('product');
|
59 |
+
if ($productIds) {
|
60 |
+
$collection->addAttributeToFilter('entity_id', explode(',',$productIds));
|
61 |
+
}
|
62 |
+
$collection = $this->_addQtyField($collection);
|
63 |
+
$collection = $this->_addDisableFilters($collection);
|
64 |
+
return $collection;
|
65 |
}
|
66 |
|
67 |
protected function _addDisableFilters($collection)
|
69 |
if (!$this->getConfig()->showDisabledProducts()) {
|
70 |
$collection->addFieldToFilter('status', array('eq' => 1));
|
71 |
}
|
72 |
+
|
73 |
+
// $allowVisibility = $this->getConfig()->getVisibility();
|
74 |
+
// $collection->addAttributeToFilter('visibility',array('in' => $allowVisibility));
|
75 |
+
|
76 |
return $collection;
|
77 |
}
|
78 |
|
81 |
*/
|
82 |
protected function _addQtyField($collection)
|
83 |
{
|
84 |
+
$storeId = $this->_getStoreId();
|
85 |
+
$websiteId = ($storeId == 0) ? 1 : Mage::app()->getStore($storeId)->getWebsiteId();
|
86 |
if ($this->getConfig()->getMinQty()) {
|
87 |
$collection->joinField(
|
88 |
'qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', null, 'left'
|
89 |
);
|
90 |
}
|
91 |
+
$collection->joinField('stock_status','cataloginventory/stock_status','stock_status',
|
92 |
+
'product_id=entity_id', array(
|
93 |
+
'stock_status' => Mage_CatalogInventory_Model_Stock_Status::STATUS_IN_STOCK,
|
94 |
+
'website_id' => $websiteId
|
95 |
+
));
|
96 |
return $collection;
|
97 |
}
|
98 |
|
106 |
|
107 |
protected function _getFinalCollection($page_num = 1, $page_size = 10, $product_id = false)
|
108 |
{
|
109 |
+
$joinType = $this->joinType;
|
110 |
|
111 |
$additional_attributes = $this->getMapping();
|
112 |
|
113 |
$collection = $this->_getCollection()
|
114 |
->setPage($page_num, $page_size)
|
115 |
+
->addAttributeToSelect('price', $joinType)
|
116 |
+
->addAttributeToSelect('special_price', $joinType)
|
117 |
+
->addAttributeToSelect('name', $joinType)
|
118 |
+
->addAttributeToSelect('category_ids', $joinType)
|
119 |
+
->addAttributeToSelect('visibility', $joinType)
|
120 |
+
->addAttributeToSelect('status', $joinType)
|
121 |
+
->addAttributeToSelect('url_path', $joinType)
|
122 |
+
->addAttributeToSelect('sku', $joinType);
|
123 |
foreach ($additional_attributes as $code => $option) {
|
124 |
+
//Join type does not work here
|
125 |
$collection->addAttributeToSelect($option);
|
126 |
}
|
127 |
if ($product_id) {
|
128 |
$collection->addFieldToFilter('entity_id', $product_id);
|
129 |
}
|
130 |
if ($this->getConfig()->addThumbs()) {
|
131 |
+
$collection->addAttributeToSelect('image', $joinType);
|
132 |
}
|
133 |
$collection = $this->_addAdditionalAttributes($collection);
|
134 |
+
$collection = $this->addImageAttributeToCollection($collection);
|
135 |
+
|
136 |
return $collection;
|
137 |
}
|
138 |
|
141 |
$additional_attributes = $this->getMapping();
|
142 |
$collection = $this->_getFinalCollection($page_num, $page_size, false);
|
143 |
$offers = array();
|
|
|
|
|
|
|
|
|
144 |
$product_items = $collection->getItems();
|
145 |
+
|
146 |
+
$showConfigurableChilds = $this->getConfig()->getShowConfigurableChilds();
|
147 |
+
$configurableChildPrice = $this->getConfig()->getConfigurableChildPrice();
|
148 |
+
$configurableChildImage = $this->getConfig()->getConfigurableChildImage();
|
149 |
+
$configurableChildRedirect = $this->getConfig()->getConfigurableChildRedirect();
|
150 |
+
$map = $this->getMapping();
|
151 |
+
$groupedChildPrice = $this->getConfig()->getGroupedChildPrice();
|
152 |
+
$groupedChildImage = $this->getConfig()->getGroupedChildImage();
|
153 |
+
$groupedChildRedirect = $this->getConfig()->getGroupedChildRedirect();
|
154 |
foreach ($product_items as $id => $product) {
|
155 |
+
if($product->getTypeId() == 'simple') {
|
156 |
+
$configurable_id = $this->getConfigurableIdByChildId($product->getId());
|
157 |
+
if ($configurable_id !== 0) {
|
158 |
+
if($showConfigurableChilds == 0) { //$showConfigurableChilds == 0 - do not show child products of configurable
|
159 |
+
continue;
|
160 |
+
} elseif($configurableChildPrice == 1) { //$configurableChildPrice == 1 - get child product price from parent config
|
161 |
+
if(!isset($this->_collectedConfigurablePrices[$configurable_id])) {
|
162 |
+
$configurableProduct = Mage::getModel('catalog/product')->load($configurable_id);
|
163 |
+
$this->_collectedConfigurablePrices[$configurable_id] = $this->getFinalPriceIncludingTax($configurableProduct,true);
|
164 |
+
}
|
165 |
+
// temporary force price for simple product that should show price from it's parent configurable
|
166 |
+
$product->setFinalPrice($this->_collectedConfigurablePrices[$configurable_id]);
|
167 |
+
$product->setSpecialPrice(null);
|
168 |
+
$product->setData($map['old_price'],null);
|
169 |
+
}
|
170 |
+
if($configurableChildImage == 1) {
|
171 |
+
if(!isset($configurableProduct)) $configurableProduct = Mage::getModel('catalog/product')->load($configurable_id);
|
172 |
+
// temporary force image for simple product that should show image from it's parent configurable
|
173 |
+
$product->setData('image',$configurableProduct->getData('image'));
|
174 |
+
}
|
175 |
+
if($configurableChildRedirect == 1) {
|
176 |
+
if(!isset($configurableProduct)) $configurableProduct = Mage::getModel('catalog/product')->load($configurable_id);
|
177 |
+
// temporary force url for simple product that should be redirected to it's parent configurable
|
178 |
+
$product->setData('url',$configurableProduct->getProductUrl());
|
179 |
+
}
|
180 |
+
}
|
181 |
+
$grouped_id = $this->getGroupedIdByChildId($product->getId());
|
182 |
+
if ($grouped_id !== 0) {
|
183 |
+
if($groupedChildPrice == 1) { //$groupedChildPrice == 1 - get child product price from parent config
|
184 |
+
if(!isset($this->_collectedGroupedPrices[$grouped_id])) {
|
185 |
+
$groupedProduct = Mage::getModel('catalog/product')->load($grouped_id);
|
186 |
+
$this->_collectedGroupedPrices[$grouped_id] = $this->getFinalPriceIncludingTax($groupedProduct,true);
|
187 |
+
}
|
188 |
+
// temporary force price for simple product that should show price from it's parent configurable
|
189 |
+
$product->setFinalPrice($this->_collectedGroupedPrices[$grouped_id][$product->getId()]);
|
190 |
+
$product->setSpecialPrice(null);
|
191 |
+
$product->setData($map['old_price'],null);
|
192 |
+
}
|
193 |
+
if($groupedChildImage == 1) {
|
194 |
+
// temporary force image for simple product that should show image from it's parent configurable
|
195 |
+
$product->setData('image',$groupedProduct->getData('image'));
|
196 |
+
}
|
197 |
+
if($groupedChildRedirect == 1) {
|
198 |
+
// temporary force url for simple product that should be redirected to it's parent grouped
|
199 |
+
$product->setData('url',$groupedProduct->getProductUrl());
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
$offer_item = $this->handleProductToGetOffer($product, $additional_attributes);
|
204 |
+
if($offer_item) $offers[] = $offer_item;
|
205 |
}
|
206 |
$collection->clear();
|
207 |
unset($collection);
|
218 |
}
|
219 |
return false;
|
220 |
}
|
221 |
+
|
222 |
+
/**
|
223 |
* Method that prepares one product to be appended to $offers table
|
224 |
*
|
225 |
* $product - product to be processed
|
227 |
* $additional_attributes - definitions of additional product attributes
|
228 |
* $rewrite_url - URL that rewrites standard product URL. If null then no rewrite is executed
|
229 |
*/
|
230 |
+
protected function handleProductToGetOffer($product, $additional_attributes = array())
|
|
|
231 |
{
|
232 |
+
if($product->getData('quarticon_exclude') == 1) return false;
|
233 |
+
|
234 |
$category_ids = array_slice($product->getCategoryIds(), 0, 6);
|
235 |
$map = $this->getMapping();
|
236 |
|
266 |
}
|
267 |
if ($this->getConfig()->addThumbs()) {
|
268 |
try {
|
269 |
+
$offer['thumb'] = Mage::helper('catalog/image')->init($product, 'image',$product->getData('image'))->__toString();
|
270 |
} catch (Exception $e) {
|
271 |
|
272 |
}
|
273 |
}
|
274 |
|
|
|
275 |
if (!empty($author_mapping)) {
|
276 |
$value = $product->getData($author_mapping);
|
277 |
if (!empty($value)) {
|
284 |
}
|
285 |
unset($value);
|
286 |
}
|
287 |
+
if (version_compare(Mage::getVersion(), '1.5.1.0', '>=')) {
|
288 |
+
$product->clearInstance();
|
289 |
+
}
|
290 |
unset($product);
|
291 |
return $offer;
|
292 |
}
|
293 |
+
|
294 |
+
/**
|
295 |
* get attributes map for product feed via handleProductToGetOffer method
|
296 |
*
|
297 |
* @return Array
|
298 |
*
|
299 |
*/
|
|
|
300 |
public function getMapping()
|
301 |
{
|
302 |
+
if (is_null($this->mapping)) {
|
303 |
+
$mapping = array();
|
304 |
+
$collection = Mage::getModel('quartic/maps')->getCollection();
|
305 |
+
foreach ($collection as $element) {
|
306 |
+
$attr = $element->getData('magento_attribute');
|
307 |
+
if (!empty($attr)) {
|
308 |
+
$mapping[$element->getData('quartic_attribute')] = $attr;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
$this->mapping = $mapping;
|
312 |
}
|
313 |
+
return $this->mapping;
|
314 |
}
|
315 |
|
316 |
+
public function getFinalPriceIncludingTax($product,$collect = false)
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
{
|
318 |
+
if($product->getTypeId() == 'configurable') {
|
319 |
+
$configurablePriceType = $this->getConfig()->getConfigurablePrice();
|
320 |
+
if($configurablePriceType > 0) { // get price from configurable product
|
321 |
+
if(!isset($this->_collectedConfigurablePrices[$product->getId()])) { // configurable product prices could be already collected
|
322 |
+
$attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
|
323 |
+
$pricesByAttributeValues = array();
|
324 |
+
$basePrice = $product->getFinalPrice();
|
325 |
+
foreach ($attributes as $attribute){
|
326 |
+
$prices = $attribute->getPrices();
|
327 |
+
foreach ($prices as $price){
|
328 |
+
if ($price['is_percent']){ //if the price is specified in percents
|
329 |
+
$pricesByAttributeValues[$price['value_index']] = (float)$price['pricing_value'] * $basePrice / 100;
|
330 |
+
}
|
331 |
+
else { //if the price is absolute value
|
332 |
+
$pricesByAttributeValues[$price['value_index']] = (float)$price['pricing_value'];
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
$totalPrices = array();
|
338 |
+
$simple = $product->getTypeInstance()->getUsedProducts();
|
339 |
+
//loop through the products
|
340 |
+
foreach ($simple as $sProduct){
|
341 |
+
$optionsPrice = $basePrice;
|
342 |
+
//loop through the configurable attributes
|
343 |
+
foreach ($attributes as $attribute){
|
344 |
+
$value = $sProduct->getData($attribute->getProductAttribute()->getAttributeCode());
|
345 |
+
if (isset($pricesByAttributeValues[$value])){
|
346 |
+
$optionsPrice += $pricesByAttributeValues[$value];
|
347 |
+
}
|
348 |
+
}
|
349 |
+
$totalPrices[$sProduct->getId()] = $optionsPrice;
|
350 |
+
}
|
351 |
+
} else {
|
352 |
+
$totalPrices = $this->_collectedConfigurablePrices[$product->getId()];
|
353 |
}
|
354 |
+
|
355 |
+
$minPrice = Mage::helper('tax')->getPrice($product, min($totalPrices), 2);
|
356 |
+
$maxPrice = Mage::helper('tax')->getPrice($product, max($totalPrices), 2);
|
357 |
}
|
|
|
|
|
|
|
|
|
358 |
|
359 |
+
if(!$collect) {
|
360 |
+
switch($configurablePriceType) {
|
361 |
+
case 0:
|
362 |
+
return Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 2);
|
363 |
+
break;
|
364 |
+
case 1:
|
365 |
+
return $minPrice;
|
366 |
+
break;
|
367 |
+
case 2:
|
368 |
+
return $maxPrice;
|
369 |
+
break;
|
370 |
+
case 3:
|
371 |
+
if($maxPrice - $minPrice) {
|
372 |
+
return Mage::helper('tax')->getPrice($product, $minPrice, 2) . ' - ' . Mage::helper('tax')->getPrice($product, $maxPrice, 2);
|
373 |
+
} else {
|
374 |
+
return $maxPrice;
|
375 |
+
}
|
376 |
+
break;
|
377 |
+
}
|
378 |
+
} else { //just collect all prices and return it as associative array
|
379 |
+
$result = $totalPrices;
|
380 |
+
$result['minPrice'] = $minPrice;
|
381 |
+
$result['maxPrice'] = $maxPrice;
|
382 |
+
return $result;
|
383 |
+
}
|
384 |
+
} elseif($product->getTypeId() == 'grouped') {
|
385 |
+
$groupedPriceType = $this->getConfig()->getGroupedChildPrice();
|
386 |
+
$totalPrices = array();
|
387 |
+
$simple = $product->getTypeInstance(true)->getAssociatedProducts($product);
|
388 |
+
foreach ($simple as $sProduct){
|
389 |
+
$totalPrices[$sProduct->getId()] = $sProduct->getFinalPrice();
|
390 |
+
}
|
391 |
+
|
392 |
+
$minPrice = Mage::helper('tax')->getPrice($product, min($totalPrices), 2);
|
393 |
+
$maxPrice = Mage::helper('tax')->getPrice($product, max($totalPrices), 2);
|
394 |
+
|
395 |
+
if(!$collect) {
|
396 |
+
switch($groupedPriceType) {
|
397 |
+
case 0:
|
398 |
+
return $minPrice;
|
399 |
+
break;
|
400 |
+
case 1:
|
401 |
+
return $maxPrice;
|
402 |
+
break;
|
403 |
+
}
|
404 |
+
} else { //just collect all prices and return it as associative array
|
405 |
+
$result = $totalPrices;
|
406 |
+
$result['minPrice'] = $minPrice;
|
407 |
+
$result['maxPrice'] = $maxPrice;
|
408 |
+
return $result;
|
409 |
+
}
|
410 |
+
} else {
|
411 |
+
return Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), 2);
|
412 |
+
}
|
413 |
}
|
414 |
|
415 |
public function getPriceIncludingTax($product)
|
447 |
*/
|
448 |
protected function _getStatus($product)
|
449 |
{
|
450 |
+
if($product->getTypeId() == 'configurable' || $product->getTypeId() == 'grouped') {
|
451 |
+
return $product->isVisibleInSiteVisibility() && $product->isVisibleInCatalog();
|
452 |
+
} else {
|
453 |
+
return $product->isVisibleInSiteVisibility() && $product->isVisibleInCatalog() && ($this->_getMinQty() ? $product->getQty() >= $this->_getMinQty() : true);
|
454 |
+
}
|
455 |
}
|
456 |
|
457 |
/**
|
469 |
return 0;
|
470 |
}
|
471 |
|
472 |
+
/**
|
473 |
+
* Gets id of a grouped product for specified child product
|
474 |
+
*
|
475 |
+
* @param int $childId
|
476 |
+
* @return int
|
477 |
+
*/
|
478 |
+
public function getGroupedIdByChildId($childId)
|
479 |
+
{
|
480 |
+
$ids = Mage::getSingleton('catalog/product_type_grouped')->getParentIdsByChild($childId);
|
481 |
+
if (!empty($ids)) {
|
482 |
+
return (int) array_shift($ids);
|
483 |
+
}
|
484 |
+
return 0;
|
485 |
+
}
|
486 |
+
|
487 |
protected function getCategories($categoryIds)
|
488 |
{
|
489 |
+
$joinType = $this->joinType;
|
490 |
$categories = array();
|
491 |
$categoryIdsToAdd = array();
|
492 |
foreach ($categoryIds as $categoryId) {
|
499 |
if (!empty($categoryIdsToAdd)) {
|
500 |
$collection = Mage::getModel('catalog/category')
|
501 |
->getCollection()
|
502 |
+
->addAttributeToSelect('name', $joinType)
|
503 |
->addAttributeToFilter('entity_id', $categoryIdsToAdd)
|
504 |
->setPage(0, count($categoryIdsToAdd));
|
505 |
foreach ($collection as $category) {
|
509 |
}
|
510 |
return $categories;
|
511 |
}
|
512 |
+
|
513 |
+
|
514 |
+
public function addImageAttributeToCollection($_productCollection) {
|
515 |
+
$_mediaGalleryAttributeId = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'image')->getAttributeId();
|
516 |
+
$core_resource = Mage::getSingleton('core/resource');
|
517 |
+
$_read = $core_resource->getConnection('core_read');
|
518 |
+
|
519 |
+
$count = count($_productCollection->getItems());
|
520 |
+
if(!$count) {
|
521 |
+
return $_productCollection;
|
522 |
+
}
|
523 |
+
|
524 |
+
$all_ids = array();
|
525 |
+
foreach($_productCollection->getItems() as $item) {
|
526 |
+
$all_ids[] = $item->getId();
|
527 |
+
}
|
528 |
+
|
529 |
+
$query = 'SELECT `entity_id`,`value` FROM `' . $core_resource->getTableName('catalog_product_entity_varchar') . '` WHERE `attribute_id` = ' . $_read->quote($_mediaGalleryAttributeId) . ' AND `entity_id` IN (' . $_read->quote($all_ids) . ');';
|
530 |
+
$_imagesData = $_read->fetchAll($query);
|
531 |
+
|
532 |
+
$images = array();
|
533 |
+
foreach($_imagesData as $_imageData) {
|
534 |
+
$images[$_imageData['entity_id']] = $_imageData['value'];
|
535 |
+
}
|
536 |
+
|
537 |
+
foreach ($_productCollection->getItems() as $_product) {
|
538 |
+
$_productId = $_product->getData('entity_id');
|
539 |
+
if (!empty($images[$_productId])) {
|
540 |
+
$_product->setData('image', $images[$_productId]);
|
541 |
+
}
|
542 |
+
}
|
543 |
+
unset($_imagesData);
|
544 |
+
|
545 |
+
return $_productCollection;
|
546 |
+
}
|
547 |
+
|
548 |
+
private function _getStoreId()
|
549 |
+
{
|
550 |
+
$params = Mage::app()->getRequest()->getParams();
|
551 |
+
if(isset($params['store'])) {
|
552 |
+
$storeId = (is_numeric($params['store'])) ? (int)$params['store'] : Mage::getModel('core/store')->load($params['store'], 'code')->getId();
|
553 |
+
} else {
|
554 |
+
$storeId = Mage::app()->getStore()->getId();
|
555 |
+
}
|
556 |
+
|
557 |
+
return $storeId;
|
558 |
+
}
|
559 |
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechildimage.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Configurablechildimage
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Get from simple product'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Get from parent product'));
|
14 |
+
}
|
15 |
+
return $this->_options;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechildprice.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Configurablechildprice
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Get from simple product'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Get from parent product'));
|
14 |
+
}
|
15 |
+
return $this->_options;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurablechilds.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Configurablechilds
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Do not show'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Show if possible'));
|
14 |
+
}
|
15 |
+
return $this->_options;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Configurableprice.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Configurableprice
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Standard configurable product price'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Minimum price'));
|
14 |
+
$this->_options[] = array('value' => 2, 'label' => Mage::helper('quartic')->__('Maximum price'));
|
15 |
+
// $this->_options[] = array('value' => 3, 'label' => Mage::helper('quartic')->__('Price range'));
|
16 |
+
}
|
17 |
+
return $this->_options;
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Groupedchildimage.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Groupedchildimage
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Get from simple product'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Get from parent product'));
|
14 |
+
}
|
15 |
+
return $this->_options;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Groupedprice.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Groupedprice
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$this->_options[] = array('value' => 0, 'label' => Mage::helper('quartic')->__('Minimum from simple products'));
|
13 |
+
$this->_options[] = array('value' => 1, 'label' => Mage::helper('quartic')->__('Maximum from simple products'));
|
14 |
+
}
|
15 |
+
return $this->_options;
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Quarticon/Quartic/Model/System/Config/Source/Visibility.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
class Quarticon_Quartic_Model_System_Config_Source_Visibility
|
6 |
+
{
|
7 |
+
protected $_options;
|
8 |
+
|
9 |
+
public function toOptionArray()
|
10 |
+
{
|
11 |
+
if (!$this->_options) {
|
12 |
+
$options = Mage::getModel('catalog/product_visibility')->getOptionArray();
|
13 |
+
foreach($options as $value => $option) {
|
14 |
+
$this->_options[] = array('value' => $value, 'label' => $option);
|
15 |
+
}
|
16 |
+
}
|
17 |
+
return $this->_options;
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Quarticon/Quartic/controllers/Adminhtml/ApiController.php
CHANGED
@@ -9,21 +9,33 @@ class Quarticon_Quartic_Adminhtml_ApiController extends Mage_Adminhtml_Controlle
|
|
9 |
}
|
10 |
|
11 |
public function placementsAction()
|
12 |
-
{
|
|
|
|
|
13 |
/* @var $session Mage_Adminhtml_Model_Session */
|
14 |
$session = Mage::getSingleton('adminhtml/session');
|
15 |
|
16 |
try {
|
17 |
/* @var $frames Quarticon_Quartic_Model_Placement */
|
18 |
$frames = Mage::getModel('quartic/placement');
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
} catch (Exception $e) {
|
22 |
foreach (explode("\n", $e->getMessage()) as $message) {
|
23 |
-
$session->addError($message);
|
24 |
}
|
25 |
}
|
26 |
-
return $this->
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -38,6 +50,10 @@ class Quarticon_Quartic_Adminhtml_ApiController extends Mage_Adminhtml_Controlle
|
|
38 |
|
39 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
40 |
$api = Mage::getModel('quartic/client_api');
|
|
|
|
|
|
|
|
|
41 |
|
42 |
try {
|
43 |
$_order = Mage::getModel('quartic/order');
|
@@ -75,9 +91,9 @@ class Quarticon_Quartic_Adminhtml_ApiController extends Mage_Adminhtml_Controlle
|
|
75 |
$writer->endElement();
|
76 |
$writer->endDocument();
|
77 |
|
78 |
-
$hash = Mage::getStoreConfig("quartic/config/hash",
|
79 |
$data = array(
|
80 |
-
'url' => Mage::getUrl('quartic/feed/orders', array('hash' => $hash)),
|
81 |
);
|
82 |
$helper->log('POST transactions');
|
83 |
$helper->log(var_export(array('data' => $data), true));
|
@@ -88,6 +104,20 @@ class Quarticon_Quartic_Adminhtml_ApiController extends Mage_Adminhtml_Controlle
|
|
88 |
} catch (Exception $e) {
|
89 |
$session->addError($e->getMessage());
|
90 |
}
|
91 |
-
return $this->_redirect('adminhtml/system_config/edit/section/quartic');
|
92 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
9 |
}
|
10 |
|
11 |
public function placementsAction()
|
12 |
+
{
|
13 |
+
$stores = Mage::app()->getStores();
|
14 |
+
|
15 |
/* @var $session Mage_Adminhtml_Model_Session */
|
16 |
$session = Mage::getSingleton('adminhtml/session');
|
17 |
|
18 |
try {
|
19 |
/* @var $frames Quarticon_Quartic_Model_Placement */
|
20 |
$frames = Mage::getModel('quartic/placement');
|
21 |
+
|
22 |
+
$deleteResult = $frames->deleteAll();
|
23 |
+
if($deleteResult) {
|
24 |
+
$loaded = $frames->apiLoad(0); // for default config value
|
25 |
+
foreach($stores as $store) {
|
26 |
+
$loaded = $frames->apiLoad($store->getId());
|
27 |
+
}
|
28 |
+
|
29 |
+
$session->addSuccess(Mage::helper('quartic')->__('The placements have been synchronised.'));
|
30 |
+
} else {
|
31 |
+
$session->addError($message);
|
32 |
+
}
|
33 |
} catch (Exception $e) {
|
34 |
foreach (explode("\n", $e->getMessage()) as $message) {
|
35 |
+
$session->addError($deleteResult['message']);
|
36 |
}
|
37 |
}
|
38 |
+
return $this->_redirectReferer();
|
39 |
}
|
40 |
|
41 |
/**
|
50 |
|
51 |
/* @var $api Quarticon_Quartic_Model_Client_Api */
|
52 |
$api = Mage::getModel('quartic/client_api');
|
53 |
+
|
54 |
+
$storeCode = $this->getRequest()->getParam('store');
|
55 |
+
$websiteCode = $this->getRequest()->getParam('website');
|
56 |
+
$storeId = $this->_getStoreId();
|
57 |
|
58 |
try {
|
59 |
$_order = Mage::getModel('quartic/order');
|
91 |
$writer->endElement();
|
92 |
$writer->endDocument();
|
93 |
|
94 |
+
$hash = Mage::getStoreConfig("quartic/config/hash", $storeId);
|
95 |
$data = array(
|
96 |
+
'url' => Mage::getUrl('quartic/feed/orders', array('hash' => $hash, 'store' => $storeId)),
|
97 |
);
|
98 |
$helper->log('POST transactions');
|
99 |
$helper->log(var_export(array('data' => $data), true));
|
104 |
} catch (Exception $e) {
|
105 |
$session->addError($e->getMessage());
|
106 |
}
|
107 |
+
return $this->_redirect('adminhtml/system_config/edit/section/quartic',array('store'=>$storeCode,'website'=>$websiteCode));
|
108 |
}
|
109 |
+
|
110 |
+
private function _getStoreId()
|
111 |
+
{
|
112 |
+
$params = Mage::app()->getRequest()->getParams();
|
113 |
+
if(isset($params['store'])) {
|
114 |
+
$storeId = (is_numeric($params['store'])) ? (int)$params['store'] : Mage::getModel('core/store')->load($params['store'], 'code')->getId();
|
115 |
+
} else {
|
116 |
+
$storeId = Mage::app()->getStore()->getId();
|
117 |
+
}
|
118 |
+
|
119 |
+
if($storeId == 0) return Mage::app()->getDefaultStoreView()->getStoreId();
|
120 |
+
|
121 |
+
return $storeId;
|
122 |
+
}
|
123 |
}
|
app/code/community/Quarticon/Quartic/controllers/Adminhtml/IndexController.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/controllers/Adminhtml/MapsController.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/controllers/FeedController.php
CHANGED
@@ -3,6 +3,17 @@
|
|
3 |
class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
4 |
{
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
protected function getConfig()
|
7 |
{
|
8 |
return Mage::getModel('quartic/config');
|
@@ -23,27 +34,40 @@ class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
|
23 |
*/
|
24 |
public function cacheproductsAction($refresh = false)
|
25 |
{
|
|
|
|
|
|
|
26 |
$cache = Mage::app()->getCacheInstance();
|
27 |
if ($refresh) {
|
28 |
-
$cache->cleanType('quartic-products');
|
29 |
}
|
30 |
-
$temp = $cache->load('quartic-products');
|
31 |
$time = microtime(true);
|
|
|
32 |
if ($temp !== false) {
|
33 |
$cache = unserialize($temp);
|
34 |
} else {
|
35 |
$data = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
$_product = Mage::getModel('quartic/product');
|
37 |
$count = $_product->getCollectionCount();
|
38 |
-
$steps = ceil($count /
|
|
|
39 |
for ($step = 1; $step <= $steps; $step++) {
|
40 |
-
$
|
|
|
41 |
}
|
42 |
$data['steps'] = $steps;
|
43 |
$data['products'] = $products;
|
44 |
$data['time'] = $time;
|
45 |
-
$cache->save(serialize($data), 'quartic-products', array(), 3600);
|
46 |
$cache = $data;
|
|
|
47 |
}
|
48 |
|
49 |
return $cache;
|
@@ -59,6 +83,21 @@ class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
|
59 |
require_once('Zend/Log.php');
|
60 |
|
61 |
header("Content-Type:text/xml");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
$writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
63 |
$writer->openUri('php://output');
|
64 |
$writer->startDocument('1.0', 'UTF-8');
|
@@ -148,6 +187,7 @@ class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
|
148 |
require_once('Zend/Log.php');
|
149 |
|
150 |
if ($this->_startXML()) {
|
|
|
151 |
header("Content-Type:text/xml");
|
152 |
$writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
153 |
$writer->openUri('php://output');
|
@@ -163,10 +203,10 @@ class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
|
163 |
http://cp.quarticon.com/docs/transactions/1.1/schema/quartic_transactions_1.1
|
164 |
.xsd");
|
165 |
$_order = Mage::getModel('quartic/order');
|
166 |
-
$count = $_order->getCollectionCount();
|
167 |
$steps = ceil($count / Quarticon_Quartic_Model_Order::ITERATION_STEP);
|
168 |
for ($step = 1; $step <= $steps; $step++) {
|
169 |
-
$collection = $_order->getAll($step, Quarticon_Quartic_Model_Order::ITERATION_STEP);
|
170 |
foreach ($collection as $o) {
|
171 |
$mem_writer->startElement('order');
|
172 |
$mem_writer->writeElement('transaction', $o['id']);
|
@@ -203,4 +243,18 @@ http://cp.quarticon.com/docs/transactions/1.1/schema/quartic_transactions_1.1
|
|
203 |
$model->setData($data);
|
204 |
$model->save();
|
205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
3 |
class Quarticon_Quartic_FeedController extends Mage_Core_Controller_Front_Action
|
4 |
{
|
5 |
|
6 |
+
const FEED_PROD_LOG = 'qon_prodfeed.log';
|
7 |
+
|
8 |
+
protected $logFeed = true;
|
9 |
+
|
10 |
+
protected function _log($message)
|
11 |
+
{
|
12 |
+
if ($this->logFeed) {
|
13 |
+
Mage::log($message, null, self::FEED_PROD_LOG);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
protected function getConfig()
|
18 |
{
|
19 |
return Mage::getModel('quartic/config');
|
34 |
*/
|
35 |
public function cacheproductsAction($refresh = false)
|
36 |
{
|
37 |
+
$storeId = $this->_getStoreId();
|
38 |
+
$currentStoreId = Mage::app()->getStore()->getId();
|
39 |
+
|
40 |
$cache = Mage::app()->getCacheInstance();
|
41 |
if ($refresh) {
|
42 |
+
$cache->cleanType('quartic-products-' . $storeId);
|
43 |
}
|
44 |
+
$temp = $cache->load('quartic-products-' . $storeId);
|
45 |
$time = microtime(true);
|
46 |
+
$products = array();
|
47 |
if ($temp !== false) {
|
48 |
$cache = unserialize($temp);
|
49 |
} else {
|
50 |
$data = array();
|
51 |
+
// for proper products data in collection set current store by param
|
52 |
+
// except for param storeId = 0 which mean it's admin area
|
53 |
+
if($currentStoreId != $storeId && $storeId != 0) Mage::app()->setCurrentStore($storeId);
|
54 |
+
/**
|
55 |
+
* @var Quarticon_Quartic_Model_Product $_product
|
56 |
+
*/
|
57 |
$_product = Mage::getModel('quartic/product');
|
58 |
$count = $_product->getCollectionCount();
|
59 |
+
$steps = ceil($count / $_product->getIterationStep($storeId));
|
60 |
+
$this->_log("Feed start: {$count} products in {$steps} slices");
|
61 |
for ($step = 1; $step <= $steps; $step++) {
|
62 |
+
$this->_log("Feed slice: {$step} of {$steps}");
|
63 |
+
$products[$step] = $_product->getAll($step, $_product->getIterationStep($storeId));
|
64 |
}
|
65 |
$data['steps'] = $steps;
|
66 |
$data['products'] = $products;
|
67 |
$data['time'] = $time;
|
68 |
+
$cache->save(serialize($data), 'quartic-products-' . $storeId, array(), 3600);
|
69 |
$cache = $data;
|
70 |
+
if($currentStoreId != $storeId && $storeId != 0) Mage::app()->setCurrentStore($currentStoreId);
|
71 |
}
|
72 |
|
73 |
return $cache;
|
83 |
require_once('Zend/Log.php');
|
84 |
|
85 |
header("Content-Type:text/xml");
|
86 |
+
|
87 |
+
if($this->getConfig()->getUseFileCache()) {
|
88 |
+
$storeId = $this->_getStoreId();
|
89 |
+
$filename = 'xmlOutput_' . $storeId . '.xml';
|
90 |
+
$filepath = Mage::getBaseDir('var') . "/quartic/" . $filename;
|
91 |
+
|
92 |
+
if(file_exists($filepath) && (time() - filemtime($filepath) < 24 * 3600)) { // not older than 24h
|
93 |
+
$contents = file_get_contents($filepath);
|
94 |
+
header("Feed-From:cachefile");
|
95 |
+
echo $contents;
|
96 |
+
die();
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
$writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
102 |
$writer->openUri('php://output');
|
103 |
$writer->startDocument('1.0', 'UTF-8');
|
187 |
require_once('Zend/Log.php');
|
188 |
|
189 |
if ($this->_startXML()) {
|
190 |
+
$storeId = $this->_getStoreId();
|
191 |
header("Content-Type:text/xml");
|
192 |
$writer = new Quarticon_Quartic_Model_Adapter_Writer();
|
193 |
$writer->openUri('php://output');
|
203 |
http://cp.quarticon.com/docs/transactions/1.1/schema/quartic_transactions_1.1
|
204 |
.xsd");
|
205 |
$_order = Mage::getModel('quartic/order');
|
206 |
+
$count = $_order->getCollectionCount($storeId);
|
207 |
$steps = ceil($count / Quarticon_Quartic_Model_Order::ITERATION_STEP);
|
208 |
for ($step = 1; $step <= $steps; $step++) {
|
209 |
+
$collection = $_order->getAll($step, Quarticon_Quartic_Model_Order::ITERATION_STEP, $storeId);
|
210 |
foreach ($collection as $o) {
|
211 |
$mem_writer->startElement('order');
|
212 |
$mem_writer->writeElement('transaction', $o['id']);
|
243 |
$model->setData($data);
|
244 |
$model->save();
|
245 |
}
|
246 |
+
|
247 |
+
private function _getStoreId()
|
248 |
+
{
|
249 |
+
$params = Mage::app()->getRequest()->getParams();
|
250 |
+
if(isset($params['store'])) {
|
251 |
+
$storeId = (is_numeric($params['store'])) ? (int)$params['store'] : Mage::getModel('core/store')->load($params['store'], 'code')->getId();
|
252 |
+
} else {
|
253 |
+
$storeId = Mage::app()->getStore()->getId();
|
254 |
+
}
|
255 |
+
|
256 |
+
if($storeId == 0) return Mage::app()->getDefaultStoreView()->getStoreId();
|
257 |
+
|
258 |
+
return $storeId;
|
259 |
+
}
|
260 |
}
|
app/code/community/Quarticon/Quartic/controllers/FrameController.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/etc/adminhtml.xml
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Quarticon_Quartic>
|
5 |
-
<version>1.
|
6 |
</Quarticon_Quartic>
|
7 |
</modules>
|
8 |
<global>
|
@@ -93,6 +93,15 @@
|
|
93 |
</quartic>
|
94 |
</observers>
|
95 |
</core_block_abstract_to_html_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
</events>
|
97 |
</frontend>
|
98 |
<default>
|
@@ -105,7 +114,22 @@
|
|
105 |
<show_disabled_products>1</show_disabled_products>
|
106 |
<category_use_product_frame>0</category_use_product_frame>
|
107 |
<min_qty>0</min_qty>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
</quartic>
|
110 |
</default>
|
111 |
<adminhtml>
|
@@ -159,6 +183,18 @@
|
|
159 |
</updates>
|
160 |
</layout>
|
161 |
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
<admin>
|
163 |
<routers>
|
164 |
<quartic>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Quarticon_Quartic>
|
5 |
+
<version>1.2.3.2</version>
|
6 |
</Quarticon_Quartic>
|
7 |
</modules>
|
8 |
<global>
|
93 |
</quartic>
|
94 |
</observers>
|
95 |
</core_block_abstract_to_html_after>
|
96 |
+
<controller_front_send_response_before>
|
97 |
+
<observers>
|
98 |
+
<quartic_controller_front_send_response_before>
|
99 |
+
<type>singleton</type>
|
100 |
+
<class>quartic/observer_frontend</class>
|
101 |
+
<method>controllerFrontSendResponseBefore</method>
|
102 |
+
</quartic_controller_front_send_response_before>
|
103 |
+
</observers>
|
104 |
+
</controller_front_send_response_before>
|
105 |
</events>
|
106 |
</frontend>
|
107 |
<default>
|
114 |
<show_disabled_products>1</show_disabled_products>
|
115 |
<category_use_product_frame>0</category_use_product_frame>
|
116 |
<min_qty>0</min_qty>
|
117 |
+
<visibility>4</visibility>
|
118 |
+
<configurable_price>0</configurable_price>
|
119 |
+
<feed>
|
120 |
+
<product>
|
121 |
+
<iteration_step>250</iteration_step>
|
122 |
+
<use_file_cache>0</use_file_cache>
|
123 |
+
</product>
|
124 |
+
</feed>
|
125 |
</config>
|
126 |
+
<composite>
|
127 |
+
<configurable_childs>1</configurable_childs>
|
128 |
+
<configurable_child_image>0</configurable_child_image>
|
129 |
+
<configurable_child_price>1</configurable_child_price>
|
130 |
+
<grouped_child_image>0</grouped_child_image>
|
131 |
+
<grouped_child_price>0</grouped_child_price>
|
132 |
+
</composite>
|
133 |
</quartic>
|
134 |
</default>
|
135 |
<adminhtml>
|
183 |
</updates>
|
184 |
</layout>
|
185 |
</adminhtml>
|
186 |
+
<crontab>
|
187 |
+
<jobs>
|
188 |
+
<quartic>
|
189 |
+
<schedule>
|
190 |
+
<cron_expr>2 * * * *</cron_expr>
|
191 |
+
</schedule>
|
192 |
+
<run>
|
193 |
+
<model>quartic/cron::refreshProductsFeed</model>
|
194 |
+
</run>
|
195 |
+
</quartic>
|
196 |
+
</jobs>
|
197 |
+
</crontab>
|
198 |
<admin>
|
199 |
<routers>
|
200 |
<quartic>
|
app/code/community/Quarticon/Quartic/etc/system.xml
CHANGED
@@ -15,8 +15,8 @@
|
|
15 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
16 |
<sort_order>10</sort_order>
|
17 |
<show_in_default>1</show_in_default>
|
18 |
-
<show_in_website>
|
19 |
-
<show_in_store>
|
20 |
<fields>
|
21 |
<active translate="label">
|
22 |
<label>Enabled</label>
|
@@ -24,8 +24,8 @@
|
|
24 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
25 |
<sort_order>10</sort_order>
|
26 |
<show_in_default>1</show_in_default>
|
27 |
-
<show_in_website>
|
28 |
-
<show_in_store>
|
29 |
<tooltip>Select if plugin should be enabled or disabled.</tooltip>
|
30 |
</active>
|
31 |
<customer translate="label">
|
@@ -34,8 +34,8 @@
|
|
34 |
<comment>This value is used for API authenthication</comment>
|
35 |
<sort_order>20</sort_order>
|
36 |
<show_in_default>1</show_in_default>
|
37 |
-
<show_in_website>
|
38 |
-
<show_in_store>
|
39 |
<tooltip>This value is used for API authentication and can be found in Quartic control panel (settings tab). Field must be filled in order to use this plugin.</tooltip>
|
40 |
</customer>
|
41 |
<api_key translate="label,comment">
|
@@ -44,8 +44,8 @@
|
|
44 |
<comment>This value is used for API authenthication</comment>
|
45 |
<sort_order>30</sort_order>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
-
<show_in_website>
|
48 |
-
<show_in_store>
|
49 |
<tooltip>This value is used for API authentication and can be found in Quartic control panel (settings tab). Field must be filled in order to use this plugin.</tooltip>
|
50 |
</api_key>
|
51 |
<register translate="label,comment">
|
@@ -55,61 +55,41 @@
|
|
55 |
<comment>Register to obtain values for customer login and key configuration fields</comment>
|
56 |
<sort_order>35</sort_order>
|
57 |
<show_in_default>1</show_in_default>
|
58 |
-
<show_in_website>
|
59 |
-
<show_in_store>
|
60 |
</register>
|
61 |
-
<!--<hash translate="label,comment">
|
62 |
-
<label>Unique Hash</label>
|
63 |
-
<frontend_type>text</frontend_type>
|
64 |
-
<comment>This value is used for the feeds URLs generation</comment>
|
65 |
-
<sort_order>40</sort_order>
|
66 |
-
<show_in_default>1</show_in_default>
|
67 |
-
<show_in_website>0</show_in_website>
|
68 |
-
<show_in_store>0</show_in_store>
|
69 |
-
</hash>
|
70 |
-
<use_sku translate="label,comment">
|
71 |
-
<label>Use SKU</label>
|
72 |
-
<comment>Disable if your SKUs are longer than 20 characters</comment>
|
73 |
-
<frontend_type>select</frontend_type>
|
74 |
-
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
75 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
76 |
-
<sort_order>50</sort_order>
|
77 |
-
<show_in_default>1</show_in_default>
|
78 |
-
<show_in_website>0</show_in_website>
|
79 |
-
<show_in_store>0</show_in_store>
|
80 |
-
</use_sku>
|
81 |
-
<add_thumbs translate="label">
|
82 |
-
<label>Add thumbnails to XML</label>
|
83 |
-
<frontend_type>select</frontend_type>
|
84 |
-
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
85 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
86 |
-
<sort_order>60</sort_order>
|
87 |
-
<show_in_default>1</show_in_default>
|
88 |
-
<show_in_website>0</show_in_website>
|
89 |
-
<show_in_store>0</show_in_store>
|
90 |
-
</add_thumbs>-->
|
91 |
<show_disabled_products translate="label">
|
92 |
<label>Show disabled products in XML feed?</label>
|
93 |
<frontend_type>select</frontend_type>
|
94 |
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
95 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
96 |
-
<sort_order>
|
97 |
<show_in_default>1</show_in_default>
|
98 |
-
<show_in_website>
|
99 |
-
<show_in_store>
|
100 |
<tooltip>Decide if you wish to include disabled product in product feed which is downloaded on a daily basis. It will not affect your recommendations.</tooltip>
|
101 |
</show_disabled_products>
|
102 |
<min_qty translate="label">
|
103 |
<label>Minimal product quantity for status equals 1</label>
|
104 |
<frontend_type>text</frontend_type>
|
105 |
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
106 |
-
<sort_order>
|
107 |
<show_in_default>1</show_in_default>
|
108 |
-
<show_in_website>
|
109 |
-
<show_in_store>
|
110 |
<validate>validate-number validate-zero-or-greater</validate>
|
111 |
<tooltip>Set the number of items in stock to mark them as available for sale (this will affect what products are recommended).</tooltip>
|
112 |
</min_qty>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
<catalog_id translate="label">
|
114 |
<label>Quartic Catalog Name</label>
|
115 |
<frontend_type>select</frontend_type>
|
@@ -117,8 +97,8 @@
|
|
117 |
<source_model>quartic/catalog</source_model>
|
118 |
<sort_order>90</sort_order>
|
119 |
<show_in_default>1</show_in_default>
|
120 |
-
<show_in_website>
|
121 |
-
<show_in_store>
|
122 |
<validate>validate-number</validate>
|
123 |
<tooltip>At the beginning select ‘—Create new—‘ this will generate your first product catalog which will be uploaded to our cloud later.</tooltip>
|
124 |
</catalog_id>
|
@@ -130,8 +110,8 @@
|
|
130 |
<comment>Load placement snippets from your QuarticON account</comment>
|
131 |
<sort_order>100</sort_order>
|
132 |
<show_in_default>1</show_in_default>
|
133 |
-
<show_in_website>
|
134 |
-
<show_in_store>
|
135 |
<tooltip>Load placement snippets from your QuarticON account.</tooltip>
|
136 |
</getplacements>
|
137 |
<sendorders translate="label,comment">
|
@@ -142,22 +122,105 @@
|
|
142 |
<comment>Send transaction history to your QuarticON account</comment>
|
143 |
<sort_order>110</sort_order>
|
144 |
<show_in_default>1</show_in_default>
|
145 |
-
<show_in_website>
|
146 |
-
<show_in_store>
|
147 |
<tooltip>Send transaction history to your QuarticON account.</tooltip>
|
148 |
</sendorders>
|
149 |
</fields>
|
150 |
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
<!-- PLACEMENTS FOR HOME -->
|
152 |
<frames_homepage translate="label">
|
153 |
<label>Recommendation frames - Homepage</label>
|
154 |
<frontend_type>fieldset</frontend_type>
|
155 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
156 |
<allow_empty>true</allow_empty>
|
157 |
-
<sort_order>
|
158 |
<show_in_default>1</show_in_default>
|
159 |
-
<show_in_website>
|
160 |
-
<show_in_store>
|
161 |
<fields>
|
162 |
<top translate="label">
|
163 |
<label>Top</label>
|
@@ -166,8 +229,8 @@
|
|
166 |
<source_model>quartic/placement_home</source_model>
|
167 |
<sort_order>10</sort_order>
|
168 |
<show_in_default>1</show_in_default>
|
169 |
-
<show_in_website>
|
170 |
-
<show_in_store>
|
171 |
<tooltip>Select which widget should be displayed on your homepage top placement.</tooltip>
|
172 |
</top>
|
173 |
<top_enabled translate="label">
|
@@ -178,8 +241,8 @@
|
|
178 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
179 |
<sort_order>15</sort_order>
|
180 |
<show_in_default>1</show_in_default>
|
181 |
-
<show_in_website>
|
182 |
-
<show_in_store>
|
183 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
184 |
</top_enabled>
|
185 |
<bottom translate="label">
|
@@ -189,8 +252,8 @@
|
|
189 |
<source_model>quartic/placement_home</source_model>
|
190 |
<sort_order>20</sort_order>
|
191 |
<show_in_default>1</show_in_default>
|
192 |
-
<show_in_website>
|
193 |
-
<show_in_store>
|
194 |
<tooltip>Select which widget should be displayed on your homepage bottom placement.</tooltip>
|
195 |
</bottom>
|
196 |
<bottom_enabled translate="label">
|
@@ -201,8 +264,8 @@
|
|
201 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
202 |
<sort_order>25</sort_order>
|
203 |
<show_in_default>1</show_in_default>
|
204 |
-
<show_in_website>
|
205 |
-
<show_in_store>
|
206 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
207 |
</bottom_enabled>
|
208 |
</fields>
|
@@ -213,10 +276,10 @@
|
|
213 |
<frontend_type>fieldset</frontend_type>
|
214 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
215 |
<allow_empty>true</allow_empty>
|
216 |
-
<sort_order>
|
217 |
<show_in_default>1</show_in_default>
|
218 |
-
<show_in_website>
|
219 |
-
<show_in_store>
|
220 |
<fields>
|
221 |
<category_use_product_frame translate="label,comment">
|
222 |
<label>Use product frame on category page</label>
|
@@ -227,8 +290,8 @@
|
|
227 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
228 |
<sort_order>5</sort_order>
|
229 |
<show_in_default>1</show_in_default>
|
230 |
-
<show_in_website>
|
231 |
-
<show_in_store>
|
232 |
<tooltip>Category page frames will show recommendations related to random product instead of recommendations related to whole category.</tooltip>
|
233 |
</category_use_product_frame>
|
234 |
<top translate="label">
|
@@ -238,8 +301,8 @@
|
|
238 |
<source_model>quartic/placement_category</source_model>
|
239 |
<sort_order>10</sort_order>
|
240 |
<show_in_default>1</show_in_default>
|
241 |
-
<show_in_website>
|
242 |
-
<show_in_store>
|
243 |
<tooltip>Select which widget should be displayed on your category top placement.</tooltip>
|
244 |
</top>
|
245 |
<top_enabled translate="label">
|
@@ -250,8 +313,8 @@
|
|
250 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
251 |
<sort_order>15</sort_order>
|
252 |
<show_in_default>1</show_in_default>
|
253 |
-
<show_in_website>
|
254 |
-
<show_in_store>
|
255 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
256 |
</top_enabled>
|
257 |
<left translate="label">
|
@@ -261,8 +324,8 @@
|
|
261 |
<source_model>quartic/placement_category</source_model>
|
262 |
<sort_order>20</sort_order>
|
263 |
<show_in_default>1</show_in_default>
|
264 |
-
<show_in_website>
|
265 |
-
<show_in_store>
|
266 |
<tooltip>Select which widget should be displayed on your category left placement.</tooltip>
|
267 |
</left>
|
268 |
<left_enabled translate="label">
|
@@ -273,8 +336,8 @@
|
|
273 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
274 |
<sort_order>25</sort_order>
|
275 |
<show_in_default>1</show_in_default>
|
276 |
-
<show_in_website>
|
277 |
-
<show_in_store>
|
278 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
279 |
</left_enabled>
|
280 |
<bottom translate="label">
|
@@ -284,8 +347,8 @@
|
|
284 |
<source_model>quartic/placement_category</source_model>
|
285 |
<sort_order>30</sort_order>
|
286 |
<show_in_default>1</show_in_default>
|
287 |
-
<show_in_website>
|
288 |
-
<show_in_store>
|
289 |
<tooltip>Select which widget should be displayed on your category bottom placement.</tooltip>
|
290 |
</bottom>
|
291 |
<bottom_enabled translate="label">
|
@@ -296,8 +359,8 @@
|
|
296 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
297 |
<sort_order>35</sort_order>
|
298 |
<show_in_default>1</show_in_default>
|
299 |
-
<show_in_website>
|
300 |
-
<show_in_store>
|
301 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
302 |
</bottom_enabled>
|
303 |
<right translate="label">
|
@@ -307,8 +370,8 @@
|
|
307 |
<source_model>quartic/placement_category</source_model>
|
308 |
<sort_order>40</sort_order>
|
309 |
<show_in_default>1</show_in_default>
|
310 |
-
<show_in_website>
|
311 |
-
<show_in_store>
|
312 |
<tooltip>Select which widget should be displayed on your category right placement.</tooltip>
|
313 |
</right>
|
314 |
<right_enabled translate="label">
|
@@ -319,8 +382,8 @@
|
|
319 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
320 |
<sort_order>45</sort_order>
|
321 |
<show_in_default>1</show_in_default>
|
322 |
-
<show_in_website>
|
323 |
-
<show_in_store>
|
324 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
325 |
</right_enabled>
|
326 |
</fields>
|
@@ -331,10 +394,10 @@
|
|
331 |
<frontend_type>fieldset</frontend_type>
|
332 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
333 |
<allow_empty>true</allow_empty>
|
334 |
-
<sort_order>
|
335 |
<show_in_default>1</show_in_default>
|
336 |
-
<show_in_website>
|
337 |
-
<show_in_store>
|
338 |
<fields>
|
339 |
<top translate="label">
|
340 |
<label>Top</label>
|
@@ -343,8 +406,8 @@
|
|
343 |
<source_model>quartic/placement_product</source_model>
|
344 |
<sort_order>10</sort_order>
|
345 |
<show_in_default>1</show_in_default>
|
346 |
-
<show_in_website>
|
347 |
-
<show_in_store>
|
348 |
<tooltip>Select which widget should be displayed on your product top placement.</tooltip>
|
349 |
</top>
|
350 |
<top_enabled translate="label">
|
@@ -355,8 +418,8 @@
|
|
355 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
356 |
<sort_order>15</sort_order>
|
357 |
<show_in_default>1</show_in_default>
|
358 |
-
<show_in_website>
|
359 |
-
<show_in_store>
|
360 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
361 |
</top_enabled>
|
362 |
<middle translate="label">
|
@@ -366,8 +429,8 @@
|
|
366 |
<source_model>quartic/placement_product</source_model>
|
367 |
<sort_order>20</sort_order>
|
368 |
<show_in_default>1</show_in_default>
|
369 |
-
<show_in_website>
|
370 |
-
<show_in_store>
|
371 |
<tooltip>Select which widget should be displayed on your product middle placement.</tooltip>
|
372 |
</middle>
|
373 |
<middle_enabled translate="label">
|
@@ -378,8 +441,8 @@
|
|
378 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
379 |
<sort_order>25</sort_order>
|
380 |
<show_in_default>1</show_in_default>
|
381 |
-
<show_in_website>
|
382 |
-
<show_in_store>
|
383 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
384 |
</middle_enabled>
|
385 |
<bottom translate="label">
|
@@ -389,8 +452,8 @@
|
|
389 |
<source_model>quartic/placement_product</source_model>
|
390 |
<sort_order>30</sort_order>
|
391 |
<show_in_default>1</show_in_default>
|
392 |
-
<show_in_website>
|
393 |
-
<show_in_store>
|
394 |
<tooltip>Select which widget should be displayed on your product bottom placement.</tooltip>
|
395 |
</bottom>
|
396 |
<bottom_enabled translate="label">
|
@@ -401,8 +464,8 @@
|
|
401 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
402 |
<sort_order>35</sort_order>
|
403 |
<show_in_default>1</show_in_default>
|
404 |
-
<show_in_website>
|
405 |
-
<show_in_store>
|
406 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
407 |
</bottom_enabled>
|
408 |
<right translate="label">
|
@@ -412,8 +475,8 @@
|
|
412 |
<source_model>quartic/placement_product</source_model>
|
413 |
<sort_order>40</sort_order>
|
414 |
<show_in_default>1</show_in_default>
|
415 |
-
<show_in_website>
|
416 |
-
<show_in_store>
|
417 |
<tooltip>Select which widget should be displayed on your product right placement.</tooltip>
|
418 |
</right>
|
419 |
<right_enabled translate="label">
|
@@ -424,8 +487,8 @@
|
|
424 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
425 |
<sort_order>45</sort_order>
|
426 |
<show_in_default>1</show_in_default>
|
427 |
-
<show_in_website>
|
428 |
-
<show_in_store>
|
429 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
430 |
</right_enabled>
|
431 |
</fields>
|
@@ -436,10 +499,10 @@
|
|
436 |
<frontend_type>fieldset</frontend_type>
|
437 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
438 |
<allow_empty>true</allow_empty>
|
439 |
-
<sort_order>
|
440 |
<show_in_default>1</show_in_default>
|
441 |
-
<show_in_website>
|
442 |
-
<show_in_store>
|
443 |
<fields>
|
444 |
<top translate="label">
|
445 |
<label>Top</label>
|
@@ -448,8 +511,8 @@
|
|
448 |
<source_model>quartic/placement_cart</source_model>
|
449 |
<sort_order>10</sort_order>
|
450 |
<show_in_default>1</show_in_default>
|
451 |
-
<show_in_website>
|
452 |
-
<show_in_store>
|
453 |
<tooltip>Select which widget should be displayed on your cart top placement.</tooltip>
|
454 |
</top>
|
455 |
<top_enabled translate="label">
|
@@ -460,8 +523,8 @@
|
|
460 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
461 |
<sort_order>15</sort_order>
|
462 |
<show_in_default>1</show_in_default>
|
463 |
-
<show_in_website>
|
464 |
-
<show_in_store>
|
465 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
466 |
</top_enabled>
|
467 |
<middle translate="label">
|
@@ -471,8 +534,8 @@
|
|
471 |
<source_model>quartic/placement_cart</source_model>
|
472 |
<sort_order>20</sort_order>
|
473 |
<show_in_default>1</show_in_default>
|
474 |
-
<show_in_website>
|
475 |
-
<show_in_store>
|
476 |
<tooltip>Select which widget should be displayed on your cart middle placement.</tooltip>
|
477 |
</middle>
|
478 |
<middle_enabled translate="label">
|
@@ -483,8 +546,8 @@
|
|
483 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
484 |
<sort_order>25</sort_order>
|
485 |
<show_in_default>1</show_in_default>
|
486 |
-
<show_in_website>
|
487 |
-
<show_in_store>
|
488 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
489 |
</middle_enabled>
|
490 |
<bottom translate="label">
|
@@ -494,8 +557,8 @@
|
|
494 |
<source_model>quartic/placement_cart</source_model>
|
495 |
<sort_order>30</sort_order>
|
496 |
<show_in_default>1</show_in_default>
|
497 |
-
<show_in_website>
|
498 |
-
<show_in_store>
|
499 |
<tooltip>Select which widget should be displayed on your cart bottom placement.</tooltip>
|
500 |
</bottom>
|
501 |
<bottom_enabled translate="label">
|
@@ -506,8 +569,8 @@
|
|
506 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
507 |
<sort_order>35</sort_order>
|
508 |
<show_in_default>1</show_in_default>
|
509 |
-
<show_in_website>
|
510 |
-
<show_in_store>
|
511 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
512 |
</bottom_enabled>
|
513 |
<right translate="label">
|
@@ -517,8 +580,8 @@
|
|
517 |
<source_model>quartic/placement_cart</source_model>
|
518 |
<sort_order>40</sort_order>
|
519 |
<show_in_default>1</show_in_default>
|
520 |
-
<show_in_website>
|
521 |
-
<show_in_store>
|
522 |
<tooltip>Select which widget should be displayed on your cart right placement.</tooltip>
|
523 |
</right>
|
524 |
<right_enabled translate="label">
|
@@ -529,8 +592,8 @@
|
|
529 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
530 |
<sort_order>45</sort_order>
|
531 |
<show_in_default>1</show_in_default>
|
532 |
-
<show_in_website>
|
533 |
-
<show_in_store>
|
534 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
535 |
</right_enabled>
|
536 |
</fields>
|
15 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
16 |
<sort_order>10</sort_order>
|
17 |
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
<fields>
|
21 |
<active translate="label">
|
22 |
<label>Enabled</label>
|
24 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
25 |
<sort_order>10</sort_order>
|
26 |
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
<tooltip>Select if plugin should be enabled or disabled.</tooltip>
|
30 |
</active>
|
31 |
<customer translate="label">
|
34 |
<comment>This value is used for API authenthication</comment>
|
35 |
<sort_order>20</sort_order>
|
36 |
<show_in_default>1</show_in_default>
|
37 |
+
<show_in_website>1</show_in_website>
|
38 |
+
<show_in_store>1</show_in_store>
|
39 |
<tooltip>This value is used for API authentication and can be found in Quartic control panel (settings tab). Field must be filled in order to use this plugin.</tooltip>
|
40 |
</customer>
|
41 |
<api_key translate="label,comment">
|
44 |
<comment>This value is used for API authenthication</comment>
|
45 |
<sort_order>30</sort_order>
|
46 |
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>1</show_in_store>
|
49 |
<tooltip>This value is used for API authentication and can be found in Quartic control panel (settings tab). Field must be filled in order to use this plugin.</tooltip>
|
50 |
</api_key>
|
51 |
<register translate="label,comment">
|
55 |
<comment>Register to obtain values for customer login and key configuration fields</comment>
|
56 |
<sort_order>35</sort_order>
|
57 |
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
</register>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<show_disabled_products translate="label">
|
62 |
<label>Show disabled products in XML feed?</label>
|
63 |
<frontend_type>select</frontend_type>
|
64 |
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
65 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
66 |
+
<sort_order>70</sort_order>
|
67 |
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
<tooltip>Decide if you wish to include disabled product in product feed which is downloaded on a daily basis. It will not affect your recommendations.</tooltip>
|
71 |
</show_disabled_products>
|
72 |
<min_qty translate="label">
|
73 |
<label>Minimal product quantity for status equals 1</label>
|
74 |
<frontend_type>text</frontend_type>
|
75 |
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
76 |
+
<sort_order>80</sort_order>
|
77 |
<show_in_default>1</show_in_default>
|
78 |
+
<show_in_website>1</show_in_website>
|
79 |
+
<show_in_store>1</show_in_store>
|
80 |
<validate>validate-number validate-zero-or-greater</validate>
|
81 |
<tooltip>Set the number of items in stock to mark them as available for sale (this will affect what products are recommended).</tooltip>
|
82 |
</min_qty>
|
83 |
+
<!-- <visibility translate="label">
|
84 |
+
<label>Product visibility in feed</label>
|
85 |
+
<frontend_type>multiselect</frontend_type>
|
86 |
+
<source_model>quartic/system_config_source_visibility</source_model>
|
87 |
+
<frontend_model>quartic/adminhtml_system_config_form_field_text</frontend_model>
|
88 |
+
<sort_order>81</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</visibility> -->
|
93 |
<catalog_id translate="label">
|
94 |
<label>Quartic Catalog Name</label>
|
95 |
<frontend_type>select</frontend_type>
|
97 |
<source_model>quartic/catalog</source_model>
|
98 |
<sort_order>90</sort_order>
|
99 |
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>1</show_in_store>
|
102 |
<validate>validate-number</validate>
|
103 |
<tooltip>At the beginning select ‘—Create new—‘ this will generate your first product catalog which will be uploaded to our cloud later.</tooltip>
|
104 |
</catalog_id>
|
110 |
<comment>Load placement snippets from your QuarticON account</comment>
|
111 |
<sort_order>100</sort_order>
|
112 |
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>1</show_in_store>
|
115 |
<tooltip>Load placement snippets from your QuarticON account.</tooltip>
|
116 |
</getplacements>
|
117 |
<sendorders translate="label,comment">
|
122 |
<comment>Send transaction history to your QuarticON account</comment>
|
123 |
<sort_order>110</sort_order>
|
124 |
<show_in_default>1</show_in_default>
|
125 |
+
<show_in_website>1</show_in_website>
|
126 |
+
<show_in_store>1</show_in_store>
|
127 |
<tooltip>Send transaction history to your QuarticON account.</tooltip>
|
128 |
</sendorders>
|
129 |
</fields>
|
130 |
</config>
|
131 |
+
<composite translate="label">
|
132 |
+
<label>Composite products</label>
|
133 |
+
<frontend_type>fieldset</frontend_type>
|
134 |
+
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
135 |
+
<sort_order>20</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>1</show_in_store>
|
139 |
+
<fields>
|
140 |
+
<configurable_price translate="label">
|
141 |
+
<label>Price type of configurable product</label>
|
142 |
+
<frontend_type>select</frontend_type>
|
143 |
+
<source_model>quartic/system_config_source_configurableprice</source_model>
|
144 |
+
<sort_order>1</sort_order>
|
145 |
+
<show_in_default>1</show_in_default>
|
146 |
+
<show_in_website>1</show_in_website>
|
147 |
+
<show_in_store>1</show_in_store>
|
148 |
+
</configurable_price>
|
149 |
+
<configurable_childs translate="label">
|
150 |
+
<label>Configurable children products</label>
|
151 |
+
<frontend_type>select</frontend_type>
|
152 |
+
<source_model>quartic/system_config_source_configurablechilds</source_model>
|
153 |
+
<sort_order>10</sort_order>
|
154 |
+
<show_in_default>1</show_in_default>
|
155 |
+
<show_in_website>1</show_in_website>
|
156 |
+
<show_in_store>1</show_in_store>
|
157 |
+
</configurable_childs>
|
158 |
+
<configurable_child_image translate="label">
|
159 |
+
<label>Configurable children product image</label>
|
160 |
+
<frontend_type>select</frontend_type>
|
161 |
+
<source_model>quartic/system_config_source_configurablechildimage</source_model>
|
162 |
+
<sort_order>20</sort_order>
|
163 |
+
<show_in_default>1</show_in_default>
|
164 |
+
<show_in_website>1</show_in_website>
|
165 |
+
<show_in_store>1</show_in_store>
|
166 |
+
</configurable_child_image>
|
167 |
+
<configurable_child_price translate="label">
|
168 |
+
<label>Configurable children product price</label>
|
169 |
+
<frontend_type>select</frontend_type>
|
170 |
+
<source_model>quartic/system_config_source_configurablechildprice</source_model>
|
171 |
+
<sort_order>30</sort_order>
|
172 |
+
<show_in_default>1</show_in_default>
|
173 |
+
<show_in_website>1</show_in_website>
|
174 |
+
<show_in_store>1</show_in_store>
|
175 |
+
</configurable_child_price>
|
176 |
+
<configurable_child_redirect translate="label">
|
177 |
+
<label>Redirect simple product to configurable</label>
|
178 |
+
<frontend_type>select</frontend_type>
|
179 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
180 |
+
<sort_order>40</sort_order>
|
181 |
+
<show_in_default>1</show_in_default>
|
182 |
+
<show_in_website>1</show_in_website>
|
183 |
+
<show_in_store>1</show_in_store>
|
184 |
+
</configurable_child_redirect>
|
185 |
+
<grouped_child_price translate="label">
|
186 |
+
<label>Grouped product price</label>
|
187 |
+
<frontend_type>select</frontend_type>
|
188 |
+
<source_model>quartic/system_config_source_groupedprice</source_model>
|
189 |
+
<sort_order>50</sort_order>
|
190 |
+
<show_in_default>1</show_in_default>
|
191 |
+
<show_in_website>1</show_in_website>
|
192 |
+
<show_in_store>1</show_in_store>
|
193 |
+
</grouped_child_price>
|
194 |
+
<grouped_child_image translate="label">
|
195 |
+
<label>Grouped children product image</label>
|
196 |
+
<frontend_type>select</frontend_type>
|
197 |
+
<source_model>quartic/system_config_source_groupedchildimage</source_model>
|
198 |
+
<sort_order>60</sort_order>
|
199 |
+
<show_in_default>1</show_in_default>
|
200 |
+
<show_in_website>1</show_in_website>
|
201 |
+
<show_in_store>1</show_in_store>
|
202 |
+
</grouped_child_image>
|
203 |
+
<grouped_child_redirect translate="label">
|
204 |
+
<label>Redirect simple product to grouped</label>
|
205 |
+
<frontend_type>select</frontend_type>
|
206 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
207 |
+
<sort_order>70</sort_order>
|
208 |
+
<show_in_default>1</show_in_default>
|
209 |
+
<show_in_website>1</show_in_website>
|
210 |
+
<show_in_store>1</show_in_store>
|
211 |
+
</grouped_child_redirect>
|
212 |
+
</fields>
|
213 |
+
</composite>
|
214 |
<!-- PLACEMENTS FOR HOME -->
|
215 |
<frames_homepage translate="label">
|
216 |
<label>Recommendation frames - Homepage</label>
|
217 |
<frontend_type>fieldset</frontend_type>
|
218 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
219 |
<allow_empty>true</allow_empty>
|
220 |
+
<sort_order>30</sort_order>
|
221 |
<show_in_default>1</show_in_default>
|
222 |
+
<show_in_website>1</show_in_website>
|
223 |
+
<show_in_store>1</show_in_store>
|
224 |
<fields>
|
225 |
<top translate="label">
|
226 |
<label>Top</label>
|
229 |
<source_model>quartic/placement_home</source_model>
|
230 |
<sort_order>10</sort_order>
|
231 |
<show_in_default>1</show_in_default>
|
232 |
+
<show_in_website>1</show_in_website>
|
233 |
+
<show_in_store>1</show_in_store>
|
234 |
<tooltip>Select which widget should be displayed on your homepage top placement.</tooltip>
|
235 |
</top>
|
236 |
<top_enabled translate="label">
|
241 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
242 |
<sort_order>15</sort_order>
|
243 |
<show_in_default>1</show_in_default>
|
244 |
+
<show_in_website>1</show_in_website>
|
245 |
+
<show_in_store>1</show_in_store>
|
246 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
247 |
</top_enabled>
|
248 |
<bottom translate="label">
|
252 |
<source_model>quartic/placement_home</source_model>
|
253 |
<sort_order>20</sort_order>
|
254 |
<show_in_default>1</show_in_default>
|
255 |
+
<show_in_website>1</show_in_website>
|
256 |
+
<show_in_store>1</show_in_store>
|
257 |
<tooltip>Select which widget should be displayed on your homepage bottom placement.</tooltip>
|
258 |
</bottom>
|
259 |
<bottom_enabled translate="label">
|
264 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
265 |
<sort_order>25</sort_order>
|
266 |
<show_in_default>1</show_in_default>
|
267 |
+
<show_in_website>1</show_in_website>
|
268 |
+
<show_in_store>1</show_in_store>
|
269 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
270 |
</bottom_enabled>
|
271 |
</fields>
|
276 |
<frontend_type>fieldset</frontend_type>
|
277 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
278 |
<allow_empty>true</allow_empty>
|
279 |
+
<sort_order>40</sort_order>
|
280 |
<show_in_default>1</show_in_default>
|
281 |
+
<show_in_website>1</show_in_website>
|
282 |
+
<show_in_store>1</show_in_store>
|
283 |
<fields>
|
284 |
<category_use_product_frame translate="label,comment">
|
285 |
<label>Use product frame on category page</label>
|
290 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
291 |
<sort_order>5</sort_order>
|
292 |
<show_in_default>1</show_in_default>
|
293 |
+
<show_in_website>1</show_in_website>
|
294 |
+
<show_in_store>1</show_in_store>
|
295 |
<tooltip>Category page frames will show recommendations related to random product instead of recommendations related to whole category.</tooltip>
|
296 |
</category_use_product_frame>
|
297 |
<top translate="label">
|
301 |
<source_model>quartic/placement_category</source_model>
|
302 |
<sort_order>10</sort_order>
|
303 |
<show_in_default>1</show_in_default>
|
304 |
+
<show_in_website>1</show_in_website>
|
305 |
+
<show_in_store>1</show_in_store>
|
306 |
<tooltip>Select which widget should be displayed on your category top placement.</tooltip>
|
307 |
</top>
|
308 |
<top_enabled translate="label">
|
313 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
314 |
<sort_order>15</sort_order>
|
315 |
<show_in_default>1</show_in_default>
|
316 |
+
<show_in_website>1</show_in_website>
|
317 |
+
<show_in_store>1</show_in_store>
|
318 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
319 |
</top_enabled>
|
320 |
<left translate="label">
|
324 |
<source_model>quartic/placement_category</source_model>
|
325 |
<sort_order>20</sort_order>
|
326 |
<show_in_default>1</show_in_default>
|
327 |
+
<show_in_website>1</show_in_website>
|
328 |
+
<show_in_store>1</show_in_store>
|
329 |
<tooltip>Select which widget should be displayed on your category left placement.</tooltip>
|
330 |
</left>
|
331 |
<left_enabled translate="label">
|
336 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
337 |
<sort_order>25</sort_order>
|
338 |
<show_in_default>1</show_in_default>
|
339 |
+
<show_in_website>1</show_in_website>
|
340 |
+
<show_in_store>1</show_in_store>
|
341 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
342 |
</left_enabled>
|
343 |
<bottom translate="label">
|
347 |
<source_model>quartic/placement_category</source_model>
|
348 |
<sort_order>30</sort_order>
|
349 |
<show_in_default>1</show_in_default>
|
350 |
+
<show_in_website>1</show_in_website>
|
351 |
+
<show_in_store>1</show_in_store>
|
352 |
<tooltip>Select which widget should be displayed on your category bottom placement.</tooltip>
|
353 |
</bottom>
|
354 |
<bottom_enabled translate="label">
|
359 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
360 |
<sort_order>35</sort_order>
|
361 |
<show_in_default>1</show_in_default>
|
362 |
+
<show_in_website>1</show_in_website>
|
363 |
+
<show_in_store>1</show_in_store>
|
364 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
365 |
</bottom_enabled>
|
366 |
<right translate="label">
|
370 |
<source_model>quartic/placement_category</source_model>
|
371 |
<sort_order>40</sort_order>
|
372 |
<show_in_default>1</show_in_default>
|
373 |
+
<show_in_website>1</show_in_website>
|
374 |
+
<show_in_store>1</show_in_store>
|
375 |
<tooltip>Select which widget should be displayed on your category right placement.</tooltip>
|
376 |
</right>
|
377 |
<right_enabled translate="label">
|
382 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
383 |
<sort_order>45</sort_order>
|
384 |
<show_in_default>1</show_in_default>
|
385 |
+
<show_in_website>1</show_in_website>
|
386 |
+
<show_in_store>1</show_in_store>
|
387 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
388 |
</right_enabled>
|
389 |
</fields>
|
394 |
<frontend_type>fieldset</frontend_type>
|
395 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
396 |
<allow_empty>true</allow_empty>
|
397 |
+
<sort_order>50</sort_order>
|
398 |
<show_in_default>1</show_in_default>
|
399 |
+
<show_in_website>1</show_in_website>
|
400 |
+
<show_in_store>1</show_in_store>
|
401 |
<fields>
|
402 |
<top translate="label">
|
403 |
<label>Top</label>
|
406 |
<source_model>quartic/placement_product</source_model>
|
407 |
<sort_order>10</sort_order>
|
408 |
<show_in_default>1</show_in_default>
|
409 |
+
<show_in_website>1</show_in_website>
|
410 |
+
<show_in_store>1</show_in_store>
|
411 |
<tooltip>Select which widget should be displayed on your product top placement.</tooltip>
|
412 |
</top>
|
413 |
<top_enabled translate="label">
|
418 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
419 |
<sort_order>15</sort_order>
|
420 |
<show_in_default>1</show_in_default>
|
421 |
+
<show_in_website>1</show_in_website>
|
422 |
+
<show_in_store>1</show_in_store>
|
423 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
424 |
</top_enabled>
|
425 |
<middle translate="label">
|
429 |
<source_model>quartic/placement_product</source_model>
|
430 |
<sort_order>20</sort_order>
|
431 |
<show_in_default>1</show_in_default>
|
432 |
+
<show_in_website>1</show_in_website>
|
433 |
+
<show_in_store>1</show_in_store>
|
434 |
<tooltip>Select which widget should be displayed on your product middle placement.</tooltip>
|
435 |
</middle>
|
436 |
<middle_enabled translate="label">
|
441 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
442 |
<sort_order>25</sort_order>
|
443 |
<show_in_default>1</show_in_default>
|
444 |
+
<show_in_website>1</show_in_website>
|
445 |
+
<show_in_store>1</show_in_store>
|
446 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
447 |
</middle_enabled>
|
448 |
<bottom translate="label">
|
452 |
<source_model>quartic/placement_product</source_model>
|
453 |
<sort_order>30</sort_order>
|
454 |
<show_in_default>1</show_in_default>
|
455 |
+
<show_in_website>1</show_in_website>
|
456 |
+
<show_in_store>1</show_in_store>
|
457 |
<tooltip>Select which widget should be displayed on your product bottom placement.</tooltip>
|
458 |
</bottom>
|
459 |
<bottom_enabled translate="label">
|
464 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
465 |
<sort_order>35</sort_order>
|
466 |
<show_in_default>1</show_in_default>
|
467 |
+
<show_in_website>1</show_in_website>
|
468 |
+
<show_in_store>1</show_in_store>
|
469 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
470 |
</bottom_enabled>
|
471 |
<right translate="label">
|
475 |
<source_model>quartic/placement_product</source_model>
|
476 |
<sort_order>40</sort_order>
|
477 |
<show_in_default>1</show_in_default>
|
478 |
+
<show_in_website>1</show_in_website>
|
479 |
+
<show_in_store>1</show_in_store>
|
480 |
<tooltip>Select which widget should be displayed on your product right placement.</tooltip>
|
481 |
</right>
|
482 |
<right_enabled translate="label">
|
487 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
488 |
<sort_order>45</sort_order>
|
489 |
<show_in_default>1</show_in_default>
|
490 |
+
<show_in_website>1</show_in_website>
|
491 |
+
<show_in_store>1</show_in_store>
|
492 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
493 |
</right_enabled>
|
494 |
</fields>
|
499 |
<frontend_type>fieldset</frontend_type>
|
500 |
<frontend_model>quartic/adminhtml_system_config_form_fieldset</frontend_model>
|
501 |
<allow_empty>true</allow_empty>
|
502 |
+
<sort_order>60</sort_order>
|
503 |
<show_in_default>1</show_in_default>
|
504 |
+
<show_in_website>1</show_in_website>
|
505 |
+
<show_in_store>1</show_in_store>
|
506 |
<fields>
|
507 |
<top translate="label">
|
508 |
<label>Top</label>
|
511 |
<source_model>quartic/placement_cart</source_model>
|
512 |
<sort_order>10</sort_order>
|
513 |
<show_in_default>1</show_in_default>
|
514 |
+
<show_in_website>1</show_in_website>
|
515 |
+
<show_in_store>1</show_in_store>
|
516 |
<tooltip>Select which widget should be displayed on your cart top placement.</tooltip>
|
517 |
</top>
|
518 |
<top_enabled translate="label">
|
523 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
524 |
<sort_order>15</sort_order>
|
525 |
<show_in_default>1</show_in_default>
|
526 |
+
<show_in_website>1</show_in_website>
|
527 |
+
<show_in_store>1</show_in_store>
|
528 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
529 |
</top_enabled>
|
530 |
<middle translate="label">
|
534 |
<source_model>quartic/placement_cart</source_model>
|
535 |
<sort_order>20</sort_order>
|
536 |
<show_in_default>1</show_in_default>
|
537 |
+
<show_in_website>1</show_in_website>
|
538 |
+
<show_in_store>1</show_in_store>
|
539 |
<tooltip>Select which widget should be displayed on your cart middle placement.</tooltip>
|
540 |
</middle>
|
541 |
<middle_enabled translate="label">
|
546 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
547 |
<sort_order>25</sort_order>
|
548 |
<show_in_default>1</show_in_default>
|
549 |
+
<show_in_website>1</show_in_website>
|
550 |
+
<show_in_store>1</show_in_store>
|
551 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
552 |
</middle_enabled>
|
553 |
<bottom translate="label">
|
557 |
<source_model>quartic/placement_cart</source_model>
|
558 |
<sort_order>30</sort_order>
|
559 |
<show_in_default>1</show_in_default>
|
560 |
+
<show_in_website>1</show_in_website>
|
561 |
+
<show_in_store>1</show_in_store>
|
562 |
<tooltip>Select which widget should be displayed on your cart bottom placement.</tooltip>
|
563 |
</bottom>
|
564 |
<bottom_enabled translate="label">
|
569 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
570 |
<sort_order>35</sort_order>
|
571 |
<show_in_default>1</show_in_default>
|
572 |
+
<show_in_website>1</show_in_website>
|
573 |
+
<show_in_store>1</show_in_store>
|
574 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
575 |
</bottom_enabled>
|
576 |
<right translate="label">
|
580 |
<source_model>quartic/placement_cart</source_model>
|
581 |
<sort_order>40</sort_order>
|
582 |
<show_in_default>1</show_in_default>
|
583 |
+
<show_in_website>1</show_in_website>
|
584 |
+
<show_in_store>1</show_in_store>
|
585 |
<tooltip>Select which widget should be displayed on your cart right placement.</tooltip>
|
586 |
</right>
|
587 |
<right_enabled translate="label">
|
592 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
593 |
<sort_order>45</sort_order>
|
594 |
<show_in_default>1</show_in_default>
|
595 |
+
<show_in_website>1</show_in_website>
|
596 |
+
<show_in_store>1</show_in_store>
|
597 |
<tooltip>Select if widget should be enabled or disabled.</tooltip>
|
598 |
</right_enabled>
|
599 |
</fields>
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-install-0.1.0.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-install-0.1.4.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.1.0-0.1.4.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.1.7-0.2.0.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.1-0.2.2.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.2-0.2.3.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.3-0.2.4.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.2.5-0.2.6.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.1-0.3.2.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.2-0.3.3.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.3-0.3.4.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.4-0.3.5.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-0.3.5-0.3.6.php
CHANGED
File without changes
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.0.2-1.0.3.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$connection = $installer->getConnection();
|
5 |
+
|
6 |
+
if ($connection->tableColumnExists($this->getTable('quartic_placements'), 'api_name') === false) {
|
7 |
+
$installer->run("
|
8 |
+
ALTER TABLE {$this->getTable('quartic_placements')}
|
9 |
+
ADD `api_name` varchar(255) NOT NULL AFTER `id`;
|
10 |
+
");
|
11 |
+
}
|
12 |
+
|
13 |
+
// category attribute
|
14 |
+
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
|
15 |
+
$setup->addAttribute('catalog_product', 'quarticon_exclude', array(
|
16 |
+
'group' => 'General',
|
17 |
+
'input' => 'select',
|
18 |
+
'type' => 'int',
|
19 |
+
'label' => 'Exclude from Quarticon feed',
|
20 |
+
'source' => 'eav/entity_attribute_source_boolean',
|
21 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
22 |
+
'visible' => 1,
|
23 |
+
'required' => 0,
|
24 |
+
'visible_on_front' => 0,
|
25 |
+
'is_html_allowed_on_front' => 0,
|
26 |
+
'is_configurable' => 0,
|
27 |
+
'searchable' => 0,
|
28 |
+
'filterable' => 0,
|
29 |
+
'comparable' => 0,
|
30 |
+
'unique' => false,
|
31 |
+
'user_defined' => true,
|
32 |
+
'default' => '1',
|
33 |
+
'is_user_defined' => true,
|
34 |
+
'used_in_product_listing' => false
|
35 |
+
));
|
36 |
+
|
37 |
+
@mail(
|
38 |
+
'contact@quarticon.com',
|
39 |
+
'[Upgrade] Quartic 1.0.3',
|
40 |
+
"IP: " . $_SERVER['SERVER_ADDR'] . "\r\nHost: " . gethostbyaddr($_SERVER['SERVER_ADDR']),
|
41 |
+
"From: " . (
|
42 |
+
Mage::getStoreConfig('general/store_information/email_address') ?
|
43 |
+
Mage::getStoreConfig('general/store_information/email_address') :
|
44 |
+
'contact@quarticon.com'
|
45 |
+
)
|
46 |
+
);
|
47 |
+
|
48 |
+
$installer->endSetup();
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.1.1-1.2.0.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
@mail(
|
5 |
+
'contact@quarticon.com',
|
6 |
+
'[Upgrade] Quartic 1.2.0',
|
7 |
+
"IP: " . $_SERVER['SERVER_ADDR'] . "\r\nHost: " . gethostbyaddr($_SERVER['SERVER_ADDR']),
|
8 |
+
"From: " . (
|
9 |
+
Mage::getStoreConfig('general/store_information/email_address') ?
|
10 |
+
Mage::getStoreConfig('general/store_information/email_address') :
|
11 |
+
'contact@quarticon.com'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$installer->endSetup();
|
app/code/community/Quarticon/Quartic/sql/quartic_setup/mysql4-upgrade-1.2.0-1.2.3.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
@mail(
|
5 |
+
'contact@quarticon.com',
|
6 |
+
'[Upgrade] Quartic 1.2.3',
|
7 |
+
"IP: " . $_SERVER['SERVER_ADDR'] . "\r\nHost: " . gethostbyaddr($_SERVER['SERVER_ADDR']),
|
8 |
+
"From: " . (
|
9 |
+
Mage::getStoreConfig('general/store_information/email_address') ?
|
10 |
+
Mage::getStoreConfig('general/store_information/email_address') :
|
11 |
+
'contact@quarticon.com'
|
12 |
+
)
|
13 |
+
);
|
14 |
+
|
15 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/quartic.xml
CHANGED
File without changes
|
app/design/adminhtml/default/default/template/quartic/api/dump.phtml
CHANGED
File without changes
|
app/design/adminhtml/default/default/template/quartic/history.phtml
CHANGED
File without changes
|
app/design/adminhtml/default/default/template/quartic/maps.phtml
CHANGED
File without changes
|
app/design/adminhtml/default/default/template/quartic/system/config/button_register.phtml
CHANGED
File without changes
|
app/design/adminhtml/default/default/template/quartic/urls.phtml
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<div class="content-header">
|
2 |
-
<table cellspacing="0">
|
3 |
-
<tr>
|
4 |
-
<td style="width:50%;"><h3><?php echo Mage::helper('quartic')->__('Quartic feed URLs') ?></h3></td>
|
5 |
-
</tr>
|
6 |
-
</table>
|
7 |
-
</div>
|
8 |
-
<div>
|
9 |
-
<?php echo $this->getGridHtml() ?>
|
10 |
-
</div>
|
1 |
+
<div class="content-header">
|
2 |
+
<table cellspacing="0">
|
3 |
+
<tr>
|
4 |
+
<td style="width:50%;"><h3><?php echo Mage::helper('quartic')->__('Quartic feed URLs') ?></h3></td>
|
5 |
+
</tr>
|
6 |
+
</table>
|
7 |
+
</div>
|
8 |
+
<div>
|
9 |
+
<?php echo $this->getGridHtml() ?>
|
10 |
+
</div>
|
app/design/frontend/base/default/layout/quartic.xml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/frame/cart.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/frame/category.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/frame/home.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/frame/product.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/getter/order.phtml
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
<?php if ($this->isActive()): ?>
|
2 |
-
<?php $order = $this->getOrder(); ?>
|
3 |
-
<?php $order_items = $this->getProducts(); ?>
|
4 |
-
<script type="text/javascript">
|
5 |
-
var upsParams = upsParams || [];
|
6 |
-
upsParams.push(['customer','<?php echo $this->getCustomer(); ?>']);
|
7 |
-
upsParams.push(['transaction', '<?php echo $order->getIncrementId(); ?>']);
|
8 |
-
upsParams.push(['user', '<?php echo $this->getUser(); ?>']);
|
9 |
-
<?php foreach ($order_items as $item): ?>
|
10 |
-
upsParams.push(['action','purchase']);
|
11 |
-
upsParams.push(['product','<?php echo $item['product']; ?>']);
|
12 |
-
upsParams.push(['price','<?php echo $item['price']; ?>']);
|
13 |
-
upsParams.push(['quantity','<?php echo $item['quantity']; ?>']);
|
14 |
-
upsParams.push(['execute']);
|
15 |
-
<?php endforeach; ?>
|
16 |
-
</script>
|
17 |
<?php endif; ?>
|
1 |
+
<?php if ($this->isActive()): ?>
|
2 |
+
<?php $order = $this->getOrder(); ?>
|
3 |
+
<?php $order_items = $this->getProducts(); ?>
|
4 |
+
<script type="text/javascript">
|
5 |
+
var upsParams = upsParams || [];
|
6 |
+
upsParams.push(['customer','<?php echo $this->getCustomer(); ?>']);
|
7 |
+
upsParams.push(['transaction', '<?php echo $order->getIncrementId(); ?>']);
|
8 |
+
upsParams.push(['user', '<?php echo $this->getUser(); ?>']);
|
9 |
+
<?php foreach ($order_items as $item): ?>
|
10 |
+
upsParams.push(['action','purchase']);
|
11 |
+
upsParams.push(['product','<?php echo $item['product']; ?>']);
|
12 |
+
upsParams.push(['price','<?php echo $item['price']; ?>']);
|
13 |
+
upsParams.push(['quantity','<?php echo $item['quantity']; ?>']);
|
14 |
+
upsParams.push(['execute']);
|
15 |
+
<?php endforeach; ?>
|
16 |
+
</script>
|
17 |
<?php endif; ?>
|
app/design/frontend/base/default/template/quartic/getter/product.phtml
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?php if ($this->isActive()): ?>
|
2 |
-
<script type="text/javascript">
|
3 |
-
var upsParams = upsParams || []
|
4 |
-
upsParams.push(['action','view'])
|
5 |
-
upsParams.push(['customer','<?php echo $this->getCustomer(); ?>'])
|
6 |
-
upsParams.push(['user', '<?php echo $this->getUser(); ?>'])
|
7 |
-
upsParams.push(['product', '<?php echo Mage::helper('quartic')->getProduct($this->getProduct()); ?>'])
|
8 |
-
upsParams.push(['execute'])
|
9 |
-
</script>
|
10 |
<?php endif; ?>
|
1 |
+
<?php if ($this->isActive()): ?>
|
2 |
+
<script type="text/javascript">
|
3 |
+
var upsParams = upsParams || []
|
4 |
+
upsParams.push(['action','view'])
|
5 |
+
upsParams.push(['customer','<?php echo $this->getCustomer(); ?>'])
|
6 |
+
upsParams.push(['user', '<?php echo $this->getUser(); ?>'])
|
7 |
+
upsParams.push(['product', '<?php echo Mage::helper('quartic')->getProduct($this->getProduct()); ?>'])
|
8 |
+
upsParams.push(['execute'])
|
9 |
+
</script>
|
10 |
<?php endif; ?>
|
app/design/frontend/base/default/template/quartic/products.phtml
CHANGED
@@ -1,90 +1,90 @@
|
|
1 |
-
<?php
|
2 |
-
$_productCollection=$this->getLoadedProductCollection();
|
3 |
-
$_helper = $this->helper('catalog/output');
|
4 |
-
?>
|
5 |
-
<?php if ($_productCollection->count()): ?>
|
6 |
-
<h2><?php echo Mage::helper('quartic')->__('Recommendations'); ?></h2>
|
7 |
-
<div class="category-products">
|
8 |
-
<?php // List mode ?>
|
9 |
-
<?php if($this->getMode()!='grid'): ?>
|
10 |
-
<?php $_iterator = 0; ?>
|
11 |
-
<ol class="products-list" id="products-list">
|
12 |
-
<?php foreach ($_productCollection as $_product): ?>
|
13 |
-
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
14 |
-
<?php // Product Image ?>
|
15 |
-
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
16 |
-
<?php // Product description ?>
|
17 |
-
<div class="product-shop">
|
18 |
-
<div class="f-fix">
|
19 |
-
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
20 |
-
<h2 class="product-name"><a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
21 |
-
<?php if($_product->getRatingSummary()): ?>
|
22 |
-
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
23 |
-
<?php endif; ?>
|
24 |
-
<?php echo $this->getPriceHtml($_product, true) ?>
|
25 |
-
<?php if($_product->isSaleable()): ?>
|
26 |
-
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getQuarticAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
27 |
-
<?php else: ?>
|
28 |
-
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
29 |
-
<?php endif; ?>
|
30 |
-
<div class="desc std">
|
31 |
-
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
32 |
-
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
33 |
-
</div>
|
34 |
-
<ul class="add-to-links">
|
35 |
-
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
36 |
-
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
37 |
-
<?php endif; ?>
|
38 |
-
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
39 |
-
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
40 |
-
<?php endif; ?>
|
41 |
-
</ul>
|
42 |
-
</div>
|
43 |
-
</div>
|
44 |
-
</li>
|
45 |
-
<?php endforeach; ?>
|
46 |
-
</ol>
|
47 |
-
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
48 |
-
|
49 |
-
<?php else: ?>
|
50 |
-
|
51 |
-
<?php // Grid Mode ?>
|
52 |
-
|
53 |
-
<?php $_collectionSize = $_productCollection->count() ?>
|
54 |
-
<?php $_columnCount = $this->getColumnCount(); ?>
|
55 |
-
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
56 |
-
<?php if ($i++%$_columnCount==0): ?>
|
57 |
-
<ul class="products-grid">
|
58 |
-
<?php endif ?>
|
59 |
-
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
60 |
-
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
61 |
-
<h2 class="product-name"><a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
62 |
-
<?php if($_product->getRatingSummary()): ?>
|
63 |
-
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
64 |
-
<?php endif; ?>
|
65 |
-
<?php echo $this->getPriceHtml($_product, true) ?>
|
66 |
-
<div class="actions">
|
67 |
-
<?php if($_product->isSaleable()): ?>
|
68 |
-
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getQuarticAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
69 |
-
<?php else: ?>
|
70 |
-
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
71 |
-
<?php endif; ?>
|
72 |
-
<ul class="add-to-links">
|
73 |
-
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
74 |
-
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
75 |
-
<?php endif; ?>
|
76 |
-
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
77 |
-
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
78 |
-
<?php endif; ?>
|
79 |
-
</ul>
|
80 |
-
</div>
|
81 |
-
</li>
|
82 |
-
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
83 |
-
</ul>
|
84 |
-
<?php endif ?>
|
85 |
-
<?php endforeach ?>
|
86 |
-
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
87 |
-
<?php endif; ?>
|
88 |
-
|
89 |
-
</div>
|
90 |
<?php endif; ?>
|
1 |
+
<?php
|
2 |
+
$_productCollection=$this->getLoadedProductCollection();
|
3 |
+
$_helper = $this->helper('catalog/output');
|
4 |
+
?>
|
5 |
+
<?php if ($_productCollection->count()): ?>
|
6 |
+
<h2><?php echo Mage::helper('quartic')->__('Recommendations'); ?></h2>
|
7 |
+
<div class="category-products">
|
8 |
+
<?php // List mode ?>
|
9 |
+
<?php if($this->getMode()!='grid'): ?>
|
10 |
+
<?php $_iterator = 0; ?>
|
11 |
+
<ol class="products-list" id="products-list">
|
12 |
+
<?php foreach ($_productCollection as $_product): ?>
|
13 |
+
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
|
14 |
+
<?php // Product Image ?>
|
15 |
+
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
16 |
+
<?php // Product description ?>
|
17 |
+
<div class="product-shop">
|
18 |
+
<div class="f-fix">
|
19 |
+
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
|
20 |
+
<h2 class="product-name"><a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
|
21 |
+
<?php if($_product->getRatingSummary()): ?>
|
22 |
+
<?php echo $this->getReviewsSummaryHtml($_product) ?>
|
23 |
+
<?php endif; ?>
|
24 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
25 |
+
<?php if($_product->isSaleable()): ?>
|
26 |
+
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getQuarticAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
|
27 |
+
<?php else: ?>
|
28 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
29 |
+
<?php endif; ?>
|
30 |
+
<div class="desc std">
|
31 |
+
<?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
|
32 |
+
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
|
33 |
+
</div>
|
34 |
+
<ul class="add-to-links">
|
35 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
36 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
37 |
+
<?php endif; ?>
|
38 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
39 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
40 |
+
<?php endif; ?>
|
41 |
+
</ul>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</li>
|
45 |
+
<?php endforeach; ?>
|
46 |
+
</ol>
|
47 |
+
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
|
48 |
+
|
49 |
+
<?php else: ?>
|
50 |
+
|
51 |
+
<?php // Grid Mode ?>
|
52 |
+
|
53 |
+
<?php $_collectionSize = $_productCollection->count() ?>
|
54 |
+
<?php $_columnCount = $this->getColumnCount(); ?>
|
55 |
+
<?php $i=0; foreach ($_productCollection as $_product): ?>
|
56 |
+
<?php if ($i++%$_columnCount==0): ?>
|
57 |
+
<ul class="products-grid">
|
58 |
+
<?php endif ?>
|
59 |
+
<li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
|
60 |
+
<a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
|
61 |
+
<h2 class="product-name"><a href="<?php echo $this->getQuarticUrl($_product) ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
|
62 |
+
<?php if($_product->getRatingSummary()): ?>
|
63 |
+
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
|
64 |
+
<?php endif; ?>
|
65 |
+
<?php echo $this->getPriceHtml($_product, true) ?>
|
66 |
+
<div class="actions">
|
67 |
+
<?php if($_product->isSaleable()): ?>
|
68 |
+
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getQuarticAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
|
69 |
+
<?php else: ?>
|
70 |
+
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
|
71 |
+
<?php endif; ?>
|
72 |
+
<ul class="add-to-links">
|
73 |
+
<?php if ($this->helper('wishlist')->isAllow()) : ?>
|
74 |
+
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
|
75 |
+
<?php endif; ?>
|
76 |
+
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
|
77 |
+
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
|
78 |
+
<?php endif; ?>
|
79 |
+
</ul>
|
80 |
+
</div>
|
81 |
+
</li>
|
82 |
+
<?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
|
83 |
+
</ul>
|
84 |
+
<?php endif ?>
|
85 |
+
<?php endforeach ?>
|
86 |
+
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
|
87 |
+
<?php endif; ?>
|
88 |
+
|
89 |
+
</div>
|
90 |
<?php endif; ?>
|
app/design/frontend/base/default/template/quartic/products/slt_cart.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/products/slt_category.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/products/slt_home.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/products/slt_product.phtml
CHANGED
File without changes
|
app/design/frontend/base/default/template/quartic/script.phtml
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
<?php if ($this->isActive()): ?>
|
2 |
-
<script type="text/javascript">
|
3 |
-
var upsParams = upsParams || [];
|
4 |
-
upsParams.push(['customer', '<?php echo $this->getCustomer(); ?>']);
|
5 |
-
var upsScript = document.createElement('script');
|
6 |
-
upsScript.setAttribute('type','text/javascript');
|
7 |
-
upsScript.setAttribute('src', '//rec.quartic.pl/qon.js');
|
8 |
-
upsScript.setAttribute('async','async');
|
9 |
-
var upsAnchor = document.getElementsByTagName('script')[0];
|
10 |
-
upsAnchor.parentNode.insertBefore(upsScript, upsAnchor);
|
11 |
-
function quartic_rec (recommendations, slot) {
|
12 |
-
var parameters = { slot: slot };
|
13 |
-
var i;
|
14 |
-
var count = recommendations.length;
|
15 |
-
for (var i = 0; i < count; i++) {
|
16 |
-
parameters['sku[' + i + ']'] = recommendations[i][0];
|
17 |
-
parameters['url[' + i + ']'] = recommendations[i][1];
|
18 |
-
}
|
19 |
-
new Ajax.Request('<?php echo Mage::getUrl('quartic/frame/index'); ?>', {
|
20 |
-
method: 'post',
|
21 |
-
parameters: parameters,
|
22 |
-
onSuccess: function(transport) {
|
23 |
-
$(slot).update(transport.responseText);
|
24 |
-
}
|
25 |
-
});
|
26 |
-
}
|
27 |
-
</script>
|
28 |
<?php endif; ?>
|
1 |
+
<?php if ($this->isActive()): ?>
|
2 |
+
<script type="text/javascript">
|
3 |
+
var upsParams = upsParams || [];
|
4 |
+
upsParams.push(['customer', '<?php echo $this->getCustomer(); ?>']);
|
5 |
+
var upsScript = document.createElement('script');
|
6 |
+
upsScript.setAttribute('type','text/javascript');
|
7 |
+
upsScript.setAttribute('src', '//rec.quartic.pl/qon.js');
|
8 |
+
upsScript.setAttribute('async','async');
|
9 |
+
var upsAnchor = document.getElementsByTagName('script')[0];
|
10 |
+
upsAnchor.parentNode.insertBefore(upsScript, upsAnchor);
|
11 |
+
function quartic_rec (recommendations, slot) {
|
12 |
+
var parameters = { slot: slot };
|
13 |
+
var i;
|
14 |
+
var count = recommendations.length;
|
15 |
+
for (var i = 0; i < count; i++) {
|
16 |
+
parameters['sku[' + i + ']'] = recommendations[i][0];
|
17 |
+
parameters['url[' + i + ']'] = recommendations[i][1];
|
18 |
+
}
|
19 |
+
new Ajax.Request('<?php echo Mage::getUrl('quartic/frame/index'); ?>', {
|
20 |
+
method: 'post',
|
21 |
+
parameters: parameters,
|
22 |
+
onSuccess: function(transport) {
|
23 |
+
$(slot).update(transport.responseText);
|
24 |
+
}
|
25 |
+
});
|
26 |
+
}
|
27 |
+
</script>
|
28 |
<?php endif; ?>
|
app/etc/modules/Quarticon_Quartic.xml
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Quarticon_Quartic>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
</Quarticon_Quartic>
|
8 |
-
</modules>
|
9 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Quarticon_Quartic>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Quarticon_Quartic>
|
8 |
+
</modules>
|
9 |
</config>
|
app/locale/pl_PL/Quarticon_Quartic.csv
CHANGED
@@ -76,4 +76,23 @@
|
|
76 |
"Left","Po lewej"
|
77 |
"Bottom","Stopka"
|
78 |
"Middle","Środek"
|
79 |
-
"Right","Po prawej"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
"Left","Po lewej"
|
77 |
"Bottom","Stopka"
|
78 |
"Middle","Środek"
|
79 |
+
"Right","Po prawej"
|
80 |
+
"Composite products","Produkty złożone"
|
81 |
+
"Price type of configurable product","Typ ceny produktu konfigurowalnego"
|
82 |
+
"Configurable children products","Produkty proste przypisane do konfigurowalnych"
|
83 |
+
"Configurable children product image","Obrazek produktów prostych przypisanych do konfigurowalnych"
|
84 |
+
"Configurable children product price","Cena produktów prostych przypisanych do konfigurowalnych"
|
85 |
+
"Redirect simple product to configurable","Przekieruj produkt prosty do konfigurowalnego"
|
86 |
+
"Grouped product price","Cena produktu grupowego"
|
87 |
+
"Grouped children product image","Obrazek produktów prostych przypisanych do grupowych"
|
88 |
+
"Redirect simple product to grouped","Przekieruj produkt prosty do grupowego"
|
89 |
+
"Standard configurable product price","Standardowa cena produktu konfigurowalnego"
|
90 |
+
"Minimum price","Cena minimalna"
|
91 |
+
"Do not show","Nie pokazuj"
|
92 |
+
"Show if possible","Pokaż jeśli to możliwe"
|
93 |
+
"Get from simple product","Pobierz z produktu prostego"
|
94 |
+
"Get from parent product","Pobierz z produktu nadrzędnego"
|
95 |
+
"Minimum from simple products","Minimalna z produktów prostych"
|
96 |
+
"Maximum from simple products","Maksymalna z produktów prostych"
|
97 |
+
"Product visibility in feed","Widoczność produktów wysyłanych do feeda"
|
98 |
+
"Exclude from Quarticon feed","Wyłącz z feeda Quarticon"
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Quarticon_Quartic</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Recommend - personalized product recommendations, by QuarticON.com</description>
|
11 |
<notes>The extension integrates your store with Quartic platform.</notes>
|
12 |
<authors><author><name>QuarticON</name><user>quarticon</user><email>contact@quarticon.com</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Quarticon"><dir name="Quartic"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><file name="Dump.php" hash="6d90575698aeb92c20b7ba8db38fd8d4"/></dir><dir name="History"><file name="Grid.php" hash="a32fe8ab7e02f309ca99b42f18af803b"/></dir><file name="History.php" hash="6d552d7d7a7f404b4ed5a816977b2dc8"/><dir name="Maps"><file name="Grid.php" hash="8fb73376bba86e8b871ae17f18769048"/><dir name="Renderer"><file name="Input.php" hash="a209bbe5b71291c1b3f5f5994fbf5e2f"/><file name="Select.php" hash="0318c06d7f4b62c11800b4ffe4aa62bc"/></dir></dir><file name="Maps.php" hash="9744bd8300dac3e98d089ecf70faa6a2"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Button.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Quarticon_Quartic</name>
|
4 |
+
<version>1.2.3.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Recommend - personalized product recommendations, by QuarticON.com</description>
|
11 |
<notes>The extension integrates your store with Quartic platform.</notes>
|
12 |
<authors><author><name>QuarticON</name><user>quarticon</user><email>contact@quarticon.com</email></author></authors>
|
13 |
+
<date>2016-01-07</date>
|
14 |
+
<time>10:02:22</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Quarticon"><dir name="Quartic"><dir name="Block"><dir name="Adminhtml"><dir name="Api"><file name="Dump.php" hash="6d90575698aeb92c20b7ba8db38fd8d4"/></dir><dir name="History"><file name="Grid.php" hash="a32fe8ab7e02f309ca99b42f18af803b"/></dir><file name="History.php" hash="6d552d7d7a7f404b4ed5a816977b2dc8"/><dir name="Maps"><file name="Grid.php" hash="8fb73376bba86e8b871ae17f18769048"/><dir name="Renderer"><file name="Input.php" hash="a209bbe5b71291c1b3f5f5994fbf5e2f"/><file name="Select.php" hash="0318c06d7f4b62c11800b4ffe4aa62bc"/></dir></dir><file name="Maps.php" hash="9744bd8300dac3e98d089ecf70faa6a2"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Button.php" hash="b9df45e6eb248d41386cb5768396c2ee"/><file name="Placement.php" hash="5d2971165f5976e3a5aaeae7ea966272"/><file name="Register.php" hash="3098ec89d046749ec94aae5fe7b74b49"/><file name="Text.php" hash="65614b678c479b7f02d6ce4f54197946"/></dir><file name="Fieldset.php" hash="29fc8b5212bd5d2c825b55beb9e08dd0"/></dir></dir></dir><dir name="Urls"><file name="Grid.php" hash="e104ebebd5ce12f49b1003068f6c40a7"/></dir><file name="Urls.php" hash="6e4bb1a3dbb25174cd9f7226a7eb3e2a"/></dir><file name="Box.php" hash="67ddbd72ae1c06dfa307bd8d6c00ae4f"/><dir name="Frame"><file name="Cart.php" hash="438a729fe07cc629693f06abe431dff3"/><file name="Category.php" hash="068d3d1062c005482bdbed623d6cf136"/><file name="Home.php" hash="475eae5b390abc205ec9a65a0d8c13ad"/><file name="Product.php" hash="e0854d2407b9048758e47e1dd7d70d94"/></dir><dir name="Getter"><file name="Cart.php" hash="d2b99e59220a32f92596033813698069"/><file name="Order.php" hash="0c13b0eb560fb95e1e73d5fd9689f8b4"/><file name="Product.php" hash="b267c9dbecea690be8aa3d028ce38d75"/></dir><file name="Products.php" hash="282af5d3242c8f13d90dfc19067fc2f7"/><file name="Script.php" hash="4e1173d214e331e68db7f8b3313d4ad6"/></dir><dir name="Helper"><file name="Data.php" hash="5ddf57e608f89502a1c396f40cdbae66"/></dir><dir name="Model"><dir name="Adapter"><file name="Writer.php" hash="66e2f2649ac3ec3f8e8878a3e595ce3c"/></dir><file name="Attribute.php" hash="0e2918e9bb12bae57b63b67b7b048f49"/><file name="Catalog.php" hash="2e0eff970755b82ab1b76e2fe9a5b893"/><dir name="Client"><file name="AbstractCurl.php" hash="dd0e0ddc0885c8224a13a563ab8759bd"/><file name="Api.php" hash="9f46b84f14151c5894407eae7fafb6b4"/><dir name="Resource"><file name="Curl.php" hash="07924c032361218ebf4390a61442c30f"/></dir></dir><file name="Config.php" hash="55df887e00772d843e5d14e7cc380a74"/><file name="Cron.php" hash="1ba762e22d4370c77a1b2c0be5fae3ff"/><file name="Frame.php" hash="073932bb3116a30a269fbe94cb019225"/><file name="History.php" hash="451b494fdd77277b235d2a0d52fcc99c"/><dir name="Insert"><file name="Cart.php" hash="c668360217730c627875560add9ad033"/><file name="Category.php" hash="313ec107fd93bbf07ad40cf754c97197"/><file name="Home.php" hash="ad89be2ba8cdd83827d9d261c056620e"/><file name="Product.php" hash="8d4609828965cc210b83094c157af22d"/></dir><file name="Insert.php" hash="3eac4d73c5d92c077a22106cd8a31651"/><file name="Maps.php" hash="772431aac9f57decc072c91f580ec3f3"/><dir name="Mysql4"><dir name="History"><file name="Collection.php" hash="16c997ad5b0206b64392d64d9986fb40"/></dir><file name="History.php" hash="10ff5200887a7c12cb9b0312acc3a4c5"/><dir name="Maps"><file name="Collection.php" hash="e5a6067327d75240ccf42fc5397332bf"/></dir><file name="Maps.php" hash="bd3dc9f67a482c2f475c1d651abd274a"/><dir name="Placement"><file name="Collection.php" hash="95ac7e3641bb395b3c518b56b85a4985"/></dir><file name="Placement.php" hash="cfaf72514c2cebc604bb14bd79966989"/></dir><dir name="Observer"><file name="Adminhtml.php" hash="495833a35273a01f49273159a4ea2c28"/><file name="Frontend.php" hash="c6028e91a381e0fe43e6685ec9b26e35"/></dir><file name="Order.php" hash="fdf30df406f857a7d8391e9205bc29f6"/><dir name="Placement"><file name="Cart.php" hash="d154c166acb0859d0ef69a81430969f5"/><file name="Category.php" hash="1175fc97b34388bd988393fc2e9a1734"/><file name="Home.php" hash="57a3fa699e54840d341fcfc15fa5a692"/><file name="Product.php" hash="eefb43d29d3945663926d43bcefb587c"/></dir><file name="Placement.php" hash="350264808b4d8a796213ffc69f7e55af"/><file name="Product.php" hash="34c6de23cc0513316463eb7a4096081a"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Configurablechildimage.php" hash="c285087d38df0cdb0d185ed9236edd95"/><file name="Configurablechildprice.php" hash="434b0050a09f54939838980cb8bc5e84"/><file name="Configurablechilds.php" hash="faa8090eade035631f216a1204f8abd4"/><file name="Configurableprice.php" hash="7aff7becec4a7ff8e470aa41ffd4dc71"/><file name="Groupedchildimage.php" hash="73360b50fc0e8081bf2f082ce499e2e7"/><file name="Groupedprice.php" hash="313a4b7c952f3276961c95413ad9edbc"/><file name="Visibility.php" hash="40a6fe7628dae2d75f9ec527d20bbf3c"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ApiController.php" hash="7cf1ad7c2edec2f311a1e3d62f35eeda"/><file name="IndexController.php" hash="aea543c7dc10403eac6b169034a3cee5"/><file name="MapsController.php" hash="6c8c889436b508edbe0b8bb5c2f13dfd"/></dir><file name="FeedController.php" hash="361ed135adb650b7b9520c8446ebb4f3"/><file name="FrameController.php" hash="124801d72b1190909cc3ae82a820e56c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5c26be5cd721f4556f7a7796c0fcafab"/><file name="config.xml" hash="db565915915548e0ec1f2aedbeb5505e"/><file name="system.xml" hash="dfc6cf02c4b98fe18cc9217791cc3528"/></dir><dir name="sql"><dir name="quartic_setup"><file name="mysql4-install-0.1.0.php" hash="9401ab0f64bb44fa0d83e217abc23918"/><file name="mysql4-install-0.1.4.php" hash="3275d471551e31d5ea6ee90d087f6f67"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="678a8b9c6ca4002cbac9b2d13dfd91ed"/><file name="mysql4-upgrade-0.1.7-0.2.0.php" hash="489a892eee6a5bc06e857f20eca2b0c7"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="875dcf3407f4d435d475c00b41252d32"/><file name="mysql4-upgrade-0.2.2-0.2.3.php" hash="ec71434fface0ed6389903a233d95bc8"/><file name="mysql4-upgrade-0.2.3-0.2.4.php" hash="1d89846536ca9de1be313b9db108dcb3"/><file name="mysql4-upgrade-0.2.5-0.2.6.php" hash="52db270d56fabc76c0a2aef1b85b54ac"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="62b390f4161ecf1309b2334bc72c9455"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="68ec9a49e0e6a27ee97d522010c84370"/><file name="mysql4-upgrade-0.3.3-0.3.4.php" hash="3abaa34c22ece6b6a6ae08bf1a5331f3"/><file name="mysql4-upgrade-0.3.4-0.3.5.php" hash="280b2662b37e6c6de936a388fcc7f71a"/><file name="mysql4-upgrade-0.3.5-0.3.6.php" hash="ec9bf15f7d14a85edbf1fcb6126810ef"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="9698bb04f261423686f4cc12faaa04c2"/><file name="mysql4-upgrade-1.1.1-1.2.0.php" hash="1b3a28dea8b60823e6c9ecef958e8176"/><file name="mysql4-upgrade-1.2.0-1.2.3.php" hash="ba1f44e1a8efb7bbb83a58c03b251d60"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="quartic.xml" hash="8c068279123fb5def099e468b87ee79c"/></dir><dir name="template"><dir name="quartic"><dir name="api"><file name="dump.phtml" hash="0fa64e9c2de0698a998679e0d2b2f1eb"/></dir><file name="history.phtml" hash="fe445bb739fcad8ae688944c0188fd41"/><file name="maps.phtml" hash="8f0814d506b1ddc5248f7487e2942d17"/><dir name="system"><dir name="config"><file name="button_register.phtml" hash="f19fdea76b46c5699f1387cf462d467b"/></dir></dir><file name="urls.phtml" hash="3d6c3fb06daad5e31dec6d97692750cc"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="quartic.xml" hash="96a0f31aa65b5ea9e6f92aecb246de72"/><file name="quartic.xml" hash="96a0f31aa65b5ea9e6f92aecb246de72"/></dir><dir name="template"><dir name="quartic"><dir name="frame"><file name="cart.phtml" hash="f7867e13e0bebd593adaab509e7bff71"/><file name="category.phtml" hash="f7867e13e0bebd593adaab509e7bff71"/><file name="home.phtml" hash="f7867e13e0bebd593adaab509e7bff71"/><file name="product.phtml" hash="43b7ffa983e9ad9324b623fce82bef6c"/></dir><dir name="getter"><file name="order.phtml" hash="e9a993d30ef73ff8b74bc0301347862a"/><file name="product.phtml" hash="68fc01a6ae190e73da448cd0b45a2066"/></dir><dir name="products"><file name="slt_cart.phtml" hash="b534e86c913c3e5c7a59956980055e9a"/><file name="slt_category.phtml" hash="b534e86c913c3e5c7a59956980055e9a"/><file name="slt_home.phtml" hash="b534e86c913c3e5c7a59956980055e9a"/><file name="slt_product.phtml" hash="b534e86c913c3e5c7a59956980055e9a"/></dir><file name="products.phtml" hash="82c4f8d4f3b223133acf500313d1ea65"/><file name="script.phtml" hash="07f7b8f0a867c694e4aec1fd26af2199"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Quarticon_Quartic.xml" hash="028268cb01d9e01103b62b265b9dcd7a"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Quarticon_Quartic.csv" hash="44471c7ccb74cefb37a9197c9df8acee"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="quarticon-icon.png" hash="75db9de222be47ea963f5432ef8b3ef3"/></dir><file name="quartic.css" hash="9fef6b352df11c73f1ea3e33041e5fa9"/></dir></dir></dir></target><target name="mage"><dir name="var"><file name="quartic" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/adminhtml/default/default/images/quarticon-icon.png
CHANGED
File without changes
|
skin/adminhtml/default/default/quartic.css
CHANGED
File without changes
|