Version Notes
Available for: EE 1.12.0.0, PE 1.12.0.0, CE 1.7.0.0
Download this release
Release Info
Developer | Magento Core Team |
Extension | Mage_GoogleShopping |
Version | 1.7.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.0.0 to 1.7.0.0
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php +22 -18
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php +1 -1
- app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php +1 -1
- app/code/core/Mage/GoogleShopping/Helper/Category.php +8 -8
- app/code/core/Mage/GoogleShopping/Helper/Data.php +1 -1
- app/code/core/Mage/GoogleShopping/Helper/Price.php +8 -8
- app/code/core/Mage/GoogleShopping/Helper/Product.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php +4 -5
- app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php +7 -3
- app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php +45 -6
- app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Config.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Flag.php +98 -0
- app/code/core/Mage/GoogleShopping/Model/Item.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/MassOperations.php +98 -54
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Attribute.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Attribute/Collection.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Item.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Item/Collection.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Type.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Mysql4/Type/Collection.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Observer.php +20 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Item.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Type.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php +13 -1
- app/code/core/Mage/GoogleShopping/Model/Service.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Service/Item.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Source/Country.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php +1 -1
- app/code/core/Mage/GoogleShopping/Model/Type.php +1 -1
- app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php +112 -14
- app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php +1 -1
- app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php +1 -1
- app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php +1 -1
- app/code/core/Mage/GoogleShopping/etc/adminhtml.xml +1 -1
- app/code/core/Mage/GoogleShopping/etc/config.xml +43 -21
- app/code/core/Mage/GoogleShopping/etc/system.xml +1 -1
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php +1 -1
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-data-install-0.2.0.php +1 -1
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-install-0.2.0.php +1 -1
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-upgrade-0.2.1-0.2.2.php +1 -1
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php +1 -10
- app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php +1 -12
- app/design/adminhtml/default/default/layout/googleshopping.xml +35 -0
- app/design/adminhtml/default/default/template/googleshopping/captcha.phtml +1 -1
- app/design/adminhtml/default/default/template/googleshopping/items.phtml +4 -9
- app/design/adminhtml/default/default/template/googleshopping/types/edit.phtml +1 -1
- app/design/adminhtml/default/default/template/googleshopping/types/edit/attributes.phtml +1 -1
- app/design/adminhtml/default/default/template/googleshopping/types/edit/select.phtml +1 -1
- app/etc/modules/Mage_GoogleShopping.xml +1 -1
- js/mage/adminhtml/googleshopping.js +139 -0
- package.xml +7 -8
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -54,23 +54,6 @@ class Mage_GoogleShopping_Block_Adminhtml_Items extends Mage_Adminhtml_Block_Wid
|
|
54 |
return $this;
|
55 |
}
|
56 |
|
57 |
-
/**
|
58 |
-
* Get HTML code for button View Available Products
|
59 |
-
*
|
60 |
-
* @return string
|
61 |
-
*/
|
62 |
-
public function getAddButtonHtml()
|
63 |
-
{
|
64 |
-
$addButtonData = array(
|
65 |
-
'id' => 'products_grid_button',
|
66 |
-
'label' => $this->__('View Available Products'),
|
67 |
-
);
|
68 |
-
return $this->getLayout()
|
69 |
-
->createBlock('adminhtml/widget_button')
|
70 |
-
->setData($addButtonData)
|
71 |
-
->toHtml();
|
72 |
-
}
|
73 |
-
|
74 |
/**
|
75 |
* Get HTML code for Store Switcher select
|
76 |
*
|
@@ -103,4 +86,25 @@ class Mage_GoogleShopping_Block_Adminhtml_Items extends Mage_Adminhtml_Block_Wid
|
|
103 |
{
|
104 |
return $this->_getData('store');
|
105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
54 |
return $this;
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Get HTML code for Store Switcher select
|
59 |
*
|
86 |
{
|
87 |
return $this->_getData('store');
|
88 |
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check whether synchronization process is running
|
92 |
+
*
|
93 |
+
* @return bool
|
94 |
+
*/
|
95 |
+
public function isProcessRunning()
|
96 |
+
{
|
97 |
+
$flag = Mage::getModel('googleshopping/flag')->loadSelf();
|
98 |
+
return $flag->isLocked();
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Build url for retrieving background process status
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
public function getStatusUrl()
|
107 |
+
{
|
108 |
+
return $this->getUrl('*/*/status');
|
109 |
+
}
|
110 |
}
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Helper/Category.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
@@ -18,10 +18,10 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright
|
24 |
-
* @license
|
25 |
*/
|
26 |
|
27 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Magento
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
/**
|
app/code/core/Mage/GoogleShopping/Helper/Data.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Helper/Price.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magento
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
-
* This source file is subject to the
|
8 |
-
* that is bundled with this package in the file
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
@@ -18,10 +18,10 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright
|
24 |
-
* @license
|
25 |
*/
|
26 |
|
27 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Magento
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
* If you did not receive a copy of the license and are unable to
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
/**
|
app/code/core/Mage/GoogleShopping/Helper/Product.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -132,10 +132,9 @@ class Mage_GoogleShopping_Model_Attribute_Default extends Mage_GoogleShopping_Mo
|
|
132 |
protected function _setAttribute($entry, $name, $type = self::ATTRIBUTE_TYPE_TEXT, $value = '', $unit = null)
|
133 |
{
|
134 |
if (is_object($value) || ((string)$value != $value)) {
|
135 |
-
Mage::throwException(
|
136 |
-
'The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.',
|
137 |
-
|
138 |
-
));
|
139 |
}
|
140 |
$attribute = $entry->getContentAttributeByName($name);
|
141 |
if ($attribute instanceof Varien_Gdata_Gshopping_Extension_Attribute) {
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
132 |
protected function _setAttribute($entry, $name, $type = self::ATTRIBUTE_TYPE_TEXT, $value = '', $unit = null)
|
133 |
{
|
134 |
if (is_object($value) || ((string)$value != $value)) {
|
135 |
+
Mage::throwException(
|
136 |
+
Mage::helper('googleshopping')->__('The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.', $name)
|
137 |
+
);
|
|
|
138 |
}
|
139 |
$attribute = $entry->getContentAttributeByName($name);
|
140 |
if ($attribute instanceof Varien_Gdata_Gshopping_Extension_Attribute) {
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -43,7 +43,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode
|
|
43 |
public function convertAttribute($product, $entry)
|
44 |
{
|
45 |
$product->setWebsiteId(Mage::app()->getStore($product->getStoreId())->getWebsiteId());
|
46 |
-
$product->setCustomerGroupId(
|
|
|
|
|
47 |
|
48 |
$store = Mage::app()->getStore($product->getStoreId());
|
49 |
$targetCountry = Mage::getSingleton('googleshopping/config')->getTargetCountry($product->getStoreId());
|
@@ -93,7 +95,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode
|
|
93 |
|
94 |
$effectiveDate = $this->getGroupAttributeSalePriceEffectiveDate();
|
95 |
if (!is_null($effectiveDate)) {
|
96 |
-
$effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom(
|
|
|
|
|
97 |
->setGroupAttributeSalePriceEffectiveDateTo($this->getGroupAttributeSalePriceEffectiveDateTo())
|
98 |
->convertAttribute($product, $entry);
|
99 |
}
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
43 |
public function convertAttribute($product, $entry)
|
44 |
{
|
45 |
$product->setWebsiteId(Mage::app()->getStore($product->getStoreId())->getWebsiteId());
|
46 |
+
$product->setCustomerGroupId(
|
47 |
+
Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $product->getStoreId())
|
48 |
+
);
|
49 |
|
50 |
$store = Mage::app()->getStore($product->getStoreId());
|
51 |
$targetCountry = Mage::getSingleton('googleshopping/config')->getTargetCountry($product->getStoreId());
|
95 |
|
96 |
$effectiveDate = $this->getGroupAttributeSalePriceEffectiveDate();
|
97 |
if (!is_null($effectiveDate)) {
|
98 |
+
$effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom(
|
99 |
+
$this->getGroupAttributeSalePriceEffectiveDateFrom()
|
100 |
+
)
|
101 |
->setGroupAttributeSalePriceEffectiveDateTo($this->getGroupAttributeSalePriceEffectiveDateTo())
|
102 |
->convertAttribute($product, $entry);
|
103 |
}
|
app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -33,6 +33,10 @@
|
|
33 |
*/
|
34 |
class Mage_GoogleShopping_Model_Attribute_Tax extends Mage_GoogleShopping_Model_Attribute_Default
|
35 |
{
|
|
|
|
|
|
|
|
|
36 |
/**
|
37 |
* Set current attribute to entry (for specified product)
|
38 |
*
|
@@ -51,16 +55,51 @@ class Mage_GoogleShopping_Model_Attribute_Tax extends Mage_GoogleShopping_Model_
|
|
51 |
$customerTaxClass = $calc->getDefaultCustomerTaxClass($product->getStoreId());
|
52 |
$rates = $calc->getRatesByCustomerAndProductTaxClasses($customerTaxClass, $product->getTaxClassId());
|
53 |
$targetCountry = Mage::getSingleton('googleshopping/config')->getTargetCountry($product->getStoreId());
|
|
|
54 |
foreach ($rates as $rate) {
|
55 |
if ($targetCountry == $rate['country']) {
|
56 |
-
$
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
|
64 |
return $entry;
|
65 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
33 |
*/
|
34 |
class Mage_GoogleShopping_Model_Attribute_Tax extends Mage_GoogleShopping_Model_Attribute_Default
|
35 |
{
|
36 |
+
/**
|
37 |
+
* Maximum number of tax rates per product supported by google shopping api
|
38 |
+
*/
|
39 |
+
const RATES_MAX = 100;
|
40 |
/**
|
41 |
* Set current attribute to entry (for specified product)
|
42 |
*
|
55 |
$customerTaxClass = $calc->getDefaultCustomerTaxClass($product->getStoreId());
|
56 |
$rates = $calc->getRatesByCustomerAndProductTaxClasses($customerTaxClass, $product->getTaxClassId());
|
57 |
$targetCountry = Mage::getSingleton('googleshopping/config')->getTargetCountry($product->getStoreId());
|
58 |
+
$ratesTotal = 0;
|
59 |
foreach ($rates as $rate) {
|
60 |
if ($targetCountry == $rate['country']) {
|
61 |
+
$regions = $this->_parseRegions($rate['state'], $rate['postcode']);
|
62 |
+
$ratesTotal += count($regions);
|
63 |
+
if ($ratesTotal > self::RATES_MAX) {
|
64 |
+
Mage::throwException(Mage::helper('googleshopping')->__("Google shopping only supports %d tax rates per product", self::RATES_MAX));
|
65 |
+
}
|
66 |
+
foreach ($regions as $region) {
|
67 |
+
$entry->addTax(array(
|
68 |
+
'tax_rate' => $rate['value'] * 100,
|
69 |
+
'tax_country' => empty($rate['country']) ? '*' : $rate['country'],
|
70 |
+
'tax_region' => $region
|
71 |
+
));
|
72 |
+
}
|
73 |
}
|
74 |
}
|
75 |
|
76 |
return $entry;
|
77 |
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Retrieve array of regions characterized by provided params
|
81 |
+
*
|
82 |
+
* @param string $state
|
83 |
+
* @param string $zip
|
84 |
+
* @return array
|
85 |
+
*/
|
86 |
+
protected function _parseRegions($state, $zip)
|
87 |
+
{
|
88 |
+
return (!empty($zip) && $zip != '*') ? $this->_parseZip($zip) : (($state) ? array($state) : array('*'));
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Retrieve array of regions characterized by provided zip code
|
93 |
+
*
|
94 |
+
* @param string $zip
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
protected function _parseZip($zip)
|
98 |
+
{
|
99 |
+
if (strpos($zip, '-') == -1) {
|
100 |
+
return array($zip);
|
101 |
+
} else {
|
102 |
+
return Mage::helper('googlecheckout')->zipRangeToZipPattern($zip);
|
103 |
+
}
|
104 |
+
}
|
105 |
}
|
app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Config.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Flag.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Google shopping synchronization operations flag
|
30 |
+
*
|
31 |
+
* @category Mage
|
32 |
+
* @package Mage_GoogleShopping
|
33 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
34 |
+
*/
|
35 |
+
class Mage_GoogleShopping_Model_Flag extends Mage_Core_Model_Flag
|
36 |
+
{
|
37 |
+
/**
|
38 |
+
* Flag time to live in seconds
|
39 |
+
*/
|
40 |
+
const FLAG_TTL = 72000;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Synchronize flag code
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
protected $_flagCode = 'googleshopping';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Lock flag
|
51 |
+
*/
|
52 |
+
public function lock()
|
53 |
+
{
|
54 |
+
$this->setState(1)
|
55 |
+
->save();
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Check wheter flag is locked
|
60 |
+
*
|
61 |
+
* @return bool
|
62 |
+
*/
|
63 |
+
public function isLocked()
|
64 |
+
{
|
65 |
+
return !!$this->getState() && !$this->isExpired();
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Unlock flag
|
70 |
+
*/
|
71 |
+
public function unlock()
|
72 |
+
{
|
73 |
+
$lastUpdate = $this->getLastUpdate();
|
74 |
+
$this->loadSelf();
|
75 |
+
$this->setState(0);
|
76 |
+
if ($lastUpdate == $this->getLastUpdate()) {
|
77 |
+
$this->save();
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Check whether flag is unlocked by expiration
|
83 |
+
*
|
84 |
+
* @return bool
|
85 |
+
*/
|
86 |
+
public function isExpired()
|
87 |
+
{
|
88 |
+
if (!!$this->getState() && Mage_GoogleShopping_Model_Flag::FLAG_TTL) {
|
89 |
+
if ($this->getLastUpdate()) {
|
90 |
+
return (time() > (strtotime($this->getLastUpdate()) + Mage_GoogleShopping_Model_Flag::FLAG_TTL));
|
91 |
+
} else {
|
92 |
+
return true;
|
93 |
+
}
|
94 |
+
} else {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
app/code/core/Mage/GoogleShopping/Model/Item.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/MassOperations.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -47,19 +47,43 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
47 |
*/
|
48 |
protected $_hasError = false;
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* Add product to Google Content.
|
52 |
*
|
53 |
* @param array $productIds
|
54 |
* @param int $storeId
|
55 |
* @throws Zend_Gdata_App_CaptchaRequiredException
|
|
|
56 |
* @return Mage_GoogleShopping_Model_MassOperations
|
57 |
*/
|
58 |
public function addProducts($productIds, $storeId)
|
59 |
{
|
60 |
$totalAdded = 0;
|
|
|
61 |
if (is_array($productIds)) {
|
62 |
foreach ($productIds as $productId) {
|
|
|
|
|
|
|
63 |
try {
|
64 |
$product = Mage::getModel('catalog/product')
|
65 |
->setStoreId($storeId)
|
@@ -73,30 +97,20 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
73 |
$totalAdded++;
|
74 |
}
|
75 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
76 |
-
// Google requires CAPTCHA for login
|
77 |
-
$this->_getSession()->addError(Mage::helper('googleshopping')->__($e->getMessage()));
|
78 |
throw $e;
|
79 |
} catch (Zend_Gdata_App_Exception $e) {
|
80 |
-
$
|
81 |
-
$this->_getSession()->addError(
|
82 |
-
Mage::helper('googleshopping')->parseGdataExceptionMessage($e->getMessage(), $product)
|
83 |
-
);
|
84 |
} catch (Zend_Db_Statement_Exception $e) {
|
|
|
85 |
if ($e->getCode() == self::ERROR_CODE_SQL_UNIQUE_INDEX) {
|
86 |
-
$
|
87 |
-
Mage::helper('googleshopping')->__("The Google Content item for product '%s' (in '%s' store) has already exist.",
|
88 |
-
$product->getName(),
|
89 |
-
Mage::app()->getStore($product->getStoreId())->getName()
|
90 |
-
)
|
91 |
-
);
|
92 |
-
} else {
|
93 |
-
$this->_getSession()->addError($e->getMessage());
|
94 |
}
|
|
|
|
|
|
|
95 |
} catch (Exception $e) {
|
96 |
Mage::logException($e);
|
97 |
-
$
|
98 |
-
Mage::helper('googleshopping')->__('The product "%s" hasn\'t been added to Google Content.', $product->getName())
|
99 |
-
);
|
100 |
}
|
101 |
}
|
102 |
if (empty($productIds)) {
|
@@ -105,15 +119,24 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
105 |
}
|
106 |
|
107 |
if ($totalAdded > 0) {
|
108 |
-
$this->
|
|
|
109 |
Mage::helper('googleshopping')->__('Total of %d product(s) have been added to Google Content.', $totalAdded)
|
110 |
);
|
111 |
-
}
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
);
|
115 |
-
} else {
|
116 |
-
$this->_getSession()->addError(Mage::helper('googleshopping')->__('No products were added to Google Content'));
|
117 |
}
|
118 |
|
119 |
return $this;
|
@@ -124,6 +147,7 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
124 |
*
|
125 |
* @param array|Mage_GoogleShopping_Model_Resource_Item_Collection $items
|
126 |
* @throws Zend_Gdata_App_CaptchaRequiredException
|
|
|
127 |
* @return Mage_GoogleShopping_Model_MassOperations
|
128 |
*/
|
129 |
public function synchronizeItems($items)
|
@@ -131,6 +155,7 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
131 |
$totalUpdated = 0;
|
132 |
$totalDeleted = 0;
|
133 |
$totalFailed = 0;
|
|
|
134 |
|
135 |
$itemsCollection = $this->_getItemsCollection($items);
|
136 |
|
@@ -139,6 +164,9 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
139 |
return $this;
|
140 |
}
|
141 |
foreach ($itemsCollection as $item) {
|
|
|
|
|
|
|
142 |
try {
|
143 |
$item->updateItem();
|
144 |
$item->save();
|
@@ -150,28 +178,23 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
150 |
$totalDeleted++;
|
151 |
} else {
|
152 |
$this->_addGeneralError();
|
153 |
-
$
|
154 |
-
|
155 |
-
->parseGdataExceptionMessage($e->getMessage(), $item->getProduct())
|
156 |
-
);
|
157 |
$totalFailed++;
|
158 |
}
|
159 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
160 |
-
// Google requires CAPTCHA for login
|
161 |
-
$this->_getSession()->addError($e->getMessage());
|
162 |
throw $e;
|
163 |
} catch (Zend_Gdata_App_Exception $e) {
|
164 |
$this->_addGeneralError();
|
165 |
-
$
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
169 |
$totalFailed++;
|
170 |
} catch (Exception $e) {
|
171 |
Mage::logException($e);
|
172 |
-
$
|
173 |
-
Mage::helper('googleshopping')->__('The item "%s" hasn\'t been updated.', $item->getProduct()->getName())
|
174 |
-
);
|
175 |
$totalFailed++;
|
176 |
}
|
177 |
}
|
@@ -179,11 +202,16 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
179 |
return $this;
|
180 |
}
|
181 |
|
182 |
-
$this->
|
|
|
183 |
Mage::helper('googleshopping')->__('Total of %d items(s) have been deleted; total of %d items(s) have been updated.', $totalDeleted, $totalUpdated)
|
184 |
);
|
185 |
-
if ($totalFailed > 0) {
|
186 |
-
$
|
|
|
|
|
|
|
|
|
187 |
}
|
188 |
|
189 |
return $this;
|
@@ -200,30 +228,28 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
200 |
{
|
201 |
$totalDeleted = 0;
|
202 |
$itemsCollection = $this->_getItemsCollection($items);
|
|
|
203 |
if ($itemsCollection) {
|
204 |
if (count($itemsCollection) < 1) {
|
205 |
return $this;
|
206 |
}
|
207 |
foreach ($itemsCollection as $item) {
|
|
|
|
|
|
|
208 |
try {
|
209 |
$item->deleteItem()->delete();
|
210 |
// The item was removed successfully
|
211 |
$totalDeleted++;
|
212 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
213 |
-
// Google requires CAPTCHA for login
|
214 |
-
$this->_getSession()->addError($e->getMessage());
|
215 |
throw $e;
|
216 |
} catch (Zend_Gdata_App_Exception $e) {
|
217 |
$this->_addGeneralError();
|
218 |
-
$
|
219 |
-
|
220 |
-
->parseGdataExceptionMessage($e->getMessage(), $item->getProduct())
|
221 |
-
);
|
222 |
} catch (Exception $e) {
|
223 |
Mage::logException($e);
|
224 |
-
$
|
225 |
-
Mage::helper('googleshopping')->__('The item "%s" hasn\'t been deleted.', $item->getProduct()->getName())
|
226 |
-
);
|
227 |
}
|
228 |
}
|
229 |
} else {
|
@@ -231,11 +257,16 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
231 |
}
|
232 |
|
233 |
if ($totalDeleted > 0) {
|
234 |
-
$this->
|
235 |
-
Mage::helper('googleshopping')->__('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
);
|
237 |
-
} else {
|
238 |
-
$this->_getSession()->addError(Mage::helper('googleshopping')->__('No items were deleted from Google Content'));
|
239 |
}
|
240 |
|
241 |
return $this;
|
@@ -271,13 +302,26 @@ class Mage_GoogleShopping_Model_MassOperations
|
|
271 |
return Mage::getSingleton('adminhtml/session');
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
/**
|
275 |
* Provides general error information
|
276 |
*/
|
277 |
protected function _addGeneralError()
|
278 |
{
|
279 |
if (!$this->_hasError) {
|
280 |
-
$this->
|
|
|
|
|
|
|
281 |
$this->_hasError = true;
|
282 |
}
|
283 |
}
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
47 |
*/
|
48 |
protected $_hasError = false;
|
49 |
|
50 |
+
/**
|
51 |
+
* Process locking flag
|
52 |
+
*
|
53 |
+
* @var Mage_GoogleShopping_Model_Flag
|
54 |
+
*/
|
55 |
+
protected $_flag;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Set process locking flag.
|
59 |
+
*
|
60 |
+
* @param Mage_GoogleShopping_Model_Flag $flag
|
61 |
+
* @return Mage_GoogleShopping_Model_MassOperations
|
62 |
+
*/
|
63 |
+
public function setFlag(Mage_GoogleShopping_Model_Flag $flag)
|
64 |
+
{
|
65 |
+
$this->_flag = $flag;
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
/**
|
70 |
* Add product to Google Content.
|
71 |
*
|
72 |
* @param array $productIds
|
73 |
* @param int $storeId
|
74 |
* @throws Zend_Gdata_App_CaptchaRequiredException
|
75 |
+
* @throws Mage_Core_Exception
|
76 |
* @return Mage_GoogleShopping_Model_MassOperations
|
77 |
*/
|
78 |
public function addProducts($productIds, $storeId)
|
79 |
{
|
80 |
$totalAdded = 0;
|
81 |
+
$errors = array();
|
82 |
if (is_array($productIds)) {
|
83 |
foreach ($productIds as $productId) {
|
84 |
+
if ($this->_flag && $this->_flag->isExpired()) {
|
85 |
+
break;
|
86 |
+
}
|
87 |
try {
|
88 |
$product = Mage::getModel('catalog/product')
|
89 |
->setStoreId($storeId)
|
97 |
$totalAdded++;
|
98 |
}
|
99 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
100 |
throw $e;
|
101 |
} catch (Zend_Gdata_App_Exception $e) {
|
102 |
+
$errors[] = Mage::helper('googleshopping')->parseGdataExceptionMessage($e->getMessage(), $product);
|
|
|
|
|
|
|
103 |
} catch (Zend_Db_Statement_Exception $e) {
|
104 |
+
$message = $e->getMessage();
|
105 |
if ($e->getCode() == self::ERROR_CODE_SQL_UNIQUE_INDEX) {
|
106 |
+
$message = Mage::helper('googleshopping')->__("The Google Content item for product '%s' (in '%s' store) has already exist.", $product->getName(), Mage::app()->getStore($product->getStoreId())->getName());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
+
$errors[] = $message;
|
109 |
+
} catch (Mage_Core_Exception $e) {
|
110 |
+
$errors[] = Mage::helper('googleshopping')->__('The product "%s" cannot be added to Google Content. %s', $product->getName(), $e->getMessage());
|
111 |
} catch (Exception $e) {
|
112 |
Mage::logException($e);
|
113 |
+
$errors[] = Mage::helper('googleshopping')->__('The product "%s" hasn\'t been added to Google Content.', $product->getName());
|
|
|
|
|
114 |
}
|
115 |
}
|
116 |
if (empty($productIds)) {
|
119 |
}
|
120 |
|
121 |
if ($totalAdded > 0) {
|
122 |
+
$this->_getNotifier()->addNotice(
|
123 |
+
Mage::helper('googleshopping')->__('Products were added to Google Shopping account.'),
|
124 |
Mage::helper('googleshopping')->__('Total of %d product(s) have been added to Google Content.', $totalAdded)
|
125 |
);
|
126 |
+
}
|
127 |
+
|
128 |
+
if (count($errors)) {
|
129 |
+
$this->_getNotifier()->addMajor(
|
130 |
+
Mage::helper('googleshopping')->__('Errors happened while adding products to Google Shopping.'),
|
131 |
+
$errors
|
132 |
+
);
|
133 |
+
}
|
134 |
+
|
135 |
+
if ($this->_flag->isExpired()) {
|
136 |
+
$this->_getNotifier()->addMajor(
|
137 |
+
Mage::helper('googleshopping')->__('Operation of adding products to Google Shopping expired.'),
|
138 |
+
Mage::helper('googleshopping')->__('Some products may have not been added to Google Shopping bacause of expiration')
|
139 |
);
|
|
|
|
|
140 |
}
|
141 |
|
142 |
return $this;
|
147 |
*
|
148 |
* @param array|Mage_GoogleShopping_Model_Resource_Item_Collection $items
|
149 |
* @throws Zend_Gdata_App_CaptchaRequiredException
|
150 |
+
* @throws Mage_Core_Exception
|
151 |
* @return Mage_GoogleShopping_Model_MassOperations
|
152 |
*/
|
153 |
public function synchronizeItems($items)
|
155 |
$totalUpdated = 0;
|
156 |
$totalDeleted = 0;
|
157 |
$totalFailed = 0;
|
158 |
+
$errors = array();
|
159 |
|
160 |
$itemsCollection = $this->_getItemsCollection($items);
|
161 |
|
164 |
return $this;
|
165 |
}
|
166 |
foreach ($itemsCollection as $item) {
|
167 |
+
if ($this->_flag && $this->_flag->isExpired()) {
|
168 |
+
break;
|
169 |
+
}
|
170 |
try {
|
171 |
$item->updateItem();
|
172 |
$item->save();
|
178 |
$totalDeleted++;
|
179 |
} else {
|
180 |
$this->_addGeneralError();
|
181 |
+
$errors[] = Mage::helper('googleshopping')
|
182 |
+
->parseGdataExceptionMessage($e->getMessage(), $item->getProduct());
|
|
|
|
|
183 |
$totalFailed++;
|
184 |
}
|
185 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
186 |
throw $e;
|
187 |
} catch (Zend_Gdata_App_Exception $e) {
|
188 |
$this->_addGeneralError();
|
189 |
+
$errors[] = Mage::helper('googleshopping')
|
190 |
+
->parseGdataExceptionMessage($e->getMessage(), $item->getProduct());
|
191 |
+
$totalFailed++;
|
192 |
+
} catch (Mage_Core_Exception $e) {
|
193 |
+
$errors[] = Mage::helper('googleshopping')->__('The item "%s" cannot be updated at Google Content. %s', $item->getProduct()->getName(), $e->getMessage());
|
194 |
$totalFailed++;
|
195 |
} catch (Exception $e) {
|
196 |
Mage::logException($e);
|
197 |
+
$errors[] = Mage::helper('googleshopping')->__('The item "%s" hasn\'t been updated.', $item->getProduct()->getName());
|
|
|
|
|
198 |
$totalFailed++;
|
199 |
}
|
200 |
}
|
202 |
return $this;
|
203 |
}
|
204 |
|
205 |
+
$this->_getNotifier()->addNotice(
|
206 |
+
Mage::helper('googleshopping')->__('Product synchronization with Google Shopping completed'),
|
207 |
Mage::helper('googleshopping')->__('Total of %d items(s) have been deleted; total of %d items(s) have been updated.', $totalDeleted, $totalUpdated)
|
208 |
);
|
209 |
+
if ($totalFailed > 0 || count($errors)) {
|
210 |
+
array_unshift($errors, Mage::helper('googleshopping')->__("Cannot update %s items.", $totalFailed));
|
211 |
+
$this->_getNotifier()->addMajor(
|
212 |
+
Mage::helper('googleshopping')->__('Errors happened during synchronization with Google Shopping'),
|
213 |
+
$errors
|
214 |
+
);
|
215 |
}
|
216 |
|
217 |
return $this;
|
228 |
{
|
229 |
$totalDeleted = 0;
|
230 |
$itemsCollection = $this->_getItemsCollection($items);
|
231 |
+
$errors = array();
|
232 |
if ($itemsCollection) {
|
233 |
if (count($itemsCollection) < 1) {
|
234 |
return $this;
|
235 |
}
|
236 |
foreach ($itemsCollection as $item) {
|
237 |
+
if ($this->_flag && $this->_flag->isExpired()) {
|
238 |
+
break;
|
239 |
+
}
|
240 |
try {
|
241 |
$item->deleteItem()->delete();
|
242 |
// The item was removed successfully
|
243 |
$totalDeleted++;
|
244 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
245 |
throw $e;
|
246 |
} catch (Zend_Gdata_App_Exception $e) {
|
247 |
$this->_addGeneralError();
|
248 |
+
$errors[] = Mage::helper('googleshopping')
|
249 |
+
->parseGdataExceptionMessage($e->getMessage(), $item->getProduct());
|
|
|
|
|
250 |
} catch (Exception $e) {
|
251 |
Mage::logException($e);
|
252 |
+
$errors[] = Mage::helper('googleshopping')->__('The item "%s" hasn\'t been deleted.', $item->getProduct()->getName());
|
|
|
|
|
253 |
}
|
254 |
}
|
255 |
} else {
|
257 |
}
|
258 |
|
259 |
if ($totalDeleted > 0) {
|
260 |
+
$this->_getNotifier()->addNotice(
|
261 |
+
Mage::helper('googleshopping')->__('Google Shopping item removal process succeded'),
|
262 |
+
Mage::helper('googleshopping')->__('Total of %d items(s) have been removed from Google Shopping.', $totalDeleted)
|
263 |
+
);
|
264 |
+
}
|
265 |
+
if (count($errors)) {
|
266 |
+
$this->_getNotifier()->addMajor(
|
267 |
+
Mage::helper('googleshopping')->__('Errors happened while deleting items from Google Shopping'),
|
268 |
+
$errors
|
269 |
);
|
|
|
|
|
270 |
}
|
271 |
|
272 |
return $this;
|
302 |
return Mage::getSingleton('adminhtml/session');
|
303 |
}
|
304 |
|
305 |
+
/**
|
306 |
+
* Retrieve admin notifier
|
307 |
+
*
|
308 |
+
* @return Mage_Adminhtml_Model_Inbox
|
309 |
+
*/
|
310 |
+
protected function _getNotifier()
|
311 |
+
{
|
312 |
+
return Mage::getModel('adminnotification/inbox');
|
313 |
+
}
|
314 |
+
|
315 |
/**
|
316 |
* Provides general error information
|
317 |
*/
|
318 |
protected function _addGeneralError()
|
319 |
{
|
320 |
if (!$this->_hasError) {
|
321 |
+
$this->_getNotifier()->addMajor(
|
322 |
+
Mage::helper('googleshopping')->__('Google Shopping Error'),
|
323 |
+
Mage::helper('googleshopping/category')->getMessage()
|
324 |
+
);
|
325 |
$this->_hasError = true;
|
326 |
}
|
327 |
}
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Attribute.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Attribute/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Item.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Item/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Type.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Mysql4/Type/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Observer.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -99,4 +99,23 @@ class Mage_GoogleShopping_Model_Observer
|
|
99 |
|
100 |
return $items;
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
99 |
|
100 |
return $items;
|
101 |
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Check if synchronize process is finished and generate notification message
|
105 |
+
*
|
106 |
+
* @param Varien_Event_Observer $observer
|
107 |
+
* @return Mage_GoogleShopping_Model_Observer
|
108 |
+
*/
|
109 |
+
public function checkSynchronizationOperations(Varien_Event_Observer $observer)
|
110 |
+
{
|
111 |
+
$flag = Mage::getSingleton('googleshopping/flag')->loadSelf();
|
112 |
+
if ($flag->isExpired()) {
|
113 |
+
Mage::getModel('adminnotification/inbox')->addMajor(
|
114 |
+
Mage::helper('googleshopping')->__('Google Shopping operation has expired.'),
|
115 |
+
Mage::helper('googleshopping')->__('One or more google shopping synchronization operations failed because of timeout.')
|
116 |
+
);
|
117 |
+
$flag->unlock();
|
118 |
+
}
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
}
|
app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Resource/Item.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Resource/Type.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -51,6 +51,18 @@ class Mage_GoogleShopping_Model_Resource_Type_Collection extends Mage_Core_Model
|
|
51 |
return $this;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* Add total count of Items for each type
|
56 |
*
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
51 |
return $this;
|
52 |
}
|
53 |
|
54 |
+
/**
|
55 |
+
* Get SQL for get record count
|
56 |
+
*
|
57 |
+
* @return Varien_Db_Select
|
58 |
+
*/
|
59 |
+
public function getSelectCountSql()
|
60 |
+
{
|
61 |
+
$this->_renderFilters();
|
62 |
+
$paginatorAdapter = new Zend_Paginator_Adapter_DbSelect($this->getSelect());
|
63 |
+
return $paginatorAdapter->getCountSelect();
|
64 |
+
}
|
65 |
+
|
66 |
/**
|
67 |
* Add total count of Items for each type
|
68 |
*
|
app/code/core/Mage/GoogleShopping/Model/Service.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Service/Item.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Source/Country.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/Model/Type.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
@@ -75,11 +75,7 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
75 |
if (!$this->_getConfig()->isValidDefaultCurrencyCode($this->_getStore()->getId())) {
|
76 |
$_countryInfo = $this->_getConfig()->getTargetCountryInfo($this->_getStore()->getId());
|
77 |
$this->_getSession()->addNotice(
|
78 |
-
|
79 |
-
"The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.",
|
80 |
-
$_countryInfo['currency_name'],
|
81 |
-
$_countryInfo['name']
|
82 |
-
)
|
83 |
);
|
84 |
}
|
85 |
|
@@ -103,23 +99,56 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
103 |
);
|
104 |
}
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
/**
|
107 |
* Add (export) several products to Google Content
|
108 |
*/
|
109 |
public function massAddAction()
|
110 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
$storeId = $this->_getStore()->getId();
|
112 |
$productIds = $this->getRequest()->getParam('product', null);
|
|
|
113 |
|
114 |
try {
|
|
|
115 |
Mage::getModel('googleshopping/massOperations')
|
|
|
116 |
->addProducts($productIds, $storeId);
|
117 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
|
|
118 |
$this->_redirectToCaptcha($e);
|
119 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
|
122 |
-
$
|
123 |
}
|
124 |
|
125 |
/**
|
@@ -127,18 +156,39 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
127 |
*/
|
128 |
public function massDeleteAction()
|
129 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
$itemIds = $this->getRequest()->getParam('item');
|
131 |
|
132 |
try {
|
|
|
133 |
Mage::getModel('googleshopping/massOperations')
|
|
|
134 |
->deleteItems($itemIds);
|
135 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
|
|
136 |
$this->_redirectToCaptcha($e);
|
137 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
|
140 |
-
$
|
141 |
-
$this->_redirect('*/*/index', array('store'=>$storeId));
|
142 |
}
|
143 |
|
144 |
/**
|
@@ -146,18 +196,39 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
146 |
*/
|
147 |
public function refreshAction()
|
148 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
$itemIds = $this->getRequest()->getParam('item');
|
150 |
|
151 |
try {
|
|
|
152 |
Mage::getModel('googleshopping/massOperations')
|
|
|
153 |
->synchronizeItems($itemIds);
|
154 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
|
|
|
|
|
|
155 |
$this->_redirectToCaptcha($e);
|
156 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
-
$
|
160 |
-
$this->_redirect('*/*/index', array('store' => $storeId));
|
161 |
}
|
162 |
|
163 |
/**
|
@@ -165,6 +236,7 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
165 |
*/
|
166 |
public function confirmCaptchaAction()
|
167 |
{
|
|
|
168 |
$storeId = $this->_getStore()->getId();
|
169 |
try {
|
170 |
Mage::getModel('googleshopping/service')->getClient(
|
@@ -179,7 +251,9 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
179 |
$this->_redirectToCaptcha($e);
|
180 |
return;
|
181 |
} catch (Zend_Gdata_App_Exception $e) {
|
182 |
-
$this->_getSession()->addError(
|
|
|
|
|
183 |
} catch (Exception $e) {
|
184 |
Mage::logException($e);
|
185 |
$this->_getSession()->addError($this->__('Captcha confirmation error.'));
|
@@ -188,6 +262,22 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
188 |
$this->_redirect('*/*/index', array('store'=>$storeId));
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
/**
|
192 |
* Redirect user to Google Captcha challenge
|
193 |
*
|
@@ -195,12 +285,20 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_
|
|
195 |
*/
|
196 |
protected function _redirectToCaptcha($e)
|
197 |
{
|
198 |
-
$this->
|
199 |
-
|
|
|
|
|
200 |
'captcha_token' => Mage::helper('core')->urlEncode($e->getCaptchaToken()),
|
201 |
'captcha_url' => Mage::helper('core')->urlEncode($e->getCaptchaUrl())
|
202 |
)
|
203 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
|
206 |
/**
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
75 |
if (!$this->_getConfig()->isValidDefaultCurrencyCode($this->_getStore()->getId())) {
|
76 |
$_countryInfo = $this->_getConfig()->getTargetCountryInfo($this->_getStore()->getId());
|
77 |
$this->_getSession()->addNotice(
|
78 |
+
Mage::helper('googleshopping')->__("The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.", $_countryInfo['currency_name'], $_countryInfo['name'])
|
|
|
|
|
|
|
|
|
79 |
);
|
80 |
}
|
81 |
|
99 |
);
|
100 |
}
|
101 |
|
102 |
+
/**
|
103 |
+
* Retrieve synchronization process mutex
|
104 |
+
*
|
105 |
+
* @return Mage_GoogleShopping_Model_Flag
|
106 |
+
*/
|
107 |
+
protected function _getFlag()
|
108 |
+
{
|
109 |
+
return Mage::getSingleton('googleshopping/flag')->loadSelf();
|
110 |
+
}
|
111 |
+
|
112 |
/**
|
113 |
* Add (export) several products to Google Content
|
114 |
*/
|
115 |
public function massAddAction()
|
116 |
{
|
117 |
+
$flag = $this->_getFlag();
|
118 |
+
if ($flag->isLocked()) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
session_write_close();
|
123 |
+
ignore_user_abort(true);
|
124 |
+
set_time_limit(0);
|
125 |
+
|
126 |
$storeId = $this->_getStore()->getId();
|
127 |
$productIds = $this->getRequest()->getParam('product', null);
|
128 |
+
$notifier = Mage::getModel('adminnotification/inbox');
|
129 |
|
130 |
try {
|
131 |
+
$flag->lock();
|
132 |
Mage::getModel('googleshopping/massOperations')
|
133 |
+
->setFlag($flag)
|
134 |
->addProducts($productIds, $storeId);
|
135 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
136 |
+
// Google requires CAPTCHA for login
|
137 |
+
$this->_getSession()->addError(Mage::helper('googleshopping')->__($e->getMessage()));
|
138 |
+
$flag->unlock();
|
139 |
$this->_redirectToCaptcha($e);
|
140 |
return;
|
141 |
+
} catch (Exception $e) {
|
142 |
+
$flag->unlock();
|
143 |
+
$notifier->addMajor(
|
144 |
+
Mage::helper('googleshopping')->__('An error has occured while adding products to google shopping account.'),
|
145 |
+
$e->getMessage()
|
146 |
+
);
|
147 |
+
Mage::logException($e);
|
148 |
+
return;
|
149 |
}
|
150 |
|
151 |
+
$flag->unlock();
|
152 |
}
|
153 |
|
154 |
/**
|
156 |
*/
|
157 |
public function massDeleteAction()
|
158 |
{
|
159 |
+
$flag = $this->_getFlag();
|
160 |
+
if ($flag->isLocked()) {
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
|
164 |
+
session_write_close();
|
165 |
+
ignore_user_abort(true);
|
166 |
+
set_time_limit(0);
|
167 |
+
|
168 |
$itemIds = $this->getRequest()->getParam('item');
|
169 |
|
170 |
try {
|
171 |
+
$flag->lock();
|
172 |
Mage::getModel('googleshopping/massOperations')
|
173 |
+
->setFlag($flag)
|
174 |
->deleteItems($itemIds);
|
175 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
176 |
+
// Google requires CAPTCHA for login
|
177 |
+
$this->_getSession()->addError(Mage::helper('googleshopping')->__($e->getMessage()));
|
178 |
+
$flag->unlock();
|
179 |
$this->_redirectToCaptcha($e);
|
180 |
return;
|
181 |
+
} catch (Exception $e) {
|
182 |
+
$flag->unlock();
|
183 |
+
Mage::getModel('adminnotification/inbox')->addMajor(
|
184 |
+
Mage::helper('googleshopping')->__('An error has occured while deleting products from google shopping account.'),
|
185 |
+
Mage::helper('googleshopping')->__('One or more products were not deleted from google shopping account. Refer to the log file for details.')
|
186 |
+
);
|
187 |
+
Mage::logException($e);
|
188 |
+
return;
|
189 |
}
|
190 |
|
191 |
+
$flag->unlock();
|
|
|
192 |
}
|
193 |
|
194 |
/**
|
196 |
*/
|
197 |
public function refreshAction()
|
198 |
{
|
199 |
+
$flag = $this->_getFlag();
|
200 |
+
if ($flag->isLocked()) {
|
201 |
+
return;
|
202 |
+
}
|
203 |
+
|
204 |
+
session_write_close();
|
205 |
+
ignore_user_abort(true);
|
206 |
+
set_time_limit(0);
|
207 |
+
|
208 |
$itemIds = $this->getRequest()->getParam('item');
|
209 |
|
210 |
try {
|
211 |
+
$flag->lock();
|
212 |
Mage::getModel('googleshopping/massOperations')
|
213 |
+
->setFlag($flag)
|
214 |
->synchronizeItems($itemIds);
|
215 |
} catch (Zend_Gdata_App_CaptchaRequiredException $e) {
|
216 |
+
// Google requires CAPTCHA for login
|
217 |
+
$this->_getSession()->addError(Mage::helper('googleshopping')->__($e->getMessage()));
|
218 |
+
$flag->unlock();
|
219 |
$this->_redirectToCaptcha($e);
|
220 |
return;
|
221 |
+
} catch (Exception $e) {
|
222 |
+
$flag->unlock();
|
223 |
+
Mage::getModel('adminnotification/inbox')->addMajor(
|
224 |
+
Mage::helper('googleshopping')->__('An error has occured while deleting products from google shopping account.'),
|
225 |
+
Mage::helper('googleshopping')->__('One or more products were not deleted from google shopping account. Refer to the log file for details.')
|
226 |
+
);
|
227 |
+
Mage::logException($e);
|
228 |
+
return;
|
229 |
}
|
230 |
|
231 |
+
$flag->unlock();
|
|
|
232 |
}
|
233 |
|
234 |
/**
|
236 |
*/
|
237 |
public function confirmCaptchaAction()
|
238 |
{
|
239 |
+
|
240 |
$storeId = $this->_getStore()->getId();
|
241 |
try {
|
242 |
Mage::getModel('googleshopping/service')->getClient(
|
251 |
$this->_redirectToCaptcha($e);
|
252 |
return;
|
253 |
} catch (Zend_Gdata_App_Exception $e) {
|
254 |
+
$this->_getSession()->addError(
|
255 |
+
Mage::helper('googleshopping')->parseGdataExceptionMessage($e->getMessage())
|
256 |
+
);
|
257 |
} catch (Exception $e) {
|
258 |
Mage::logException($e);
|
259 |
$this->_getSession()->addError($this->__('Captcha confirmation error.'));
|
262 |
$this->_redirect('*/*/index', array('store'=>$storeId));
|
263 |
}
|
264 |
|
265 |
+
/**
|
266 |
+
* Retrieve background process status
|
267 |
+
*
|
268 |
+
* @return Zend_Controller_Response_Abstract
|
269 |
+
*/
|
270 |
+
public function statusAction()
|
271 |
+
{
|
272 |
+
if ($this->getRequest()->isAjax()) {
|
273 |
+
$this->getResponse()->setHeader('Content-Type', 'application/json');
|
274 |
+
$params = array(
|
275 |
+
'is_running' => $this->_getFlag()->isLocked()
|
276 |
+
);
|
277 |
+
return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($params));
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
/**
|
282 |
* Redirect user to Google Captcha challenge
|
283 |
*
|
285 |
*/
|
286 |
protected function _redirectToCaptcha($e)
|
287 |
{
|
288 |
+
$redirectUrl = $this->getUrl(
|
289 |
+
'*/*/index',
|
290 |
+
array(
|
291 |
+
'store' => $this->_getStore()->getId(),
|
292 |
'captcha_token' => Mage::helper('core')->urlEncode($e->getCaptchaToken()),
|
293 |
'captcha_url' => Mage::helper('core')->urlEncode($e->getCaptchaUrl())
|
294 |
)
|
295 |
);
|
296 |
+
if ($this->getRequest()->isAjax()) {
|
297 |
+
$this->getResponse()->setHeader('Content-Type', 'application/json')
|
298 |
+
->setBody(Mage::helper('core')->jsonEncode(array('redirect' => $redirectUrl)));
|
299 |
+
} else {
|
300 |
+
$this->_redirect($redirectUrl);
|
301 |
+
}
|
302 |
}
|
303 |
|
304 |
/**
|
app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/etc/adminhtml.xml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
-
* @copyright Copyright (c)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
app/code/core/Mage/GoogleShopping/etc/config.xml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
-
* @copyright Copyright (c)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
@@ -107,6 +107,14 @@
|
|
107 |
</googleshopping_observer>
|
108 |
</observers>
|
109 |
</catalog_product_delete_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
</events>
|
111 |
<layout>
|
112 |
<updates>
|
@@ -122,7 +130,7 @@
|
|
122 |
<target_country>US</target_country>
|
123 |
<account_type>HOSTED_OR_GOOGLE</account_type>
|
124 |
|
125 |
-
<!--
|
126 |
language code (ISO 639-1) and currency code (ISO 3166)
|
127 |
according to Google Content documentation. -->
|
128 |
<allowed_countries>
|
@@ -132,12 +140,25 @@
|
|
132 |
<currency>AUD</currency>
|
133 |
<currency_name>Australian Dollar</currency_name>
|
134 |
</AU>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
<CN translate="name currency_name">
|
136 |
<name>China</name>
|
137 |
<language>zh_CN</language>
|
138 |
<currency>CNY</currency>
|
139 |
<currency_name>Chinese Yuan Renminbi</currency_name>
|
140 |
</CN>
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
<DE translate="name currency_name">
|
142 |
<name>Germany</name>
|
143 |
<language>de</language>
|
@@ -145,25 +166,6 @@
|
|
145 |
<currency>EUR</currency>
|
146 |
<currency_name>Euro</currency_name>
|
147 |
</DE>
|
148 |
-
<ES translate="name currency_name">
|
149 |
-
<name>Spain</name>
|
150 |
-
<language>es</language>
|
151 |
-
<currency>EUR</currency>
|
152 |
-
<currency_name>Euro</currency_name>
|
153 |
-
</ES>
|
154 |
-
<FR translate="name currency_name">
|
155 |
-
<name>France</name>
|
156 |
-
<language>fr</language>
|
157 |
-
<currency>EUR</currency>
|
158 |
-
<currency_name>Euro</currency_name>
|
159 |
-
</FR>
|
160 |
-
<GB translate="name currency_name">
|
161 |
-
<name>United Kingdom</name>
|
162 |
-
<language>en</language>
|
163 |
-
<locale>en_GB</locale>
|
164 |
-
<currency>GBP</currency>
|
165 |
-
<currency_name>British Pound Sterling</currency_name>
|
166 |
-
</GB>
|
167 |
<IT translate="name currency_name">
|
168 |
<name>Italy</name>
|
169 |
<language>it</language>
|
@@ -182,6 +184,26 @@
|
|
182 |
<currency>EUR</currency>
|
183 |
<currency_name>Euro</currency_name>
|
184 |
</NL>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
<US translate="name currency_name">
|
186 |
<name>United States</name>
|
187 |
<language>en</language>
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
107 |
</googleshopping_observer>
|
108 |
</observers>
|
109 |
</catalog_product_delete_before>
|
110 |
+
<controller_action_predispatch_adminhtml>
|
111 |
+
<observers>
|
112 |
+
<googleshopping_observer>
|
113 |
+
<class>googleshopping/observer</class>
|
114 |
+
<method>checkSynchronizationOperations</method>
|
115 |
+
</googleshopping_observer>
|
116 |
+
</observers>
|
117 |
+
</controller_action_predispatch_adminhtml>
|
118 |
</events>
|
119 |
<layout>
|
120 |
<updates>
|
130 |
<target_country>US</target_country>
|
131 |
<account_type>HOSTED_OR_GOOGLE</account_type>
|
132 |
|
133 |
+
<!-- Available target countries. Each country must have
|
134 |
language code (ISO 639-1) and currency code (ISO 3166)
|
135 |
according to Google Content documentation. -->
|
136 |
<allowed_countries>
|
140 |
<currency>AUD</currency>
|
141 |
<currency_name>Australian Dollar</currency_name>
|
142 |
</AU>
|
143 |
+
<BR translate="name currency_name">
|
144 |
+
<name>Brazil</name>
|
145 |
+
<language>pt</language>
|
146 |
+
<locale>pt_BR</locale>
|
147 |
+
<currency>BRL</currency>
|
148 |
+
<currency_name>Brazilian Real</currency_name>
|
149 |
+
</BR>
|
150 |
<CN translate="name currency_name">
|
151 |
<name>China</name>
|
152 |
<language>zh_CN</language>
|
153 |
<currency>CNY</currency>
|
154 |
<currency_name>Chinese Yuan Renminbi</currency_name>
|
155 |
</CN>
|
156 |
+
<FR translate="name currency_name">
|
157 |
+
<name>France</name>
|
158 |
+
<language>fr</language>
|
159 |
+
<currency>EUR</currency>
|
160 |
+
<currency_name>Euro</currency_name>
|
161 |
+
</FR>
|
162 |
<DE translate="name currency_name">
|
163 |
<name>Germany</name>
|
164 |
<language>de</language>
|
166 |
<currency>EUR</currency>
|
167 |
<currency_name>Euro</currency_name>
|
168 |
</DE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
<IT translate="name currency_name">
|
170 |
<name>Italy</name>
|
171 |
<language>it</language>
|
184 |
<currency>EUR</currency>
|
185 |
<currency_name>Euro</currency_name>
|
186 |
</NL>
|
187 |
+
<ES translate="name currency_name">
|
188 |
+
<name>Spain</name>
|
189 |
+
<language>es</language>
|
190 |
+
<currency>EUR</currency>
|
191 |
+
<currency_name>Euro</currency_name>
|
192 |
+
</ES>
|
193 |
+
<CH translate="name currency_name">
|
194 |
+
<name>Switzerland</name>
|
195 |
+
<language>de</language>
|
196 |
+
<locale>de_CH</locale>
|
197 |
+
<currency>CHF</currency>
|
198 |
+
<currency_name>Swiss Franc</currency_name>
|
199 |
+
</CH>
|
200 |
+
<GB translate="name currency_name">
|
201 |
+
<name>United Kingdom</name>
|
202 |
+
<language>en</language>
|
203 |
+
<locale>en_GB</locale>
|
204 |
+
<currency>GBP</currency>
|
205 |
+
<currency_name>British Pound Sterling</currency_name>
|
206 |
+
</GB>
|
207 |
<US translate="name currency_name">
|
208 |
<name>United States</name>
|
209 |
<language>en</language>
|
app/code/core/Mage/GoogleShopping/etc/system.xml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
-
* @copyright Copyright (c)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-data-install-0.2.0.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-install-0.2.0.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-upgrade-0.2.1-0.2.2.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/mysql4-upgrade-1.5.9.9-1.6.0.0.php
CHANGED
@@ -20,18 +20,10 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
-
/**
|
28 |
-
* GoogleShopping upgrade
|
29 |
-
*
|
30 |
-
* @category Mage
|
31 |
-
* @package Mage_GoogleShopping
|
32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
-
*/
|
34 |
-
|
35 |
/* @var $installer Mage_Core_Model_Resource_Setup */
|
36 |
$installer = $this;
|
37 |
$installer->startSetup();
|
@@ -80,7 +72,6 @@ $installer->getConnection()->dropIndex(
|
|
80 |
/**
|
81 |
* Change columns
|
82 |
*/
|
83 |
-
|
84 |
$tables = array(
|
85 |
$installer->getTable('googleshopping/types') => array(
|
86 |
'columns' => array(
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/* @var $installer Mage_Core_Model_Resource_Setup */
|
28 |
$installer = $this;
|
29 |
$installer->startSetup();
|
72 |
/**
|
73 |
* Change columns
|
74 |
*/
|
|
|
75 |
$tables = array(
|
76 |
$installer->getTable('googleshopping/types') => array(
|
77 |
'columns' => array(
|
app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php
CHANGED
@@ -20,26 +20,15 @@
|
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
-
/**
|
28 |
-
* GoogleShopping upgrade
|
29 |
-
*
|
30 |
-
* @category Mage
|
31 |
-
* @package Mage_GoogleShopping
|
32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
-
*/
|
34 |
/** @var $installer Mage_Core_Model_Resource_Setup */
|
35 |
$installer = $this;
|
36 |
|
37 |
-
$installer->startSetup();
|
38 |
-
|
39 |
$installer->getConnection()->addColumn($installer->getTable('googleshopping/types'), 'category', array(
|
40 |
'TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
41 |
'LENGTH' => 40,
|
42 |
'COMMENT' => 'Google product category',
|
43 |
));
|
44 |
-
|
45 |
-
$installer->endSetup();
|
20 |
*
|
21 |
* @category Mage
|
22 |
* @package Mage_GoogleShopping
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/** @var $installer Mage_Core_Model_Resource_Setup */
|
28 |
$installer = $this;
|
29 |
|
|
|
|
|
30 |
$installer->getConnection()->addColumn($installer->getTable('googleshopping/types'), 'category', array(
|
31 |
'TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
32 |
'LENGTH' => 40,
|
33 |
'COMMENT' => 'Google product category',
|
34 |
));
|
|
|
|
app/design/adminhtml/default/default/layout/googleshopping.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package default_default
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
|
29 |
+
<layout>
|
30 |
+
<adminhtml_googleshopping_items_index>
|
31 |
+
<reference name="head">
|
32 |
+
<action method="addJs"><file>mage/adminhtml/googleshopping.js</file></action>
|
33 |
+
</reference>
|
34 |
+
</adminhtml_googleshopping_items_index>
|
35 |
+
</layout>
|
app/design/adminhtml/default/default/template/googleshopping/captcha.phtml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
app/design/adminhtml/default/default/template/googleshopping/items.phtml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
@@ -28,7 +28,6 @@
|
|
28 |
<?php echo $this->getCaptchaHtml() ?>
|
29 |
|
30 |
<?php echo $this->getStoreSwitcherHtml() ?>
|
31 |
-
|
32 |
<div class="entry-edit">
|
33 |
<div class="entry-edit-head">
|
34 |
<div style="float: right;"></div>
|
@@ -44,14 +43,10 @@
|
|
44 |
<?php echo $this->getChildHtml('product') ?>
|
45 |
</div>
|
46 |
|
47 |
-
|
48 |
<script type="text/javascript">
|
49 |
//<![CDATA[
|
50 |
-
|
51 |
-
|
52 |
-
$('
|
53 |
-
var element = event.element();
|
54 |
-
productsGridElement.visible() ? productsGridElement.hide() : productsGridElement.show();
|
55 |
-
});
|
56 |
//]]>
|
57 |
</script>
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
28 |
<?php echo $this->getCaptchaHtml() ?>
|
29 |
|
30 |
<?php echo $this->getStoreSwitcherHtml() ?>
|
|
|
31 |
<div class="entry-edit">
|
32 |
<div class="entry-edit-head">
|
33 |
<div style="float: right;"></div>
|
43 |
<?php echo $this->getChildHtml('product') ?>
|
44 |
</div>
|
45 |
|
|
|
46 |
<script type="text/javascript">
|
47 |
//<![CDATA[
|
48 |
+
Mage.GoogleShopping.isProcessRunning = <?php echo $this->isProcessRunning() ? 'true' : 'false'; ?>;
|
49 |
+
Mage.GoogleShopping.statusUrl = '<?php echo $this->getStatusUrl(); ?>';
|
50 |
+
Mage.GoogleShopping.runningMessage = '<?php echo $this->__('Google Shopping synchronization process is running');?>';
|
|
|
|
|
|
|
51 |
//]]>
|
52 |
</script>
|
app/design/adminhtml/default/default/template/googleshopping/types/edit.phtml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
app/design/adminhtml/default/default/template/googleshopping/types/edit/attributes.phtml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
app/design/adminhtml/default/default/template/googleshopping/types/edit/select.phtml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
-
* @copyright Copyright (c)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
20 |
*
|
21 |
* @category design
|
22 |
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
*/
|
26 |
?>
|
app/etc/modules/Mage_GoogleShopping.xml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
-
* @copyright Copyright (c)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
21 |
*
|
22 |
* @category Mage
|
23 |
* @package Mage_GoogleShopping
|
24 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
25 |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
*/
|
27 |
-->
|
js/mage/adminhtml/googleshopping.js
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Magento
|
3 |
+
*
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/afl-3.0.php
|
10 |
+
* If you did not receive a copy of the license and are unable to
|
11 |
+
* obtain it through the world-wide-web, please send an email
|
12 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
13 |
+
*
|
14 |
+
* DISCLAIMER
|
15 |
+
*
|
16 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
17 |
+
* versions in the future. If you wish to customize Magento for your
|
18 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
19 |
+
*
|
20 |
+
* @category Mage
|
21 |
+
* @package Mage_Adminhtml
|
22 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
23 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
24 |
+
*/
|
25 |
+
if (typeof Mage == 'undefined') {
|
26 |
+
Mage = {};
|
27 |
+
}
|
28 |
+
if (typeof Mage.GoogleShopping == 'undefined') {
|
29 |
+
Mage.GoogleShopping = {
|
30 |
+
productForm: null,
|
31 |
+
productGrid: null,
|
32 |
+
|
33 |
+
poller: {
|
34 |
+
timeout: 10000,
|
35 |
+
interval: null,
|
36 |
+
|
37 |
+
start: function(url) {
|
38 |
+
this.interval = setInterval(this.request.bind(this, url), this.timeout)
|
39 |
+
},
|
40 |
+
|
41 |
+
stop: function() {
|
42 |
+
clearInterval(this.interval);
|
43 |
+
},
|
44 |
+
|
45 |
+
request: function(url) {
|
46 |
+
Ajax.Responders.unregister(varienLoaderHandler.handler);
|
47 |
+
new Ajax.Request(url, {
|
48 |
+
method: 'get',
|
49 |
+
onComplete: (function (response) {
|
50 |
+
this.onSuccess(response.responseJSON.is_running);
|
51 |
+
}).bind(this)
|
52 |
+
})
|
53 |
+
},
|
54 |
+
|
55 |
+
onSuccess: function(isFinished) {
|
56 |
+
|
57 |
+
}
|
58 |
+
},
|
59 |
+
|
60 |
+
startAction: function (form) {
|
61 |
+
Ajax.Responders.unregister(varienLoaderHandler.handler);
|
62 |
+
this.lock();
|
63 |
+
new Ajax.Request(form.action, {
|
64 |
+
'method': 'post',
|
65 |
+
'parameters': form.serialize(true),
|
66 |
+
'onSuccess': Mage.GoogleShopping.onSuccess.bind(Mage.GoogleShopping, this),
|
67 |
+
'onFailure': Mage.GoogleShopping.onFailure.bind(Mage.GoogleShopping, this)
|
68 |
+
});
|
69 |
+
},
|
70 |
+
|
71 |
+
onSuccess: function(form, response) {
|
72 |
+
if (response.responseJSON && typeof response.responseJSON.redirect != 'undefined') {
|
73 |
+
setLocation(response.responseJSON.redirect);
|
74 |
+
} else {
|
75 |
+
window.location.reload();
|
76 |
+
}
|
77 |
+
},
|
78 |
+
|
79 |
+
onFailure: function() {
|
80 |
+
window.location.reload();
|
81 |
+
},
|
82 |
+
|
83 |
+
lock: function() {
|
84 |
+
if (this.itemForm) {
|
85 |
+
this.lockButton($(this.itemForm).down('button'));
|
86 |
+
}
|
87 |
+
if (this.productForm) {
|
88 |
+
this.lockButton($(this.productForm).down('button'));
|
89 |
+
}
|
90 |
+
this.addMessage();
|
91 |
+
},
|
92 |
+
|
93 |
+
addMessage: function() {
|
94 |
+
var messageBox = $('messages');
|
95 |
+
var messageList = $(messageBox).down('ul.messages');
|
96 |
+
if (!messageList) {
|
97 |
+
messageList = new Element('ul', {class: 'messages'});
|
98 |
+
messageBox.update(messageList);
|
99 |
+
}
|
100 |
+
var message = '<li class="notice-msg">' + this.runningMessage + '</li>';
|
101 |
+
messageList.update(message);
|
102 |
+
},
|
103 |
+
|
104 |
+
lockButton: function (button) {
|
105 |
+
$(button).addClassName('disabled loading');
|
106 |
+
$(button).disabled = true;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
Event.observe(document, 'dom:loaded', function() {
|
113 |
+
Mage.GoogleShopping.itemForm = items_massactionJsObject.form;
|
114 |
+
items_massactionJsObject.prepareForm = items_massactionJsObject.prepareForm.wrap(function (proceed) {
|
115 |
+
Mage.GoogleShopping.itemForm = proceed();
|
116 |
+
Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); };
|
117 |
+
return Mage.GoogleShopping.itemForm;
|
118 |
+
});
|
119 |
+
|
120 |
+
Mage.GoogleShopping.productForm = googleshopping_selection_search_grid__massactionJsObject.form;
|
121 |
+
googleshopping_selection_search_grid__massactionJsObject.prepareForm = googleshopping_selection_search_grid__massactionJsObject.prepareForm.wrap(function (proceed) {
|
122 |
+
Mage.GoogleShopping.productForm = proceed();
|
123 |
+
Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) };
|
124 |
+
return Mage.GoogleShopping.productForm;
|
125 |
+
});
|
126 |
+
|
127 |
+
Mage.GoogleShopping.itemForm.submit = function(){ Mage.GoogleShopping.startAction(this); };
|
128 |
+
Mage.GoogleShopping.productForm.submit = function() { Mage.GoogleShopping.startAction(this) };
|
129 |
+
if (Mage.GoogleShopping.isProcessRunning) {
|
130 |
+
Mage.GoogleShopping.lock();
|
131 |
+
Mage.GoogleShopping.poller.onSuccess = function(isRunning){
|
132 |
+
if (!isRunning) {
|
133 |
+
this.stop()
|
134 |
+
Mage.GoogleShopping.onSuccess();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
Mage.GoogleShopping.poller.start(Mage.GoogleShopping.statusUrl);
|
138 |
+
}
|
139 |
+
});
|
package.xml
CHANGED
@@ -1,19 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mage_GoogleShopping</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Google Content API for Shopping</summary>
|
10 |
-
<description>This extension covers the new Content API logic and it is designed for managing merchant item being uploaded to Google Base
|
11 |
-
</
|
12 |
-
<notes>Available for: EE 1.11.0.0, PE 1.11.0.0, CE 1.6.0.0</notes>
|
13 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
14 |
-
<date>
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecore"><dir name="Mage"><dir name="GoogleShopping"><dir name="Block"><dir name="Adminhtml"><file name="Captcha.php" hash="
|
17 |
<compatible/>
|
18 |
-
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mage_GoogleShopping</name>
|
4 |
+
<version>1.7.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Google Content API for Shopping</summary>
|
10 |
+
<description>This extension covers the new Content API logic and it is designed for managing merchant item being uploaded to Google Base - in Magento it will simply replace the current Google Base API logic.</description>
|
11 |
+
<notes>Available for: EE 1.12.0.0, PE 1.12.0.0, CE 1.7.0.0</notes>
|
|
|
12 |
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
|
13 |
+
<date>2012-04-26</date>
|
14 |
+
<time>11:09:04</time>
|
15 |
+
<contents><target name="magecore"><dir name="Mage"><dir name="GoogleShopping"><dir name="Block"><dir name="Adminhtml"><file name="Captcha.php" hash="4143ad16c3eb0da512afbe6066644ae0"/><dir name="Items"><file name="Item.php" hash="6336fee4c4f0245536814f4a1d9a62b3"/><file name="Product.php" hash="7ef7189611e3c6c91fc26bd73e0d73c3"/><dir name="Renderer"><file name="Id.php" hash="81b4f42f633401a756999fb51fe4f3ed"/></dir></dir><file name="Items.php" hash="0bbda8cb8f0a3723c052fd3d3b8d7305"/><dir name="Store"><file name="Switcher.php" hash="be432a7b88a0e1e7d091953c7f0afe54"/></dir><dir name="Types"><dir name="Edit"><file name="Attributes.php" hash="d437ceeacbbb6ef6d18561ff63a61eff"/><file name="Form.php" hash="3aed4d86b22c806457ca13a69283cf4e"/><file name="Select.php" hash="7b469323826d6d216f65478d3575138d"/></dir><file name="Edit.php" hash="0c4b329b5823b8e79f8759f019a7f207"/><file name="Grid.php" hash="2c831913aa3fd0d50d9e9fd35af1be7c"/><dir name="Renderer"><file name="Country.php" hash="4a984a1d395855a6ec80d1a26239d000"/></dir></dir><file name="Types.php" hash="f9034dd04ef04449c171a06d64dff23f"/></dir></dir><dir name="Helper"><file name="Category.php" hash="227d84a2293eadb42ad39fec2878add6"/><file name="Data.php" hash="39c9622a2bdc1a31776daede23f0a21e"/><file name="Price.php" hash="d2d5bfc0867b3b44930940e59f6d7722"/><file name="Product.php" hash="b8cdee9bf276fcf1b75d5265c45730dd"/></dir><dir name="Model"><dir name="Attribute"><file name="Availability.php" hash="f13aa5dc7418e4db05bebb5b583ac87c"/><file name="Condition.php" hash="0af0cf46ef94cfad75c8e411c0b5694c"/><file name="Content.php" hash="716dee77d50d34663e50e223898c9309"/><file name="ContentLanguage.php" hash="61c164d479c88306fd32c7ca51cacbbe"/><file name="Default.php" hash="ad65c6747c653fdf4ca24b36bee95d3e"/><file name="Destinations.php" hash="3dcd8748de8dfe1538aa8c3d2328f5a3"/><file name="GoogleProductCategory.php" hash="205bd4dfad29327095562cb161a5583f"/><file name="Id.php" hash="0a89b3505d107f462997de0fa075c503"/><file name="ImageLink.php" hash="77350ef00768e2719de25182c7f01af1"/><file name="Link.php" hash="aaeedeb15920000ceb5fcd13ef0d4dd0"/><file name="Price.php" hash="0eb8dc8f95738e0f24c1e7b6f6cbabbc"/><file name="ProductType.php" hash="b568224e6120553f71d70e39e2649326"/><file name="Quantity.php" hash="4d0060a71b67f5238403f4fe8f81618d"/><file name="SalePriceEffectiveDate.php" hash="01b2674fe481580d8bbc712c317a635a"/><file name="ShippingWeight.php" hash="6ca5fe3da32581c19e80cdafc679b613"/><file name="TargetCountry.php" hash="1dab9f2a02f1c5454f2cd067f9a67c98"/><file name="Tax.php" hash="53d907760630cfabbb38390590d0dd81"/><file name="Title.php" hash="47bf436dc33db0e70dad53f2586deb37"/></dir><file name="Attribute.php" hash="bb8ce8268655853fe31f71bb96a02a66"/><file name="Config.php" hash="90c7eb82f97e35dd5927396d4cd4e74a"/><file name="Flag.php" hash="35582ef287ec3dff6d68bf8785ab399c"/><file name="Item.php" hash="4afa35a4f808392f180086126e3a1933"/><file name="MassOperations.php" hash="40d62c8e8e663e575638fd7d1448cd5f"/><dir name="Mysql4"><dir name="Attribute"><file name="Collection.php" hash="49ead48432c28687afae3dfda987ddd6"/></dir><file name="Attribute.php" hash="7a836f2544d4fabff71a4d2b4b4280d2"/><dir name="Item"><file name="Collection.php" hash="17007455ec641486eddf50685af40b97"/></dir><file name="Item.php" hash="5573793589fe1dfac871a0f3b1a19f61"/><dir name="Type"><file name="Collection.php" hash="6b97cd92c5d7fe1b820a768a5e438a2d"/></dir><file name="Type.php" hash="19e26756704e527ec780f40deaf5098c"/></dir><file name="Observer.php" hash="23d8f04bfd3705e27070b3a389e0ebdb"/><dir name="Resource"><dir name="Attribute"><file name="Collection.php" hash="d3d5cc5a29fde046c657e5214ee7e366"/></dir><file name="Attribute.php" hash="4846e788785db47b89ed48ec6ac06f8b"/><dir name="Item"><file name="Collection.php" hash="ee6dcf9fa9a73d14b5d5f8613c67b0d8"/></dir><file name="Item.php" hash="411dedb533dd505047b31554524b14ea"/><dir name="Type"><file name="Collection.php" hash="a9464f9bf197890159ad0eced2c5103d"/></dir><file name="Type.php" hash="4582fd47e62b05bc523fe4a78b7a96b2"/></dir><dir name="Service"><file name="Item.php" hash="e6e4a829829527ba6ea86e12f5b0af48"/></dir><file name="Service.php" hash="a35e7ba95ec136bf0f8a61ff224cdb88"/><dir name="Source"><file name="Accounttype.php" hash="ba1834d3e34814e1879a4fbc76c9b183"/><file name="Authtype.php" hash="31d531d5e42072b8cd896afddc3d9032"/><file name="Country.php" hash="23cc14b10f6eca4947507ecd7f7f69d7"/><file name="Destinationstates.php" hash="b3544e361d0a73f45a1514a04ff9b349"/><file name="Statuses.php" hash="a5a5c53eae596966cedae54d539df43b"/></dir><file name="Type.php" hash="40276556255a531c1a10e2806df97639"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Googleshopping"><file name="ItemsController.php" hash="c58ede615629aed9c6acd18e9c0053f8"/><file name="SelectionController.php" hash="ff899be758938c82d884d970416ab6ef"/><file name="TypesController.php" hash="616488851ab9c1ae9fdc5e0cbbbd383c"/></dir></dir></dir><dir name="data"><dir name="googleshopping_setup"><file name="data-install-1.6.0.0.php" hash="fd5a6606c7f1daac7ad7817131ef284c"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d5257bafde2f337dd572e512a3704b9d"/><file name="config.xml" hash="c53e02278813511473a46f2af79626df"/><file name="system.xml" hash="c5ff99eda3263334647e47d2c701be3f"/></dir><dir name="sql"><dir name="googleshopping_setup"><file name="install-1.6.0.0.php" hash="9490dc3a2891d30783c8ed18601788bd"/><file name="mysql4-data-install-0.2.0.php" hash="12e5243bac7412f5de1847786362b84b"/><file name="mysql4-install-0.2.0.php" hash="96dcb8be2a9ac84bdd88544660411f32"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="3234a535e84bdc5466166fcf9bbb6491"/><file name="mysql4-upgrade-1.5.9.9-1.6.0.0.php" hash="776f4ca64eafbf4e594b486278191e02"/><file name="upgrade-1.6.0.0-1.6.0.0.1.php" hash="0db18243865a9ea0d7fa60437c1cc944"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="googleshopping"><file name="captcha.phtml" hash="a00c84d74ca35d93e33b0aa9bdb25c9f"/><file name="items.phtml" hash="342abd65c89e703655399af8fd81111d"/><dir name="types"><dir name="edit"><file name="attributes.phtml" hash="31f1466fa8a6f11210b593a0803ad43c"/><file name="select.phtml" hash="d7fa1d77bd9ce2975630dfcd4b06d85e"/></dir><file name="edit.phtml" hash="ffc81f19da5748941c8a58866a65e97f"/></dir></dir></dir><dir name="layout"><file name="googleshopping.xml" hash="c1a3a42ec3fb219aa32f584055e10c2c"/></dir></dir></dir></dir></target><target name="magelib"><dir name="Varien"><dir name="Gdata"><dir name="Gshopping"><file name="Content.php" hash="c7068958fc703a7218928c776ef418ce"/><file name="Entry.php" hash="859e7f4ac186179c09fa47c1905fd056"/><dir name="Extension"><file name="Attribute.php" hash="79b90aa71c69919301ed4915651d2591"/><file name="Control.php" hash="7b15a224cee2784f5d34cafd36da8d2d"/><file name="Shipping.php" hash="9e0ff59b68f0437cf5f0119d552d2566"/><file name="Tax.php" hash="2d4d18d2e3bfe4cb3cb71b9fa2ad6a70"/></dir><file name="HttpException.php" hash="c2274331db8c5dfc48cd8df7c155ea3d"/><file name="ItemQuery.php" hash="cd3bd236e9bbbf1faf72f12dcffc743f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_GoogleShopping.xml" hash="a3b0206b7012d21649e0159420a256f7"/></dir></target><target name="mageweb"><dir name="js"><dir name="mage"><dir name="adminhtml"><file name="googleshopping.js" hash="48a094d1a255031737e0dfa7c65e3510"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|