diff --git a/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Other/View/Grid.php b/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Other/View/Grid.php index d50c454f6..78001d5c0 100644 --- a/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Other/View/Grid.php +++ b/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Other/View/Grid.php @@ -280,8 +280,6 @@ public function callbackColumnProductTitle($value, $row, $column, $isExport) { if (is_null($value)) { $value = 'receiving...'; - } elseif ($value == '') { - $value = 'none'; } else { $value = '' . Mage::helper('M2ePro')->escapeHtml($value) . ''; } diff --git a/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Search/Grid.php b/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Search/Grid.php index 3b035e20b..8e6903393 100644 --- a/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Search/Grid.php +++ b/app/code/community/Ess/M2ePro/Block/Adminhtml/Common/Amazon/Listing/Search/Grid.php @@ -458,7 +458,11 @@ public function callbackColumnProductId($value, $row, $column, $isExport) public function callbackColumnProductTitle($value, $row, $column, $isExport) { - $value = ''.Mage::helper('M2ePro')->escapeHtml($value).''; + if (is_null($value)) { + $value = 'receiving...'; + } else { + $value = '' .Mage::helper('M2ePro')->escapeHtml($value). ''; + } if (!is_null($row->getData('listing_id'))) { $urlParams = array(); diff --git a/app/code/community/Ess/M2ePro/CHANGELOG b/app/code/community/Ess/M2ePro/CHANGELOG index e08bae765..677fb1250 100644 --- a/app/code/community/Ess/M2ePro/CHANGELOG +++ b/app/code/community/Ess/M2ePro/CHANGELOG @@ -1,3 +1,22 @@ +* 6.4.4 (r10771) (18/09/2016) + +* Added: Ability to install module via composer (composer.json file added) +* Added: Ability to install module via modman (modman file added) +* Added: [Amazon] Ability to create new ASIN/ISBN in Canada Marketplace using Description Policy +* Improvement: [eBay] Variation Options label can be renamed now without further errors from eBay Trading API +* Improvement: [eBay] Preventing the eBay Trading API errors if Magento Child Product will be unassigned from Parent +* Improvement: [eBay] Preventing the eBay Trading API errors if Magento Child Product will be totally removed +* Improvement: [eBay] Price will be sent to the eBay each time during Relist action (together with QTY and Variations Data) +* Fix: Quantity could be calculated incorrectly in some special cases (high limited range of cases) +* Fix: [eBay] Items duplicates because User could List Items with "Listed (Hidden)" status manually +* Fix: [eBay] Orders Synchronization could not work correctly sometimes if there are a lot of changes on eBay side +* Fix: [eBay] Wrong QTY could be set for Item after Relist action for items with "Listed (Hidden)" status +* Fix: [eBay] Excluded locations were not removed from eBay when they were removed from Shipping Policy before +* Fix: [eBay] Error "The Product was Listed as a Simple Product as it has limitation for Multi-Variation Items" during list item even if requirements are met +* Fix: [Amazon] Full revise by Description Policy did not work, if change was performed on Definition tab +* Fix: [Amazon] Synchronization was broken due to error "Call to a member function getOptions() on a non-object" +* Fix: [Amazon/Rakuten.com] Product was not revised if their Policy settings were changed and it was in "Revise in progress" state + * 6.4.3 (r10536) (20/04/2016) * Improvement: [eBay] If category of listed Item starts to require UPC/EAN/ISBN identifier, M2E will send full Details to prevent an error diff --git a/app/code/community/Ess/M2ePro/Helper/Component/Amazon.php b/app/code/community/Ess/M2ePro/Helper/Component/Amazon.php index 8836d4b48..a66ba911c 100644 --- a/app/code/community/Ess/M2ePro/Helper/Component/Amazon.php +++ b/app/code/community/Ess/M2ePro/Helper/Component/Amazon.php @@ -202,7 +202,7 @@ public function getMarketplacesAvailableForApiCreation() public function getMarketplacesAvailableForAsinCreation() { $collection = $this->getMarketplacesAvailableForApiCreation(); - return $collection->addFieldToFilter('is_asin_available', 1); + return $collection->addFieldToFilter('is_new_asin_available', 1); } //######################################## diff --git a/app/code/community/Ess/M2ePro/Helper/Module.php b/app/code/community/Ess/M2ePro/Helper/Module.php index 33251fc36..cacacae40 100644 --- a/app/code/community/Ess/M2ePro/Helper/Module.php +++ b/app/code/community/Ess/M2ePro/Helper/Module.php @@ -72,7 +72,7 @@ public function getVersion() public function getRevision() { - $revision = '10536'; + $revision = '10771'; if ($revision == str_replace('|','#','|REVISION|')) { $revision = (int)exec('svnversion'); diff --git a/app/code/community/Ess/M2ePro/Helper/Module/License.php b/app/code/community/Ess/M2ePro/Helper/Module/License.php index 5a1dfcfdb..aa0afe0bf 100644 --- a/app/code/community/Ess/M2ePro/Helper/Module/License.php +++ b/app/code/community/Ess/M2ePro/Helper/Module/License.php @@ -243,7 +243,7 @@ public function getIntervalBeforeExpirationDate($component) //######################################## public function obtainRecord($email = NULL, $firstName = NULL, $lastName = NULL, - $country = NULL, $city = NULL, $postalCode = NULL) + $country = NULL, $city = NULL, $postalCode = NULL, $phone = NULL) { $requestParams = array( 'domain' => Mage::helper('M2ePro/Client')->getDomain(), @@ -253,6 +253,7 @@ public function obtainRecord($email = NULL, $firstName = NULL, $lastName = NULL, !is_null($email) && $requestParams['email'] = $email; !is_null($firstName) && $requestParams['first_name'] = $firstName; !is_null($lastName) && $requestParams['last_name'] = $lastName; + !is_null($phone) && $requestParams['phone'] = $phone; !is_null($country) && $requestParams['country'] = $country; !is_null($city) && $requestParams['city'] = $city; !is_null($postalCode) && $requestParams['postal_code'] = $postalCode; diff --git a/app/code/community/Ess/M2ePro/Model/Account.php b/app/code/community/Ess/M2ePro/Model/Account.php index 6afea3b85..5db4aa669 100644 --- a/app/code/community/Ess/M2ePro/Model/Account.php +++ b/app/code/community/Ess/M2ePro/Model/Account.php @@ -117,6 +117,11 @@ public function getTitle() return $this->getData('title'); } + public function getAdditionalData() + { + return $this->getData('additional_data'); + } + /** * @return bool */ diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Listing/Other.php b/app/code/community/Ess/M2ePro/Model/Amazon/Listing/Other.php index ae1c1e282..4365c621a 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Listing/Other.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Listing/Other.php @@ -11,6 +11,8 @@ */ class Ess_M2ePro_Model_Amazon_Listing_Other extends Ess_M2ePro_Model_Component_Child_Amazon_Abstract { + const EMPTY_TITLE_PLACEHOLDER = '--'; + //######################################## public function _construct() diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Marketplace.php b/app/code/community/Ess/M2ePro/Model/Amazon/Marketplace.php index c24e3169b..85ae1a0c9 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Marketplace.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Marketplace.php @@ -62,9 +62,9 @@ public function getDefaultCurrency() /** * @return bool */ - public function isAsinAvailable() + public function isNewAsinAvailable() { - return (bool)$this->getData('is_asin_available'); + return (bool)$this->getData('is_new_asin_available'); } /** @@ -77,22 +77,6 @@ public function isMerchantFulfillmentAvailable() //######################################## - /** - * @return bool - */ - public function isNewAsinAvailable() - { - $newAsinNotImplementedMarketplaces = array( - Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_CA, - Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_JP, - Ess_M2ePro_Helper_Component_Amazon::MARKETPLACE_CN, - ); - - return !in_array((int)$this->getId(),$newAsinNotImplementedMarketplaces); - } - - //######################################## - public function save() { Mage::helper('M2ePro/Data_Cache_Permanent')->removeTagValues('marketplace'); diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Orders/Receive/Requester.php b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Orders/Receive/Requester.php index 959a41538..81b6c0cff 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Orders/Receive/Requester.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Orders/Receive/Requester.php @@ -9,6 +9,10 @@ class Ess_M2ePro_Model_Amazon_Synchronization_Orders_Receive_Requester extends Ess_M2ePro_Model_Connector_Amazon_Orders_Get_ItemsRequester { + const TIMEOUT_ERRORS_COUNT_TO_RISE = 3; + const TIMEOUT_RISE_ON_ERROR = 30; + const TIMEOUT_RISE_MAX_VALUE = 1500; + //######################################## /** @@ -38,4 +42,53 @@ public function setProcessingLocks(Ess_M2ePro_Model_Processing_Request $processi } //######################################## + + public function process() + { + $cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig(); + $cacheConfigGroup = '/amazon/synchronization/orders/receive/timeout'; + + try { + + parent::process(); + + } catch (Ess_M2ePro_Model_Exception_Connection $exception) { + + $data = $exception->getAdditionalData(); + if (!empty($data['curl_error_number']) && $data['curl_error_number'] == CURLE_OPERATION_TIMEOUTED) { + + $fails = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'fails'); + $fails++; + + $rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise'); + $rise += self::TIMEOUT_RISE_ON_ERROR; + + if ($fails >= self::TIMEOUT_ERRORS_COUNT_TO_RISE && $rise <= self::TIMEOUT_RISE_MAX_VALUE) { + + $fails = 0; + $cacheConfig->setGroupValue($cacheConfigGroup, 'rise', $rise); + } + $cacheConfig->setGroupValue($cacheConfigGroup, 'fails', $fails); + } + + throw $exception; + } + + $cacheConfig->setGroupValue($cacheConfigGroup, 'fails', 0); + } + + //######################################## + + protected function getRequestTimeout() + { + $cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig(); + $cacheConfigGroup = '/amazon/synchronization/orders/receive/timeout'; + + $rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise'); + $rise > self::TIMEOUT_RISE_MAX_VALUE && $rise = self::TIMEOUT_RISE_MAX_VALUE; + + return 300 + $rise; + } + + //######################################## } \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Title.php b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Title.php index ff20ca5dc..001012e82 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Title.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Title.php @@ -220,7 +220,7 @@ private function updateNotReceivedTitles($neededItems, $responseData) { $connWrite->update( $aloTable, - array('title' => ''), + array('title' => Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER), array('general_id = ?' => (string)$generalId) ); } diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update.php b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update.php index 18d3bf4f5..fdc434be0 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update.php @@ -106,9 +106,18 @@ protected function performActions() 'Process Account '.$account->getTitle() ); + $params = array(); + if (!$this->isFullItemsDataAlreadyReceived($account)) { + $params['full_items_data'] = true; + + $additionalData = (array)json_decode($account->getAdditionalData(), true); + $additionalData['is_amazon_other_listings_full_items_data_already_received'] = true; + $account->setSettings('additional_data', $additionalData)->save(); + } + $dispatcherObject = Mage::getModel('M2ePro/Connector_Amazon_Dispatcher'); $connectorObj = $dispatcherObject->getConnector('otherListings', 'update' ,'requester', - array(), $account, 'Ess_M2ePro_Model_Amazon_Synchronization'); + $params, $account, 'Ess_M2ePro_Model_Amazon_Synchronization'); $dispatcherObject->process($connectorObj); @@ -138,5 +147,11 @@ private function isLockedAccount(Ess_M2ePro_Model_Account $account) return $lockItem->isExist(); } + private function isFullItemsDataAlreadyReceived(Ess_M2ePro_Model_Account $account) + { + $additionalData = (array)json_decode($account->getAdditionalData(), true); + return !empty($additionalData['is_amazon_other_listings_full_items_data_already_received']); + } + //######################################## } \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update/Responser.php b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update/Responser.php index 1badfad1c..8453b7f78 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update/Responser.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/OtherListings/Update/Responser.php @@ -144,7 +144,7 @@ protected function updateReceivedOtherListings($receivedItems) $newData = array( 'general_id' => (string)$receivedItem['identifiers']['general_id'], - 'title' => !empty($receivedItem['title']) ? (string)$receivedItem['title'] : NULL, + 'title' => (string)$receivedItem['title'], 'online_price' => (float)$receivedItem['price'], 'online_qty' => (int)$receivedItem['qty'], 'is_afn_channel' => (bool)$receivedItem['channel']['is_afn'], @@ -172,8 +172,10 @@ protected function updateReceivedOtherListings($receivedItems) 'status' => (int)$existingItem['status'] ); - if (is_null($newData['title']) && !is_null($existingData['title'])) { - $newData['title'] = $existingData['title']; + if (is_null($receivedItem['title']) || + $receivedItem['title'] == Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER) { + + unset($newData['title'], $existingData['title']); } if ($newData == $existingData) { @@ -300,7 +302,7 @@ protected function createNotExistedOtherListings($receivedItems) 'general_id' => (string)$receivedItem['identifiers']['general_id'], 'sku' => (string)$receivedItem['identifiers']['sku'], - 'title' => !empty($receivedItem['title']) ? (string)$receivedItem['title'] : NULL, + 'title' => $receivedItem['title'], 'online_price' => (float)$receivedItem['price'], 'online_qty' => (int)$receivedItem['qty'], @@ -309,6 +311,12 @@ protected function createNotExistedOtherListings($receivedItems) 'is_isbn_general_id' => (bool)$receivedItem['identifiers']['is_isbn'] ); + if (isset($this->params['full_items_data']) && $this->params['full_items_data'] && + $newData['title'] == Ess_M2ePro_Model_Amazon_Listing_Other::EMPTY_TITLE_PLACEHOLDER) { + + $newData['title'] = NULL; + } + if ((bool)$newData['is_afn_channel']) { $newData['online_qty'] = NULL; $newData['status'] = Ess_M2ePro_Model_Listing_Product::STATUS_UNKNOWN; diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Templates/Revise.php b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Templates/Revise.php index f481ff117..e564cdb2a 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Templates/Revise.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Synchronization/Templates/Revise.php @@ -304,6 +304,16 @@ private function executeNeedSynchronize() $listingProductCollection->addFieldToFilter('synch_status',Ess_M2ePro_Model_Listing_Product::SYNCH_STATUS_NEED); $listingProductCollection->addFieldToFilter('is_variation_parent', 0); + $tag = 'in_action'; + $modelName = Mage::getModel('M2ePro/Listing_Product')->getResourceName(); + + $listingProductCollection->getSelect()->joinLeft( + array('lo' => Mage::getResourceModel('M2ePro/LockedObject')->getMainTable()), + "lo.object_id = main_table.id AND lo.tag='{$tag}' AND lo.model_name = '{$modelName}'", + array() + ); + $listingProductCollection->addFieldToFilter('lo.id', array('null' => true)); + $listingProductCollection->getSelect()->limit(100); /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */ diff --git a/app/code/community/Ess/M2ePro/Model/Amazon/Template/Description.php b/app/code/community/Ess/M2ePro/Model/Amazon/Template/Description.php index c7f8da66d..6f709df44 100644 --- a/app/code/community/Ess/M2ePro/Model/Amazon/Template/Description.php +++ b/app/code/community/Ess/M2ePro/Model/Amazon/Template/Description.php @@ -158,6 +158,12 @@ public function setMarketplace(Ess_M2ePro_Model_Marketplace $instance) // --------------------------------------- + public function setDefinitionTemplate(Ess_M2ePro_Model_Amazon_Template_Description_Definition $template) + { + $this->descriptionDefinitionModel = $template; + return $this; + } + /** * @return Ess_M2ePro_Model_Amazon_Template_Description_Definition */ diff --git a/app/code/community/Ess/M2ePro/Model/Buy/Synchronization/Templates/Revise.php b/app/code/community/Ess/M2ePro/Model/Buy/Synchronization/Templates/Revise.php index 30aba532a..8c3263e01 100644 --- a/app/code/community/Ess/M2ePro/Model/Buy/Synchronization/Templates/Revise.php +++ b/app/code/community/Ess/M2ePro/Model/Buy/Synchronization/Templates/Revise.php @@ -126,6 +126,16 @@ private function executeNeedSynchronize() $listingProductCollection->addFieldToFilter('status', Ess_M2ePro_Model_Listing_Product::STATUS_LISTED); $listingProductCollection->addFieldToFilter('synch_status',Ess_M2ePro_Model_Listing_Product::SYNCH_STATUS_NEED); + $tag = 'in_action'; + $modelName = Mage::getModel('M2ePro/Listing_Product')->getResourceName(); + + $listingProductCollection->getSelect()->joinLeft( + array('lo' => Mage::getResourceModel('M2ePro/LockedObject')->getMainTable()), + "lo.object_id = main_table.id AND lo.tag='{$tag}' AND lo.model_name = '{$modelName}'", + array() + ); + $listingProductCollection->addFieldToFilter('lo.id', array('null' => true)); + $listingProductCollection->getSelect()->limit(100); /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */ diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Amazon/Inventory/Get/ItemsRequester.php b/app/code/community/Ess/M2ePro/Model/Connector/Amazon/Inventory/Get/ItemsRequester.php index 510f20978..4271cb94c 100644 --- a/app/code/community/Ess/M2ePro/Model/Connector/Amazon/Inventory/Get/ItemsRequester.php +++ b/app/code/community/Ess/M2ePro/Model/Connector/Amazon/Inventory/Get/ItemsRequester.php @@ -32,7 +32,12 @@ protected function getResponserParams() protected function getRequestData() { - return array(); + $requestData = array(); + if (isset($this->params['full_items_data'])) { + $requestData['full_items_data'] = $this->params['full_items_data']; + } + + return $requestData; } //######################################## diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Multiple.php b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Multiple.php index 2d287ca94..9ced3727b 100644 --- a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Multiple.php +++ b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Multiple.php @@ -75,6 +75,25 @@ protected function filterManualListingsProducts() continue; } + if ($listingProduct->isHidden()) { + + $message = array( + // M2ePro_TRANSLATIONS + // The List action cannot be executed for this Item as it has a Listed (Hidden) status. You have to stop Item manually first to run the List action for it. + parent::MESSAGE_TEXT_KEY => 'The List action cannot be executed for this Item as it has + a Listed (Hidden) status. You have to stop Item manually first + to run the List action for it.', + parent::MESSAGE_TYPE_KEY => parent::MESSAGE_TYPE_ERROR + ); + + $this->getLogger()->logListingProductMessage( + $listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM + ); + + $this->removeAndUnlockListingProduct($listingProduct); + continue; + } + if (!$listingProduct->getChildObject()->isSetCategoryTemplate()) { $message = array( diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Single.php b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Single.php index 89102a99e..618ff68b5 100644 --- a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Single.php +++ b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/List/Single.php @@ -68,6 +68,24 @@ protected function filterManualListingProduct() return false; } + if ($this->listingProduct->isHidden()) { + + $message = array( + // M2ePro_TRANSLATIONS + // The List action cannot be executed for this Item as it has a Listed (Hidden) status. You have to stop Item manually first to run the List action for it. + parent::MESSAGE_TEXT_KEY => 'The List action cannot be executed for this Item as it has + a Listed (Hidden) status. You have to stop Item manually first + to run the List action for it.', + parent::MESSAGE_TYPE_KEY => parent::MESSAGE_TYPE_ERROR + ); + + $this->getLogger()->logListingProductMessage( + $this->listingProduct, $message, Ess_M2ePro_Model_Log_Abstract::PRIORITY_MEDIUM + ); + + return false; + } + if (!$this->listingProduct->getChildObject()->isSetCategoryTemplate()) { $message = array( diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Relist/Single.php b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Relist/Single.php index fb3ce325a..b48772936 100644 --- a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Relist/Single.php +++ b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Relist/Single.php @@ -96,8 +96,7 @@ public function process() $result = parent::process(); if ($this->params['status_changer'] == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_SYNCH && - ($this->listingProduct->getActionConfigurator()->isPartialMode() || - $this->listingProduct->getActionConfigurator()->isEmptyMode()) && + $this->listingProduct->getActionConfigurator()->isPartialMode() && $this->isNewRequiredSpecificNeeded($this->messages)) { $this->processRelistActionWithAllDataAction(); diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Revise/Single.php b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Revise/Single.php index 42475f55f..33c40d97b 100644 --- a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Revise/Single.php +++ b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Item/Revise/Single.php @@ -80,8 +80,7 @@ public function process() $result = parent::process(); if ($this->params['status_changer'] == Ess_M2ePro_Model_Listing_Product::STATUS_CHANGER_SYNCH && - ($this->listingProduct->getActionConfigurator()->isPartialMode() || - $this->listingProduct->getActionConfigurator()->isEmptyMode()) && + $this->listingProduct->getActionConfigurator()->isPartialMode() && $this->isNewRequiredSpecificNeeded($this->messages)) { $this->processReviseActionWithAllDataAction(); diff --git a/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Order/Receive/Items.php b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Order/Receive/Items.php new file mode 100644 index 000000000..315187636 --- /dev/null +++ b/app/code/community/Ess/M2ePro/Model/Connector/Ebay/Order/Receive/Items.php @@ -0,0 +1,94 @@ + $this->params['last_update'], + ); + } + + // ######################################## + + public function process() + { + $cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig(); + $cacheConfigGroup = '/ebay/synchronization/orders/receive/timeout'; + + try { + + $result = parent::process(); + + } catch (Ess_M2ePro_Model_Exception_Connection $exception) { + + $data = $exception->getAdditionalData(); + if (!empty($data['curl_error_number']) && $data['curl_error_number'] == CURLE_OPERATION_TIMEOUTED) { + + $fails = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'fails'); + $fails++; + + $rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise'); + $rise += self::TIMEOUT_RISE_ON_ERROR; + + if ($fails >= self::TIMEOUT_ERRORS_COUNT_TO_RISE && $rise <= self::TIMEOUT_RISE_MAX_VALUE) { + + $fails = 0; + $cacheConfig->setGroupValue($cacheConfigGroup, 'rise', $rise); + } + $cacheConfig->setGroupValue($cacheConfigGroup, 'fails', $fails); + } + + throw $exception; + } + + $cacheConfig->setGroupValue($cacheConfigGroup, 'fails', 0); + + return $result; + } + + // ######################################## + + protected function getRequestTimeout() + { + $cacheConfig = Mage::helper('M2ePro/Module')->getCacheConfig(); + $cacheConfigGroup = '/ebay/synchronization/orders/receive/timeout'; + + $rise = (int)$cacheConfig->getGroupValue($cacheConfigGroup, 'rise'); + $rise > self::TIMEOUT_RISE_MAX_VALUE && $rise = self::TIMEOUT_RISE_MAX_VALUE; + + return 300 + $rise; + } + + // ######################################## + + protected function validateResponseData($response) + { + return true; + } + + protected function prepareResponseData($response) + { + return $response; + } + + // ######################################## +} \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Action/Configurator.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Action/Configurator.php index 208fae16b..fbbcf3971 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Action/Configurator.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Action/Configurator.php @@ -9,8 +9,6 @@ abstract class Ess_M2ePro_Model_Ebay_Listing_Action_Configurator extends Ess_M2ePro_Model_Listing_Product_Action_Configurator { - const MODE_EMPTY = 'empty'; - const DATA_TYPE_GENERAL = 'general'; const DATA_TYPE_QTY = 'qty'; const DATA_TYPE_PRICE = 'price'; @@ -20,37 +18,6 @@ abstract class Ess_M2ePro_Model_Ebay_Listing_Action_Configurator //######################################## - /** - * @return array - */ - public function getAllModes() - { - return array_merge( - parent::getAllModes(), - array(self::MODE_EMPTY) - ); - } - - //######################################## - - /** - * @return bool - */ - public function isEmptyMode() - { - return $this->mode == self::MODE_EMPTY; - } - - /** - * @return $this - */ - public function setEmptyMode() - { - return $this->setMode(self::MODE_EMPTY); - } - - //######################################## - /** * @return array */ @@ -68,64 +35,6 @@ public function getAllDataTypes() //######################################## - /** - * @return bool - */ - public function isAllAllowed() - { - if ($this->isEmptyMode()) { - return false; - } - - return parent::isAllAllowed(); - } - - /** - * @return array - */ - public function getAllowedDataTypes() - { - if ($this->isEmptyMode()) { - return array(); - } - - return parent::getAllowedDataTypes(); - } - - //######################################## - - /** - * @param $dataType - * @return bool - */ - public function isAllowed($dataType) - { - if ($this->isEmptyMode()) { - return false; - } - - return parent::isAllowed($dataType); - } - - /** - * @param $dataType - * @return $this - * @throws Ess_M2ePro_Model_Exception_Logic - */ - public function allow($dataType) - { - $this->validateDataType($dataType); - - if ($this->isAllowed($dataType) || $this->isEmptyMode()) { - return $this; - } - - $this->allowedDataTypes[] = $dataType; - return $this; - } - - //######################################## - /** * @return bool */ @@ -281,38 +190,4 @@ public function disallowDescription() } //######################################## - - /** - * @param Ess_M2ePro_Model_Listing_Product_Action_Configurator $configurator - * @return bool - */ - public function isDataConsists(Ess_M2ePro_Model_Listing_Product_Action_Configurator $configurator) - { - if ($configurator->isEmptyMode()) { - return true; - } - - if ($this->isEmptyMode()) { - return false; - } - - return parent::isDataConsists($configurator); - } - - // --------------------------------------- - - /** - * @param Ess_M2ePro_Model_Listing_Product_Action_Configurator $configurator - * @return $this - */ - public function mergeData(Ess_M2ePro_Model_Listing_Product_Action_Configurator $configurator) - { - if ($configurator->isEmptyMode()) { - return $this; - } - - return parent::mergeData($configurator); - } - - //######################################## } \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Shipping.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Shipping.php index ee60f45fc..e41f2b63f 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Shipping.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Shipping.php @@ -58,6 +58,7 @@ public function getData() $data['cross_border_trade'] = self::CROSS_BORDER_TRADE_NONE; } + $data['excluded_locations'] = array(); foreach ($this->getShippingTemplate()->getExcludedLocations() as $location) { $data['excluded_locations'][] = $location['code']; } diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Variations.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Variations.php index 1f1db28e6..3d738e3f4 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Variations.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Request/Variations.php @@ -37,6 +37,10 @@ public function getData() $data['variation_image'] = $this->getImagesData(); + if ($variationsThatCanNotBeDeleted = $this->getVariationsThatCanNotBeDeleted()) { + $data['variations_that_can_not_be_deleted'] = $variationsThatCanNotBeDeleted; + } + return $data; } @@ -146,6 +150,17 @@ public function getSetsData() return false; } + public function getVariationsThatCanNotBeDeleted() + { + $additionalData = $this->getListingProduct()->getAdditionalData(); + + if (isset($additionalData['variations_that_can_not_be_deleted'])) { + return $additionalData['variations_that_can_not_be_deleted']; + } + + return false; + } + /** * @return array */ diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/List/Request.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/List/Request.php index 6cc3a98be..6569fab8b 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/List/Request.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/List/Request.php @@ -39,6 +39,13 @@ public function getActionData() public function resetVariations() { $variations = $this->getListingProduct()->getVariations(true); + if (empty($variations)) { + return; + } + + $additionalData = $this->getListingProduct()->getAdditionalData(); + $additionalData['variations_that_can_not_be_deleted'] = []; + $this->getListingProduct()->setSettings('additional_data', $additionalData)->save(); foreach ($variations as $variation) { diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Relist/Response.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Relist/Response.php index 51eb77fdd..372dcc034 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Relist/Response.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Relist/Response.php @@ -39,6 +39,7 @@ public function processSuccess(array $response, array $responseParams = array()) $data = $this->removeConditionNecessary($data); $data = $this->appendIsVariationMpnFilledValue($data); + $data = $this->appendVariationsThatCanNotBeDeleted($data, $response); if (isset($data['additional_data'])) { $data['additional_data'] = json_encode($data['additional_data']); diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php index 2080c31e3..74434e8f3 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php @@ -512,5 +512,19 @@ protected function appendIsVariationMpnFilledValue($data) return $data; } + protected function appendVariationsThatCanNotBeDeleted(array $data, array $response) + { + if (!$this->getRequestData()->isVariationItem()) { + return $data; + } + + $variations = isset($response['variations_that_can_not_be_deleted']) + ? $response['variations_that_can_not_be_deleted'] : array(); + + $data['additional_data']['variations_that_can_not_be_deleted'] = $variations; + + return $data; + } + //######################################## } \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Revise/Response.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Revise/Response.php index ee689ad41..729dc981f 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Revise/Response.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Revise/Response.php @@ -36,6 +36,7 @@ public function processSuccess(array $response, array $responseParams = array()) $data = $this->appendGalleryImagesValues($data, $response, $responseParams); $data = $this->appendIsVariationMpnFilledValue($data); + $data = $this->appendVariationsThatCanNotBeDeleted($data, $response); if (isset($data['additional_data'])) { $data['additional_data'] = json_encode($data['additional_data']); diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Orders/Receive.php b/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Orders/Receive.php index f6a97b6ea..cacbdd27e 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Orders/Receive.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Orders/Receive.php @@ -121,9 +121,9 @@ private function processEbayOrders($account) $fromTime = $this->prepareFromTime($account); $dispatcherObj = Mage::getModel('M2ePro/Connector_Ebay_Dispatcher'); - $connectorObj = $dispatcherObj->getVirtualConnector('sales', 'get', 'list', + $connectorObj = $dispatcherObj->getConnector('order', 'receive', 'items', array('last_update' => $fromTime), - NULL, NULL, $account); + NULL, $account); $response = $dispatcherObj->process($connectorObj); $this->processResponseMessages($connectorObj); diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Templates/Relist.php b/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Templates/Relist.php index 8e1bc9a81..7469510ec 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Templates/Relist.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Synchronization/Templates/Relist.php @@ -269,17 +269,10 @@ private function prepareConfigurator(Ess_M2ePro_Model_Listing_Product $listingPr /** @var Ess_M2ePro_Model_Ebay_Listing_Product $ebayListingProduct */ $ebayListingProduct = $listingProduct->getChildObject(); - if ($ebayListingProduct->getEbaySynchronizationTemplate()->isRelistSendData()) { - return; + if (!$ebayListingProduct->getEbaySynchronizationTemplate()->isRelistSendData()) { + $configurator->setPartialMode(); + $configurator->allowQty()->allowPrice()->allowVariations(); } - - if (!$listingProduct->isHidden() && $action == Ess_M2ePro_Model_Listing_Product::ACTION_RELIST) { - $configurator->setEmptyMode(); - return; - } - - $configurator->setPartialMode(); - $configurator->allowQty()->allowVariations(); } //######################################## diff --git a/app/code/community/Ess/M2ePro/Model/Listing.php b/app/code/community/Ess/M2ePro/Model/Listing.php index a8731fa52..0b241df80 100644 --- a/app/code/community/Ess/M2ePro/Model/Listing.php +++ b/app/code/community/Ess/M2ePro/Model/Listing.php @@ -563,7 +563,7 @@ public function removeDeletedProduct($product) ->addFieldToFilter('product_id', $productId) ->getItems(); - $deletedVariationsIds = array(); + $processedVariationsIds = array(); /** @var $variationOption Ess_M2ePro_Model_Listing_Product_Variation_Option */ foreach ($variationOptions as $variationOption) { @@ -571,9 +571,55 @@ public function removeDeletedProduct($product) /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */ $listingProduct = $variationOption->getListingProduct(); - if (!in_array($variationOption->getListingProductVariationId(),$deletedVariationsIds)) { - $variationOption->getListingProductVariation()->deleteInstance(); - $deletedVariationsIds[] = $variationOption->getListingProductVariationId(); + if (!in_array($variationOption->getListingProductVariationId(),$processedVariationsIds)) { + + $processedVariationsIds[] = $variationOption->getListingProductVariationId(); + + if ($variationOption->isComponentModeEbay()) { + + $variation = $variationOption->getListingProductVariation(); + + /** @var Ess_M2ePro_Model_Ebay_Listing_Product_Variation $ebayVariation */ + $ebayVariation = $variation->getChildObject(); + + if (!$ebayVariation->isNotListed()) { + $additionalData = $listingProduct->getAdditionalData(); + $variationsThatCanNotBeDeleted = isset($additionalData['variations_that_can_not_be_deleted']) + ? $additionalData['variations_that_can_not_be_deleted'] : array(); + + $specifics = array(); + + foreach ($variation->getOptions(true) as $option) { + $specifics[$option->getAttribute()] = $option->getOption(); + } + + $variationsThatCanNotBeDeleted[] = array( + 'qty' => 0, + 'price' => $ebayVariation->getPrice(), + 'sku' => $ebayVariation->getOnlineSku(), + 'add' => 0, + 'delete' => 1, + 'specifics' => $specifics, + 'has_sales' => $ebayVariation->hasSales(), + ); + + $additionalData['variations_that_can_not_be_deleted'] = $variationsThatCanNotBeDeleted; + + $listingProduct->setSettings('additional_data', $additionalData)->save(); + } + + $variation->deleteInstance(); + } else { + $listingProduct->deleteObjectLocks(); + + if ($listingProduct->isStoppable()) { + Mage::getModel('M2ePro/StopQueue')->add($listingProduct); + $listingProduct->setStatus(Ess_M2ePro_Model_Listing_Product::STATUS_STOPPED)->save(); + } + + $listingsProductsForRemove[$listingProduct->getId()] = $listingProduct; + } + } $listingId = $listingProduct->getListingId(); @@ -601,6 +647,20 @@ public function removeDeletedProduct($product) } foreach ($listingsProductsForRemove as $listingProduct) { + if ($listingProduct->isComponentModeAmazon()) { + /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */ + $amazonListingProduct = $listingProduct->getChildObject(); + $variationManager = $amazonListingProduct->getVariationManager(); + + if ($variationManager->isRelationChildType()) { + /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonParentListingProduct */ + $amazonParentListingProduct = $variationManager->getTypeModel()->getAmazonParentListingProduct(); + $listingProduct->deleteInstance(); + $amazonParentListingProduct->getVariationManager()->getTypeModel()->getProcessor()->process(); + continue; + } + } + $listingProduct->deleteInstance(); } // --------------------------------------- diff --git a/app/code/community/Ess/M2ePro/Model/Listing/Product/QtyCalculator.php b/app/code/community/Ess/M2ePro/Model/Listing/Product/QtyCalculator.php index 792729f10..56024dd46 100644 --- a/app/code/community/Ess/M2ePro/Model/Listing/Product/QtyCalculator.php +++ b/app/code/community/Ess/M2ePro/Model/Listing/Product/QtyCalculator.php @@ -251,7 +251,7 @@ protected function applyValuePercentageModifications($value) { $percents = $this->getSource('qty_percentage'); - if ($value <= 0 || $percents < 0 || $percents > 100) { + if ($value <= 0 || $percents < 0 || $percents == 100) { return $value; } diff --git a/app/code/community/Ess/M2ePro/Model/Magento/Product/Variation.php b/app/code/community/Ess/M2ePro/Model/Magento/Product/Variation.php index 8d9a16b52..d06761d29 100644 --- a/app/code/community/Ess/M2ePro/Model/Magento/Product/Variation.php +++ b/app/code/community/Ess/M2ePro/Model/Magento/Product/Variation.php @@ -426,7 +426,7 @@ protected function prepareVariationsTypeStandard(&$optionsScope, &$set, $optionS foreach ($optionsScope[$optionScopeIndex] as $option) { if (!isset($set[$option['attribute']]) || - !in_array($option['option'],$set[$option['attribute']])) { + !in_array($option['option'],$set[$option['attribute']],true)) { continue; } @@ -451,7 +451,7 @@ protected function sortAttributeOptions($attributeCode, $options) $sortedOptions = array(); foreach ($optionCollection as $option) { - if (!in_array($option->getValue(), $options) || + if (!in_array($option->getValue(), $options, true) || in_array($option->getValue(), $sortedOptions, true)) { continue; } @@ -919,7 +919,7 @@ protected function getConfigurableTitlesVariationSet() $attributeValues[$valueId] = array(); } - if (!in_array($attributeValue->getValue(), $attributeValues[$valueId])) { + if (!in_array($attributeValue->getValue(), $attributeValues[$valueId], true)) { $attributeValues[$valueId][$storeId] = $attributeValue->getValue(); } } diff --git a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Common/Amazon/Template/DescriptionController.php b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Common/Amazon/Template/DescriptionController.php index 669771133..6c42ec402 100644 --- a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Common/Amazon/Template/DescriptionController.php +++ b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Common/Amazon/Template/DescriptionController.php @@ -250,6 +250,7 @@ public function saveAction() /** @var Ess_M2ePro_Model_Amazon_Template_Description $amazonDescriptionTemplate */ $amazonDescriptionTemplate = $descriptionTemplate->getChildObject(); + $amazonDescriptionTemplate->setDefinitionTemplate($descriptionDefinition); // Saving specifics info // --------------------------------------- diff --git a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationCommonController.php b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationCommonController.php index c90007c1d..591e22ba9 100644 --- a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationCommonController.php +++ b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationCommonController.php @@ -54,6 +54,7 @@ public function createLicenseAction() 'email', 'firstname', 'lastname', + 'phone', 'country', 'city', 'postal_code', @@ -86,7 +87,8 @@ public function createLicenseAction() $licenseResult = Mage::helper('M2ePro/Module_License')->obtainRecord( $licenseData['email'], $licenseData['firstname'], $licenseData['lastname'], - $licenseData['country'], $licenseData['city'], $licenseData['postal_code'] + $licenseData['country'], $licenseData['city'], + $licenseData['postal_code'], $licenseData['phone'] ); return $this->getResponse()->setBody(json_encode(array('result' => $licenseResult))); diff --git a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationEbayController.php b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationEbayController.php index 4e3bd7c69..259033cbf 100644 --- a/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationEbayController.php +++ b/app/code/community/Ess/M2ePro/controllers/Adminhtml/Wizard/InstallationEbayController.php @@ -226,6 +226,7 @@ public function beforeTokenAction() 'email', 'firstname', 'lastname', + 'phone', 'country', 'city', 'postal_code', @@ -256,7 +257,8 @@ public function beforeTokenAction() $licenseResult = Mage::helper('M2ePro/Module_License')->obtainRecord( $licenseData['email'], $licenseData['firstname'], $licenseData['lastname'], - $licenseData['country'], $licenseData['city'], $licenseData['postal_code'] + $licenseData['country'], $licenseData['city'], + $licenseData['postal_code'], $licenseData['phone'] ); if (!$licenseResult) { diff --git a/app/code/community/Ess/M2ePro/etc/config.xml b/app/code/community/Ess/M2ePro/etc/config.xml index 6c8a17371..2ef8d597f 100644 --- a/app/code/community/Ess/M2ePro/etc/config.xml +++ b/app/code/community/Ess/M2ePro/etc/config.xml @@ -2,7 +2,7 @@ - 6.4.3 + 6.4.4 diff --git a/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-install-6.4.4.php b/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-install-6.4.4.php new file mode 100644 index 000000000..ce68d0899 --- /dev/null +++ b/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-install-6.4.4.php @@ -0,0 +1,3410 @@ +startSetup(); + +//######################################## + +// GENERAL SCRIPT + +$tempMagentoConnectUrl = 'http://www.magentocommerce.com/magento-connect/customer-experience/alternative-sales-models/'; +$tempMagentoConnectUrl .= 'ebay-magento-integration-order-importing-and-stock-level-synchronization-9193.html'; + +$servicingInterval = rand(43200, 86400); + +$installer->run(<<run(<<generateRandomHash()}', 'Unique identifier of M2E instance', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/modules/', 'M2ePro', '0.0.0.r0', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/server/', 'baseurl_1', 'https://s1.m2epro.com/', 'Support server base url', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'); + +INSERT INTO `m2epro_config` (`group`,`key`,`value`,`notice`,`update_date`,`create_date`) VALUES + ('/cron/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/', 'runner', 'magento', NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/', 'last_access', NULL, 'Time of last cron synchronization', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/', 'last_runner_change', NULL, 'Time of last change cron runner', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/cron/', 'last_executed_slow_task', NULL, '', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/service/', 'auth_key', NULL, NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/service/', 'disabled', '0', NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/magento/', 'disabled', '0', NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/service/', 'hostname', 'cron.m2epro.com', NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/task/logs_clearing/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/cron/task/logs_clearing/', 'interval', '86400', 'in seconds', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/task/logs_clearing/', 'last_access', NULL, 'date of last access', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/cron/task/logs_clearing/', 'last_run', NULL, 'date of last run', '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/task/synchronization/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/cron/task/synchronization/', 'interval', '300', 'in seconds', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/task/synchronization/', 'last_access', NULL, 'date of last access', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/cron/task/synchronization/', 'last_run', NULL, 'date of last run', '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/cron/task/servicing/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/task/servicing/', 'interval', '{$servicingInterval}', 'in seconds', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/task/servicing/', 'last_access', NULL, 'date of last access', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/cron/task/servicing/', 'last_run', NULL, 'date of last run', '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/logs/clearing/listings/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/logs/clearing/listings/', 'days', '30', 'in days', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/clearing/other_listings/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/logs/clearing/other_listings/', 'days', '30', 'in days', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/clearing/synchronizations/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/logs/clearing/synchronizations/', 'days', '30', 'in days', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/clearing/orders/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/clearing/orders/', 'days', '90', 'in days', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/listings/', 'last_action_id', '0', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/logs/other_listings/', 'last_action_id', '0', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/support/', 'knowledge_base_url', 'http://support.m2epro.com/knowledgebase', NULL, '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/support/', 'documentation_url', 'http://docs.m2epro.com', NULL, '2015-07-03 00:00:00', + '2015-07-03 00:00:00'), + ('/support/', 'clients_portal_url', 'https://clients.m2epro.com/', NULL, '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/support/', 'main_website_url', 'http://m2epro.com/', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/support/', 'main_support_url', 'http://support.m2epro.com/', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/support/', 'magento_connect_url', '{$tempMagentoConnectUrl}', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/support/', 'contact_email', 'support@m2epro.com', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/support/uservoice/', 'api_url', 'http://magento2ebay.uservoice.com/api/v1/', NULL, '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/support/uservoice/', 'api_client_key', 'WEsfO8nFh3FXffUU1Oa7A', NULL, '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/view/', 'show_block_notices', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/', 'show_products_thumbnails', '1', 'Visibility thumbnails into grid', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/view/requirements/popup/', 'closed', '0', '0 - false, - true', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/synchronization/revise_total/', 'show', '0', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/view/common/component/', 'default', 'amazon', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/common/autocomplete/', 'max_records_quantity', '100', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/', 'mode', 'simple', 'simple, advanced', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/notice/', 'disable_collapse', '0', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/view/ebay/template/selling_format/', 'show_tax_category', '0', '0 - disable, \r\n1 - enable', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/feedbacks/notification/', 'mode', '0', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/view/ebay/feedbacks/notification/', 'last_check', NULL, 'Date last check new buyers feedbacks', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/advanced/autoaction_popup/', 'shown', '0', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/motors_epids_attribute/', 'listing_notification_shown', '0', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/multi_currency_marketplace_2/', 'notification_shown', '0', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/multi_currency_marketplace_19/', 'notification_shown', '0', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/view/ebay/terapeak/', 'mode', '1', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/debug/exceptions/', 'send_to_server', '1', '0 - disable,\r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/debug/exceptions/', 'filters_mode', '0', '0 - disable,\r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/debug/fatal_error/', 'send_to_server', '1', '0 - disable,\r\n1 - enable', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/debug/logging/', 'send_to_server', 1, '0 - disable,\r\n1 - enable', '2015-08-12 00:00:00', '2015-08-12 00:00:00'), + ('/debug/maintenance/', 'mode', '0', '0 - disable,\r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/debug/maintenance/', 'restore_date', NULL, NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/renderer/description/', 'convert_linebreaks', '1', '0 - No\r\n1 - Yes', '2013-05-08 00:00:00', + '2013-05-08 00:00:00'), + ('/other/paypal/', 'url', 'paypal.com/cgi-bin/webscr/', 'PayPal url', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/product/index/', 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/product/force_qty/', 'mode', '0', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/product/force_qty/', 'value', '10', 'min qty value', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/qty/percentage/', 'rounding_greater', '0', NULL, '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/order/magento/settings/', 'create_with_first_product_options_when_variation_unavailable', '1', + '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'); + +INSERT INTO `m2epro_synchronization_config` (`group`,`key`,`value`,`notice`,`update_date`,`create_date`) VALUES + (NULL, 'mode', '1', '0 - disable, \r\n1 - enable', '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + (NULL, 'last_access', NULL, NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + (NULL, 'last_run', NULL, NULL, '2014-01-01 00:00:00', '2014-01-01 00:00:00'), + ('/settings/product_change/', 'max_count_per_one_time', '500', NULL, + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/settings/product_change/', 'max_lifetime', '86400', 'in seconds', + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/settings/product_change/', 'max_count', '10000', NULL, + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/defaults/', 'mode', '1', '0 - disable, \r\n1 - enable', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/processing/', 'mode', '1', '0 - disable, \r\n1 - enable', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/deleted_products/', 'mode', '1', '0 - disable, \r\n1 - enable', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/deleted_products/', 'interval', '3600', 'in seconds', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/deleted_products/', 'last_time', NULL, 'Last check time', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/added_products/', 'last_magento_product_id', NULL, NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/stop_queue/', 'mode', '1', '0 - disable, \r\n1 - enable', + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/defaults/stop_queue/', 'interval', '3600', 'in seconds', + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/defaults/stop_queue/', 'last_time', NULL, 'Last check time', + '2012-05-21 10:47:49', '2012-05-21 10:47:49'), + ('/defaults/inspector/', 'mode', '0', '0 - disable, \r\n1 - enable', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/', 'type', 'circle', 'circle', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'last_listing_product_id', NULL, NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'min_interval_between_circles', '3600', 'in seconds', + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'max_count_times_for_full_circle', '50', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'min_count_items_per_one_time', '100', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'max_count_items_per_one_time', '500', NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'), + ('/defaults/inspector/product_changes/circle/', 'last_time_start_circle', NULL, NULL, + '2013-05-08 00:00:00', '2013-05-08 00:00:00'); + +INSERT INTO `m2epro_wizard` VALUES + (1, 'migrationToV6', '*', 3, NULL, 1, 1), + (2, 'installationEbay', 'ebay', 0, NULL, 1, 2), + (3, 'installationCommon', 'common', 0, NULL, 1, 2), + (4, 'amazon', 'common', 0, NULL, 0, 3), + (5, 'buy', 'common', 0, NULL, 0, 4), + (6, 'migrationNewAmazon', 'common', 3, NULL, 1, 5), + (7, 'removedPlay', 'common', 3, NULL, 0, 6), + (8, 'ebayProductDetails', 'ebay', 3, NULL, 1, 7), + (9, 'fullAmazonCategories', 'common', 3, NULL, 1, 8), + (10, 'amazonShippingOverridePolicy', 'common', 3, NULL, 1, 9); + +SQL +); + +//######################################## + +// EBAY SCRIPT +$installer->run(<<run(<<run(<<run(<<run(<<run(<<endSetup(); + +//######################################## \ No newline at end of file diff --git a/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-upgrade-6.4.3-6.4.4.php b/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-upgrade-6.4.3-6.4.4.php new file mode 100644 index 000000000..79140a3e0 --- /dev/null +++ b/app/code/community/Ess/M2ePro/sql/M2ePro_setup/mysql4-upgrade-6.4.3-6.4.4.php @@ -0,0 +1,44 @@ +startSetup(); + +$connection = $installer->getConnection(); + +//######################################## + +$installer->getTableModifier('amazon_marketplace')->renameColumn('is_asin_available', 'is_new_asin_available', true); + +$installer->run(<<getTableModifier('account') + ->addColumn('additional_data', 'TEXT', 'NULL', 'component_mode'); + +$installer->run(<<endSetup(); + +//######################################## \ No newline at end of file diff --git a/app/design/adminhtml/default/default/template/M2ePro/wizard/installationCommon/installation/license.phtml b/app/design/adminhtml/default/default/template/M2ePro/wizard/installationCommon/installation/license.phtml index 95858fee0..d8f5a5978 100644 --- a/app/design/adminhtml/default/default/template/M2ePro/wizard/installationCommon/installation/license.phtml +++ b/app/design/adminhtml/default/default/template/M2ePro/wizard/installationCommon/installation/license.phtml @@ -86,6 +86,16 @@ + + + __('Phone') ?>: + + + + getUserInfoValue('phone', 'span'); ?> + + + @@ -156,7 +166,7 @@ - + @@ -192,6 +202,15 @@ + + + __('Phone') ?>: * + + + + + + __('Country') ?>: * diff --git a/app/design/adminhtml/default/default/template/M2ePro/wizard/installationEbay/installation/license.phtml b/app/design/adminhtml/default/default/template/M2ePro/wizard/installationEbay/installation/license.phtml index de15cfa43..3963532d4 100644 --- a/app/design/adminhtml/default/default/template/M2ePro/wizard/installationEbay/installation/license.phtml +++ b/app/design/adminhtml/default/default/template/M2ePro/wizard/installationEbay/installation/license.phtml @@ -83,6 +83,16 @@ + + + __('Phone') ?>: + + + + getUserInfoValue('phone', 'span'); ?> + + + @@ -166,7 +176,7 @@ - + @@ -201,6 +211,15 @@ + + + __('Phone') ?>: * + + + + + + __('Country') ?>: * diff --git a/js/M2ePro/Wizard/InstallationCommon.js b/js/M2ePro/Wizard/InstallationCommon.js index ef6de7226..4faf1382e 100644 --- a/js/M2ePro/Wizard/InstallationCommon.js +++ b/js/M2ePro/Wizard/InstallationCommon.js @@ -46,7 +46,7 @@ WizardInstallationCommon = Class.create(CommonHandler, { windowClassName: "popup-window", title: M2ePro.translator.translate('Register Your M2E Pro Extension'), width: 640, - height: 315, + height: 350, zIndex: 100, hideEffect: Element.hide, showEffect: Element.show diff --git a/js/M2ePro/Wizard/InstallationEbay.js b/js/M2ePro/Wizard/InstallationEbay.js index 545aa9d7c..40ad633e0 100644 --- a/js/M2ePro/Wizard/InstallationEbay.js +++ b/js/M2ePro/Wizard/InstallationEbay.js @@ -26,7 +26,7 @@ WizardInstallationEbay = Class.create(CommonHandler, { windowClassName: "popup-window", title: M2ePro.translator.translate('Register Your M2E Pro Extension'), width: 640, - height: 315, + height: 350, zIndex: 100, recenterAuto: false, hideEffect: Element.hide,