Version Notes
Version 2.0.7
Download this release
Release Info
Developer | Cosmic Cart, Inc. |
Extension | CosmicCart |
Version | 2.0.7 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.7
- app/code/community/CosmicCart/.DS_Store +0 -0
- app/code/community/CosmicCart/Cosmicapi/etc/config.xml +1 -1
- app/code/community/CosmicCart/Integration/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Block/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Block/Adminhtml/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Block/Adminhtml/Log.php +23 -0
- app/code/community/CosmicCart/Integration/Block/Adminhtml/Log/Grid.php +79 -0
- app/code/community/CosmicCart/Integration/Block/Adminhtml/Log/Grid/Renderer/Severity.php +25 -0
- app/code/community/CosmicCart/Integration/Helper/Data.php +53 -2
- app/code/community/CosmicCart/Integration/Model/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Model/Adminhtml/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Model/Adminhtml/System/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Model/Adminhtml/System/Config/Ean.php +7 -7
- app/code/community/CosmicCart/Integration/Model/Exporter.php +120 -3
- app/code/community/CosmicCart/Integration/Model/Log.php +22 -0
- app/code/community/CosmicCart/Integration/Model/Resource/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/Model/Resource/Log.php +20 -0
- app/code/community/CosmicCart/Integration/Model/Resource/Log/Collection.php +21 -0
- app/code/community/CosmicCart/Integration/Model/System/Config/Source/Configurablepricing.php +28 -0
- app/code/community/CosmicCart/Integration/Model/System/Config/Source/Logginglevel.php +32 -0
- app/code/community/CosmicCart/Integration/controllers/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/controllers/Adminhtml/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/controllers/Adminhtml/Cosmiccart/LoggerController.php +26 -0
- app/code/community/CosmicCart/Integration/etc/config.xml +16 -8
- app/code/community/CosmicCart/Integration/etc/system.xml +19 -0
- app/code/community/CosmicCart/Integration/sql/.DS_Store +0 -0
- app/code/community/CosmicCart/Integration/sql/cosmiccart_integration_setup/upgrade-2.0.6-2.0.7.php +31 -0
- app/design/adminhtml/default/default/layout/cosmiccart/integration.xml +17 -1
- package.xml +5 -5
app/code/community/CosmicCart/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Cosmicapi/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CosmicCart_Cosmicapi>
|
5 |
-
<version>2.0.
|
6 |
</CosmicCart_Cosmicapi>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CosmicCart_Cosmicapi>
|
5 |
+
<version>2.0.7</version>
|
6 |
</CosmicCart_Cosmicapi>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/CosmicCart/Integration/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Block/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Block/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Block/Adminhtml/Log.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
class CosmicCart_Integration_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
|
14 |
+
{
|
15 |
+
public function __construct()
|
16 |
+
{
|
17 |
+
$this->_controller = 'adminhtml_log';
|
18 |
+
$this->_blockGroup = 'cosmiccart_integration';
|
19 |
+
parent::__construct();
|
20 |
+
$this->_headerText = Mage::helper('cosmiccart_integration')->__('Cosmiccart Logs');
|
21 |
+
$this->_removeButton('add');
|
22 |
+
}
|
23 |
+
}
|
app/code/community/CosmicCart/Integration/Block/Adminhtml/Log/Grid.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
15 |
+
{
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
parent::__construct();
|
19 |
+
$this->setId('cosmiccartGrid');
|
20 |
+
$this->setDefaultSort('batch_id');
|
21 |
+
$this->setDefaultDir('ASC');
|
22 |
+
$this->setSaveParametersInSession(true);
|
23 |
+
}
|
24 |
+
|
25 |
+
protected function _prepareCollection()
|
26 |
+
{
|
27 |
+
$collection = Mage::getModel('cosmiccart_integration/log')->getCollection();
|
28 |
+
$this->setCollection($collection);
|
29 |
+
return parent::_prepareCollection();
|
30 |
+
}
|
31 |
+
|
32 |
+
protected function _prepareColumns()
|
33 |
+
{
|
34 |
+
$this->addColumn(
|
35 |
+
'message',
|
36 |
+
array(
|
37 |
+
'header' => Mage::helper('cosmiccart_integration')->__('Message'),
|
38 |
+
'align' => 'left',
|
39 |
+
'index' => 'message',
|
40 |
+
)
|
41 |
+
);
|
42 |
+
|
43 |
+
$this->addColumn(
|
44 |
+
'severity',
|
45 |
+
array(
|
46 |
+
'header' => Mage::helper('cosmiccart_integration')->__('Severity'),
|
47 |
+
'align' => 'left',
|
48 |
+
'width' => '200px',
|
49 |
+
'renderer' => 'cosmiccart_integration/adminhtml_log_grid_renderer_severity',
|
50 |
+
'type' => 'options',
|
51 |
+
'index' => 'severity',
|
52 |
+
'options' => Mage::helper('cosmiccart_integration')->getLoggingOptionsArray()
|
53 |
+
)
|
54 |
+
);
|
55 |
+
|
56 |
+
$this->addColumn(
|
57 |
+
'type',
|
58 |
+
array(
|
59 |
+
'header' => Mage::helper('cosmiccart_integration')->__('Type'),
|
60 |
+
'align' => 'left',
|
61 |
+
'width' => '200px',
|
62 |
+
'index' => 'type',
|
63 |
+
)
|
64 |
+
);
|
65 |
+
|
66 |
+
$this->addColumn(
|
67 |
+
'created_at',
|
68 |
+
array(
|
69 |
+
'header' => Mage::helper('cosmiccart_integration')->__('Date'),
|
70 |
+
'index' => 'created_at',
|
71 |
+
'width' => '160px',
|
72 |
+
'type' => 'datetime',
|
73 |
+
)
|
74 |
+
);
|
75 |
+
|
76 |
+
return parent::_prepareColumns();
|
77 |
+
}
|
78 |
+
|
79 |
+
}
|
app/code/community/CosmicCart/Integration/Block/Adminhtml/Log/Grid/Renderer/Severity.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
class CosmicCart_Integration_Block_Adminhtml_Log_Grid_Renderer_Severity
|
13 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Renders grid column
|
17 |
+
*
|
18 |
+
* @param Varien_Object $row
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function render(Varien_Object $row)
|
22 |
+
{
|
23 |
+
return Mage::helper('cosmiccart_integration')->getLoggingOptionsArray()[$row->getSeverity()];
|
24 |
+
}
|
25 |
+
}
|
app/code/community/CosmicCart/Integration/Helper/Data.php
CHANGED
@@ -16,8 +16,8 @@ class CosmicCart_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
16 |
const CRON_EXPORT_ENABLED = 'cosmiccart/configurable_cron/enable';
|
17 |
const COSMICCART_PAYMENT_METHOD_CODE = 'cosmiccart/options/payment_method';
|
18 |
|
19 |
-
|
20 |
const COSMICCART_API_ENVIRONMENT_PATH = 'cosmiccart/options/environment';
|
|
|
21 |
|
22 |
const COSMICCART_API_STAGING_URL_PATH = 'cosmiccart/options/staging_api_url';
|
23 |
const COSMICCART_API_STAGING_SFTP_PATH = 'cosmiccart/options/staging_api_sftp';
|
@@ -28,6 +28,8 @@ class CosmicCart_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
28 |
const COSMICCART_API_LOCAL_URL_PATH = 'cosmiccart/options/local_api_url';
|
29 |
const COSMICCART_API_LOCAL_SFTP_PATH = 'cosmiccart/options/local_api_sftp';
|
30 |
|
|
|
|
|
31 |
public function checkBatch($batch_id)
|
32 |
{
|
33 |
$batch = Mage::getModel('cosmiccart_integration/batch')->load($batch_id);
|
@@ -45,6 +47,22 @@ class CosmicCart_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
45 |
return Mage::getStoreConfig(self::COSMICCART_PAYMENT_METHOD_CODE);
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
public function getApiUrl()
|
49 |
{
|
50 |
$env = $this->getEnvironment();
|
@@ -80,5 +98,38 @@ class CosmicCart_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
80 |
return $env;
|
81 |
}
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
-
}
|
16 |
const CRON_EXPORT_ENABLED = 'cosmiccart/configurable_cron/enable';
|
17 |
const COSMICCART_PAYMENT_METHOD_CODE = 'cosmiccart/options/payment_method';
|
18 |
|
|
|
19 |
const COSMICCART_API_ENVIRONMENT_PATH = 'cosmiccart/options/environment';
|
20 |
+
const COSMICCART_CONFIGURABLE_PRICING_PATH = 'cosmiccart/export_opt/configurable_pricing';
|
21 |
|
22 |
const COSMICCART_API_STAGING_URL_PATH = 'cosmiccart/options/staging_api_url';
|
23 |
const COSMICCART_API_STAGING_SFTP_PATH = 'cosmiccart/options/staging_api_sftp';
|
28 |
const COSMICCART_API_LOCAL_URL_PATH = 'cosmiccart/options/local_api_url';
|
29 |
const COSMICCART_API_LOCAL_SFTP_PATH = 'cosmiccart/options/local_api_sftp';
|
30 |
|
31 |
+
const COSMICCART_LOGGING_LEVEL_PATH = 'cosmiccart/options/logging_level';
|
32 |
+
|
33 |
public function checkBatch($batch_id)
|
34 |
{
|
35 |
$batch = Mage::getModel('cosmiccart_integration/batch')->load($batch_id);
|
47 |
return Mage::getStoreConfig(self::COSMICCART_PAYMENT_METHOD_CODE);
|
48 |
}
|
49 |
|
50 |
+
public function getConfigurableProductPricingMode()
|
51 |
+
{
|
52 |
+
$mode = Mage::getStoreConfig(self::COSMICCART_CONFIGURABLE_PRICING_PATH);
|
53 |
+
if (empty($mode)) {
|
54 |
+
//Set Configurable Plus Option Pricing if option is not set
|
55 |
+
$mode = CosmicCart_Integration_Model_System_Config_Source_Configurablepricing::COSMICCART_PRICING_CONFIGURABLE_OPTION;
|
56 |
+
}
|
57 |
+
|
58 |
+
return $mode;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getConfigurableProductPricingOption()
|
62 |
+
{
|
63 |
+
return CosmicCart_Integration_Model_System_Config_Source_Configurablepricing::COSMICCART_PRICING_CONFIGURABLE_OPTION;
|
64 |
+
}
|
65 |
+
|
66 |
public function getApiUrl()
|
67 |
{
|
68 |
$env = $this->getEnvironment();
|
98 |
return $env;
|
99 |
}
|
100 |
|
101 |
+
public function getLoggingLevel()
|
102 |
+
{
|
103 |
+
$env = Mage::getStoreConfig(self::COSMICCART_LOGGING_LEVEL_PATH);
|
104 |
+
if (empty($env)) {
|
105 |
+
//Set Logging level to error if not specified
|
106 |
+
$env = CosmicCart_Integration_Model_System_Config_Source_Logginglevel::COSMICCART_LOGGING_ERROR;
|
107 |
+
}
|
108 |
+
|
109 |
+
return $env;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function log($message, $severity = 4, $type = 'exporter')
|
113 |
+
{
|
114 |
+
if ($this->getLoggingLevel() >= $severity) {
|
115 |
+
$log = Mage::getModel('cosmiccart_integration/log');
|
116 |
+
$log->setMessage($message);
|
117 |
+
$log->setSeverity($severity);
|
118 |
+
$log->setType($type);
|
119 |
+
$log->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
|
120 |
+
$log->save();
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
public function getLoggingOptionsArray()
|
125 |
+
{
|
126 |
+
$array = array();
|
127 |
+
foreach (CosmicCart_Integration_Model_System_Config_Source_Logginglevel::toOptionArray() as $option) {
|
128 |
+
$id = $option['value'];
|
129 |
+
$array[$id] = $option['label'];
|
130 |
+
}
|
131 |
+
|
132 |
+
return $array;
|
133 |
+
}
|
134 |
|
135 |
+
}
|
app/code/community/CosmicCart/Integration/Model/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Model/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Model/Adminhtml/System/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Model/Adminhtml/System/Config/Ean.php
CHANGED
@@ -15,20 +15,20 @@ class CosmicCart_Integration_Model_Adminhtml_System_Config_Ean extends Mage_Core
|
|
15 |
public function save()
|
16 |
{
|
17 |
$ean = $this->getValue();
|
18 |
-
|
19 |
// Using the SKU as the attribute causes a SQL error
|
20 |
if (strtolower($ean) == "sku") {
|
21 |
-
Mage::throwException("SKU cannot be used as the EAN/UPC attribute.");
|
22 |
}
|
23 |
-
|
24 |
// Check to see if the attribute they entered is a valid attribute
|
25 |
$attr = Mage::getResourceModel('catalog/eav_attribute')
|
26 |
->loadByCode('catalog_product',$ean);
|
27 |
|
28 |
-
if (!$attr->getId()) {
|
29 |
-
Mage::throwException($ean . ' is not a valid attribute.');
|
30 |
}
|
31 |
-
|
32 |
-
return parent::save();
|
33 |
}
|
34 |
}
|
15 |
public function save()
|
16 |
{
|
17 |
$ean = $this->getValue();
|
18 |
+
|
19 |
// Using the SKU as the attribute causes a SQL error
|
20 |
if (strtolower($ean) == "sku") {
|
21 |
+
Mage::throwException("SKU cannot be used as the EAN/UPC attribute.");
|
22 |
}
|
23 |
+
|
24 |
// Check to see if the attribute they entered is a valid attribute
|
25 |
$attr = Mage::getResourceModel('catalog/eav_attribute')
|
26 |
->loadByCode('catalog_product',$ean);
|
27 |
|
28 |
+
if (!$attr->getId() && ($ean != "")) {
|
29 |
+
Mage::throwException($ean . ' is not a valid attribute.');
|
30 |
}
|
31 |
+
|
32 |
+
return parent::save();
|
33 |
}
|
34 |
}
|
app/code/community/CosmicCart/Integration/Model/Exporter.php
CHANGED
@@ -42,8 +42,10 @@ class CosmicCart_Integration_Model_Exporter
|
|
42 |
|
43 |
//Prevent duplicated CRON running same time
|
44 |
if (self::$_batchGenerateCron == true) {
|
|
|
45 |
return $this;
|
46 |
}
|
|
|
47 |
$this->exportCatalog('new');
|
48 |
|
49 |
self::$_batchGenerateCron = true;
|
@@ -70,6 +72,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
70 |
$this->exportCatalog();
|
71 |
} Catch (Exception $e) {
|
72 |
$process->setStatus($status);
|
|
|
73 |
Mage::throwException($e);
|
74 |
}
|
75 |
|
@@ -159,6 +162,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
159 |
$row['num_of_times_retried'] = $row['num_of_times_retried'] + 1;
|
160 |
$data['num_of_times_retried'] = $row['num_of_times_retried'];
|
161 |
$data['comment'] = $error->getMessage();
|
|
|
162 |
|
163 |
$where = $this->_getWriteConnection()->quoteInto('batch_id =?', $row['batch_id']);
|
164 |
$this->_getWriteConnection()->update($this->_getTableName('cosmiccart_integration/batch'), $data, $where);
|
@@ -178,6 +182,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
178 |
|
179 |
private function _handleStage0($row, $store)
|
180 |
{
|
|
|
181 |
// First, let's find all the configurable products that are visible and enabled (PRODUCT)
|
182 |
$configurables_collection = $this->_getConfigurablesCollection($store);
|
183 |
$simple_collection = $this->_getSimplesCollection($store);
|
@@ -186,6 +191,9 @@ class CosmicCart_Integration_Model_Exporter
|
|
186 |
$configurables_collection_count = $configurables_collection->getSize();
|
187 |
$simple_collection_count = $simple_collection->getSize();
|
188 |
|
|
|
|
|
|
|
189 |
// Update the row count now
|
190 |
$data = array();
|
191 |
$data['total_row_count'] = $simple_collection_count;
|
@@ -206,6 +214,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
206 |
|
207 |
private function _handleStage1($row)
|
208 |
{
|
|
|
209 |
$data = array();
|
210 |
$data['current_stage'] = 2;
|
211 |
$data['comment'] = 'Processing rows';
|
@@ -218,10 +227,14 @@ class CosmicCart_Integration_Model_Exporter
|
|
218 |
|
219 |
private function _handleStage2($row, $store, $currency)
|
220 |
{
|
|
|
221 |
// Process the export
|
222 |
$configurables_collection = $this->_getConfigurablesCollection($store);
|
223 |
$simple_collection = $this->_getSimplesCollection($store);
|
224 |
|
|
|
|
|
|
|
225 |
// Work on configurable first
|
226 |
try {
|
227 |
$numWritten = 0;
|
@@ -237,6 +250,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
237 |
);
|
238 |
}
|
239 |
} catch (Exception $e) {
|
|
|
240 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage() . " - " . time(), null, 'cosmiccart-export.log');
|
241 |
Mage::getModel('cosmiccart_integration/mail')->sendEmail(
|
242 |
'cosmiccart_integration_import_exception_tpl',
|
@@ -268,6 +282,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
268 |
}
|
269 |
} catch (Exception $e) {
|
270 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage() . " - " . time(), null, 'cosmiccart-export.log');
|
|
|
271 |
Mage::getModel('cosmiccart_integration/mail')->sendEmail(
|
272 |
'cosmiccart_integration_import_exception_tpl',
|
273 |
'api-fallback@cosmiccart.com',
|
@@ -298,6 +313,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
298 |
|
299 |
private function _handleStage3($row)
|
300 |
{
|
|
|
301 |
// Merge the files
|
302 |
// File path of final result
|
303 |
$exportDir = $this->_getExportDir();
|
@@ -339,6 +355,8 @@ class CosmicCart_Integration_Model_Exporter
|
|
339 |
|
340 |
private function _handleStage4($row, $client)
|
341 |
{
|
|
|
|
|
342 |
$sftpServer = Mage::helper('cosmiccart_integration')->getSftpUrl();
|
343 |
|
344 |
// Upload FTP
|
@@ -355,6 +373,8 @@ class CosmicCart_Integration_Model_Exporter
|
|
355 |
$exportDir = $this->_getExportDir();
|
356 |
$exportReadyFile = $exportDir . DS . $row['batch_id'] . '.gz';
|
357 |
|
|
|
|
|
358 |
$connection->put($sftpTargetFile, $exportReadyFile, NET_SFTP_LOCAL_FILE);
|
359 |
$connection->disconnect();
|
360 |
|
@@ -463,6 +483,8 @@ class CosmicCart_Integration_Model_Exporter
|
|
463 |
*/
|
464 |
private function exportCollection($store, $currency, $collectionCounter, $collection, $number_of_processed_row, $batchId, $isConfigurable)
|
465 |
{
|
|
|
|
|
466 |
$stopNow = false;
|
467 |
|
468 |
$this->_exportStoreId = $store;
|
@@ -476,6 +498,7 @@ class CosmicCart_Integration_Model_Exporter
|
|
476 |
|
477 |
do {
|
478 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . "Batch Started: " . $number_of_processed_row . " - " . time(), null, 'cosmiccart-export.log');
|
|
|
479 |
|
480 |
if (Mage::helper('cosmiccart_integration')->checkBatch($batchId) != $batchId) {
|
481 |
throw new Exception('User cancelled');
|
@@ -575,9 +598,23 @@ class CosmicCart_Integration_Model_Exporter
|
|
575 |
if ($attr) {
|
576 |
$child->setData($attributeCode, $attr);
|
577 |
$value = $child->getAttributeText($attributeCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
$data[] = array(
|
579 |
'attribute' => $label,
|
580 |
-
'value' => $value
|
|
|
|
|
|
|
|
|
|
|
581 |
);
|
582 |
}
|
583 |
}
|
@@ -588,11 +625,14 @@ class CosmicCart_Integration_Model_Exporter
|
|
588 |
|
589 |
public function exportCollectionCallback($product)
|
590 |
{
|
|
|
|
|
591 |
$helper = Mage::helper('core');
|
592 |
$storeId = $this->_exportStoreId;
|
593 |
|
594 |
-
$
|
595 |
-
$
|
|
|
596 |
|
597 |
$brandType = $this->_getBrandAttributeType();
|
598 |
if (is_null($brandType)) {
|
@@ -672,6 +712,10 @@ class CosmicCart_Integration_Model_Exporter
|
|
672 |
$attributes = $this->_getConfigurableAttributes($parentSku, $product);
|
673 |
$result['attributes'] = $attributes;
|
674 |
|
|
|
|
|
|
|
|
|
675 |
//Handle product export here for each product
|
676 |
$this->_exportData[] = $helper->jsonEncode($result);
|
677 |
}
|
@@ -688,6 +732,79 @@ class CosmicCart_Integration_Model_Exporter
|
|
688 |
return $this;
|
689 |
}
|
690 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
691 |
private function _getConfigurableTypeInstance()
|
692 |
{
|
693 |
if (!$this->_configurableTypeInstance) {
|
42 |
|
43 |
//Prevent duplicated CRON running same time
|
44 |
if (self::$_batchGenerateCron == true) {
|
45 |
+
Mage::helper('cosmiccart_integration')->log('Duplicated cron job already running', 4, 'exporter');
|
46 |
return $this;
|
47 |
}
|
48 |
+
Mage::helper('cosmiccart_integration')->log('Generating batch', 4, 'exporter');
|
49 |
$this->exportCatalog('new');
|
50 |
|
51 |
self::$_batchGenerateCron = true;
|
72 |
$this->exportCatalog();
|
73 |
} Catch (Exception $e) {
|
74 |
$process->setStatus($status);
|
75 |
+
Mage::helper('cosmiccart_integration')->log($e, 1, 'exporter');
|
76 |
Mage::throwException($e);
|
77 |
}
|
78 |
|
162 |
$row['num_of_times_retried'] = $row['num_of_times_retried'] + 1;
|
163 |
$data['num_of_times_retried'] = $row['num_of_times_retried'];
|
164 |
$data['comment'] = $error->getMessage();
|
165 |
+
Mage::helper('cosmiccart_integration')->log($error->getMessage(), 1, 'exporter');
|
166 |
|
167 |
$where = $this->_getWriteConnection()->quoteInto('batch_id =?', $row['batch_id']);
|
168 |
$this->_getWriteConnection()->update($this->_getTableName('cosmiccart_integration/batch'), $data, $where);
|
182 |
|
183 |
private function _handleStage0($row, $store)
|
184 |
{
|
185 |
+
Mage::helper('cosmiccart_integration')->log('Beginning stage 0', 4, 'exporter');
|
186 |
// First, let's find all the configurable products that are visible and enabled (PRODUCT)
|
187 |
$configurables_collection = $this->_getConfigurablesCollection($store);
|
188 |
$simple_collection = $this->_getSimplesCollection($store);
|
191 |
$configurables_collection_count = $configurables_collection->getSize();
|
192 |
$simple_collection_count = $simple_collection->getSize();
|
193 |
|
194 |
+
Mage::helper('cosmiccart_integration')->log("Found $configurables_collection_count configurable products", 4, 'exporter');
|
195 |
+
Mage::helper('cosmiccart_integration')->log("Found $simple_collection_count simple products", 4, 'exporter');
|
196 |
+
|
197 |
// Update the row count now
|
198 |
$data = array();
|
199 |
$data['total_row_count'] = $simple_collection_count;
|
214 |
|
215 |
private function _handleStage1($row)
|
216 |
{
|
217 |
+
Mage::helper('cosmiccart_integration')->log('Beginning stage 1', 4, 'exporter');
|
218 |
$data = array();
|
219 |
$data['current_stage'] = 2;
|
220 |
$data['comment'] = 'Processing rows';
|
227 |
|
228 |
private function _handleStage2($row, $store, $currency)
|
229 |
{
|
230 |
+
Mage::helper('cosmiccart_integration')->log('Beginning stage 2', 4, 'exporter');
|
231 |
// Process the export
|
232 |
$configurables_collection = $this->_getConfigurablesCollection($store);
|
233 |
$simple_collection = $this->_getSimplesCollection($store);
|
234 |
|
235 |
+
Mage::helper('cosmiccart_integration')->log('Found ' . $configurables_collection->getSize() . ' configurable products', 4, 'exporter');
|
236 |
+
Mage::helper('cosmiccart_integration')->log('Found ' . $simple_collection->getSize() . ' simple products', 4, 'exporter');
|
237 |
+
|
238 |
// Work on configurable first
|
239 |
try {
|
240 |
$numWritten = 0;
|
250 |
);
|
251 |
}
|
252 |
} catch (Exception $e) {
|
253 |
+
Mage::helper('cosmiccart_integration')->log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage(), 1, 'exporter');
|
254 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage() . " - " . time(), null, 'cosmiccart-export.log');
|
255 |
Mage::getModel('cosmiccart_integration/mail')->sendEmail(
|
256 |
'cosmiccart_integration_import_exception_tpl',
|
282 |
}
|
283 |
} catch (Exception $e) {
|
284 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage() . " - " . time(), null, 'cosmiccart-export.log');
|
285 |
+
Mage::helper('cosmiccart_integration')->log(__FILE__ . ' ' . __LINE__ . ' ' . " Error: " . $e->getMessage(), 1, 'exporter');
|
286 |
Mage::getModel('cosmiccart_integration/mail')->sendEmail(
|
287 |
'cosmiccart_integration_import_exception_tpl',
|
288 |
'api-fallback@cosmiccart.com',
|
313 |
|
314 |
private function _handleStage3($row)
|
315 |
{
|
316 |
+
Mage::helper('cosmiccart_integration')->log('Beginning stage 3', 4, 'exporter');
|
317 |
// Merge the files
|
318 |
// File path of final result
|
319 |
$exportDir = $this->_getExportDir();
|
355 |
|
356 |
private function _handleStage4($row, $client)
|
357 |
{
|
358 |
+
Mage::helper('cosmiccart_integration')->log('Beginning stage 4', 4, 'exporter');
|
359 |
+
|
360 |
$sftpServer = Mage::helper('cosmiccart_integration')->getSftpUrl();
|
361 |
|
362 |
// Upload FTP
|
373 |
$exportDir = $this->_getExportDir();
|
374 |
$exportReadyFile = $exportDir . DS . $row['batch_id'] . '.gz';
|
375 |
|
376 |
+
Mage::helper('cosmiccart_integration')->log("Uploading $exportReadyFile", 4, 'exporter');
|
377 |
+
|
378 |
$connection->put($sftpTargetFile, $exportReadyFile, NET_SFTP_LOCAL_FILE);
|
379 |
$connection->disconnect();
|
380 |
|
483 |
*/
|
484 |
private function exportCollection($store, $currency, $collectionCounter, $collection, $number_of_processed_row, $batchId, $isConfigurable)
|
485 |
{
|
486 |
+
Mage::helper('cosmiccart_integration')->log('Beginning exportCollection', 4, 'exporter');
|
487 |
+
|
488 |
$stopNow = false;
|
489 |
|
490 |
$this->_exportStoreId = $store;
|
498 |
|
499 |
do {
|
500 |
Mage::log(__FILE__ . ' ' . __LINE__ . ' ' . "Batch Started: " . $number_of_processed_row . " - " . time(), null, 'cosmiccart-export.log');
|
501 |
+
Mage::helper('cosmiccart_integration')->log("Batch Started: $number_of_processed_row", 4, 'exporter');
|
502 |
|
503 |
if (Mage::helper('cosmiccart_integration')->checkBatch($batchId) != $batchId) {
|
504 |
throw new Exception('User cancelled');
|
598 |
if ($attr) {
|
599 |
$child->setData($attributeCode, $attr);
|
600 |
$value = $child->getAttributeText($attributeCode);
|
601 |
+
$optionPricing = null;
|
602 |
+
foreach ($attribute['values'] as $option) {
|
603 |
+
if ($option['label'] == $value) {
|
604 |
+
$optionPricing = array(
|
605 |
+
'is_percent' => $option['is_percent'],
|
606 |
+
'pricing_value' => $option['pricing_value']
|
607 |
+
);
|
608 |
+
}
|
609 |
+
}
|
610 |
$data[] = array(
|
611 |
'attribute' => $label,
|
612 |
+
'value' => $value,
|
613 |
+
'optionPricing' => $optionPricing,
|
614 |
+
'parentPricing' => array(
|
615 |
+
'price' => $parent->getPrice(),
|
616 |
+
'specialPrice' => $parent->getSpecialPrice()
|
617 |
+
)
|
618 |
);
|
619 |
}
|
620 |
}
|
625 |
|
626 |
public function exportCollectionCallback($product)
|
627 |
{
|
628 |
+
Mage::helper('cosmiccart_integration')->log('Exporting ' . $product->getRawItemType() . ' sku ' . $product->getSku(), 4, 'exporter');
|
629 |
+
|
630 |
$helper = Mage::helper('core');
|
631 |
$storeId = $this->_exportStoreId;
|
632 |
|
633 |
+
$pricing = $this->_getSimplePrice($product);
|
634 |
+
$price = $pricing['price'];
|
635 |
+
$specialPrice = $pricing['specialPrice'];
|
636 |
|
637 |
$brandType = $this->_getBrandAttributeType();
|
638 |
if (is_null($brandType)) {
|
712 |
$attributes = $this->_getConfigurableAttributes($parentSku, $product);
|
713 |
$result['attributes'] = $attributes;
|
714 |
|
715 |
+
$pricing = $this->_getVariantPrice($product, $attributes);
|
716 |
+
$result['price'] = $pricing['price'];
|
717 |
+
$result['special_price'] = $pricing['price'];
|
718 |
+
|
719 |
//Handle product export here for each product
|
720 |
$this->_exportData[] = $helper->jsonEncode($result);
|
721 |
}
|
732 |
return $this;
|
733 |
}
|
734 |
|
735 |
+
/**
|
736 |
+
* Returns an array with the variant pricing depending on what pricing mode is set
|
737 |
+
*
|
738 |
+
* @param $product
|
739 |
+
* @param $attributes
|
740 |
+
* @return array $pricing
|
741 |
+
*/
|
742 |
+
private function _getVariantPrice($product, $attributes)
|
743 |
+
{
|
744 |
+
$helper = Mage::helper('cosmiccart_integration');
|
745 |
+
|
746 |
+
if ($helper->getConfigurableProductPricingMode() == $helper->getConfigurableProductPricingOption()) {
|
747 |
+
return $this->_getConfigurableProductPricing($product, $attributes);
|
748 |
+
}
|
749 |
+
|
750 |
+
return $this->_getSimplePrice($product);
|
751 |
+
}
|
752 |
+
|
753 |
+
/**
|
754 |
+
* Returns an array with the Configurable Plus Option Pricing variant pricing
|
755 |
+
*
|
756 |
+
* @param $product
|
757 |
+
* @param $attributes
|
758 |
+
* @return array $pricing
|
759 |
+
*/
|
760 |
+
private function _getConfigurableProductPricing($product, $attributes)
|
761 |
+
{
|
762 |
+
$price = $attributes[0]['parentPricing']['price'];
|
763 |
+
$specialPrice = $attributes[0]['parentPricing']['specialPrice'];
|
764 |
+
|
765 |
+
foreach ($attributes as $attribute) {
|
766 |
+
if ($attribute['optionPricing']['is_percent'] == 1) {
|
767 |
+
$price += ($price * $attribute['optionPricing']['pricing_value']);
|
768 |
+
$specialPrice += ($specialPrice * $attribute['optionPricing']['pricing_value']);
|
769 |
+
} else {
|
770 |
+
$price += $attribute['optionPricing']['pricing_value'];
|
771 |
+
$specialPrice += $attribute['optionPricing']['pricing_value'];
|
772 |
+
}
|
773 |
+
}
|
774 |
+
|
775 |
+
return array(
|
776 |
+
'price' => $this->_formatPrice($price),
|
777 |
+
'specialPrice' => $this->_formatPrice($specialPrice)
|
778 |
+
);
|
779 |
+
}
|
780 |
+
|
781 |
+
/**
|
782 |
+
* Returns an array with the regular price and special price
|
783 |
+
*
|
784 |
+
* @param $product
|
785 |
+
* @return array $pricing
|
786 |
+
*/
|
787 |
+
private function _getSimplePrice($product)
|
788 |
+
{
|
789 |
+
$price = $product->getPrice();
|
790 |
+
$specialPrice = $product->getSpecialPrice();
|
791 |
+
|
792 |
+
return array(
|
793 |
+
'price' => $this->_formatPrice($price),
|
794 |
+
'specialPrice' => $this->_formatPrice($specialPrice)
|
795 |
+
);
|
796 |
+
}
|
797 |
+
|
798 |
+
/**
|
799 |
+
* Returns a number value with two decimals and no thousands separator
|
800 |
+
*
|
801 |
+
* @param $price
|
802 |
+
* @return $formatted_price
|
803 |
+
*/
|
804 |
+
private function _formatPrice($price) {
|
805 |
+
return $price ? number_format($price, 2, ".", "") : null;
|
806 |
+
}
|
807 |
+
|
808 |
private function _getConfigurableTypeInstance()
|
809 |
{
|
810 |
if (!$this->_configurableTypeInstance) {
|
app/code/community/CosmicCart/Integration/Model/Log.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Model_Log extends Mage_Core_Model_Abstract
|
15 |
+
{
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->_init('cosmiccart_integration/log');
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
app/code/community/CosmicCart/Integration/Model/Resource/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/Model/Resource/Log.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Abstract
|
15 |
+
{
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
$this->_init('cosmiccart_integration/log', 'id');
|
19 |
+
}
|
20 |
+
}
|
app/code/community/CosmicCart/Integration/Model/Resource/Log/Collection.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Model_Resource_Log_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
15 |
+
{
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->_init('cosmiccart_integration/log');
|
20 |
+
}
|
21 |
+
}
|
app/code/community/CosmicCart/Integration/Model/System/Config/Source/Configurablepricing.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Model_System_Config_Source_Configurablepricing
|
15 |
+
{
|
16 |
+
const COSMICCART_PRICING_CONFIGURABLE_OPTION = 1;
|
17 |
+
const COSMICCART_PRICING_SIMPLE = 2;
|
18 |
+
|
19 |
+
|
20 |
+
public function toOptionArray()
|
21 |
+
{
|
22 |
+
return array(
|
23 |
+
array('value' => self::COSMICCART_PRICING_CONFIGURABLE_OPTION, 'label' => Mage::helper('cosmiccart_integration')->__('Configurable Plus Option Pricing')),
|
24 |
+
array('value' => self::COSMICCART_PRICING_SIMPLE, 'label' => Mage::helper('cosmiccart_integration')->__('Simple Product Pricing'))
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
app/code/community/CosmicCart/Integration/Model/System/Config/Source/Logginglevel.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
class CosmicCart_Integration_Model_System_Config_Source_Logginglevel
|
15 |
+
{
|
16 |
+
const COSMICCART_LOGGING_ERROR = 1;
|
17 |
+
const COSMICCART_LOGGING_WARN = 2;
|
18 |
+
const COSMICCART_LOGGING_INFO = 3;
|
19 |
+
const COSMICCART_LOGGING_VERBOSE = 4;
|
20 |
+
|
21 |
+
|
22 |
+
public function toOptionArray()
|
23 |
+
{
|
24 |
+
return array(
|
25 |
+
array('value' => self::COSMICCART_LOGGING_ERROR, 'label' => Mage::helper('cosmiccart_integration')->__('Error')),
|
26 |
+
array('value' => self::COSMICCART_LOGGING_WARN, 'label' => Mage::helper('cosmiccart_integration')->__('Warn')),
|
27 |
+
array('value' => self::COSMICCART_LOGGING_INFO, 'label' => Mage::helper('cosmiccart_integration')->__('Info')),
|
28 |
+
array('value' => self::COSMICCART_LOGGING_VERBOSE, 'label' => Mage::helper('cosmiccart_integration')->__('Verbose'))
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
}
|
app/code/community/CosmicCart/Integration/controllers/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/controllers/Adminhtml/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/controllers/Adminhtml/Cosmiccart/LoggerController.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
class CosmicCart_Integration_Adminhtml_Cosmiccart_LoggerController extends Mage_Adminhtml_Controller_Action
|
14 |
+
{
|
15 |
+
|
16 |
+
public function indexAction()
|
17 |
+
{
|
18 |
+
$this->loadLayout();
|
19 |
+
$this->renderLayout();
|
20 |
+
}
|
21 |
+
|
22 |
+
public function gridAction()
|
23 |
+
{
|
24 |
+
$this->loadLayout()->renderLayout();
|
25 |
+
}
|
26 |
+
}
|
app/code/community/CosmicCart/Integration/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CosmicCart_Integration>
|
5 |
-
<version>2.0.
|
6 |
</CosmicCart_Integration>
|
7 |
</modules>
|
8 |
|
@@ -24,6 +24,9 @@
|
|
24 |
<batch>
|
25 |
<table>cosmiccart_batch_status</table>
|
26 |
</batch>
|
|
|
|
|
|
|
27 |
</entities>
|
28 |
</cosmiccart_integration_resource>
|
29 |
</models>
|
@@ -93,7 +96,7 @@
|
|
93 |
<adminhtml>
|
94 |
<args>
|
95 |
<modules>
|
96 |
-
<
|
97 |
</modules>
|
98 |
</args>
|
99 |
</adminhtml>
|
@@ -104,14 +107,14 @@
|
|
104 |
<resources>
|
105 |
<admin>
|
106 |
<children>
|
107 |
-
<
|
108 |
<children>
|
109 |
<integration_activation>
|
110 |
<title>Activation</title>
|
111 |
</integration_activation>
|
112 |
</children>
|
113 |
<sort_order>1</sort_order>
|
114 |
-
</
|
115 |
<system>
|
116 |
<children>
|
117 |
<config>
|
@@ -142,23 +145,28 @@
|
|
142 |
<sort_order>2</sort_order>
|
143 |
<action>adminhtml/integration_batch</action>
|
144 |
</integration_batch>
|
|
|
|
|
|
|
|
|
|
|
145 |
</children>
|
146 |
</cosmiccart>
|
147 |
</menu>
|
148 |
<translate>
|
149 |
<modules>
|
150 |
-
<
|
151 |
<files>
|
152 |
<default>CosmicCart_Integration.csv</default>
|
153 |
</files>
|
154 |
-
</
|
155 |
</modules>
|
156 |
</translate>
|
157 |
<layout>
|
158 |
<updates>
|
159 |
-
<
|
160 |
<file>cosmiccart/integration.xml</file>
|
161 |
-
</
|
162 |
</updates>
|
163 |
</layout>
|
164 |
</adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CosmicCart_Integration>
|
5 |
+
<version>2.0.7</version>
|
6 |
</CosmicCart_Integration>
|
7 |
</modules>
|
8 |
|
24 |
<batch>
|
25 |
<table>cosmiccart_batch_status</table>
|
26 |
</batch>
|
27 |
+
<log>
|
28 |
+
<table>cosmiccart_log</table>
|
29 |
+
</log>
|
30 |
</entities>
|
31 |
</cosmiccart_integration_resource>
|
32 |
</models>
|
96 |
<adminhtml>
|
97 |
<args>
|
98 |
<modules>
|
99 |
+
<cosmiccart_integration before="Mage_Adminhtml">CosmicCart_Integration_Adminhtml</cosmiccart_integration>
|
100 |
</modules>
|
101 |
</args>
|
102 |
</adminhtml>
|
107 |
<resources>
|
108 |
<admin>
|
109 |
<children>
|
110 |
+
<cosmiccart_integration translate="title" module="cosmiccart_integration">
|
111 |
<children>
|
112 |
<integration_activation>
|
113 |
<title>Activation</title>
|
114 |
</integration_activation>
|
115 |
</children>
|
116 |
<sort_order>1</sort_order>
|
117 |
+
</cosmiccart_integration>
|
118 |
<system>
|
119 |
<children>
|
120 |
<config>
|
145 |
<sort_order>2</sort_order>
|
146 |
<action>adminhtml/integration_batch</action>
|
147 |
</integration_batch>
|
148 |
+
<logviewer module="cosmiccart_integration">
|
149 |
+
<title>Log Viewer</title>
|
150 |
+
<sort_order>3</sort_order>
|
151 |
+
<action>adminhtml/cosmiccart_logger</action>
|
152 |
+
</logviewer>
|
153 |
</children>
|
154 |
</cosmiccart>
|
155 |
</menu>
|
156 |
<translate>
|
157 |
<modules>
|
158 |
+
<cosmiccart_integration>
|
159 |
<files>
|
160 |
<default>CosmicCart_Integration.csv</default>
|
161 |
</files>
|
162 |
+
</cosmiccart_integration>
|
163 |
</modules>
|
164 |
</translate>
|
165 |
<layout>
|
166 |
<updates>
|
167 |
+
<cosmiccart_integration>
|
168 |
<file>cosmiccart/integration.xml</file>
|
169 |
+
</cosmiccart_integration>
|
170 |
</updates>
|
171 |
</layout>
|
172 |
</adminhtml>
|
app/code/community/CosmicCart/Integration/etc/system.xml
CHANGED
@@ -106,6 +106,15 @@
|
|
106 |
<show_in_store>0</show_in_store>
|
107 |
<source_model>cosmiccart_integration/system_config_source_environment</source_model>
|
108 |
</environment>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
</fields>
|
110 |
</options>
|
111 |
<export_opt translate="label" module="cosmiccart_integration">
|
@@ -143,6 +152,16 @@
|
|
143 |
<comment>Code of attribute which represents UPC/EAN</comment>
|
144 |
<backend_model>cosmiccart_integration/adminhtml_system_config_ean</backend_model>
|
145 |
</ean_attr_code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
</fields>
|
147 |
</export_opt>
|
148 |
</groups>
|
106 |
<show_in_store>0</show_in_store>
|
107 |
<source_model>cosmiccart_integration/system_config_source_environment</source_model>
|
108 |
</environment>
|
109 |
+
<logging_level translate="label">
|
110 |
+
<label>Logging Level</label>
|
111 |
+
<frontend_type>select</frontend_type>
|
112 |
+
<sort_order>40</sort_order>
|
113 |
+
<show_in_default>1</show_in_default>
|
114 |
+
<show_in_website>0</show_in_website>
|
115 |
+
<show_in_store>0</show_in_store>
|
116 |
+
<source_model>cosmiccart_integration/system_config_source_logginglevel</source_model>
|
117 |
+
</logging_level>
|
118 |
</fields>
|
119 |
</options>
|
120 |
<export_opt translate="label" module="cosmiccart_integration">
|
152 |
<comment>Code of attribute which represents UPC/EAN</comment>
|
153 |
<backend_model>cosmiccart_integration/adminhtml_system_config_ean</backend_model>
|
154 |
</ean_attr_code>
|
155 |
+
<configurable_pricing translate="label">
|
156 |
+
<label>Configurable Product Pricing</label>
|
157 |
+
<frontend_type>select</frontend_type>
|
158 |
+
<sort_order>130</sort_order>
|
159 |
+
<show_in_default>1</show_in_default>
|
160 |
+
<show_in_website>0</show_in_website>
|
161 |
+
<show_in_store>0</show_in_store>
|
162 |
+
<comment>Use the default configurable price plus option prices or the simple product price for variants</comment>
|
163 |
+
<source_model>cosmiccart_integration/system_config_source_configurablepricing</source_model>
|
164 |
+
</configurable_pricing>
|
165 |
</fields>
|
166 |
</export_opt>
|
167 |
</groups>
|
app/code/community/CosmicCart/Integration/sql/.DS_Store
ADDED
Binary file
|
app/code/community/CosmicCart/Integration/sql/cosmiccart_integration_setup/upgrade-2.0.6-2.0.7.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Cosmic Cart license, a commercial license.
|
6 |
+
*
|
7 |
+
* @category CosmicCart
|
8 |
+
* @package Integration
|
9 |
+
* @copyright Copyright (c) 2015 Cosmic Cart, Inc.
|
10 |
+
* @license CosmicCart Software License https://cosmiccart.com/help/license/software
|
11 |
+
*/
|
12 |
+
|
13 |
+
|
14 |
+
$installer = $this;
|
15 |
+
$installer->startSetup();
|
16 |
+
|
17 |
+
$table = $installer->getConnection()
|
18 |
+
->newTable($installer->getTable('cosmiccart_log'))
|
19 |
+
->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
20 |
+
'identity' => true,
|
21 |
+
'unsigned' => true,
|
22 |
+
'nullable' => false,
|
23 |
+
'primary' => true
|
24 |
+
))
|
25 |
+
->addColumn('message', Varien_Db_Ddl_Table::TYPE_TEXT, '64k', array(),'Message')
|
26 |
+
->addColumn('severity', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(),'Severity')
|
27 |
+
->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(),'Type')
|
28 |
+
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(),'Created At');
|
29 |
+
$installer->getConnection()->createTable($table);
|
30 |
+
|
31 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/cosmiccart/integration.xml
CHANGED
@@ -10,4 +10,20 @@
|
|
10 |
<block type="cosmiccart_integration/adminhtml_cosmiccart" name="cosmiccart"/>
|
11 |
</reference>
|
12 |
</adminhtml_integration_batch_index>
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
<block type="cosmiccart_integration/adminhtml_cosmiccart" name="cosmiccart"/>
|
11 |
</reference>
|
12 |
</adminhtml_integration_batch_index>
|
13 |
+
|
14 |
+
<adminhtml_cosmiccart_logger_index>
|
15 |
+
<reference name="menu">
|
16 |
+
<action method="setActive">
|
17 |
+
<menupath>cosmiccart/logviewer</menupath>
|
18 |
+
</action>
|
19 |
+
</reference>
|
20 |
+
<reference name="content">
|
21 |
+
<block type="cosmiccart_integration/adminhtml_log" name="log" />
|
22 |
+
</reference>
|
23 |
+
</adminhtml_cosmiccart_logger_index>
|
24 |
+
<adminhtml_cosmiccart_logger_grid>
|
25 |
+
<block type="core/text_list" name="root" output="toHtml">
|
26 |
+
<block type="cosmiccart_integration/adminhtml_log_grid" name="log_grid"/>
|
27 |
+
</block>
|
28 |
+
</adminhtml_cosmiccart_logger_grid>
|
29 |
+
</layout>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cosmic_Cart</name>
|
4 |
-
<version>2.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://cosmiccart.com/help/license/software">CosmicCart Software License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Cosmic Cart</summary>
|
10 |
<description>Cosmic Cart</description>
|
11 |
-
<notes>Version 2.0.
|
12 |
<authors><author><name>Cosmic Cart, Inc.</name><user>cosmiccart</user><email>info@cosmiccart.com</email></author></authors>
|
13 |
-
<date>2016-03-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="CosmicCart"><dir name="Cosmicapi"><dir name="Helper"><file name="Data.php" hash="beb4f6961e2de95ee5c026e43981b7cb"/></dir><dir name="Model"><file name="Cosmicapi.php" hash="418a09523deb3a866c3556e450cb89f6"/><dir name="Resource"><dir name="Cosmicapi"><file name="Collection.php" hash="19ecabb6fbfbe4bbd7ccdfe3e1348c34"/></dir><file name="Cosmicapi.php" hash="600cc458f3b284c025fe0928082c65b3"/></dir></dir><dir name="controllers"><file name="RestController.php" hash="9eca60b458b1e26f9d247bc31010eb91"/></dir><dir name="etc"><file name="config.xml" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.4.0</min><max>5.6.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Cosmic_Cart</name>
|
4 |
+
<version>2.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://cosmiccart.com/help/license/software">CosmicCart Software License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Cosmic Cart</summary>
|
10 |
<description>Cosmic Cart</description>
|
11 |
+
<notes>Version 2.0.7</notes>
|
12 |
<authors><author><name>Cosmic Cart, Inc.</name><user>cosmiccart</user><email>info@cosmiccart.com</email></author></authors>
|
13 |
+
<date>2016-03-30</date>
|
14 |
+
<time>12:48:21</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="CosmicCart"><dir name="Cosmicapi"><dir name="Helper"><file name="Data.php" hash="beb4f6961e2de95ee5c026e43981b7cb"/></dir><dir name="Model"><file name="Cosmicapi.php" hash="418a09523deb3a866c3556e450cb89f6"/><dir name="Resource"><dir name="Cosmicapi"><file name="Collection.php" hash="19ecabb6fbfbe4bbd7ccdfe3e1348c34"/></dir><file name="Cosmicapi.php" hash="600cc458f3b284c025fe0928082c65b3"/></dir></dir><dir name="controllers"><file name="RestController.php" hash="9eca60b458b1e26f9d247bc31010eb91"/></dir><dir name="etc"><file name="config.xml" hash="127b8a848fdb9483c046fef9ca17b4a0"/></dir><dir name="sql"><dir name="cosmicapi_setup"><file name="install-0.1.0.php" hash="6ca54f01f2ff2da8dd15d2bc52d08032"/></dir></dir></dir><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Cosmiccart"><dir name="Edit"><file name="Form.php" hash="fb88468096b0d03ab57401789a1df184"/><dir name="Tab"><file name="Form.php" hash="9059e9b7007e7d19206ed8fd47a19d96"/></dir><file name="Tabs.php" hash="99bc110d5881c6a43bec9cc8d19f37e5"/></dir><file name="Edit.php" hash="04b9bccce57fe0f467c8ae2d2eb9520a"/><file name="Grid.php" hash="d14433b3c5a77d9714ad606d3480a183"/></dir><file name="Cosmiccart.php" hash="843445e1325c536a25944370aa0a1bef"/><dir name="Log"><dir name="Grid"><dir name="Renderer"><file name="Severity.php" hash="5499b71c03a947693509e7a9590df4a2"/></dir></dir><file name="Grid.php" hash="2164bd9517467d4785d01373503862c7"/></dir><file name="Log.php" hash="60bf29c52ee0ffae76fdaf5b6037e432"/><file name="Storeselect.php" hash="66dd0f6eed12ea2966e6bf522aa2b1e4"/><file name=".DS_Store" hash="2df7fc57836235af1b5f34f94919af52"/></dir><file name="Cosmiccart.php" hash="ba430aafc8a3859c921cb648a1a98856"/><file name=".DS_Store" hash="2b86e4a84ed248c69377f0a3eecf949e"/></dir><dir name="Helper"><file name="Data.php" hash="17acb9cb4a74cafce749087383892cf7"/></dir><dir name="Model"><file name="AccessToken.php" hash="a10013f841758229c6dc2e4a16a1b0bf"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Dynamic"><file name="Cron.php" hash="8a50e02ba7d42f01b3287cc304578e40"/></dir></dir><file name="Ean.php" hash="f50af5d3155aacd06e032fa521ff994f"/><dir name="Source"><file name="Payment.php" hash="1fded50ba4959e53875f1dac03ce8309"/></dir></dir><file name=".DS_Store" hash="084c74a9dcbc6dfcb653d57b1e29381a"/></dir><file name=".DS_Store" hash="688e144a6beb0cfc89bc878c583abd33"/></dir><file name="Batch.php" hash="07a37f12406ab16275e51331676b67e7"/><file name="Client.php" hash="3814db313c82812595e75d65cc854bc6"/><file name="ErrorHandler.php" hash="7550833e0c628a11984577227b4e4b12"/><file name="Exporter.php" hash="cadd84e1f2d0cdb0cacad4cdffee681f"/><file name="Log.php" hash="6537f36be76e95c82b83544a73201cd3"/><file name="Mail.php" hash="7d003fd58c43438362efe28a4a1380b6"/><file name="Oauth2client.php" hash="bd11c9ba42b69d3ad25153ed8c6d4df8"/><file name="Observer.php" hash="8c222a8dae1ed04c110ed0fefe3d3fae"/><dir name="Order"><dir name="Api"><file name="V2.php" hash="526ad61de3db04ee3e7da05bb68305bf"/></dir></dir><file name="Pay.php" hash="40dbd03250bea454ed54a69e09b577e6"/><dir name="Resource"><dir name="AccessToken"><file name="Collection.php" hash="d3a02ed68f823476ee9564c713bc65f3"/></dir><file name="AccessToken.php" hash="b26b20be7e18e8ff12260064daad5e0f"/><dir name="Batch"><file name="Collection.php" hash="1d441b30c548026dce0e9a120639f56e"/></dir><file name="Batch.php" hash="17f8761372d73307ce3826ea6cd2656f"/><dir name="Client"><file name="Collection.php" hash="d2fba20f90d6baaba572ae19f2f7888e"/></dir><file name="Client.php" hash="bff3e3025a5ff9bcff5c93394ab038f2"/><dir name="Log"><file name="Collection.php" hash="ced7345049d6df7bbe5c00f9c6741b87"/></dir><file name="Log.php" hash="58c0936ef45f4313aa0bbed20a2186cb"/><file name="Setup.php" hash="a209ae59d0f6f14055f47e1738fd970d"/><file name=".DS_Store" hash="3e1d3c3dd1aed59de5e4b5fd629afdf3"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Configurablepricing.php" hash="a7901358a6e925ad97cc3f6129878de1"/><file name="Environment.php" hash="a39a92f32ba26e34cfc12b5b71cfa5c6"/><file name="Logginglevel.php" hash="bd83017485483b9b544a48b37e639f50"/></dir></dir></dir><file name=".DS_Store" hash="ba2f78bd9a9b2c34fafbd5b5e679f18f"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Cosmiccart"><file name="LoggerController.php" hash="c016a2d86225b1b9acbcde5c2227efc6"/></dir><dir name="Integration"><file name="ActivationController.php" hash="d30a8f5de9bea5f0185fd824941d07c6"/><file name="BatchController.php" hash="2e9dd8658dba3eec4e3bc42c368d6f58"/></dir><file name=".DS_Store" hash="f7794987e583dcd4a5473bc73fea44c2"/></dir><file name=".DS_Store" hash="7ea627f9563894260ad9278d14d999e9"/></dir><dir name="etc"><file name="config.xml" hash="e983d346e590daa452448ccfa2257da8"/><file name="system.xml" hash="03e4ed775c7170f2522e00c173c489b7"/></dir><dir name="sql"><dir name="cosmiccart_integration_setup"><file name="install-1.0.0.php" hash="c8efe70eabbb8aec987b0dea4b832627"/><file name="upgrade-1.0.0-1.0.1.php" hash="d319248b90cf192a7689cb2f853353fe"/><file name="upgrade-2.0.0-2.0.1.php" hash="8b3c1575b4c68e129877d758e3cb672b"/><file name="upgrade-2.0.6-2.0.7.php" hash="e361d6fd17a4471bcca3a371d5b2feab"/></dir><file name=".DS_Store" hash="96c3221947bd7e596d0cd832b64bc394"/></dir><file name=".DS_Store" hash="b69cc28d74ad92754935b899959bbba6"/></dir><file name=".DS_Store" hash="e9cffeeeafe12a009adde895b828d1c2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="cosmiccart"><file name="integration.xml" hash="f4ade46ffcdeea31d242542278f7f5ce"/></dir></dir><dir name="template"><dir name="cosmiccart"><file name="activation.phtml" hash="5381a2f847b707796b447365a14211f1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CosmicCart_Cosmicapi.xml" hash="b5437750840096c7ed1abc8bdced6443"/><file name="CosmicCart_Integration.xml" hash="b33d7bbfcd97eedaab65dfd8b6869de1"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="cosmiccart"><file name="generic_error.html" hash="8458908bf29309629c3176f822c26ecb"/><file name="import_exception.html" hash="04aa8082317443692db7e7a42f84c1af"/><file name="package_shipped.html" hash="c57b318982b00b44e9279615d19455f6"/><file name="refund_exception.html" hash="488184cded40efd171cc9706c54ad8b0"/></dir></dir></dir></dir><dir><dir name="en_US"><file name="CosmicCart_Integration.csv" hash="b2a4c1b460ed259a6aaa41809cb49e77"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.4.0</min><max>5.6.0</max></php></required></dependencies>
|
18 |
</package>
|