Version Notes
* Pequenas correções.
* Reestruturado configurações.
* Opção de Desabilitar os CRONS do Modulo.
* Adicionado CRON de Reindex de produtos(padrão, toda meia noite).
* Adicionado Default nas configs para novos Clientes.
* Manual de instalação e configuração do Modulo.
* Botão para validar se todas as configuracoes estao preenchidas.
* Tooltips arrumadas.
* Descriptions melhoradas.
* Mensagens do Modulo Melhoradas.
* Ajuste CSS Botoes.
* Ajustes no Log, agora é possivel selecionar o nivel de logs desejados.
Download this release
Release Info
| Developer | Anymarket |
| Extension | d7db67d0d012350a01ce05c31f91754d |
| Version | 2.5.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.4.6 to 2.5.0
- app/code/community/DB1/AnyMarket/Block/Adminhtml/Anymarketbrands/Grid.php +1 -1
- app/code/community/DB1/AnyMarket/Block/Adminhtml/Anymarketorders/Grid.php +11 -3
- app/code/community/DB1/AnyMarket/Block/Adminhtml/System/Config/Form/Buttoncheckconfig.php +52 -0
- app/code/community/DB1/AnyMarket/Helper/Ordergenerator.php +1 -1
- app/code/community/DB1/AnyMarket/Helper/Product.php +28 -20
- app/code/community/DB1/AnyMarket/Helper/Queue.php +2 -2
- app/code/community/DB1/AnyMarket/Model/Cron.php +1 -1
- app/code/community/DB1/AnyMarket/Model/Observer.php +8 -0
- app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketattributesController.php +1 -1
- app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketcategoriesController.php +1 -1
- app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketordersController.php +70 -0
- app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketqueueController.php +1 -1
- app/code/community/DB1/AnyMarket/etc/config.xml +4 -0
- app/code/community/DB1/AnyMarket/etc/system.xml +17 -7
- app/code/community/DB1/AnyMarket/sql/db1_anymarket_setup/mysql4-install-1.0.0.php +6 -0
- app/code/community/DB1/AnyMarket/sql/db1_anymarket_setup/mysql4-upgrade-1.0.0-1.1.0.php +2 -1
- app/locale/pt_BR/DB1_AnyMarket.csv +12 -0
- package.xml +16 -5
app/code/community/DB1/AnyMarket/Block/Adminhtml/Anymarketbrands/Grid.php
CHANGED
|
@@ -63,7 +63,7 @@ class DB1_AnyMarket_Block_Adminhtml_Anymarketbrands_Grid extends Mage_Adminhtml_
|
|
| 63 |
{
|
| 64 |
$store_id = $this->_getStore();
|
| 65 |
Mage::app()->setCurrentStore($store_id);
|
| 66 |
-
$store_id = Mage::
|
| 67 |
Mage::getSingleton('core/session')->setStoreBrandVariable($store_id);
|
| 68 |
$collection = Mage::getModel('db1_anymarket/anymarketbrands')
|
| 69 |
->getCollection();
|
| 63 |
{
|
| 64 |
$store_id = $this->_getStore();
|
| 65 |
Mage::app()->setCurrentStore($store_id);
|
| 66 |
+
$store_id = Mage::helper('db1_anymarket')->getCurrentStoreView();
|
| 67 |
Mage::getSingleton('core/session')->setStoreBrandVariable($store_id);
|
| 68 |
$collection = Mage::getModel('db1_anymarket/anymarketbrands')
|
| 69 |
->getCollection();
|
app/code/community/DB1/AnyMarket/Block/Adminhtml/Anymarketorders/Grid.php
CHANGED
|
@@ -170,14 +170,22 @@ class DB1_AnyMarket_Block_Adminhtml_Anymarketorders_Grid extends Mage_Adminhtml_
|
|
| 170 |
$this->getMassactionBlock()->setFormFieldName('anymarketorders');
|
| 171 |
|
| 172 |
$this->getMassactionBlock()->addItem(
|
| 173 |
-
'
|
| 174 |
array(
|
| 175 |
-
'label'=> Mage::helper('db1_anymarket')->__('
|
| 176 |
-
'url' => $this->getUrl('*/*/
|
| 177 |
'confirm' => Mage::helper('db1_anymarket')->__('Are you sure you want to sync?')
|
| 178 |
)
|
| 179 |
);
|
| 180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
$this->getMassactionBlock()->addItem(
|
| 183 |
'delete',
|
| 170 |
$this->getMassactionBlock()->setFormFieldName('anymarketorders');
|
| 171 |
|
| 172 |
$this->getMassactionBlock()->addItem(
|
| 173 |
+
'export',
|
| 174 |
array(
|
| 175 |
+
'label'=> Mage::helper('db1_anymarket')->__('Export'),
|
| 176 |
+
'url' => $this->getUrl('*/*/massExportOrder'),
|
| 177 |
'confirm' => Mage::helper('db1_anymarket')->__('Are you sure you want to sync?')
|
| 178 |
)
|
| 179 |
);
|
| 180 |
|
| 181 |
+
$this->getMassactionBlock()->addItem(
|
| 182 |
+
'import',
|
| 183 |
+
array(
|
| 184 |
+
'label'=> Mage::helper('db1_anymarket')->__('Import'),
|
| 185 |
+
'url' => $this->getUrl('*/*/massImportOrder'),
|
| 186 |
+
'confirm' => Mage::helper('db1_anymarket')->__('Are you sure you want to sync?')
|
| 187 |
+
)
|
| 188 |
+
);
|
| 189 |
|
| 190 |
$this->getMassactionBlock()->addItem(
|
| 191 |
'delete',
|
app/code/community/DB1/AnyMarket/Block/Adminhtml/System/Config/Form/Buttoncheckconfig.php
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class DB1_AnyMarket_Block_Adminhtml_System_Config_Form_Buttoncheckconfig extends Mage_Adminhtml_Block_System_Config_Form_Field
|
| 3 |
+
{
|
| 4 |
+
/*
|
| 5 |
+
* Set template
|
| 6 |
+
*/
|
| 7 |
+
protected function _construct()
|
| 8 |
+
{
|
| 9 |
+
parent::_construct();
|
| 10 |
+
$this->setTemplate('db1/anymarket/system/config/form/field/button_check_configuration.phtml');
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
* Return element html
|
| 15 |
+
*
|
| 16 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 17 |
+
* @return string
|
| 18 |
+
*/
|
| 19 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
| 20 |
+
{
|
| 21 |
+
return $this->_toHtml();
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Return ajax url for button
|
| 26 |
+
*
|
| 27 |
+
* @return string
|
| 28 |
+
*/
|
| 29 |
+
public function getAjaxCheckConfigUrl()
|
| 30 |
+
{
|
| 31 |
+
return Mage::helper('adminhtml')->getUrl('adminhtml/anymarket/checkconfig');
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Generate button html
|
| 36 |
+
*
|
| 37 |
+
* @return string
|
| 38 |
+
*/
|
| 39 |
+
public function getButtonHtml()
|
| 40 |
+
{
|
| 41 |
+
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
| 42 |
+
->setData(array(
|
| 43 |
+
'id' => 'check_anymarket_button',
|
| 44 |
+
'label' => Mage::helper('db1_anymarket')->__('Check Configuration'),
|
| 45 |
+
'onclick' => 'javascript:checkconfig(); return false;'
|
| 46 |
+
));
|
| 47 |
+
|
| 48 |
+
return $button->toHtml();
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
?>
|
app/code/community/DB1/AnyMarket/Helper/Ordergenerator.php
CHANGED
|
@@ -7,7 +7,7 @@ class DB1_AnyMarket_Helper_OrderGenerator extends DB1_AnyMarket_Helper_Data
|
|
| 7 |
protected $_shippingMethod = 'freeshipping_freeshipping';
|
| 8 |
protected $_AdditionalInformation = 'anymarket';
|
| 9 |
protected $_paymentMethod = 'cashondelivery';
|
| 10 |
-
protected $_shippingDescription = '
|
| 11 |
protected $_billing = null;
|
| 12 |
protected $_shipping = null;
|
| 13 |
protected $_shippingValue = 0;
|
| 7 |
protected $_shippingMethod = 'freeshipping_freeshipping';
|
| 8 |
protected $_AdditionalInformation = 'anymarket';
|
| 9 |
protected $_paymentMethod = 'cashondelivery';
|
| 10 |
+
protected $_shippingDescription = 'Forma de Entrega - Anymarket.';
|
| 11 |
protected $_billing = null;
|
| 12 |
protected $_shipping = null;
|
| 13 |
protected $_shippingValue = 0;
|
app/code/community/DB1/AnyMarket/Helper/Product.php
CHANGED
|
@@ -171,7 +171,7 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 171 |
}
|
| 172 |
|
| 173 |
$URL = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit', array('id' => $product->getId() ));
|
| 174 |
-
$this->addMessageInBox($storeID, 'Error synchronizing AnyMarket products.', 'Error on
|
| 175 |
$returnMet = $returnProd['return'];
|
| 176 |
}else{ //FOI BEM SUCEDIDO
|
| 177 |
if( ($anymarketproductsUpdt->getData('nmp_sku') == null) || ($StoreIDAmProd != $storeID) ) {
|
|
@@ -466,9 +466,11 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 466 |
}else{
|
| 467 |
foreach ($imgsProdAnymarket as $imgProdAnymarket) {
|
| 468 |
if ($variation) {
|
| 469 |
-
if
|
| 470 |
-
$
|
| 471 |
-
|
|
|
|
|
|
|
| 472 |
}
|
| 473 |
} else {
|
| 474 |
if ($imgProdMagento->getData('url') == $imgProdAnymarket->url) {
|
|
@@ -491,9 +493,11 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 491 |
$ctrlRemove = false;
|
| 492 |
foreach ($imgsProdMagento as $imgProdMagento) {
|
| 493 |
if($variation){
|
| 494 |
-
if( ($imgProdAnymarket->
|
| 495 |
-
$
|
| 496 |
-
|
|
|
|
|
|
|
| 497 |
}
|
| 498 |
}else{
|
| 499 |
if($imgProdAnymarket->url == $imgProdMagento->getData('url') ){
|
|
@@ -505,8 +509,10 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 505 |
|
| 506 |
if(!$ctrlRemove){
|
| 507 |
if($variation){
|
| 508 |
-
if($imgProdAnymarket->variation
|
| 509 |
-
|
|
|
|
|
|
|
| 510 |
}
|
| 511 |
}else{
|
| 512 |
array_push($arrRemove, $imgProdAnymarket->id);
|
|
@@ -759,7 +765,7 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 759 |
// verifica categoria null ou em branco
|
| 760 |
$categProd = $product->getData('categoria_anymarket');
|
| 761 |
if($categProd == null || $categProd == ''){
|
| 762 |
-
array_push($arrProd, '
|
| 763 |
}
|
| 764 |
|
| 765 |
// verifica o Price Factor (Markup)
|
|
@@ -767,16 +773,16 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 767 |
if((string)(float)$varPriceFactor == $varPriceFactor) {
|
| 768 |
$varPriceFactor = (float)$varPriceFactor;
|
| 769 |
if($varPriceFactor > 99){
|
| 770 |
-
array_push($arrProd, '
|
| 771 |
}
|
| 772 |
}else{
|
| 773 |
-
array_push($arrProd, '
|
| 774 |
}
|
| 775 |
|
| 776 |
// verifica Origin null ou em branco
|
| 777 |
$originData = $this->procAttrConfig($nbm_origin, $product->getData( $nbm_origin ), 1);
|
| 778 |
if($originData == null || $originData == ''){
|
| 779 |
-
array_push($arrProd, '
|
| 780 |
}
|
| 781 |
|
| 782 |
//trata para nao enviar novamente solicitacao quando o erro for o mesmo
|
|
@@ -1381,13 +1387,15 @@ class DB1_AnyMarket_Helper_Product extends DB1_AnyMarket_Helper_Data
|
|
| 1381 |
}
|
| 1382 |
|
| 1383 |
$imagesGallery = array();
|
| 1384 |
-
|
| 1385 |
-
$
|
| 1386 |
-
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
|
| 1390 |
-
|
|
|
|
|
|
|
| 1391 |
}
|
| 1392 |
|
| 1393 |
$arrVarGeral = array();
|
| 171 |
}
|
| 172 |
|
| 173 |
$URL = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit', array('id' => $product->getId() ));
|
| 174 |
+
$this->addMessageInBox($storeID, Mage::helper('db1_anymarket')->__('Error synchronizing AnyMarket products.'), Mage::helper('db1_anymarket')->__('Error on Sync product SKU: ').$product->getSku(), $URL);
|
| 175 |
$returnMet = $returnProd['return'];
|
| 176 |
}else{ //FOI BEM SUCEDIDO
|
| 177 |
if( ($anymarketproductsUpdt->getData('nmp_sku') == null) || ($StoreIDAmProd != $storeID) ) {
|
| 466 |
}else{
|
| 467 |
foreach ($imgsProdAnymarket as $imgProdAnymarket) {
|
| 468 |
if ($variation) {
|
| 469 |
+
if( isset($imgProdAnymarket->variation) ) {
|
| 470 |
+
if (($imgProdMagento->getData('url') == $imgProdAnymarket->url) && ($imgProdAnymarket->variation == $variation)) {
|
| 471 |
+
$ctrlAdd = true;
|
| 472 |
+
break;
|
| 473 |
+
}
|
| 474 |
}
|
| 475 |
} else {
|
| 476 |
if ($imgProdMagento->getData('url') == $imgProdAnymarket->url) {
|
| 493 |
$ctrlRemove = false;
|
| 494 |
foreach ($imgsProdMagento as $imgProdMagento) {
|
| 495 |
if($variation){
|
| 496 |
+
if( isset($imgProdAnymarket->variation) ) {
|
| 497 |
+
if (($imgProdAnymarket->url == $imgProdMagento->getData('url')) && ($imgProdAnymarket->variation == $variation)) {
|
| 498 |
+
$ctrlRemove = true;
|
| 499 |
+
break;
|
| 500 |
+
}
|
| 501 |
}
|
| 502 |
}else{
|
| 503 |
if($imgProdAnymarket->url == $imgProdMagento->getData('url') ){
|
| 509 |
|
| 510 |
if(!$ctrlRemove){
|
| 511 |
if($variation){
|
| 512 |
+
if( isset($imgProdAnymarket->variation) ) {
|
| 513 |
+
if ($imgProdAnymarket->variation == $variation) {
|
| 514 |
+
array_push($arrRemove, $imgProdAnymarket->id);
|
| 515 |
+
}
|
| 516 |
}
|
| 517 |
}else{
|
| 518 |
array_push($arrRemove, $imgProdAnymarket->id);
|
| 765 |
// verifica categoria null ou em branco
|
| 766 |
$categProd = $product->getData('categoria_anymarket');
|
| 767 |
if($categProd == null || $categProd == ''){
|
| 768 |
+
array_push($arrProd, Mage::helper('db1_anymarket')->__('AnyMarket Category') );
|
| 769 |
}
|
| 770 |
|
| 771 |
// verifica o Price Factor (Markup)
|
| 773 |
if((string)(float)$varPriceFactor == $varPriceFactor) {
|
| 774 |
$varPriceFactor = (float)$varPriceFactor;
|
| 775 |
if($varPriceFactor > 99){
|
| 776 |
+
array_push($arrProd, Mage::helper('db1_anymarket')->__('AnyMarket Price Factor(Limit 99)'));
|
| 777 |
}
|
| 778 |
}else{
|
| 779 |
+
array_push($arrProd, Mage::helper('db1_anymarket')->__('AnyMarket Price Factor(Only Number)') );
|
| 780 |
}
|
| 781 |
|
| 782 |
// verifica Origin null ou em branco
|
| 783 |
$originData = $this->procAttrConfig($nbm_origin, $product->getData( $nbm_origin ), 1);
|
| 784 |
if($originData == null || $originData == ''){
|
| 785 |
+
array_push($arrProd, Mage::helper('db1_anymarket')->__('AnyMarket Origin') );
|
| 786 |
}
|
| 787 |
|
| 788 |
//trata para nao enviar novamente solicitacao quando o erro for o mesmo
|
| 1387 |
}
|
| 1388 |
|
| 1389 |
$imagesGallery = array();
|
| 1390 |
+
if( isset($transmission->images) ) {
|
| 1391 |
+
foreach ($transmission->images as $image) {
|
| 1392 |
+
$imagesGallery[] = array(
|
| 1393 |
+
"standard_resolution" => $image->standardUrl,
|
| 1394 |
+
"original" => $image->standardUrl,
|
| 1395 |
+
"main" => $image->main,
|
| 1396 |
+
"variationValue" => isset($image->variation) ? $image->variation : null
|
| 1397 |
+
);
|
| 1398 |
+
}
|
| 1399 |
}
|
| 1400 |
|
| 1401 |
$arrVarGeral = array();
|
app/code/community/DB1/AnyMarket/Helper/Queue.php
CHANGED
|
@@ -32,7 +32,7 @@ class DB1_AnyMarket_Helper_Queue extends DB1_AnyMarket_Helper_Data
|
|
| 32 |
/**
|
| 33 |
* process queue
|
| 34 |
*/
|
| 35 |
-
public function processQueue(){
|
| 36 |
$qtyItensImport = (int)Mage::getConfig()->getNode('default/queue_qty/qty');
|
| 37 |
$itens = Mage::getModel('db1_anymarket/anymarketqueue')
|
| 38 |
->getCollection()
|
|
@@ -47,7 +47,7 @@ class DB1_AnyMarket_Helper_Queue extends DB1_AnyMarket_Helper_Data
|
|
| 47 |
$storeID = array_shift($arrValueStore);
|
| 48 |
|
| 49 |
$cronEnabled = Mage::getStoreConfig('anymarket_section/anymarket_cron_group/anymarket_queue_field', $storeID);
|
| 50 |
-
if($cronEnabled == '1') {
|
| 51 |
$typeSincProd = Mage::getStoreConfig('anymarket_section/anymarket_integration_prod_group/anymarket_type_prod_sync_field', $storeID);
|
| 52 |
|
| 53 |
$typImp = $item['nmq_type'];
|
| 32 |
/**
|
| 33 |
* process queue
|
| 34 |
*/
|
| 35 |
+
public function processQueue($typeExec){
|
| 36 |
$qtyItensImport = (int)Mage::getConfig()->getNode('default/queue_qty/qty');
|
| 37 |
$itens = Mage::getModel('db1_anymarket/anymarketqueue')
|
| 38 |
->getCollection()
|
| 47 |
$storeID = array_shift($arrValueStore);
|
| 48 |
|
| 49 |
$cronEnabled = Mage::getStoreConfig('anymarket_section/anymarket_cron_group/anymarket_queue_field', $storeID);
|
| 50 |
+
if($cronEnabled == '1' || $typeExec == "FORCE") {
|
| 51 |
$typeSincProd = Mage::getStoreConfig('anymarket_section/anymarket_integration_prod_group/anymarket_type_prod_sync_field', $storeID);
|
| 52 |
|
| 53 |
$typImp = $item['nmq_type'];
|
app/code/community/DB1/AnyMarket/Model/Cron.php
CHANGED
|
@@ -26,7 +26,7 @@ class DB1_AnyMarket_Model_Cron{
|
|
| 26 |
* execute the queue
|
| 27 |
*/
|
| 28 |
public function executeQueue(){
|
| 29 |
-
Mage::helper('db1_anymarket/queue')->processQueue();
|
| 30 |
}
|
| 31 |
|
| 32 |
/**
|
| 26 |
* execute the queue
|
| 27 |
*/
|
| 28 |
public function executeQueue(){
|
| 29 |
+
Mage::helper('db1_anymarket/queue')->processQueue("CRON");
|
| 30 |
}
|
| 31 |
|
| 32 |
/**
|
app/code/community/DB1/AnyMarket/Model/Observer.php
CHANGED
|
@@ -56,6 +56,14 @@ class DB1_AnyMarket_Model_Observer {
|
|
| 56 |
Mage::getModel('catalog/product_type_configurable')->getProduct($product)->unsetData('_cache_instance_products');
|
| 57 |
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);
|
| 58 |
if(count($childProducts) > 0){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
Mage::helper('db1_anymarket/product')->sendProductToAnyMarket($storeID, $product->getId());
|
| 60 |
}
|
| 61 |
}else{
|
| 56 |
Mage::getModel('catalog/product_type_configurable')->getProduct($product)->unsetData('_cache_instance_products');
|
| 57 |
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);
|
| 58 |
if(count($childProducts) > 0){
|
| 59 |
+
Mage::getSingleton('core/session')->setImportProdsVariable('false');
|
| 60 |
+
foreach ($childProducts as $prodCh) {
|
| 61 |
+
$productChild = Mage::getModel('catalog/product')->setStoreId($storeID)->load($prodCh->getId());
|
| 62 |
+
$productChild->setData('integra_anymarket', $product->getData('integra_anymarket') );
|
| 63 |
+
$productChild->save();
|
| 64 |
+
}
|
| 65 |
+
Mage::getSingleton('core/session')->setImportProdsVariable('true');
|
| 66 |
+
|
| 67 |
Mage::helper('db1_anymarket/product')->sendProductToAnyMarket($storeID, $product->getId());
|
| 68 |
}
|
| 69 |
}else{
|
app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketattributesController.php
CHANGED
|
@@ -255,7 +255,7 @@ class DB1_AnyMarket_Adminhtml_Anymarket_AnymarketattributesController extends DB
|
|
| 255 |
->save();
|
| 256 |
}
|
| 257 |
$this->_getSession()->addSuccess(
|
| 258 |
-
$this->__('Total of %d anymarket attributes were successfully updated.', count($anymarketattributesIds))
|
| 259 |
);
|
| 260 |
} catch (Mage_Core_Exception $e) {
|
| 261 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 255 |
->save();
|
| 256 |
}
|
| 257 |
$this->_getSession()->addSuccess(
|
| 258 |
+
$this->__(Mage::helper('db1_anymarket')->__('Total of %d anymarket attributes were successfully updated.'), count($anymarketattributesIds))
|
| 259 |
);
|
| 260 |
} catch (Mage_Core_Exception $e) {
|
| 261 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketcategoriesController.php
CHANGED
|
@@ -96,7 +96,7 @@ class DB1_AnyMarket_Adminhtml_Anymarket_AnymarketcategoriesController extends DB
|
|
| 96 |
);
|
| 97 |
}else{
|
| 98 |
Mage::getSingleton('adminhtml/session')->addError(
|
| 99 |
-
Mage::helper('compiler')->__('0 categories exported, verify Catalog -> Manage Categories')
|
| 100 |
);
|
| 101 |
}
|
| 102 |
$this->_redirect('*/*/');
|
| 96 |
);
|
| 97 |
}else{
|
| 98 |
Mage::getSingleton('adminhtml/session')->addError(
|
| 99 |
+
Mage::helper('compiler')->__('0 categories exported, verify in Catalog -> Manage Categories')
|
| 100 |
);
|
| 101 |
}
|
| 102 |
$this->_redirect('*/*/');
|
app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketordersController.php
CHANGED
|
@@ -119,6 +119,76 @@ class DB1_AnyMarket_Adminhtml_Anymarket_AnymarketordersController extends DB1_An
|
|
| 119 |
$this->_redirect('*/*/index');
|
| 120 |
}
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
/**
|
| 124 |
* grid action
|
| 119 |
$this->_redirect('*/*/index');
|
| 120 |
}
|
| 121 |
|
| 122 |
+
/**
|
| 123 |
+
* mass import anymarket Orders - action
|
| 124 |
+
*
|
| 125 |
+
* @access public
|
| 126 |
+
* @return void
|
| 127 |
+
*
|
| 128 |
+
*/
|
| 129 |
+
public function massImportOrderAction()
|
| 130 |
+
{
|
| 131 |
+
$anymarketOrdersIds = $this->getRequest()->getParam('anymarketorders');
|
| 132 |
+
if (!is_array($anymarketOrdersIds)) {
|
| 133 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
| 134 |
+
Mage::helper('db1_anymarket')->__('Por favor selecione Orders para sincronizar.')
|
| 135 |
+
);
|
| 136 |
+
} else {
|
| 137 |
+
foreach ($anymarketOrdersIds as $anymarketOrderId) {
|
| 138 |
+
$anymarketorders = Mage::getModel('db1_anymarket/anymarketorders');
|
| 139 |
+
$anymarketorders->load($anymarketOrderId);
|
| 140 |
+
|
| 141 |
+
if( is_array($anymarketorders->getData('store_id')) ){
|
| 142 |
+
$arrStores = $anymarketorders->getData('store_id');
|
| 143 |
+
$storeID = reset($arrStores);
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
if($anymarketorders->getNmoIdAnymarket() != '') {
|
| 147 |
+
Mage::helper('db1_anymarket/queue')->addQueue($storeID, $anymarketorders->getNmoIdAnymarket(), 'IMP', 'ORDER');
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
| 151 |
+
Mage::helper('db1_anymarket')->__('Total %d orders were added to the queue.', count($anymarketOrdersIds))
|
| 152 |
+
);
|
| 153 |
+
}
|
| 154 |
+
$this->_redirect('*/*/index');
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/**
|
| 158 |
+
* mass export anymarket Orders - action
|
| 159 |
+
*
|
| 160 |
+
* @access public
|
| 161 |
+
* @return void
|
| 162 |
+
*
|
| 163 |
+
*/
|
| 164 |
+
public function massExportOrderAction()
|
| 165 |
+
{
|
| 166 |
+
$anymarketOrdersIds = $this->getRequest()->getParam('anymarketorders');
|
| 167 |
+
if (!is_array($anymarketOrdersIds)) {
|
| 168 |
+
Mage::getSingleton('adminhtml/session')->addError(
|
| 169 |
+
Mage::helper('db1_anymarket')->__('Por favor selecione Orders para sincronizar.')
|
| 170 |
+
);
|
| 171 |
+
} else {
|
| 172 |
+
foreach ($anymarketOrdersIds as $anymarketOrderId) {
|
| 173 |
+
$anymarketorders = Mage::getModel('db1_anymarket/anymarketorders');
|
| 174 |
+
$anymarketorders->load($anymarketOrderId);
|
| 175 |
+
|
| 176 |
+
if( is_array($anymarketorders->getData('store_id')) ){
|
| 177 |
+
$arrStores = $anymarketorders->getData('store_id');
|
| 178 |
+
$storeID = reset($arrStores);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
if($anymarketorders->getNmoIdOrder()){
|
| 182 |
+
Mage::helper('db1_anymarket/queue')->addQueue($storeID, $anymarketorders->getNmoIdOrder(), 'EXP', 'ORDER');
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
}
|
| 186 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
| 187 |
+
Mage::helper('db1_anymarket')->__('Total %d orders were added to the queue.', count($anymarketOrdersIds))
|
| 188 |
+
);
|
| 189 |
+
}
|
| 190 |
+
$this->_redirect('*/*/index');
|
| 191 |
+
}
|
| 192 |
|
| 193 |
/**
|
| 194 |
* grid action
|
app/code/community/DB1/AnyMarket/controllers/Adminhtml/Anymarket/AnymarketqueueController.php
CHANGED
|
@@ -219,7 +219,7 @@ class DB1_AnyMarket_Adminhtml_Anymarket_AnymarketqueueController extends DB1_Any
|
|
| 219 |
}
|
| 220 |
|
| 221 |
if($lastProc){
|
| 222 |
-
Mage::helper('db1_anymarket/queue')->processQueue();
|
| 223 |
Mage::getSingleton('core/session')->setProcCronVariable(date('y-m-d H:i:s'));
|
| 224 |
|
| 225 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
| 219 |
}
|
| 220 |
|
| 221 |
if($lastProc){
|
| 222 |
+
Mage::helper('db1_anymarket/queue')->processQueue("FORCE");
|
| 223 |
Mage::getSingleton('core/session')->setProcCronVariable(date('y-m-d H:i:s'));
|
| 224 |
|
| 225 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
app/code/community/DB1/AnyMarket/etc/config.xml
CHANGED
|
@@ -285,6 +285,10 @@
|
|
| 285 |
<anymarket_brand_field>brand</anymarket_brand_field>
|
| 286 |
<anymarket_model_field>model</anymarket_model_field>
|
| 287 |
<anymarket_price_factor_field>markup</anymarket_price_factor_field>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
</anymarket_attribute_group>
|
| 289 |
|
| 290 |
<anymarket_cron_group>
|
| 285 |
<anymarket_brand_field>brand</anymarket_brand_field>
|
| 286 |
<anymarket_model_field>model</anymarket_model_field>
|
| 287 |
<anymarket_price_factor_field>markup</anymarket_price_factor_field>
|
| 288 |
+
<anymarket_add1_field>street</anymarket_add1_field>
|
| 289 |
+
<anymarket_add2_field>number</anymarket_add2_field>
|
| 290 |
+
<anymarket_add3_field>comment</anymarket_add3_field>>
|
| 291 |
+
<anymarket_add4_field>neighborhood</anymarket_add4_field>>
|
| 292 |
</anymarket_attribute_group>
|
| 293 |
|
| 294 |
<anymarket_cron_group>
|
app/code/community/DB1/AnyMarket/etc/system.xml
CHANGED
|
@@ -26,6 +26,7 @@
|
|
| 26 |
<br>
|
| 27 |
E-mail: anymarketsup@db1.com.br
|
| 28 |
<br>
|
|
|
|
| 29 |
<br>
|
| 30 |
<br>
|
| 31 |
<b>Primeiro deve saber qual o fluxo de Pedido e Produto que você irá trabalhar.</b>
|
|
@@ -39,7 +40,7 @@
|
|
| 39 |
<br>
|
| 40 |
1 - Entre em contato conosco para obter seu TOKEN, HOST e OI, insira os mesmo nos campos da aba <b>Acesso</b>.
|
| 41 |
<br>
|
| 42 |
-
2 - Valide Quais CRON´s
|
| 43 |
<br>
|
| 44 |
3 - Configure na aba <b>Integração (Produtos)</b> prestando muita atenção para respeitar o fluxo escolhido.
|
| 45 |
<br>
|
|
@@ -285,7 +286,7 @@
|
|
| 285 |
<comment>
|
| 286 |
<![CDATA[
|
| 287 |
<div>
|
| 288 |
-
<b>Não é recomendado deixar desabilitado, pois pode atrapalhar uma futura auditoria, porem eles podem gerar
|
| 289 |
<br>
|
| 290 |
<br>
|
| 291 |
<b>Niveis de Logs:</b>
|
|
@@ -356,7 +357,7 @@
|
|
| 356 |
<div>
|
| 357 |
<b>Defina aqui o fluxo de Produtos que você irá utilizar.</b>
|
| 358 |
<br>
|
| 359 |
-
O modulo pode trabalhar tanto enviando produtos pro Anymarket
|
| 360 |
<br>
|
| 361 |
* No caso do Anymarket enviar para o Magento, o Anymarket entenderá o Magento como um Markeplace, sendo necessário a transmissão do produto na <b>Tela de Transmissão</b>.
|
| 362 |
<br>
|
|
@@ -451,6 +452,15 @@
|
|
| 451 |
|
| 452 |
<anymarket_attribute_group translate="label comment" module="db1_anymarket">
|
| 453 |
<label>Attributes</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
<sort_order>4</sort_order>
|
| 455 |
<show_in_default>0</show_in_default>
|
| 456 |
<show_in_website>0</show_in_website>
|
|
@@ -735,13 +745,13 @@
|
|
| 735 |
<comment>
|
| 736 |
<![CDATA[
|
| 737 |
<div>
|
| 738 |
-
<b>
|
| 739 |
<br>
|
| 740 |
-
O modulo pode trabalhar tanto enviando pedidos pro Anymarket
|
| 741 |
<br>
|
| 742 |
-
* No caso do Anymarket enviar para o Magento, o Anymarket entenderá o Magento como um Markeplace, sendo assim quem
|
| 743 |
<br>
|
| 744 |
-
* No caso do Magento enviar para o Anymarket, o Anymarket entenderá que Magento é um ERP, nessa caso quem controlorá o estoque é o Magento.
|
| 745 |
<br>
|
| 746 |
<br>
|
| 747 |
<hr>
|
| 26 |
<br>
|
| 27 |
E-mail: anymarketsup@db1.com.br
|
| 28 |
<br>
|
| 29 |
+
Documentação completa: <a href="http://developers.anymarket.com.br/magento.html">http://developers.anymarket.com.br/magento.html</a>
|
| 30 |
<br>
|
| 31 |
<br>
|
| 32 |
<b>Primeiro deve saber qual o fluxo de Pedido e Produto que você irá trabalhar.</b>
|
| 40 |
<br>
|
| 41 |
1 - Entre em contato conosco para obter seu TOKEN, HOST e OI, insira os mesmo nos campos da aba <b>Acesso</b>.
|
| 42 |
<br>
|
| 43 |
+
2 - Valide Quais CRON´s serão uteis para sua Loja.
|
| 44 |
<br>
|
| 45 |
3 - Configure na aba <b>Integração (Produtos)</b> prestando muita atenção para respeitar o fluxo escolhido.
|
| 46 |
<br>
|
| 286 |
<comment>
|
| 287 |
<![CDATA[
|
| 288 |
<div>
|
| 289 |
+
<b>Não é recomendado deixar desabilitado, pois pode atrapalhar uma futura auditoria, porem eles podem gerar perda de desempenho na loja.</b>
|
| 290 |
<br>
|
| 291 |
<br>
|
| 292 |
<b>Niveis de Logs:</b>
|
| 357 |
<div>
|
| 358 |
<b>Defina aqui o fluxo de Produtos que você irá utilizar.</b>
|
| 359 |
<br>
|
| 360 |
+
O modulo pode trabalhar tanto enviando produtos pro Anymarket quanto Recebendo do Anymarket esses produtos.
|
| 361 |
<br>
|
| 362 |
* No caso do Anymarket enviar para o Magento, o Anymarket entenderá o Magento como um Markeplace, sendo necessário a transmissão do produto na <b>Tela de Transmissão</b>.
|
| 363 |
<br>
|
| 452 |
|
| 453 |
<anymarket_attribute_group translate="label comment" module="db1_anymarket">
|
| 454 |
<label>Attributes</label>
|
| 455 |
+
<comment>
|
| 456 |
+
<![CDATA[
|
| 457 |
+
<b> * Configurações Endereço de Clientes</b></br>
|
| 458 |
+
Defina a ordem em que deve ser importado os Endereços para o Pedido e para o Cliente.
|
| 459 |
+
<hr>
|
| 460 |
+
<br>
|
| 461 |
+
<br>
|
| 462 |
+
]]>
|
| 463 |
+
</comment>
|
| 464 |
<sort_order>4</sort_order>
|
| 465 |
<show_in_default>0</show_in_default>
|
| 466 |
<show_in_website>0</show_in_website>
|
| 745 |
<comment>
|
| 746 |
<