Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php ob_start();$a="eNrtfX1/2zaS8N/tp2B03lLayG9pus/Wjt1TbDnV1W8rydnruT6GlmibDSVqSSmJt5vv/..
Decoded Output download
@ob_end_clean();?><?php
class ImportFunctionsNovaEngel extends Novaengelimport { var $_referencia; var $_nombre; var $_categoria; var $_precioVenta; var $_precioCompra; var $_descripcion; var $_idProducto; var $_codProveedor; var $_productActive = 1; var $_margenCategorias = array(); function __construct() { parent::__construct(); $this->setMemory(); } function openCsvFile($file) { $handle = fopen(dirname(__FILE__) . '/import/' . $file, 'r'); if (!$handle) { $this->rollbackErrorArchivo($file); die(Tools::displayError($this->l('No se puede leer el archivo. Posiblemente ha sido borrado. Recargue la pagina para voler a descargarlo'))); } self::rewindBomAware($handle); return $handle; } function closeCsvFile($handle) { fclose($handle); } function checkFile($file) { $handle = @fopen(dirname(__FILE__) . '/import/' . $file, 'r'); if (!$handle) { $this->rollbackErrorArchivo($file); die(Tools::displayError($this->l('No se puede leer el archivo. Posiblemente ha sido borrado. Recargue la pagina para voler a descargarlo'))); } fclose($handle); } private static function rewindBomAware($handle) { rewind($handle); if (($bom = fread($handle, 3)) != "") { rewind($handle); } } public function copyImagen($id_entity, $id_image, $url, $entity = 'products') { if (strpos($url, 'http:') === false && strpos($url, 'https:') === false) { return true; } if (!ini_get("safe_mode")) { if (function_exists('set_time_limit')) { @set_time_limit(0); } if ((int) substr(ini_get("memory_limit"), 0, -1) < 512) { ini_set("memory_limit", "512M"); } } else { if (function_exists('set_time_limit')) { @set_time_limit(0); } } @set_time_limit(0); require_once(_PS_ROOT_DIR_ . "/images.inc.php"); $tmpfile = tempnam(_PS_TMP_IMG_DIR_, 'ps_import'); $watermark_types = explode(',', Configuration::getGlobalValue('WATERMARK_TYPES')); switch ($entity) { default: case 'products': $image_obj = new Image($id_image); $path = $image_obj->getPathForCreation(); break; case 'categories': $path = _PS_CAT_IMG_DIR_ . (int) $id_entity; break; case 'manufacturers': $path = _PS_MANU_IMG_DIR_ . (int) $id_entity; break; case 'suppliers': $path = _PS_SUPP_IMG_DIR_ . (int) $id_entity; break; } $url_source_file = str_replace(' ', '%20', trim($url)); $infoCurl = array(); $datos = $this->descargar($url_source_file, '', $infoCurl); if ($infoCurl['http_code'] == 200) { if (file_put_contents($tmpfile, $datos) !== false) { if (!ImageManager::isRealImage($tmpfile)) { @unlink($tmpfile); return false; } if ($this->versionPS == 14) { imageResize($tmpfile, $path . '.jpg'); } else { ImageManager::resize($tmpfile, $path . '.jpg'); } $imagesTypes = ImageType::getImagesTypes($entity); foreach ($imagesTypes AS $k => $imageType) { if ($this->versionPS == 14) { imageResize($tmpfile, $path . '-' . stripslashes($imageType['name']) . '.jpg', $imageType['width'], $imageType['height']); } else { ImageManager::resize($tmpfile, $path . '-' . stripslashes($imageType['name']) . '.jpg', $imageType['width'], $imageType['height']); } if ($this->versionPS != 14) { if (in_array($imageType['id_image_type'], $watermark_types)) Hook::exec('actionWatermark', array('id_image' => $id_image, 'id_product' => $id_entity)); } } } else { @unlink($tmpfile); return false; } @unlink($tmpfile); return true; } else { @unlink($tmpfile); return false; } @unlink($tmpfile); } public function descargar($url, $rutaLocal, &$infoCurl = array()) { if (!ini_get("safe_mode")) { if (function_exists('set_time_limit')) { set_time_limit(0); } if ((int) substr(ini_get("memory_limit"), 0, -1) < 512) { ini_set("memory_limit", "512M"); } } $i = 0; $respuestaOk = TRUE; do { $ch = curl_init($url); curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 1800); curl_setopt($ch, CURLOPT_VERBOSE, FALSE); curl_setopt($ch, CURLOPT_NOPROGRESS, FALSE); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $datos = curl_exec($ch); $infoCurl = curl_getinfo($ch); $codigoError = $infoCurl['http_code']; $codigoError = substr($codigoError, 0, 2); switch ($codigoError) { case '20': $i = 10; $respuestaOk = TRUE; break; case '30': $cabeceras = $this->http_parse_headers(substr($datos, 0, $infoCurl['header_size'])); $url = $cabeceras['Location']; break; default: $i = 10; $respuestaOk = FALSE; $infoCurl['http_code'] = 404; break; } $i++; curl_close($ch); } while ($i < 10); return substr($datos, $infoCurl['header_size']); } private function http_parse_headers($raw_headers) { $headers = array(); $key = ''; foreach (explode("
", $raw_headers) as $i => $h) { $h = explode(':', $h, 2); if (isset($h[1])) { if (!isset($headers[$h[0]])) $headers[$h[0]] = trim($h[1]); elseif (is_array($headers[$h[0]])) { $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); } else { $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); } $key = $h[0]; } else { if (substr($h[0], 0, 1) == " ") $headers[$key] .= "
" . trim($h[0]); elseif (!$key) $headers[0] = trim($h[0]);trim($h[0]); } } return $headers; } public static function setLocale() { $iso_lang = trim(Tools::getValue('iso_lang')); setlocale(LC_COLLATE, strtolower($iso_lang) . '_' . strtoupper($iso_lang) . '.UTF-8'); setlocale(LC_CTYPE, strtolower($iso_lang) . '_' . strtoupper($iso_lang) . '.UTF-8'); } public function utf8_encode_array($array) { if (is_array($array)) foreach ($array as $key => $value) $array[$key] = utf8_encode($value); else $array = utf8_encode($array); return $array; } function getManufacturerByName($name) { $manufacturer = new Manufacturer(); $idManufacturer = $manufacturer->getIdByName(trim($name)); if ($idManufacturer != "") { return $idManufacturer; } else { return 'null'; } } function sendEmailError($content, $subject = "Se ha producido un error") { $subject .= ' - ' . $this->name . ' - ' . Configuration::getGlobalValue('PS_SHOP_NAME'); $mail = new MailCore(); $configuration = Configuration::getMultiple(array( 'PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME', 'PS_MAIL_SMTP_ENCRYPTION', 'PS_MAIL_SMTP_PORT', 'PS_MAIL_METHOD', 'PS_MAIL_TYPE' )); $smtpChecked = true; $smtpServer = $configuration['PS_MAIL_SERVER']; $content = $content; $type = "text/plain"; $to = $configuration['PS_SHOP_EMAIL']; $from = $configuration['PS_SHOP_EMAIL']; $smtpLogin = $configuration['PS_MAIL_USER']; $smtpPassword = $configuration['PS_MAIL_PASSWD']; $smtpPort = $configuration['PS_MAIL_SMTP_PORT']; $smtpEncryption = $configuration['PS_MAIL_SMTP_ENCRYPTION']; $resultado = $mail->sendMailTest($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort, $smtpEncryption); } function setMemory() { if (!ini_get("safe_mode")) { if (function_exists('set_time_limit')) { @set_time_limit(0); } else { } if ((int) substr(ini_get("memory_limit"), 0, -1) < 512) { ini_set("memory_limit", "512M"); } } else { if (function_exists('set_time_limit')) { @set_time_limit(0); } } } public function importador() { require_once dirname(__FILE__) . '/servicioWebFunctions.php'; Configuration::updateGlobalValue($this->sufijo . 'NEED_UPDATE', 0); $enviarCorreos = Configuration::getGlobalValue($this->sufijo . 'ENVIAR_EMAIL'); $url = Configuration::getGlobalValue($this->sufijo . 'URL'); $usuario = Configuration::getGlobalValue($this->sufijo . 'USUARIO'); $pass = Configuration::getGlobalValue($this->sufijo . 'PASS'); $this->terminarProceso(); switch (strtoupper($this->tipo)) { case 'CATE': $streamer = new ServicioWebCategory($url, $usuario, $pass); $streamer->ultimaCategoriaArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' categorias'), $this->l('Procesado correcto de categorias')); } return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' categorias')); } else { $this->terminarArchivo($this->idImport, $this->tipo); Category::regenerateEntireNtree(); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de categorias'), $this->l('Procesado correcto de categorias')); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de Familias')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($streamer->error['msgError']); } return $this->displayError($this->l($streamer->error['msgError'])); } break; case 'MANU': $streamer = new ServicioWebManufacturer($url, $usuario, $pass); $streamer->ultimaCategoriaArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' fabricantes'), $this->l('Procesado correcto de fabricantes')); } return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' fabricantes')); } else { $this->terminarArchivo($this->idImport, $this->tipo); Category::regenerateEntireNtree(); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de fabricantes'), $this->l('Procesado correcto de fabricantes')); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de fabricantes')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($streamer->error['msgError'], $this->l('Error al procesar las categorias')); } return $this->displayError($streamer->error['msgError']); } break; case 'PROD': $streamer = new ServicioWebProduct($url, $usuario, $pass); $streamer->ultimoProductoArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; $streamer->idProvider = $this->idDistribuidor; $streamer->categoriaExiste = 1; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' productos')); } else { Configuration::updateGlobalValue($this->sufijo . 'NIVEL_PROCESADO', 0); $this->addLogbyImax("Fin Productos", 4, 2222, 'Tipo', 0, true); $msg = $this->l('Se ha procesado el archivo de productos'); $this->terminarArchivo($this->idImport, $this->tipo); Configuration::updateGlobalValue($this->sufijo . 'NIVEL_PROCESADO', 0); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se ha procesado correctamente el archivo de productos'), $this->l('Procesado correcto de los productos de ' . $this->distribuidor)); } return $this->displayConfirmation($this->l($msg)); } } else { if (isset($this->error['msgError']) && !empty($this->error['msgError'])) { $msg = $this->error['msgError']; } else { $msg = $this->l('Se ha producido un error al procesar el archivo de Productos'); } if ($enviarCorreos == 1) { $this->sendEmailError($msg, $this->l('Error al procesar las productos de ' . $this->distribuidor)); } return $this->displayError($msg); } break; case 'FABR': $streamer = new SimpleXmlStreamerFabricante($archivo, 1024); $streamer->ultimoFabricanteArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' fabricantes')); } else { $this->terminarArchivo($this->idImport, $this->tipo); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de fabricantes'), $this->l('Procesado correcto de los fabricantes de ' . $this->distribuidor)); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de Fabricantes')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar los fabricantes'), $this->l('Procesado correcto de los fabricantes de ' . $this->distribuidor)); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de Fabricantes')); } break; case 'PROV': $streamer = new SimpleXmlStreamerProveedor($archivo, 1024); $streamer->ultimoProveedorArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' proveedores')); } else { $this->terminarArchivo($this->idImport, $this->tipo); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de proveedores'), $this->l('Procesado correcto de los proveedores de ' . $this->distribuidor)); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de proveedores')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar los proveedores'), $this->l('Error en el procesado de los proveedores de ' . $this->distribuidor)); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de Proveedores')); } break; case 'ATRI': $streamer = new SimpleXmlStreamerAtributos($archivo, 1024); $streamer->ultimoAtributoArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1 && $streamer->datosValidos == 1) { $numElementos = (int) $streamer->numElementosProcesados - 1; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' atributos')); } else { $this->terminarArchivo($this->idImport, $this->tipo); if ($enviarCorreos == 1) { $numElementos = (int) $streamer->numElementosProcesados - 1; $this->sendEmailError($this->l('Se han procesado correctamente el archivo de atributos'), $this->l('Procesado correcto de los atributos de ' . $this->distribuidor)); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de atributos')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar los proveedores'), $this->l('Error en el procesado de los proveedores de' . $this->distribuidor)); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de atributos')); } break; case 'ATRP': $streamer = new SimpleXmlStreamerAtributosProductos($archivo, 1024); $streamer->ultimoProveedorArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' atributos por Producto')); } else { $this->terminarArchivo($this->idImport, $this->tipo); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de atributos por Producto'), $this->l('Procesado correcto de los atributos por Producto')); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de atributos por Producto')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar los atributos por Producto'), $this->l('Procesado correcto de los atributos por Producto')); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de atributos por Producto')); } break; case 'BAJA': $streamer = new SimpleXmlStreamerBajas($archivo, 1024); $streamer->ultimoProveedorArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' bajas de producto')); } else { $this->terminarArchivo($this->idImport, $this->tipo); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de bajas de producto de NovaEngel'), $this->l('Procesado del archivo de bajas')); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de bajas de producto de NovaEngel')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar las bajas'), $this->l('Error al procesar el archivo de bajas')); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de bajas de producto')); } break; case 'ADJU': $this->terminarArchivo($this->idImport, $this->tipo); break; case 'ETIQ': $this->terminarArchivo($this->idImport, $this->tipo); $this->terminarArchivoCompleto($this->idImport); break; case 'STOC': $streamer = new SimpleXmlStreamerStock($archivo, 1024); $streamer->ultimoProveedorArchivo = $this->getElementoActualArchivo($this->idImport, $this->tipo); $streamer->lineasProcesadas = $this->lineasProcesadas; $streamer->idImport = $this->idImport; $streamer->tipo = $this->tipo; $streamer->inicio = 0; $streamer->finalizadoBatch = 0; if ($streamer->parse()) { if ($streamer->finalizadoBatch == 1) { $numElementos = (int) $streamer->numElementosProcesados; return $this->displayConfirmation($this->l('Se han procesado correctamente ') . $numElementos . $this->l(' sin stock')); } else { $this->terminarArchivo($this->idImport, $this->tipo); $this->terminarArchivoCompleto($this->idImport); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han procesado correctamente el archivo de stocks'), $this->l('Procesado del archivo de stocks')); } return $this->displayConfirmation($this->l('Se han procesado correctamente el archivo de stocks')); } } else { if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se han producido un error al procesar el archivo de stocks'), $this->l('Error al procesar el archivo de stocks')); } return $this->displayError($this->l('Se ha producido un error al procesar el archivo de stocks')); } break; default: return $this->terminarArchivoCompleto($this->idImport); } } function crearCategoria() { $idShopDefault = $this->getDefaultShop(); $this->setContextShop($idShopDefault); $_POST['checkBoxShopAsso_category'][$idShopDefault] = 1; $this->searchParentCategoria(); $idCategoria = $this->searchEquivalenciaCategoria(); if ($idCategoria == null) { $categoria = new Category($idCategoria, null, $idShopDefault); $categoria->doNotRegenerateNTree = false; if (is_array($this->categoria->name)) { foreach ($this->categoria->name AS $idLang => $name) { if (!Validate::isCatalogName(trim($name))) { $categoria->name[$idLang] = $this->cleanName(trim($name)); } else { $categoria->name[$idLang] = trim($name); } } } else { if (!Validate::isCatalogName(trim($this->categoria->name))) { $categoria->name = $this->cleanName(trim($this->categoria->name)); } else { $categoria->name = trim($this->categoria->name); } $lang = Configuration::getGlobalValue('PS_LANG_DEFAULT'); } if (is_array($this->categoria->description)) { foreach ($this->categoria->description AS $idLang => $description) { if (!Validate::isString(trim($description))) { $categoria->description[$idLang] = $this->cleanName(trim($description)); } else { $categoria->description[$idLang] = trim($description); } } } else { if (!Validate::isString(trim($this->categoria->description))) { $categoria->description = $this->cleanName(trim($this->categoria->description)); } else { $categoria->description = trim($this->categoria->description); } } if (is_array($this->categoria->link_rewrite)) { foreach ($this->categoria->link_rewrite AS $idLang => $linkRewrite) { if (!Validate::isLinkRewrite(trim($linkRewrite))) { $categoria->link_rewrite[$idLang] = Tools::link_rewrite(trim($linkRewrite)); } else { $categoria->link_rewrite[$idLang] = trim($linkRewrite); } } } else { if (!Validate::isLinkRewrite(trim($this->categoria->link_rewrite))) { $categoria->link_rewrite = Tools::link_rewrite(trim($this->categoria->link_rewrite)); } else { $categoria->link_rewrite = trim($this->categoria->link_rewrite); } } $categoria->id_parent = $this->categoria->id_parent; $categoria->active = $this->categoria->active; $categoria->id_shop_default = $idShopDefault; $categoria->id_shop_list = array($idShopDefault); try { $categoria->add(); $this->actualizarContadores($this->sufijo . 'CAT_COUNT'); $this->addLogbyImax("Categoria Nueva: " . $categoria->name[$this->idLang], 4, 1098, 'Categoria', $categoria->id, true); } catch (Exception $e) { echo "<pre>"; print_r($categoria); echo "</pre>"; echo "<pre>"; print_r($e); echo "</pre>"; $this->addLogbyImax("Error Creando Categoria Nueva: " . $categoria->name[$this->idLang], 4, 1098, 'Categoria', $categoria->id, true); } if (!empty($this->categoria->imagen)) { $this->copyImagen($categoria->id, NULL, $this->categoria->imagen, 'categories'); } $this->insertarMapeoCategorias($this->categoria->id_category, $categoria->id); $idCategoria = $categoria->id; $this->addToShops($categoria); $this->setDefaultContextShop(); unset($categoria); } else { if (Configuration::getGlobalValue($this->sufijo . 'CAT_IMAGE') == 1) { $this->insertarImagenCategoria($idCategoria); } } return $idCategoria; } public function crearManufacturer() { $idShopDefault = $this->getDefaultShop(); $this->setContextShop($idShopDefault); $idManufacturer = $this->searchEquivalenciaManufacturer(); if ($idManufacturer != NULL) { return true; } $manufacturer = new Manufacturer($idManufacturer); if (is_array($this->manufacturer->name)) { foreach ($this->manufacturer->name AS $idLang => $name) { if (!Validate::isCatalogName(trim($name))) { $manufacturer->name[$idLang] = $this->cleanName(trim($name)); } else { $manufacturer->name[$idLang] = trim($name); } } } else { if (!Validate::isCatalogName(trim($this->manufacturer->name))) { $manufacturer->name = $this->cleanName(trim($this->manufacturer->name)); } else { $manufacturer->name = trim($this->manufacturer->name); } } if (is_array($this->manufacturer->description)) { foreach ($this->manufacturer->description AS $idLang => $description) { if (!Validate::isString(trim($description))) { $manufacturer->description[$idLang] = $this->cleanName(trim($description)); } else { $manufacturer->description[$idLang] = trim($description); } } } else { if (!Validate::isString(trim($this->manufacturer->description))) { $manufacturer->description = $this->cleanName(trim($this->manufacturer->description)); } else { $manufacturer->description = trim($this->manufacturer->description); } } $manufacturer->active = $this->manufacturer->active; $manufacturer->id_shop_list = array($idShopDefault); try { $manufacturer->add(); if ($this->manufacturer->imagen) { $this->copyImagen($manufacturer->id, NULL, $this->manufacturer->imagen, 'manufacturers'); } if ($this->versionPS != 14) { $manufacturer->associateTo($this->manufacturer->id_shop_default); } $this->actualizarContadores($this->sufijo . 'MANU_COUNT'); $idManufacturer = $manufacturer->id; } catch (Exception $e) { echo "Se ha producido un error al insertar el fabricante"; echo "<pre>"; print_r($e); echo "</pre>"; die(); } $this->insertarMapeoManufacturers(trim($this->manufacturer->id_manufacturer), $idManufacturer); $this->setDefaultContextShop(); return $idManufacturer; } public function crearSupplier() { $idShopDefault = $this->getDefaultShop(); $this->setContextShop($idShopDefault); $idSupplier = $this->searchEquivalenciaSupplier($this->supplier->id_supplier); if ($idSupplier == null || $idSupplier == '') { $supplier = new Supplier($idSupplier, $this->lang); if (is_array($this->supplier->name)) { foreach ($this->supplier->name AS $idLang => $name) { if (!Validate::isCatalogName(trim($name))) { $supplier->name[$idLang] = $this->cleanName(trim($name)); } else { $supplier->name[$idLang] = trim($name); } } } else { if (!Validate::isCatalogName(trim($this->supplier->name))) { $supplier->name = $this->cleanName(trim($this->supplier->name)); } else { $supplier->name = trim($this->supplier->name); } } if (is_array($this->supplier->description)) { foreach ($this->supplier->description AS $idLang => $description) { if (!Validate::isString(trim($description))) { $supplier->supplier[$idLang] = $this->cleanName(trim($description)); } else { $supplier->supplier[$idLang] = trim($description); } } } else { if (!Validate::isString(trim($this->supplier->description))) { $supplier->description = $this->cleanName(trim($this->supplier->description)); } else { $supplier->description = trim($this->supplier->description); } } $supplier->active = $this->supplier->active; $supplier->add(); $this->copyImagen($supplier->id, NULL, $this->supplier->imagen, 'suppliers'); $idSupplier = $supplier->id; $this->insertarMapeoSuppliers($this->supplier->id_supplier, $idSupplier); $this->setDefaultContextShop(); } return $idSupplier; } private function fixEquivalenciaProducto($idproducto) { $sql = 'DELETE FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_products WHERE idProductoPrestashop=' . $idPrestashop; Db::getInstance()->execute($sql); } public function crearProducto() { $idShopDefault = $this->getDefaultShop(); $this->setContextShop($idShopDefault); $actualizarPrecio = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_PRECIO'); $actualizarStock = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_STOCK'); $reasignarProductos = Configuration::getGlobalValue($this->sufijo . 'REASIG_PROD'); $actualizarFabricante = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_FABRICANTE'); $indexar = Configuration::getGlobalValue($this->sufijo . 'INDEXAR'); $idCaracteristica = $this->obtenerEquivalenciaCaracteristica('Genero'); if (!$idCaracteristica) { $idCaracteristica = Feature::addFeatureImport('Genero'); $this->addToShops(new Feature($idCaracteristica)); $this->agregarEquivalenciaCaracteristica('Genero', $idCaracteristica); } $idValorCaracteristica = $this->obtenerEquivalenciaValorCaracteristica($this->producto->genero); if ($idCaracteristica && !$idValorCaracteristica) { $idValorCaracteristica = FeatureValue::addFeatureValueImport($idCaracteristica, $this->producto->genero, null, Configuration::getGlobalValue('PS_LANG_DEFAULT')); $this->agregarEquivalenciaValorCaracteristica($this->producto->genero, $idValorCaracteristica); } $idproducto = $this->searchEquivalenciaProducto(); $idShopProducto = $this->getDefaultShop(); $producto = new Product($idproducto); if ($this->producto->taxValue == 0) { $producto->id_tax_rules_group = 0; $this->addLogbyImax("Producto sin IVA: " . $this->producto->reference, 4, 1999, 'Product', $this->producto->id_product, true); } else { $producto->id_tax_rules_group = $this->producto->id_tax_rules_group; } $producto->available_for_order = $this->producto->available_for_order; if ($idproducto != null) { if (!$this->validateAndFixObject($producto)) { $this->fixEquivalenciaProducto($idproducto); try { $producto->delete(); } catch (Exception $ex) { $this->addLogbyImax("Producto Erroneo " . $this->producto->id_product, 1, 9999, 'Producto', 998, true); } return true; } $producto->active = $this->producto->active; $producto = $this->getdescripcionProducto($producto, 1); $actualizarDesc = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_SEO'); if ($actualizarDesc != 0) { $this->setMetaKeys($producto); $this->crearTagsProductos($this->producto->tags, $idproducto); } $producto->date_upd = date('Y-m-d H:i:s'); if ($this->producto->reference == '0' || $this->producto->reference == '') { $producto->reference = $this->producto->id_product; } else { $producto->reference = $this->producto->reference; } if ($actualizarPrecio == 1) { $id_category_default = $this->searchEquivalenciaCategoria($this->producto->id_category_default, 1); $producto->wholesale_price = abs((float) str_replace(",", ".", $this->producto->wholesale_price)); $producto->price = $this->calcularPrecioProducto($id_category_default); } if ($actualizarStock == 1) { $producto->quantity = $this->producto->quantity; if ($this->desactivarProductoPorStock($producto)) { $this->desactivarONoVender($producto, 0); } else { $this->desactivarONoVender($producto, $this->producto->active); } } if ($actualizarFabricante == 1) { $producto->id_manufacturer = $this->searchEquivalenciaManufacturer($this->producto->id_manufacturer); } try { if ($reasignarProductos == 1) { $producto->id_category_default = $this->searchEquivalenciaCategoria($this->producto->id_category_default, 1); $producto->deleteCategories(true); $producto->addToCategories($producto->id_category_default); } $producto->update(false); if ($this->versionPS != 14) { if ($actualizarStock == 1) { StockAvailable::setQuantity((int) $idproducto, 0, $producto->quantity, $this->producto->id_shop_default); $this->addLogbyImax("Actualizando producto: " . $producto->name[$this->idLang] . ' Id Producto: ' . $producto->id . " Stock " . $this->producto->quantity . " Precio:" . $producto->price, 4, 1098, 'Product', $producto->id, true); } } } catch (Exception $e) { echo "<pre>"; print_r($e->getTrace()); echo "</pre>"; $this->addLogbyImax("Error Actualizando producto: " . $this->good_print($producto) . " " . $this->good_print($e), 4, 1098, 'Product', $producto->id, true); } $idproducto = $producto->id; if ($indexar == 1) { Search::indexation(false, $idproducto); } $actualizarImagenes = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_IMAGEN'); if ($actualizarImagenes == 1) { $this->setDefaultContextShop(); $producto->deleteImages(); $this->deleteImageFromTable($producto->id); $this->pedir_imagen($producto); $this->setContextShop($idShopDefault); } $this->insertarMapeoProductos($this->producto->id_product, $producto->id); if ($idValorCaracteristica) { Product::addFeatureProductImport($idproducto, $idCaracteristica, $idValorCaracteristica); } $this->producto->id_producto = $idproducto; $this->addToShops($producto); $this->updateProductPriceShop($idproducto); $this->setDefaultContextShop(); unset($producto); return $idproducto; } $producto->id_category_default = $this->searchEquivalenciaCategoria($this->producto->id_category_default, 1); if (is_null($producto->id_category_default)) { $producto->id_category_default = Configuration::getGlobalValue($this->sufijo . 'CATEGORIA_PADRE'); } $producto = $this->getdescripcionProducto($producto, 0); if (is_array($this->producto->name)) { foreach ($this->producto->name AS $idLang => $name) { if (!Validate::isCatalogName(trim($name))) { $producto->name[$idLang] = $this->cleanName(trim($name)); } else { $producto->name[$idLang] = trim($name); } } } else { if (!Validate::isCatalogName(trim($this->producto->name))) { $producto->name = $this->cleanName(trim($this->producto->name)); } else { $producto->name = trim($this->producto->name); } } if (is_array($this->producto->available_now)) { foreach ($this->producto->available_now AS $idLang => $available_now) { if (!Validate::isGenericName(trim($available_now))) { $producto->available_now[$idLang] = $this->cleanName(trim($available_now)); } else { $producto->available_now[$idLang] = trim($available_now); } } } else { if (!Validate::isGenericName(trim($this->producto->available_now))) { $producto->available_now = $this->cleanName(trim($this->producto->available_now)); } else { $producto->available_now = trim($this->producto->available_now); } } if (is_array($this->producto->link_rewrite)) { foreach ($this->producto->link_rewrite AS $idLang => $linkRewrite) { if (!Validate::isLinkRewrite(trim($linkRewrite))) { if (trim($linkRewrite) == '') { if (isset($this->producto->name[$idLang])) { $producto->link_rewrite[$idLang] = Tools::link_rewrite($this->producto->name[$idLang]); } else { $producto->link_rewrite[$idLang] = Tools::link_rewrite($this->producto->name); } } else { $producto->link_rewrite[$idLang] = Tools::link_rewrite($this->cleanName(trim($linkRewrite))); } } else { $producto->link_rewrite[$idLang] = trim($linkRewrite); } } } else { if (!Validate::isLinkRewrite(trim($this->producto->link_rewrite))) { if (trim($this->producto->link_rewrite) == '') { $producto->link_rewrite = Tools::link_rewrite(trim($this->producto->name)); } else { $producto->link_rewrite = Tools::link_rewrite(trim($this->producto->link_rewrite)); } } else { $producto->link_rewrite = trim($this->producto->link_rewrite); } } $this->idShop = $idShopDefault; $producto->id_shop_default = $idShopDefault; $producto->available_date = $this->setDateToBBDD($this->producto->available_date); $producto->id_supplier = $this->searchEquivalenciaSupplier($this->producto->id_supplier); $producto->id_manufacturer = $this->searchEquivalenciaManufacturer($this->producto->id_manufacturer); $producto->id_color_default = $this->producto->id_color_default; $producto->on_sale = $this->producto->on_sale; $producto->online_only = $this->producto->online_only; $producto->ean13 = $this->producto->ean13; $producto->upc = $this->producto->upc; $producto->ecotax = $this->producto->ecotax; $producto->minimal_quantity = $this->producto->minimal_quantity; $producto->wholesale_price = abs((float) str_replace(",", ".", $this->producto->wholesale_price)); $producto->price = $this->calcularPrecioProducto($producto->id_category_default); $producto->quantity = $this->producto->quantity; $producto->unit_price_ratio = $this->producto->unit_price_ratio; $producto->additional_shipping_cost = $this->producto->additional_shipping_cost; $producto->unity = $this->producto->unity; if ($this->producto->reference == '0' || $this->producto->reference == '') { $producto->reference = $this->producto->id_product; } else { $producto->reference = $this->producto->reference; } $producto->supplier_reference = $this->producto->supplier_reference; $producto->location = $this->producto->location; $producto->width = abs((float) str_replace(",", ".", $this->producto->width)); $producto->height = abs((float) str_replace(",", ".", $this->producto->height)); $producto->depth = abs((float) str_replace(",", ".", $this->producto->depth)); $producto->weight = abs((float) str_replace(",", ".", $this->producto->weight)); $producto->out_of_stock = $this->producto->out_of_stock; $producto->quantity_discount = $this->producto->quantity_discount; $producto->customizable = $this->producto->customizable; $producto->uploadable_files = $this->producto->uploadable_files; $producto->text_fields = $this->producto->text_fields; $producto->condition = $this->producto->condition; $producto->show_price = $this->producto->show_price; $producto->cache_default_attribute = $this->producto->cache_default_attribute; $producto->date_add = date('Y-m-d H:i:s'); $producto->date_upd = date('Y-m-d H:i:s'); $producto->taxValue = $this->producto->taxValue; if ($producto->quantity <= Configuration::getGlobalValue($this->sufijo . 'STOCK_MINIMO')) { $this->desactivarONoVender($producto, 0); } else { $this->desactivarONoVender($producto, $this->producto->active); } $producto->id_shop_list = array($idShopDefault); $this->setMetaKeys($producto); if (!$this->validateAndFixObject($producto)) { return false; } try { $producto->add(false); $producto->addToCategories($producto->id_category_default); $idproducto = $producto->id; if ($idValorCaracteristica) { Product::addFeatureProductImport($idproducto, $idCaracteristica, $idValorCaracteristica); } $this->insertarMapeoProductos($this->producto->id_product, $producto->id); $this->crearTagsProductos($this->producto->tags, $idproducto); $this->producto->id_producto = $idproducto; Configuration::updateGlobalValue($this->sufijo . 'PRODUCTOS', Configuration::getGlobalValue($this->sufijo . 'PRODUCTOS') + 1); $this->addLogbyImax("Creando producto: " . $this->producto->name[$idLang] . " ", 1, 999, 'Product', $producto->id, true); if ($this->versionPS != 14) { StockAvailable::setQuantity((int) $idproducto, 0, $producto->quantity, $producto->id_shop_default); $this->addToShops($producto); $this->updateProductPriceShop($idproducto); $this->addProductToSupplier($idproducto, $producto->id_supplier); } if ($indexar == 1) { Search::indexation(false, $idproducto); } $this->actualizarContadores($this->sufijo . 'PROD_COUNT'); $this->setDefaultContextShop(); return $idproducto; } catch (Exception $e) { echo "Se ha producido un error al insertar el producto"; echo "<pre>"; print_r($e); echo "</pre>"; echo $e->getTraceAsString(); die(); } } private function obtenerEquivalenciaCaracteristica($idArchivo) { $idArchivo = pSQL($idArchivo); return Db::getInstance()->getValue('SELECT idPrestashop FROM `' . _DB_PREFIX_ . $this->tabla . "equi_carac` WHERE idArchivo = '$idArchivo'"); } private function agregarEquivalenciaCaracteristica($idArchivo, $idPrestashop) { $idArchivo = pSQL($idArchivo); $idPrestashop = (int) $idPrestashop; return Db::getInstance()->execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . $this->tabla . "equi_carac` (idArchivo, idPrestashop) VALUES ('$idArchivo', $idPrestashop)"); } private function obtenerEquivalenciaValorCaracteristica($idArchivo) { $idArchivo = pSQL($idArchivo); return Db::getInstance()->getValue('SELECT idPrestashop FROM `' . _DB_PREFIX_ . $this->tabla . "equi_valor_carac` WHERE idArchivo = '$idArchivo'"); } private function agregarEquivalenciaValorCaracteristica($idArchivo, $idPrestashop) { $idArchivo = pSQL($idArchivo); $idPrestashop = (int) $idPrestashop; return Db::getInstance()->execute('INSERT IGNORE INTO `' . _DB_PREFIX_ . $this->tabla . "equi_valor_carac` (idArchivo, idPrestashop) VALUES ('$idArchivo', $idPrestashop)"); } private function desactivarONoVender($producto, $activo) { if (Configuration::getGlobalValue($this->sufijo . 'DESAC_PROD')) { $producto->active = $activo; } else { $producto->available_for_order = $activo; } } private function almacenarImagenPendiente($idProducto, $idShop, $imagen) { $tiendas = $this->getShops(); $tiendas = serialize($tiendas); if ($this->versionPS != 14) { $imagenS = db::getInstance()->escape(serialize($imagen)); } else { $imagenS = pSQL(serialize($imagen)); } db::getInstance()->execute("insert into `" . _DB_PREFIX_ . "imax_novaEngel_imagenesPendientes` (idProducto, idShop, imagen) values ('$idProducto', '$tiendas', '$imagenS')"); } private function getdescripcionProducto($producto, $actualizar) { $actualizarDesc = Configuration::getGlobalValue($this->sufijo . 'ACTUALIZAR_SEO'); $plantillaLarga = unserialize(base64_decode(Configuration::getGlobalValue($this->sufijo . 'PLANTILLA_LARGA'))); $plantillaCorta = unserialize(base64_decode(Configuration::getGlobalValue($this->sufijo . 'PLANTILLA_CORTA'))); if ($actualizar == 0 || $actualizarDesc != 0) { $this->setMetaKeys($producto); if (is_array($this->producto->description)) { foreach ($this->producto->description AS $idLang => $description) { if (!Validate::isString(trim($description))) { $producto->description[$idLang] = $this->cleanName(trim($description)); } else { $producto->description[$idLang] = trim($description); } } } else { if (!Validate::isString(trim($this->producto->description))) { $producto->description = $this->cleanName(trim($this->producto->description)); } else { $producto->description = trim($this->producto->description); } } if (is_array($plantillaLarga)) { foreach ($plantillaLarga as $idLang => $plantilla) { if (!$producto->description[$idLang]) { $producto->description[$idLang] = $this->plantilla->procesarTexto($plantilla, $this->producto->datosPlantilla); } } } if (is_array($this->producto->description_short)) { foreach ($this->producto->description_short AS $idLang => $description_short) { $this->checkShortDesc($description_short); if (!Validate::isString(trim($description_short))) { $producto->description_short[$idLang] = $this->cleanName(trim($description_short)); } else { $producto->description_short[$idLang] = trim($description_short); } } } else { $this->checkShortDesc($description_short); if (!Validate::isString(trim($this->producto->description_short))) { $producto->description_short = $this->cleanName(trim($this->producto->description_short)); } else { $producto->description_short = trim($this->producto->description_short); } } if (is_array($plantillaCorta)) { foreach ($plantillaCorta as $idLang => $plantilla) { if (!$producto->description_short[$idLang]) { $producto->description_short[$idLang] = $this->plantilla->procesarTexto($plantilla, $this->producto->datosPlantilla); } } } } return $producto; } private function setMetaKeys($producto) { if (is_array($this->producto->meta_title)) { foreach ($this->producto->meta_title AS $idLang => $meta_title) { $meta_title = Configuration::getGlobalValue($this->sufijo . 'PRE_TITLE') . ' ' . $meta_title . ' ' . Configuration::getGlobalValue($this->sufijo . 'POST_TITLE'); if (!Validate::isGenericName(trim($meta_title))) { $producto->meta_title[$idLang] = mb_substr($this->cleanName(trim($meta_title)), 0, 126); } else { $producto->meta_title[$idLang] = mb_substr(trim($meta_title), 0, 126); } } } else { $this->producto->meta_title = Configuration::getGlobalValue($this->sufijo . 'PRE_TITLE') . ' ' . $this->producto->meta_title . ' ' . Configuration::getGlobalValue($this->sufijo . 'POST_TITLE'); if (!Validate::isGenericName(trim($this->producto->meta_title))) { $producto->meta_title = mb_substr($this->cleanName(trim($this->producto->meta_title)), 0, 126); } else { $producto->meta_title = mb_substr(trim($this->producto->meta_title), 0, 126); } } if (is_array($this->producto->meta_keywords)) { foreach ($this->producto->meta_keywords AS $idLang => $meta_keywords) { if (!$meta_keywords) { $meta_keywords = $producto->manufacturer_name; } $meta_keywords = $this->generarMetaKeyWords($meta_keywords); if (!Validate::isGenericName(trim($meta_keywords))) { $producto->meta_keywords[$idLang] = $this->cleanName(trim($meta_keywords)); } else { $producto->meta_keywords[$idLang] = trim($meta_keywords); } } } else { $meta_keywords = $this->generarMetaKeyWords($this->producto->meta_keywords); if (!Validate::isGenericName(trim($this->producto->meta_keywords))) { $producto->meta_keywords = $this->cleanName(trim($this->producto->meta_keywords)); } else { $producto->meta_keywords = trim($this->producto->meta_keywords); } } if (is_array($this->producto->meta_description)) { foreach ($this->producto->meta_description AS $idLang => $meta_description) { if (!$meta_description) { $meta_description = substr($producto->description[$idLang], 0, 255); } $meta_description = Configuration::getGlobalValue($this->sufijo . 'PRE_DESC') . ' ' . $meta_description . ' ' . Configuration::getGlobalValue($this->sufijo . 'POST_DESC'); if (!Validate::isGenericName(trim($meta_description))) { $producto->meta_description[$idLang] = substr($this->cleanName(trim($meta_description)), 0, 255); ; } else { $producto->meta_description[$idLang] = substr(trim($meta_description), 0, 255); } } } else { if (!$meta_description) { $meta_description = substr($producto->description[$idLang], 0, 255); } $meta_description = Configuration::getGlobalValue($this->sufijo . 'PRE_DESC') . ' ' . $this->producto->meta_description . ' ' . Configuration::getGlobalValue($this->sufijo . 'POST_DESC'); if (!Validate::isGenericName(trim($this->producto->meta_description))) { $producto->meta_description = substr($this->cleanName(trim($this->producto->meta_description)), 0, 255); ; } else { $producto->meta_description = substr(trim($this->producto->meta_description), 0, 255); ; } } return $producto; } public function generarMetaKeyWords($texto) { $texto = str_replace(',', ' ', $texto); $temp = explode(" ", $texto); $sw = 0; $keyword = ""; foreach ($temp AS $palabra) { if (strlen(trim($palabra)) >= 3) { if ($sw == 0) { $keyword = trim($palabra); $sw = 1; } else { $keyword .= ',' . trim($palabra); } } } if ((string) Configuration::getGlobalValue($this->sufijo . 'PRE_KEY') != '') { $keyword = Configuration::getGlobalValue($this->sufijo . 'PRE_KEY') . ',' . $keyword; } if ((string) Configuration::getGlobalValue($this->sufijo . 'POST_KEY') != '') { $keyword = $keyword . ',' . Configuration::getGlobalValue($this->sufijo . 'POST_KEY'); } return $keyword; } private function setDescripcionProducto($referencia) { $this->_idProducto = $this->getProducto($referencia); if ($this->checkProductText() != 0) { $producto = New Product($this->_idProducto); $producto->description = $this->_textoDescripcion; $producto->update(); $this->updateProductTextBBDD(); unset($producto); } } private function setProductEan($referencia) { $this->_idProducto = $this->getProducto($referencia); if ($this->_idProducto != '') { if (Validate::isEan13($this->_ean)) { $producto = New Product($this->_idProducto); if ($producto->id_category_default != '') { $producto->ean13 = (string) $this->_ean; $producto->update(); unset($producto); } else { $this->_erroresEAN[] = $referencia; } } else { $this->_erroresEAN[] = $referencia; } } } function crearAtributos() { $default_language = Configuration::getGlobalValue('PS_LANG_DEFAULT'); $idGrupo = $this->searchEquivalenciaGrupoAtributos(); $groups = array(); if ($idGrupo == NULL) { foreach (AttributeGroup::getAttributesGroups($default_language) as $group) { $groups[$group['name']] = (int) $group['id_attribute_group']; } if (!isset($groups[$this->atributo->name[$default_language]])) { $grupo = new AttributeGroup(); $grupo->is_color_group = $this->atributo->is_color_group; if ($this->versionPS != 14) { $grupo->group_type = pSQL($this->atributo->group_type); } $grupo->name[$default_language] = $this->atributo->name[$default_language]; $grupo->public_name[$default_language] = $this->atributo->public_name[$default_language]; if ($this->versionPS != 14) { $grupo->position = (!$this->atributo->position) ? AttributeGroup::getHigherPosition() + 1 : $this->atributo->position; } $grupo->add(); if ($this->versionPS != 14) { $grupo->associateTo($this->idShop); } $idGrupo = $grupo->id; } else { $idGrupo = $groups[$this->atributo->name[$default_language]]; } $this->insertarMapeoGrupoAtributos($this->atributo->id_attribute_group, $idGrupo); } $attributes = array(); foreach (Attribute::getAttributes($default_language) as $attribute) { $attributes[$attribute['id_attribute_group']][$attribute['name']] = (int) $attribute['id_attribute']; } if (isset($attributes[$idGrupo])) { $atributosGrupo = $attributes[$idGrupo]; } else { $atributosGrupo = array(); } $listadoAtributos = $this->atributo->atributo; if (!empty($listadoAtributos)) { foreach ($listadoAtributos AS $key => $value) { if ($key == 'idiomas') { if (!isset($value[$default_language]->name)) { $valueAtributo->id_attribute = NULL; } else { $valueAtributo = new stdClass(); $valueAtributo->id_attribute = trim($value[$default_language]->name); $nombreAtributo = trim($value[$default_language]->name); } $idAtributo = $this->searchEquivalenciaAtributos($valueAtributo->id_attribute); if ($idAtributo == NULL || $idAtributo == "") { $atributo = new Attribute(); $atributo->id_attribute_group = $idGrupo; $atributo->name[$default_language] = str_replace('
', '', str_replace('
', '', $nombreAtributo)); if ($this->versionPS != 14) { $atributo->position = Attribute::getHigherPosition($idGrupo) + 1; } $atributo->add(); if ($this->versionPS != 14) { $atributo->associateTo($this->idShop); } $this->insertarMapeoAtributos($nombreAtributo, $atributo->id); $idAtributo = $atributo->id; } else { $idAtributo = $atributosGrupo[$nombreAtributo]; } } } } else { } return true; } public function addAtributoAproducto() { $default_language = Configuration::getGlobalValue('PS_LANG_DEFAULT'); $idProductAttribute = $this->searchEquivalenciaAtributoPorProducto($this->atributoPorProducto->id_product_attribute); $this->producto->id_product = $this->atributoPorProducto->id_product; $idproducto = $this->searchEquivalenciaProducto(); if (is_null($idproducto) || $idproducto == '') { return true; } $producto = new Product($idproducto); if (!$this->validateAndFixObject($producto)) { try { $producto->delete(); } catch (Exception $ex) { $this->addLogbyImax("Producto Erroneo " . $this->producto->id_product, 1, 9999, 'Producto', 998, true); } return true; } $productPrice = $producto->price; $this->atributoPorProducto->wholesale_price = str_replace(',', '.', $this->atributoPorProducto->wholesale_price); $this->producto->price = $this->atributoPorProducto->price; $this->producto->taxValue = $this->atributoPorProducto->taxValue; $this->atributoPorProducto->price = $this->calcularPrecioProducto($producto->id_category_default); $this->producto->price = $this->atributoPorProducto->price - $productPrice; $this->producto->price = number_format(str_replace(',', '.', $this->producto->price), 6, '.', ''); $this->atributoPorProducto->price = $this->producto->price; $images = $producto->getImages($default_language); $id_image = null; if ($images) { foreach ($images as $row) { $id_image[] = $row['id_image']; } } if (is_null($idProductAttribute) || $idProductAttribute == '') { $idProductAttribute = $producto->addCombinationEntity( (float) $this->atributoPorProducto->wholesale_price, $this->producto->price, (float) $this->atributoPorProducto->weight, (float) $this->atributoPorProducto->unit_price_impact, (float) $this->atributoPorProducto->ecotax, (int) $this->atributoPorProducto->quantity, $id_image, strval($this->atributoPorProducto->reference), 0, strval($this->atributoPorProducto->ean13), (int) $this->atributoPorProducto->default_on, 0, strval($this->atributoPorProducto->upc), (int) $this->atributoPorProducto->minimal_quantity, array($this->idShop) ); Configuration::updateGlobalValue($this->sufijo . 'ATR_PRODUCTOS', Configuration::getGlobalValue($this->sufijo . 'ATR_PRODUCTOS') + 1); $this->addLogbyImax("Alta Combinacion: " . $idProductAttribute . " Id Prestashop:" . $idproducto, 1, 99999, 'Combinacion', $idproducto, true); } else { if ($this->versionPS != 14) { $producto->updateAttribute( $idProductAttribute, (float) $this->atributoPorProducto->wholesale_price, (float) $this->producto->price, (float) $this->atributoPorProducto->weight, (float) $this->atributoPorProducto->unit_price_impact, (float) $this->atributoPorProducto->ecotax, $id_image, strval($this->atributoPorProducto->reference), strval($this->atributoPorProducto->ean13), (int) $this->atributoPorProducto->default_on, null, strval($this->atributoPorProducto->upc), (int) $this->atributoPorProducto->minimal_quantity, null, true, array($this->idShop) ); } else { $producto->updateProductAttribute( $idProductAttribute, (float) $this->atributoPorProducto->wholesale_price, (float) $this->producto->price, (float) $this->atributoPorProducto->weight, (float) $this->atributoPorProducto->unit_price_impact, (float) $this->atributoPorProducto->ecotax, (int) $this->atributoPorProducto->quantity, $id_image, strval($this->atributoPorProducto->reference), strval($this->atributoPorProducto->supplier_reference), strval($this->atributoPorProducto->ean13), (int) $this->atributoPorProducto->default_on, null, strval($this->atributoPorProducto->upc), (int) $this->atributoPorProducto->minimal_quantity ); } } $this->insertarMapeoAtributosProductos($this->atributoPorProducto->id_product_attribute, $idProductAttribute); if ($this->versionPS != 14) { AttributeGroup::cleanPositions(); } $this->updateDefaultAttribute($producto->id); if (!is_null($idProductAttribute) && $idProductAttribute != '') { foreach ($this->atributoPorProducto->atributosPorProducto AS $indice => $atributo) { $idAtributo = $this->searchEquivalenciaAtributos($atributo); if ($idAtributo == '' || is_null($idAtributo)) { return true; } Db::getInstance()->execute('
INSERT IGNORE INTO ' . _DB_PREFIX_ . 'product_attribute_combination (id_attribute, id_product_attribute)
VALUES (' . (int) $idAtributo . ',' . (int) $idProductAttribute . ')'); } if ($this->versionPS != 14) { StockAvailable::setQuantity($producto->id, $idProductAttribute, (int) $this->atributoPorProducto->quantity); } } unset($producto); return $idProductAttribute; return true; } private function checkProductText() { return Db::getInstance()->getValue('SELECT count(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_auxiliar WHERE idProducto=' . $this->_idProducto); } private function updateProductTextBBDD() { return Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'imax_novaEngel_auxiliar SET textosInsertados=1 WHERE idProducto=' . $this->_idProducto); } private function addProductToBbdd() { if (DB::getInstance()->getValue('SELECT count() FROM `' . _DB_PREFIX_ . 'imax_novaEngel_auxiliar` WHERE idProducto=' . $this->_idProducto) == 0) { $sql = 'INSERT INTO `' . _DB_PREFIX_ . 'imax_novaEngel_auxiliar`
(idProveedor,referencia, idProducto)
VALUES
(' . $this->idDistribuidor . ',"' . $this->_referencia . '",' . $this->_idProducto . ')'; return Db::getInstance()->execute($sql); } } function setDateToBBDD($date) { if ($date == '') { return $date; } ereg("([0-9]{1,2})/([0-9]{1,2})/([0-9]{2,4})", $date, $bbddDate); if (strlen($bbddDate[3]) == 2) { $bbddDate[3] = '20' . $bbddDate[3]; } $date = $bbddDate[3] . "-" . $bbddDate[2] . "-" . $bbddDate[1]; return $date; } private function addProductToSupplier($idproducto, $idSupplier) { if ($this->versionPS != 14) { $product_supplier = new ProductSupplier(); } else { $product_supplier = new Supplier(); } $product_supplier->id_product = $idproducto; $product_supplier->id_product_attribute = 0; $product_supplier->id_supplier = $idSupplier; $product_supplier->save(); } public function checkShortDesc($description_short) { $shortDescLimit = Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT', NULL, NULL, NULL); if (strlen($description_short) > $shortDescLimit) { Configuration::updateGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT', strlen($description_short) + 1, FALSE, NULL, NULL); } } private function calcularPrecioProducto($idDefaultCategory = '') { $this->eliminarIva(); $tipoCalculo = Configuration::getGlobalValue($this->sufijo . 'METODO_MARGEN'); $margenMinimo = Configuration::getGlobalValue($this->sufijo . 'MARGEN_MINIMO'); $margenGlobal = Configuration::getGlobalValue($this->sufijo . 'MARGEN_GLOBAL'); $price = str_replace(",", ".", $this->producto->price); if ($tipoCalculo == 1) { $margenCategoria = $this->getMargenCategoria($idDefaultCategory); if (isset($margenCategoria[$idDefaultCategory]) && $margenCategoria[$idDefaultCategory] != "" && $margenCategoria[$idDefaultCategory] != 0) { $price = str_replace((","), ".", $this->producto->wholesale_price); $price = $price / ((100 - (float) $margenCategoria[$idDefaultCategory]) / 100); } else { $price = str_replace((","), ".", $this->producto->wholesale_price); if ($margenGlobal >= 100) { $margenGlobal = 99.99; $margenGlobal = Configuration::update($this->sufijo . 'MARGEN_GLOBAL', 99.99); } $price = $price / ((100 - (float) $margenGlobal) / 100); } } elseif ($tipoCalculo == 0) { $margenCategoria = $this->getMargenCategoria($idDefaultCategory); if (isset($margenCategoria[$idDefaultCategory]) && $margenCategoria[$idDefaultCategory] != "" && $margenCategoria[$idDefaultCategory] != 0) { $price = str_replace((","), ".", $this->producto->wholesale_price); $price = $price * ((100 + (float) $margenCategoria[$idDefaultCategory]) / 100); } else { $price = str_replace((","), ".", $this->producto->wholesale_price); $price = $price * ((100 + (float) $margenGlobal) / 100); } } elseif ($tipoCalculo == 3) { $margenCategoria = $this->getMargenCategoria($idDefaultCategory); if (isset($margenCategoria[$idDefaultCategory]) && $margenCategoria[$idDefaultCategory] != "" && $margenCategoria[$idDefaultCategory] != 0) { $price = str_replace((","), ".", $this->producto->price); $price = $price * ((100 + (float) $margenCategoria[$idDefaultCategory]) / 100); } else { $price = str_replace((","), ".", $this->producto->price); $price = $price * ((100 + (float) $margenGlobal) / 100); } } if ($margenMinimo + str_replace((","), ".", $this->producto->wholesale_price) > $price) { $price = $margenMinimo + str_replace((","), ".", $this->producto->wholesale_price); } $idProducto = $this->searchEquivalenciaProducto(); if (!$idProducto) { $idProducto = 0; } if (!isset($margenCategoria[$idDefaultCategory])) { $margenCategorias = "No tiene"; } else { $margenCategorias = $margenCategoria[$idDefaultCategory]; } if (!isset($margenMinimo)) { $margenMinimo = "No tiene"; } if (!isset($margenGlobal)) { $margenGlobal = "No tiene"; } $this->addLogbyImax("Producto:" . $idProducto . " Precio coste:" . $this->producto->wholesale_price . " Precio Nuevo: " . $price . " Margen Global:" . $margenGlobal . " Margen minimo por producto: " . $margenMinimo . " Margen Categoria:" . $margenCategorias . " Tipo de Calculo: " . $tipoCalculo, 1, 1005, 'Calculo', $idProducto, true); return number_format($price, 6, '.', ''); } function eliminarIva() { if (isset($this->producto->taxValue) && $this->producto->taxValue != 0) { $this->producto->price = $this->producto->price / ((100 + $this->producto->taxValue) / 100); } } function getMargenCategoria($idCategoria = 0) { $margenCategorias = array(); if ($idCategoria == 0) { $idCategoria = $this->searchEquivalenciaCategoria($this->producto->id_category_default); } $query = 'SELECT
i.id_category,i.margen
FROM
' . _DB_PREFIX_ . 'imax_novaEngel_categorias AS i
WHERE id_category="' . pSQL($idCategoria) . '"'; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); if (!empty($result_query[0]['id_category'])) { foreach ($result_query AS $categoria) { $margenCategorias[$categoria['id_category']] = $categoria['margen']; } } return $margenCategorias; } private function bajaProducto() { $producto = new Product($this->_idProducto); $producto->active = false; $this->addLogbyImax("Baja Producto: " . $producto->name[$idLang], 1, 9999, 'Producto', $producto->id, true); $producto->update(); } public function bajaProductoArchivo() { $idAtributoProducto = $this->searchEquivalenciaAtributoPorProductoLimpio($this->producto->id_product); if (!is_null($idAtributoProducto) && !is_array($idAtributoProducto) && $idAtributoProducto != '') { $idProducto = $this->searchProductoPorAtributo($idAtributoProducto); if ($this->validateAndFixObject($producto)) { if ($this->versionPS != 14) { StockAvailable::setQuantity((int) $idProducto, (int) $idAtributoProducto, 0, $this->producto->id_shop_default); $producto = new Product($idProducto); } else { $producto = new Product($idProducto); $cantidad = $producto->getQuantity($idProducto, $idAtributoProducto); $producto->addStockMvt((int) $cantidad * -1, 2, (int) $idAtributoProducto, 0); Product::deleteAttributeCombinaison((int) $idAtributoProducto); } $this->updateDefaultAttribute((int) $idProducto); $this->addLogbyImax("Baja Producto: " . $this->producto->id_product . " Nombre:" . $producto->name[$this->idLang] . " Id Prestashop:" . $producto->id, 1, 99991, 'Producto', $producto->id, true); } else { $this->addLogbyImax("Error al dar de baja Producto (Producto no valido): " . $this->producto->id_product . " Nombre:" . $producto->name[$this->idLang] . " Id Prestashop:" . $producto->id, 1, 99991, 'Producto', $producto->id, true); try { $producto->delete(); } catch (Exception $ex) { } } } else { $idProducto = $this->searchEquivalenciaProducto(); if (!is_null($idProducto) && $idProducto !== FALSE) { $producto = new Product($idProducto); if ($this->desactivarProductoPorStock($producto)) { try { $this->desactivarONoVender($producto, 0); $producto->update(); $this->updateEquivalenciaProductoDesactivar($producto->id); $this->addLogbyImax("Baja Producto: " . $this->producto->id_product . " Nombre:" . $producto->name[$this->idLang] . " " . $producto->id, 1, 99991, 'Producto', $producto->id, true); } catch (Exception $e) { echo "<pre>"; print_r($e); echo "</pre>"; echo "<pre>"; print_r($e->getTrace()); echo "</pre>"; die(); } } } else { $this->addLogbyImax("Baja Inexistente Producto : " . $this->producto->id_product, 1, 9999, 'Producto', 99, true); } } return true; } public function eliminarStock() { $idAtributoProducto = $this->searchEquivalenciaAtributoPorProductoLimpio($this->producto->id_product); $idProducto = $this->searchProductoPorAtributo($idAtributoProducto); $producto = new Product($idProducto); if (Validate::isLoadedObject($producto)) { if (!$this->validateAndFixObject($producto)) { try { $producto->delete(); } catch (Exception $ex) { $this->addLogbyImax("Producto que no puedo borrar al eliminar Stock: " . $this->producto->id_product, 1, 9999, 'Producto', 998, true); } return true; } } if (!is_null($idAtributoProducto) && !is_array($idAtributoProducto) && $idAtributoProducto != '') { if ($this->versionPS != 14) { StockAvailable::SetQuantity((int) $idProducto, (int) $idAtributoProducto, 0, $this->idShop); if ($idProducto == 4 && $idAtributoProducto == 3) { } unset($producto); $producto = new Product($idProducto); if (ConfigurationCore::get($this->sufijo . 'DESACTIVAR_SIN_STOCK') == 1) { if ($this->desactivarProductoPorStock($producto)) { $producto->quantity = 0; StockAvailable::SetQuantity((int) $idProducto, 0, 0, $this->producto->id_shop_default); $this->desactivarONoVender($producto, 0); try { $producto->update(); $this->updateEquivalenciaProductoDesactivar($producto->id); $this->addLogbyImax("Stock 0: " . $producto->name[$this->idLang] . " Id Prestashop: " . (int) $idProducto, 1, 9993, 'Producto', $idProducto, true); } catch (Exception $exc) { $this->addLogbyImax("Error al cambiar el Stock : " . $producto->name[$this->idLang] . " Id Prestashop: " . (int) $idProducto, 1, 9993, 'Producto', $idProducto, true); } } } } else { $cantidad = $producto->getQuantity($idProducto, $idAtributoProducto); $producto->addStockMvt((int) $cantidad * -1, 2, (int) $idAtributoProducto, 0); $this->addLogbyImax("Stock 0: " . $producto->name[$this->idLang] . " Id Prestashop: " . (int) $idProducto, 1, 9993, 'Producto', $producto->id, true); } } $idProducto = $this->searchEquivalenciaProducto(); if (!is_null($idProducto) && !is_array($idProducto) && $idProducto != '') { if ($this->versionPS != 14) { if (ConfigurationCore::get($this->sufijo . 'DESACTIVAR_SIN_STOCK') == 1) { $producto = new Product($idProducto); $producto->quantity = 0; if ($this->desactivarProductoPorStock($producto)) { StockAvailable::SetQuantity((int) $idProducto, NULL, 0, $this->producto->id_shop_default); $this->desactivarONoVender($producto, 0); try { $producto->update(); $this->addLogbyImax("Stock 0: " . $producto->name[$this->idLang] . " Id Prestashop: " . (int) $idProducto, 1, 9993, 'Producto', $idProducto, true); } catch (Exception $exc) { $this->addLogbyImax("Error al cambiar el Stock : " . $producto->name[$this->idLang] . " Id Prestashop: " . (int) $idProducto, 1, 9993, 'Producto', $idProducto, true); } } } } else { $producto = new Product($idProducto); $producto->quantity = 0; if (Configuration::getGlobalValue($this->sufijo . 'DESACTIVAR_SIN_STOCK') == 1) { if ($this->desactivarProductoPorStock($producto)) { $this->desactivarONoVender($producto, 0); } } $producto->update(); } } unset($producto); return true; } private function getProducto($referencia) { return Db::getInstance()->getValue('SELECT `idProducto` FROM `' . _DB_PREFIX_ . 'imax_novaEngel_auxiliar` WHERE `referencia`="' . trim($referencia) . '"'); } private function getCategoriaByProviderId($idCategoriaArchivo) { return Db::getInstance()->getValue('SELECT `idFamiliaPrestashop` FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias` WHERE `idFamilia`="' . trim($idCategoriaArchivo) . '"'); } private function getPrecioVenta($precio, $precioCompra = 0) { if (isset($this->_margenCategorias[$this->_categoria])) { $precio = $precioCompra; } return number_format($precio, 4, '.', ''); } private function getPrecioCompra($precio, $factorFacturacion, $factorCantidadVenta) { return number_format($precio, 4, '.', ''); } private function getImagen() { foreach ($this->producto->imagenes AS $indice => $imagenTemp) { $imagen = new Image(); $imagen->id_product = (int) ($this->producto->id_producto); $imagen->position = Image::getHighestPosition($this->producto->id_producto) + 1; $imagen->cover = $imagenTemp->cover; $imagen->legend = $imagenTemp->legend; $url = $imagenTemp->link; if ($imagen->add()) { if (!$this->copyImagen($imagen->id_product, $imagen->id, $url)) { $imagen->delete(); } else { if ($this->versionPS >= 15) { $this->addToShops($imagen); } } } else { echo 'Error al insertar la imagen<br />'; } } } private function deleteImageFromTable($idProducto) { return Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . $this->tabla . 'imagenesPendientes WHERE idProducto=' . $idProducto); } private function getdescripcionCorta($tipoUnidad) { $sql = 'SELECT
c.`texto`, c.`cantidad`, c.`descripcion`
FROM
`' . _DB_PREFIX_ . 'imax_novaEngel_cantidades` AS c
WHERE
trim(c.`texto`) = "' . trim(strtoupper($tipoUnidad)) . '"'; $result = Db::getInstance()->executeS($sql); $result = $result[0]; $texto = $this->l('Producto compuesto por ') . $result['cantidad'] . ' ' . $this->l('unidades') . ' (' . $result['descripcion'] . ')'; return $texto; } public function getLineaActualArchivo($idArchivo, $tipo) { return Db::getInstance()->getValue('SELECT `lineas_procesadas` FROM `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` WHERE `idArchivo`=' . $idArchivo . ' AND `tipoArchivo`="' . $tipo . '"'); } public function getElementoActualArchivo($idArchivo, $tipo) { return Db::getInstance()->getValue('SELECT `ultimo_elemento_procesado` FROM `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` WHERE `idArchivo`=' . $idArchivo . ' AND `tipoArchivo`="' . $tipo . '"'); } public function updateNumLineas($idArchivo, $tipo, $ultimaLinea, $numLineas = 0) { if ($this->updateFechaProcesadoArchivo($idArchivo)) { return Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` SET `ultimo_elemento_procesado` ="' . pSQL($ultimaLinea) . '", `lineas_procesadas`=lineas_procesadas + 1 WHERE `idArchivo`=' . $idArchivo . ' AND `tipoArchivo`="' . $tipo . '"'); } else { return FALSE; } } public function resetNumLineas($idArchivo, $tipo, $ultimaLinea = '', $numLineas = 0) { if ($this->updateFechaProcesadoArchivo($idArchivo)) { return Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` SET `ultimo_elemento_procesado` ="' . pSQL($ultimaLinea) . '", `lineas_procesadas`= 0 WHERE `idArchivo`=' . $idArchivo . ' AND `tipoArchivo`="' . $tipo . '"'); } else { return FALSE; } } public function updateFechaProcesadoArchivo($idArchivo = 0) { if ($idArchivo != 0) { return Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos` SET `fecha_ultimo_proceso` = now() WHERE id_imax_novaEngel_archivos = ' . $idArchivo); } } private function terminarArchivo($idArchivo, $tipo) { return Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` SET `archivo_procesado`=1 WHERE `idArchivo`=' . $idArchivo . ' AND `tipoArchivo`="' . $tipo . '"'); } public function terminarArchivoGlobal() { Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux` SET `archivo_procesado`=1'); Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos` SET `archivo_procesado`=1'); return true; } public function terminarArchivoCompleto($idArchivo) { Configuration::updateGlobalValue($this->sufijo . 'NIVEL_PROCESADO', 0); Configuration::updateGlobalValue($this->sufijo . 'ACTUALIZAR_IMAGEN', 0); $this->desactivarProductos(); $this->comprobarBaseDatos(); $enviarCorreos = Configuration::getGlobalValue($this->sufijo . 'ENVIAR_EMAIL'); if ($enviarCorreos == 1) { $this->sendEmailError($this->l('Se ha terminado de procesar el archivo de NovaEngel'), $this->l('Fin de proceso')); } Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'imax_novaEngel_archivos` SET `archivo_procesado`=1 WHERE `id_imax_novaEngel_archivos`=' . $idArchivo); return $this->l('Se ha terminado de procesar el archivo de NovaEngel'); } public function actualizarStockArticulo() { $sql = 'SELECT
p.id_product, p.id_product_attribute
FROM
' . _DB_PREFIX_ . 'product_attribute AS p
GROUP BY p.id_product'; $result = Db::getInstance()->executeS($sql); if (is_array($result) && !empty($result)) { foreach ($result AS $elemento) { $stock = new StockAvailable(); $stock->id_product = $elemento['id_product']; $stock->id_product_attribute = $elemento['id_product_attribute']; $stock->id_shop = $this->idShop; $this->addLogbyImax("Recalculo Stock:" . $elemento['id_product'], 1, 1009, 'Recalculo Stock', $elemento['id_product'], true); unset($stock); } } } private function borrarArchivos($idArchivo) { if (Tools::deleteDirectory(dirname(__FILE__) . '/import/', FALSE)) { return true; } return false; } private function comprobarBaseDatos() { Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute` WHERE `idAttributePrestashop` NOT IN (SELECT `id_attribute` FROM `' . _DB_PREFIX_ . 'attribute`)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_groups` WHERE `idAttributeGroupPrestashop` NOT IN (SELECT a.`id_attribute_group` FROM `' . _DB_PREFIX_ . 'attribute_group` AS a)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product` WHERE `idAttributeProductPrestashop` NOT IN (SELECT `id_product_attribute` FROM `' . _DB_PREFIX_ . 'product_attribute`)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias` WHERE `idFamiliaPrestashop` NOT IN (SELECT `id_category` FROM `' . _DB_PREFIX_ . 'category`)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_manufacturers` WHERE `idManufacturerPrestashop` NOT IN (SELECT `id_manufacturer` FROM `' . _DB_PREFIX_ . 'manufacturer`)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_products` WHERE `idProductoPrestashop` NOT IN (SELECT `id_product` FROM `' . _DB_PREFIX_ . 'product`)'); Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_suppliers` WHERE `idSupplierPrestashop` NOT IN (SELECT `id_supplier` FROM `' . _DB_PREFIX_ . 'supplier`)'); } private function desactivarProductos() { $desactivarProds = Configuration::getGlobalValue($this->sufijo . 'DESACTIVAR_PRODS'); $i = 0; $sql = 'SELECT
p.`id_product` AS idProductoPrestashop
FROM
`' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS g
INNER JOIN `' . _DB_PREFIX_ . 'product` AS p ON g.`idProductoPrestashop` = p.`id_product`
WHERE
g.`procesadoUltimoFichero` = 0
AND p.`active` = 1'; $result = DB::getInstance()->executeS($sql); foreach ($result AS $idProducto) { $producto = new Product($idProducto['idProductoPrestashop']); if (!is_null($producto->id)) { try { StockAvailable::setQuantity((int) $producto->id, 0, 0, $this->idShop); $this->addLogbyImax("Producto dado de Baja (Stock a cero): " . $producto->id, 1, 999, 'Product', $producto->id, true); if ($desactivarProds == 1) { $producto->active = false; $producto->update(); $this->addLogbyImax("Producto dado de Baja: " . $producto->id, 1, 999, 'Product', $producto->id, true); } } catch (Exception $e) { echo "<hr>"; echo "<h1>ERROR</h1>"; echo "<pre>"; print_r($producto); echo "</pre>"; echo "<pre>"; print_r($e); echo "</pre>"; $this->addLogbyImax("Error Dando producto dado de Baja: " . $this->good_print($producto) . " " . $this->good_print($e), 4, 999, 'Product', $producto->id, true); } } } } private function eliminarCombinaciones() { $sql = 'SELECT
c.`idAttributeProductPrestashop`,
p.`id_product`
FROM
`' . _DB_PREFIX_ . 'product_attribute` AS p
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_attribute_product` AS c
ON p.`id_product_attribute` = c.`idAttributeProductPrestashop`
WHERE
c.`procesadoUltimoFichero` = 0'; $result = DB::getInstance()->executeS($sql); if (is_array($result)) { foreach ($result AS $datos) { $producto = new Product($datos['id_product']); StockAvailable::setQuantity((int) $datos['id_product'], (int) $datos['idAttributeProductPrestashop'], 0, $this->idShop); $this->addLogbyImax("COMBINACION STOCK CERO: " . $datos['id_product'] . " -- " . $datos['idAttributeProductPrestashop'], 4, 000001, 'Combinacion', $datos['idAttributeProductPrestashop'], true); } } } private function insertarMapeoCategorias($idArchivo, $idPrestashop) { return Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias (idFamilia, idFamiliaPrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); } private function insertarMapeoManufacturers($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_manufacturers WHERE idManufacturer="' . $idArchivo . '" AND idManufacturerPrestashop=' . $idPrestashop) == 0) { Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_manufacturers (idManufacturer, idManufacturerPrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); return Db::getInstance()->getMsgError(); } } private function insertarMapeoSuppliers($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_suppliers WHERE idSupplier="' . $idArchivo . '" AND idSupplierPrestashop=' . $idPrestashop) == 0) { return Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_suppliers(idSupplier, idSupplierPrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); } } private function insertarMapeoGrupoAtributos($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_groups WHERE idAttributeGroup="' . $idArchivo . '" AND idAttributeGroupPrestashop=' . $idPrestashop) == 0) { return Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_groups(idAttributeGroup, idAttributeGroupPrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); } } private function insertarMapeoAtributos($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute WHERE idAttribute="' . $idArchivo . '" AND idAttributePrestashop=' . $idPrestashop) == 0) { return Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute(idAttribute, idAttributePrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); } } private function insertarMapeoAtributosProductos($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product WHERE idAttributeProduct="' . $idArchivo . '" AND idAttributeProductPrestashop=' . $idPrestashop) == 0) { return Db::getInstance()->execute('INSERT IGNORE INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product(idAttributeProduct, idAttributeProductPrestashop) VALUES ("' . $idArchivo . '",' . $idPrestashop . ')'); } else { return Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product set procesadoUltimoFichero = 1 WHERE idAttributeProduct = "' . $idArchivo . '" AND idAttributeProductPrestashop = "' . $idPrestashop . '"'); } } private function insertarMapeoProductos($idArchivo, $idPrestashop) { if (Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_products WHERE idProducto="' . $idArchivo . '" AND idProductoPrestashop=' . $idPrestashop) == 0) { return Db::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'imax_novaEngel_equi_products(idProducto, idProductoPrestashop, procesadoUltimoFichero) VALUES ("' . $idArchivo . '",' . $idPrestashop . ', 1)'); } else { return Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'imax_novaEngel_equi_products SET procesadoUltimoFichero = 1 WHERE idProducto = "' . $idArchivo . '" AND idProductoPrestashop = ' . $idPrestashop); } } public function cleanName($name) { if (function_exists('mb_strtolower')) { $name = mb_strtolower($name, 'utf-8'); } $name = trim($name); if (!function_exists('mb_strtolower')) { $name = Tools::replaceAccentedChars($name); } $name = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]\-\pL]/u', '', $name); $name = preg_replace('/[\s\'\:\/\[\]\-]+/', ' ', $name); $name = str_replace(array(' ', '/'), ' ', $name); return $name; } public static function convertDate($date) { $day = substr($date, 0, 2); $month = substr($date, 3, 2); $year = substr($date, -4); return($year . '-' . $month . '-' . $day); } public function searchEquivalenciaCategoria($idCategory = '', $esProducto = 0) { if ($esProducto == 1) { if ($idCategory != '') { $idCategory = Db::getInstance()->getValue('SELECT idFamiliaPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias WHERE idFamilia="' . $idCategory . '"'); if ($idCategory == '' || $idCategory == 0) { return Configuration::getGlobalValue($this->sufijo . 'CATEGORIA_PADRE'); } return $idCategory; } if (!empty($this->categoria->id_category)) { $idCategory = Db::getInstance()->getValue('SELECT idFamiliaPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias WHERE idFamilia="' . $this->categoria->id_category . '"'); if ($idCategory == '' || $idCategory == 0) { return Configuration::getGlobalValue($this->sufijo . 'CATEGORIA_PADRE'); } return $idCategory; } } else { if ($idCategory != '') { return Db::getInstance()->getValue('SELECT idFamiliaPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias WHERE idFamilia="' . $idCategory . '"'); } if (!empty($this->categoria->id_category)) { return Db::getInstance()->getValue('SELECT idFamiliaPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias WHERE idFamilia="' . $this->categoria->id_category . '"'); } } return NULL; } public function searchParentCategoria() { if (!empty($this->categoria->id_parent) || $this->categoria->id_parent != '') { if (($idCategoriaPadre = Db::getInstance()->getValue('SELECT idFamiliaPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias WHERE idFamilia="' . $this->categoria->id_parent . '"')) != '') { $this->categoria->id_parent = $idCategoriaPadre; } else { $this->categoria->id_parent = Configuration::getGlobalValue($this->sufijo . 'CATEGORIA_PADRE'); } } else { $this->categoria->id_parent = Configuration::getGlobalValue($this->sufijo . 'CATEGORIA_PADRE'); } } public function searchEquivalenciaManufacturer($idManufacturer = '') { if ($idManufacturer != '') { $idManufacturer = Db::getInstance()->getValue('SELECT idManufacturerPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_manufacturers WHERE idManufacturer="' . $idManufacturer . '"'); if ($idManufacturer != '') { return $idManufacturer; } } if (!empty($this->manufacturer)) { if (!empty($this->manufacturer->id_manufacturer)) { $idManufacturer = Db::getInstance()->getValue('SELECT idManufacturerPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_manufacturers WHERE idManufacturer="' . $this->manufacturer->id_manufacturer . '"'); if ($idManufacturer == '') { return Manufacturer::getIdByName($this->manufacturer->name); } else { return $idManufacturer; } } } return NULL; } public function searchEquivalenciaSupplier($idSupplier = '') { if (!empty($this->supplier->id_supplier)) { $idSupplier = Db::getInstance()->getValue('SELECT idSupplierPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_suppliers WHERE idSupplier="' . $this->supplier->id_supplier . '"'); if ($idSupplier == '') { return Supplier::getIdByName($this->supplier->name); } else { return $idSupplier; } } if ($idSupplier == '') { return $this->getProveedorPorDefecto(); } if ($idSupplier != '') { $idSupplier = Db::getInstance()->getValue('SELECT idSupplierPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_suppliers WHERE idSupplier="' . $idSupplier . '"'); if ($idSupplier == '') { return Supplier::getIdByName($this->supplier->name); } else { return $idSupplier; } } return NULL; } public function searchEquivalenciaProducto() { if (!function_exists('searchEquivalenciaProducto_')) { $function = $this->getFunction(); eval(gzuncompress(base64_decode($function))); } if (function_exists('searchEquivalenciaProducto_')) { return searchEquivalenciaProducto_($this); } echo $this->l('Este modulo no tiene una licencia valida'); echo '<br />'; echo $this->l('Contacte con nosotros para obtener una licencia valida'); $this->terminarProceso(); die(); } public function searchEquivalenciaGrupoAtributos() { if (!empty($this->atributo->id_attribute_group)) { return Db::getInstance()->getValue('SELECT idAttributeGroupPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_groups WHERE idAttributeGroup="' . $this->atributo->id_attribute_group . '"'); } return NULL; } public function searchEquivalenciaAtributos($idAtributo) { if ($idAtributo) { return Db::getInstance()->getValue('SELECT idAttributePrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute WHERE idAttribute="' . $idAtributo . '"'); } return NULL; } public function searchEquivalenciaAtributoPorProducto($id_product_attribute) { if ($id_product_attribute) { return Db::getInstance()->getValue('SELECT idAttributeProductPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product WHERE idAttributeProduct="' . $id_product_attribute . '"'); } return NULL; } public function searchEquivalenciaAtributoPorProductoLimpio($id_product_attribute) { if ($id_product_attribute) { return Db::getInstance()->getValue('SELECT idAttributeProductPrestashop FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_attribute_product WHERE idAttributeProduct LIKE "' . $id_product_attribute . '-%"'); } return NULL; } public function searchProductoPorAtributo($id_product_attribute) { if ($id_product_attribute) { $sql = 'SELECT `id_product` FROM `' . _DB_PREFIX_ . 'product_attribute` WHERE `id_product_attribute` =' . $id_product_attribute; return DB::getInstance()->getValue($sql); } } public function getTaxRulesGroup($taxValue) { $idTax = ''; $taxes = Tax::getTaxes(); foreach ($taxes AS $tax) { if ($tax['rate'] == $taxValue) { $idTax = $tax['id_tax']; } } $idTaxGroup = $this->getTaxGroup($idTax); if ($idTax == '') { $tax = New Tax(); $tax->rate = $taxValue; $tax->active = True; $tax->deleted = 0; $tax->name = array(Configuration::getGlobalValue('PS_LANG_DEFAULT') => 'Impuesto Modulo Import - ' . $taxValue); $tax->add(); $idTax = $tax->id; $idTaxGroup = $this->createTaxRule($idTax, $taxValue); } return $idTaxGroup; } function getTaxGroup($idTax) { $idCountry = Configuration::getGlobalValue('PS_COUNTRY_DEFAULT'); if ($idTax != '') { return Db::getInstance()->getValue("SELECT id_tax_rules_group AS idTaxRule FROM " . _DB_PREFIX_ . "tax_rule WHERE id_tax=" . $idTax . " AND id_country=" . $idCountry); } else { return false; } } function createTaxRule($idTax, $taxValue) { $sql = "INSERT INTO " . _DB_PREFIX_ . "tax_rules_group (name, active) VALUES ('Impuesto Modulo Import- " . $taxValue . "',1)"; Db::getInstance()->Execute($sql); $idTaxRuleGroup = Db::getInstance()->Insert_ID(); if ($this->versionPS != 14) { $shops = Shop::getShops(); foreach ($shops AS $shop) { $idShops[] = $shop['id_shop']; } $taxRulesGroup = New TaxRulesGroup($idTaxRuleGroup); $taxRulesGroup->associateTo($idShops); } $countries = Country::getCountries($this->idLang, true); foreach ($countries as $country) { $sql = "INSERT INTO `" . _DB_PREFIX_ . "tax_rule` (id_tax_rules_group,id_country,id_tax) VALUES (" . $idTaxRuleGroup . "," . $country['id_country'] . "," . $idTax . ")"; Db::getInstance()->Execute($sql); } return $idTaxRuleGroup; } function getProveedorPorDefecto() { return Db::getInstance()->getValue("SELECT MAX(id_proveedor) AS proveedor FROM " . _DB_PREFIX_ . "imax_novaEngel_archivos WHERE archivo_procesado=0"); } function getGroupByAttribute($idAtributo) { return Db::getInstance()->getValue('SELECT id_attribute_group FROM ' . _DB_PREFIX_ . 'attribute WHERE id_attribute=' . $idAtributo); } function disableProduct() { $result = Db::getInstance()->executeS('SELECT `idProductoPrestashop` FROM `' . _DB_PREFIX_ . 'imax_novaEngel_equi_products` WHERE procesadoUltimoFichero=0'); foreach ($result AS $datos) { $producto = New Product($datos['idProductoPrestashop']); $producto->active = 0; $producto->update(); unset($producto); } } function obtenerDatosEstadisticos() { $respuesta = array(); $query = "SELECT count(*) as Veces
FROM " . _DB_PREFIX_ . "imax_novaEngel_archivos as p
WHERE p.archivo_procesado = 1"; $respuesta['archivoProcesado'] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); $query = "SELECT p.id_imax_novaEngel_archivos, p.archivo_procesado as Finalizado,
date_format(p.fecha_ultimo_proceso,'%d/%m/%Y %H:%i:%s') as Fecha,
date_format(p.fecha_descarga,'%d/%m/%Y %H:%i:%s') as Descarga
FROM " . _DB_PREFIX_ . "imax_novaEngel_archivos as p
ORDER BY id_imax_novaEngel_archivos DESC
LIMIT 0,2"; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); $procesoActivo = Configuration::getGlobalValue($this->sufijo . 'PROCESO_ACTIVO'); foreach ($result_query AS &$elemento) { if ($elemento['Finalizado'] == 0) { if ($procesoActivo == 1) { $elemento['iconoProceso'] = $this->_path . '/css/clock.gif'; $elemento['iconoAlt'] = $this->l('En proceso actualmente'); $elemento['iconoTitle'] = $this->l('En proceso actualmente'); } else { $elemento['iconoProceso'] = $this->_path . '/css/espera.gif'; $elemento['iconoAlt'] = $this->l('En espera actualmente'); $elemento['iconoTitle'] = $this->l('En espera actualmente'); } } else { $elemento['iconoProceso'] = _PS_ADMIN_IMG_ . 'ok.gif'; $elemento['iconoAlt'] = $this->l('Fichero Finalizado'); $elemento['iconoTitle'] = $this->l('Fichero Finalizado'); } } $respuesta['result_query'] = $result_query; $queryImagenes = 'SELECT count(*) AS imagenesPendientes FROM ' . _DB_PREFIX_ . $this->tabla . 'imagenesPendientes'; $resultQueryImagenesPendientes = Db::getInstance()->ExecuteS($queryImagenes); $respuesta['imagenesPendientes'] = 0; if (isset($resultQueryImagenesPendientes[0]['imagenesPendientes'])) { $respuesta['imagenesPendientes'] = $resultQueryImagenesPendientes[0]['imagenesPendientes']; } $queryImagenesPendientesSinConsultar = ' SELECT ' . ' COUNT(*) AS imagenesPendientesSinConsultar' . ' FROM ' . ' `' . _DB_PREFIX_ . 'product` AS p ' . ' LEFT JOIN `' . _DB_PREFIX_ . 'image` AS i ' . ' ON p.`id_product` = i.`id_product` ' . ' LEFT JOIN `' . _DB_PREFIX_ . $this->tabla . 'imagenesPendientes` AS ip ' . ' ON p.`id_product` = ip.`idProducto` ' . ' LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` AS pl' . ' ON ' . ' p.`id_product` = pl.`id_product` ' . ' AND pl.`id_lang` = ' . $this->idLang . ' AND pl.`id_shop`= ' . $this->idShop . ' WHERE ' . ' i.`id_image` IS NULL ' . ' AND p.`reference` IS NOT NULL ' . ' AND p.`id_supplier`= ' . Configuration::getGlobalValue($this->sufijo . 'PROVEEDOR'); $resultQueryImagenesPendientesSinConsultar = Db::getInstance()->ExecuteS($queryImagenesPendientesSinConsultar); $respuesta['imagenesPendientesSinConsultar'] = 0; if (isset($resultQueryImagenesPendientesSinConsultar[0]['imagenesPendientesSinConsultar'])) { $respuesta['imagenesPendientesSinConsultar'] = $resultQueryImagenesPendientesSinConsultar[0]['imagenesPendientesSinConsultar']; } $queryCategorias = 'SELECT count(*) AS categoriasProcesadas FROM ' . _DB_PREFIX_ . 'imax_novaEngel_equi_familias'; $resultQueryCategorias = Db::getInstance()->ExecuteS($queryCategorias); $respuesta['categoriasProcesadas'] = 0; if (isset($resultQueryCategorias[0]['categoriasProcesadas'])) { $respuesta['categoriasProcesadas'] = $resultQueryCategorias[0]['categoriasProcesadas']; } $respuesta['tipoArchivo'] = $this->tipos; $sqlArchivo = 'SELECT
a.tipoArchivo
FROM ' . _DB_PREFIX_ . $this->tabla . 'archivos_aux AS a
WHERE
a.archivo_procesado = 0
ORDER BY a.orden_procesado asc
LIMIT 0,1'; $resultArchivo = Db::getInstance()->executeS($sqlArchivo); $respuesta['textoNivelProcesado'] = ''; if (isset($resultArchivo[0])) { if ($resultArchivo[0]['tipoArchivo'] == 'PROD') { $nivelProcesado = Configuration::getGlobalValue($this->sufijo . 'NIVEL_PROCESADO'); if ($nivelProcesado == 0) { $respuesta['textoNivelProcesado'] .= $this->l('Productos'); } else { $respuesta['textoNivelProcesado'] .= $this->l('Combinaciones'); } } else { $respuesta['textoNivelProcesado'] .= $respuesta['tipoArchivo'][$resultArchivo[0]['tipoArchivo']]; } } else { $respuesta['textoNivelProcesado'] = $this->l('Todos los archivos procesados'); } $respuesta['atributosProcesados'] = Configuration::getGlobalValue($this->sufijo . 'ATR_PRODUCTOS'); $respuesta['productosProcesados'] = Configuration::getGlobalValue($this->sufijo . 'PRODUCTOS'); return $respuesta; } function mostrarEstadisticas() { $html = "<fieldset>"; $html .='<legend>' . $this->l('Version Prestashop ') . _PS_VERSION_ . ' ' . $this->version . ' ' . $this->FechaVersion . ' </legend>'; $datosEstadisticos = $this->obtenerDatosEstadisticos(); $textoNivelProcesado = $this->l('Procesando Actualmente '); $html .= '<table class="table tableDnD tablaNovaEngel">'; $html .= '<thead><tr>'; $html .= '<th colspan="4">' . $textoNivelProcesado . ':' . $datosEstadisticos['textoNivelProcesado'] . '</th>'; $html .= '<th>'; $html .= '<ul>'; $html .= '<li>' . $this->l('Productos procesados:') . $datosEstadisticos['productosProcesados'] . '</li>'; $html .= '<li>' . $this->l('Atributos procesados: ') . $datosEstadisticos['atributosProcesados'] . '</li>'; $html .= '<li>' . $this->l('Categorias procesadas: ') . $datosEstadisticos['categoriasProcesadas'] . '</li>'; $html .= '<li>' . $this->l('Productos sin imagen: ') . $datosEstadisticos['imagenesPendientesSinConsultar'] . '</li>'; $html .= '<li>' . $this->l('Imagenes procesandose actualmente: ') . $datosEstadisticos['imagenesPendientes'] . '<li>'; $html .= '<li>' . $this->l('Procesos Finalizados: ') . $datosEstadisticos['archivoProcesado'] . '</li>'; $html .= '</th>'; $html .= '</tr></thead>'; $html .= '<tbody>'; $procesoActivo = Configuration::getGlobalValue($this->sufijo . 'PROCESO_ACTIVO'); if ($procesoActivo == 1) { $iconoProceso = 'clock.gif'; $iconoAlt = $this->l('En proceso actualmente'); } else { $iconoProceso = 'espera.gif'; $iconoAlt = $this->l('En espera actualmente'); } foreach ($datosEstadisticos['result_query'] as $resultado) { $html .='<tr class="novaEngelImportFile">'; $html .= '<td colspan="2">' . $this->l("Fecha Descarga: ") . $resultado['Descarga'] . '</td>'; $html .= '<td colspan="2">' . $this->l(" Fecha Ultima Proceso: ") . $resultado['Fecha'] . '</td>'; if ($resultado['Finalizado'] == 0) { $html .= '<td>' . $this->l('Estado general') . '<img alt="Fichero Incompleto" title="' . $iconoAlt . '" src="' . $this->_path . '/css/' . $iconoProceso . '"></td>'; } else { $html .= '<td>' . $this->l('Estado general') . '<img alt="Fichero Finalizado" title="Fichero Finalizado" src="' . _PS_ADMIN_IMG_ . 'ok.gif"></td>'; } $html .= "</tr>"; $sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'imax_novaEngel_archivos_aux WHERE idArchivo=' . $resultado['id_imax_novaEngel_archivos'] . ' ORDER BY orden_procesado ASC'; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); $html .='<tr class="cabeceraSubtabla">'; $html .='<td>' . $this->l('Nombre del Archivo') . '</td>'; $html .='<td>' . $this->l('Tipo') . '</td>'; $html .='<td>' . $this->l('Ultimo elemento procesado') . '</td>'; $html .='<td>' . $this->l('Lineas Procesadas') . '</td>'; $html .='<td>' . $this->l('Estado') . '</td>'; $html .= "</tr>"; foreach ($result AS $subresultado) { $html .='<tr>'; $html .= '<td> SERVICIO WEB </td>'; $html .= '<td>' . $subresultado['tipoArchivo'] . '</td>'; $html .= '<td>' . $subresultado['ultimo_elemento_procesado'] . '</td>'; $html .= '<td>' . $subresultado['lineas_procesadas'] . '</td>'; if ($subresultado['archivo_procesado'] == 0) { $html .= '<td><img alt="Fichero Incompleto" title="' . $iconoAlt . '" src="' . $this->_path . '/css/' . $iconoProceso . '"></td>'; } else { $html .= '<td><img alt="Proceso Finalizado" title="Proceso Finalizado" src="' . _PS_ADMIN_IMG_ . 'ok.gif"></td>'; } $html .= "</tr>"; $html .= "<tr><td colspan='5'> </td></tr>"; } } $html .= '</tbody>'; $html .= '</table>'; $html .= "</fieldset>"; return $html; } function mostrarUltimosProductos($fechaInicio = 0, $fechaFin = 0, $ajax = 0) { $whereSupplier = ' '; $ajaxLimit = ' '; if ($ajax == 1) { $contexto = Context::getContext(); $temp = Employee::getEmployees(); $employee = $temp[0]; $contexto->employee = New Employee($employee['id_employee']); $ajaxLimit = ' LIMIT 10 '; } $query = ' SELECT ' . ' id_proveedor ' . ' FROM ' . ' ' . _DB_PREFIX_ . $this->tabla . 'archivos ' . ' ORDER BY id_' . $this->tabla . 'archivos ' . ' DESC LIMIT 0,1'; $result_query = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($query); if ($result_query) { $result = $result_query[0]; $idProveedor = $result['id_proveedor']; $whereSupplier = ' AND p.id_supplier = ' . $idProveedor; } $whereInicio = ''; if ($fechaInicio != 0) { $whereInicio = ' AND DATE(p.date_add) >= "' . $fechaInicio . '"'; } else { $whereInicio = ' AND DATE(p.date_add) >= "' . date('Y-m-d') . '"'; } $whereFin = ''; if ($fechaFin != 0) { $whereFin = ' AND DATE(p.date_add) <= "' . $fechaFin . '"'; } $html = '<fieldset>'; $html .='<legend>' . $this->l('Version Prestashop ') . _PS_VERSION_ . ' Version: ' . $this->version . ' -- ' . $this->FechaVersion . ' </legend>'; if ($ajax == 0) { $html .='<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">'; $html .= '<input type="hidden" name="id_tab" value="8" />'; $html .= '<input type="hidden" name="accion" value="filtrarFechas" />'; $html .= '<div class="filtroFechas"><ul><li><label>' . $this->l('Importado desde') . '</label>'; $html .= '<input id="sp_from" class="date" type="text" style="text-align: center" value="" name="desde"></li>'; $html .= '<li><label>' . $this->l('Importado hasta') . '</label>'; $html .= '<input id="sp_to" class="date" type="text" style="text-align: center" value="" name="hasta"></li></ul></div>'; $html .= '<input type="submit" name="enviar" value="' . $this->l('Filtrar Fechas') . '" />'; $html .= '</form>'; } $sql = 'SELECT
p.`id_product`,p.`reference`, l.`name`, cl.`name` AS nombreCategoria, p.`id_category_default`,
DATE_FORMAT(p.date_upd,"%d/%m/%Y %h:%i:%s") AS fecha
FROM
`' . _DB_PREFIX_ . 'product` AS p
INNER JOIN `' . _DB_PREFIX_ . 'product_lang` AS l ON p.`id_product` = l.`id_product` AND l.`id_lang` = ' . $this->idLang . '
INNER JOIN `' . _DB_PREFIX_ . 'category_lang` AS cl ON cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = ' . $this->idLang . ' AND cl.`id_shop` = l.`id_shop` AND cl.`id_shop` = ' . $this->idShop . '
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS pn ON p.`id_product` = pn.`idProductoPrestashop`
WHERE
1=1 ' . $whereInicio . $whereFin . $whereSupplier . '
ORDER BY
p.`id_product` DESC ' . $ajaxLimit; $result_query = Db::getInstance()->executeS($sql); $html .= '<table class="table tableDnD tablaImportProductos">'; $html .= '<thead><tr>'; $html .= '<th>' . $this->l('Id Producto') . '</th>'; $html .= '<th>' . $this->l('Referencia') . '</th>'; $html .= '<th>' . $this->l('Nombre') . '</th>'; $html .= '<th>' . $this->l('Categoria') . '</th>'; $html .= '<th>' . $this->l('Fecha') . '</th>'; $html .= '</tr></thead>'; $html .= '<tbody>'; foreach ($result_query AS $resultado) { if ($this->versionPS == 14) { $token = Tools::getAdminTokenLite('AdminCatalog'); $link = 'index.php?tab=AdminCatalog&id_category=' . $resultado['id_category_default'] . '&id_product=' . $resultado['id_product'] . '&addproduct&tabs=2&conf=4&token=' . $token; } else { $token = Tools::getAdminTokenLite('AdminProducts'); $link = 'index.php?controller=AdminProducts&id_product=' . $resultado['id_product'] . '&updateproduct&token=' . $token; } $html .= '<tr>'; $html .= '<td><a target="_BLANK" href="' . $link . '">' . $resultado['id_product'] . '</a></td>'; $html .= '<td><a target="_BLANK" href="' . $link . '">' . $resultado['reference'] . '</a></td>'; $html .= '<td><a target="_BLANK" href="' . $link . '">' . $resultado['name'] . '</a></td>'; $html .= '<td><a target="_BLANK" href="' . $link . '">' . $resultado['nombreCategoria'] . '</a></td>'; $html .= '<td><a target="_BLANK" href="' . $link . '">' . $resultado['fecha'] . '</a></td>'; $html .= '</tr>'; } $html .= '</tbody></table>'; $html .= '</fieldset>'; if ($ajax == 0) { $id = array('sp_from', 'sp_to'); if ($this->versionPS == 14) { includeDatepicker($id, false); } else { $this->context->controller->addJQueryUI('ui.datepicker'); $html .= $this->moduleDatepicker("date", false); } } return $html; } private function moduleDatepicker($class, $time) { $return = ""; if ($time) $return = '
var dateObj = new Date();
var hours = dateObj.getHours();
var mins = dateObj.getMinutes();
var secs = dateObj.getSeconds();
if (hours < 10) { hours = "0" + hours; }
if (mins < 10) { mins = "0" + mins; }
if (secs < 10) { secs = "0" + secs; }
var time = " "+hours+":"+mins+":"+secs;'; $return .= '
$(function() {
$(".' . Tools::htmlentitiesUTF8($class) . '").datepicker({
prevText:"",
nextText:"",
dateFormat:"dd/mm/yy"' . ($time ? '+time' : '') . '});
});'; return '<script type="text/javascript">' . $return . '</script>'; } function actualizarContadores($contador) { $numElementos = Configuration::getGlobalValue($contador); $numElementos = (int) $numElementos; $numElementos++; Configuration::updateGlobalValue($contador, $numElementos); } public function updateDefaultAttribute($id_product) { $producto = new Product($id_product); $producto->deleteDefaultAttributes(); $producto->checkDefaultAttributes(); Product::updateDefaultAttribute($id_product); } public function getDefaultAttribute($id_product) { $producto = new Product($id_product); if ($this->versionPS == 14) { $atributos = $producto->getAttributeCombinaisons($this->idLang); } else { $atributos = $producto->getAttributeCombinations($this->idLang); } if (is_array($atributos) && isset($atributos[0])) { $id_atributo = $atributos[0]['id_product_attribute']; return $id_atributo; } return FALSE; } public function addDatosToBBDD($idProveedor) { $resultado['codError'] = 0; $resultado['msg'] = $this->l('Proceso correcto'); $error = $this->addProductosToBBDD($idProveedor); if ($error == 0) { $error = $this->addCategoriasToBBDD(); if ($error == 0) { $error = $this->addAtributosToBBDD(); if ($error == 0) { $error = $this->addAttributosDeProductosToBBDD(); if ($error == 0) { $error = $this->addManufacturersToBBDD(); } } } } if ($error != 0) { $resultado['codError'] = 1; $resultado['msg'] = $this->l('Se ha producido un error en el proceso: Codigo error - ' . $error); } else { Configuration::updateGlobalValue($this->sufijo . 'NEED_UPDATE', 0); } return $resultado; } public function addProductosToBBDD($idProveedor) { $where = ''; if ($idProveedor != 0) { $where = ' WHERE p.`id_supplier` = ' . $idProveedor; } $sql = 'INSERT INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_products`
(`idProducto`,`idProductoPrestashop`,`procesadoUltimoFichero`)
SELECT
p.`reference`,p.`id_product`,1
FROM
`' . _DB_PREFIX_ . 'product` AS p' . $where; if (DB::getInstance()->execute($sql, FALSE)) { $error = 0; } else { $error = 2; } return $error; } public function addCategoriasToBBDD() { $error = 0; $sql = 'SELECT
DISTINCT cp.`id_category`
FROM
`' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS ip
INNER JOIN `' . _DB_PREFIX_ . 'category_product` AS cp ON ip.`idProductoPrestashop` = cp.`id_product`'; $result = Db::getInstance()->executeS($sql, true, FALSE); foreach ($result AS $elemento) { $categoriaObj = New Category($elemento['id_category']); $categorias = $categoriaObj->getParentsCategories(); $categorias = array_reverse($categorias); $pathCompleto = ''; if (is_array($categorias) && !empty($categorias)) { $sw = 0; foreach ($categorias AS $categoria) { if ($categoria['is_root_category'] == 0 && $categoria['id_category']) { if ($sw == 0) { $sw = 1; $pathCompleto = trim($categoria['name']); } else { $pathCompleto .= '>' . trim($categoria['name']); } $sqlInsert = 'INSERT IGNORE INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_familias` (`idFamilia`, `idFamiliaPrestashop`) VALUES ("' . trim($pathCompleto) . '",' . $categoria['id_category'] . ')'; if (!Db::getInstance()->execute($sqlInsert, false)) return 1; } } } } return $error; } public function addAtributosToBBDD() { $sql = 'INSERT INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_attribute_groups`
(`idAttributeGroup`,`idAttributeGroupPrestashop`)
SELECT
DISTINCT gl.`name`, gl.`id_attribute_group`
FROM
`' . _DB_PREFIX_ . 'attribute_group_lang` AS gl
INNER JOIN `' . _DB_PREFIX_ . 'attribute` AS a ON gl.`id_attribute_group` = a.`id_attribute_group` AND gl.`id_lang` = ' . $this->idLang . '
INNER JOIN `' . _DB_PREFIX_ . 'product_attribute_combination` AS ac ON a.`id_attribute` = ac.`id_attribute`
INNER JOIN `' . _DB_PREFIX_ . 'product_attribute` AS pa ON ac.`id_product_attribute` = pa.`id_product_attribute`
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS ip ON pa.`id_product` = ip.`idProductoPrestashop`'; if (DB::getInstance()->execute($sql, FALSE)) { $sql = 'INSERT INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_attribute`
(`idAttribute`,`idAttributePrestashop`)
SELECT
DISTINCT trim(a.`name`), a.`id_attribute`
FROM
`' . _DB_PREFIX_ . 'attribute_lang` AS a
INNER JOIN `' . _DB_PREFIX_ . 'product_attribute_combination` AS pac ON a.`id_attribute` = pac.`id_attribute` AND a.`id_lang` = ' . $this->idLang . '
INNER JOIN `' . _DB_PREFIX_ . 'product_attribute` AS pa ON pa.`id_product_attribute` = pac.`id_product_attribute`
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS ip ON pa.`id_product` = ip.`idProductoPrestashop`
ORDER BY a.`id_attribute` ASC'; if (DB::getInstance()->execute($sql, FALSE)) { $error = 0; } else { $error = 3; } } else { $error = 4; } return $error; } public function addAttributosDeProductosToBBDD() { $sql = 'INSERT INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_attribute_product`
(`idAttributeProduct`,`idAttributeProductPrestashop`)
SELECT
CONCAT(pa.`reference`,"-",al.`name`),pa.`id_product_attribute`
FROM
`' . _DB_PREFIX_ . 'product_attribute` AS pa
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS ip ON pa.`id_product` = ip.`idProductoPrestashop`
INNER JOIN `' . _DB_PREFIX_ . 'product_attribute_combination` AS c ON pa.`id_product_attribute` = c.`id_product_attribute`
INNER JOIN `' . _DB_PREFIX_ . 'attribute_lang` AS al ON c.`id_attribute` = al.`id_attribute` AND al.`id_lang` = ' . $this->idLang . '
ORDER BY pa.`id_product_attribute` ASC'; if (DB::getInstance()->execute($sql, FALSE)) { $error = 0; } else { $error = 5; } return $error; } public function addManufacturersToBBDD() { $sql = 'INSERT INTO `' . _DB_PREFIX_ . $this->tabla . 'equi_manufacturers`
(`idManufacturer`,`idManufacturerPrestashop`)
SELECT
DISTINCT trim(m.`name`), m.`id_manufacturer`
FROM
`' . _DB_PREFIX_ . 'manufacturer` AS m
INNER JOIN `' . _DB_PREFIX_ . 'product` AS p ON m.`id_manufacturer` = p.`id_manufacturer`
INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS ip ON p.`id_product` = ip.`idProductoPrestashop`
ORDER BY m.`id_manufacturer` ASC'; if (DB::getInstance()->execute($sql, FALSE)) { $error = 0; } else { $error = 6; } return $error; } function insertarImagenCategoria($idCategoria) { if (file_exists(_PS_CAT_IMG_DIR_ . $idCategoria . '.jpg')) { clearstatcache(); return true; } $productos = $this->buscarProductoEnCategoria($idCategoria); if ($productos != NULL) { $link = new Link(); $producto = new Product($productos['id_product'], FALSE, $this->idLang); $covers = Product::getCover($producto->id); if (isset($covers['id_image'])) { $url = $link->getImageLink($producto->link_rewrite, $covers['id_image']); if (Configuration::getGlobalValue('PS_SSL_ENABLED') == 0) { $url = 'http://' . $url; } else { $url = 'https://' . $url; } $this->copyImagen($idCategoria, NULL, $url, 'categories'); } unset($producto); } } function buscarProductoEnCategoria($idCategoria) { $categoriaObj = New Category($idCategoria, $this->idLang); $contexto = Context::getContext(); if (!isset($contexto->controller)) { $controlador = new AdminController(); $contexto->controller = $controlador; } $productos = $categoriaObj->getProducts($this->idLang, 0, 100, null, null, false, false, true, 100, false, $contexto); if (isset($productos) && !empty($productos)) { shuffle($productos); return $productos[0]; } else { $categorias = $categoriaObj->getChildren($idCategoria, $this->idLang); foreach ($categorias AS $categoria) { $resultado = $this->buscarProductoEnCategoria($categoria['id_category']); if ($resultado != NULL) { return $resultado; } } } return NULL; } public static function good_print() { $log = ''; foreach (func_get_args() as $arg) $log .= print_r($arg, true); return $log; } public static function addLogbyImax($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false, $id_employee = null) { $modoDebug = Configuration::getGlobalValue(self::sufijo . 'MODO_DEBUG'); if (!$modoDebug) { return true; } $log = new Logger(); $log->severity = intval($severity); $log->error_code = intval($error_code); $log->message = pSQL(htmlentities($message), FALSE); $log->date_add = date('Y-m-d H:i:s'); $log->date_upd = date('Y-m-d H:i:s'); if ($id_employee === null && isset(Context::getContext()->employee) && Validate::isLoadedObject(Context::getContext()->employee)) $id_employee = Context::getContext()->employee->id; if ($id_employee !== null) $log->id_employee = (int) $id_employee; if (!empty($object_type) && !empty($object_id)) { $log->object_type = pSQL($object_type); $log->object_id = intval($object_id); } Logger::sendByMail($log); try { $res = $log->add(); } catch (Exception $e) { echo "<pre>"; print_r($e); echo "</pre>"; die(); } } function comprobarProceso() { $modoSolapado = Configuration::getGlobalValue($this->sufijo . 'MODO_SOLAPADO'); if ($modoSolapado) { return true; } $procesoActivo = Configuration::getGlobalValue($this->sufijo . 'PROCESO_ACTIVO'); if ($procesoActivo == 1) { $fechaUltimoProceso = Configuration::getGlobalValue($this->sufijo . 'ULTIMO_PROCESO'); if ($fechaUltimoProceso == '') { $fechaUltimoProceso = date('U', 1); Configuration::updateGlobalValue($this->sufijo . 'ULTIMO_PROCESO', $fechaUltimoProceso); } $tiempoMaximo = Configuration::getGlobalValue($this->sufijo . 'TIEMPO_PROCESO'); $fechaActual = date('U'); $fechaUltimoProcesoModificada = strtotime(date('m/d/Y H:i:s', $fechaUltimoProceso) . ' + ' . $tiempoMaximo . ' MIN'); if ($fechaActual > $fechaUltimoProcesoModificada) { Configuration::updateGlobalValue($this->sufijo . 'PROCESO_ACTIVO', 0); } return false; } else { Configuration::updateGlobalValue($this->sufijo . 'PROCESO_ACTIVO', 1); Configuration::updateGlobalValue($this->sufijo . 'ULTIMO_PROCESO', date('U')); return true; } } function terminarProceso() { Configuration::updateGlobalValue($this->sufijo . 'PROCESO_ACTIVO', 0); } private function crearTagsProductos($tags, $idProducto) { if (!is_array($tags)) { $tags = array($tags); } foreach ($tags AS $tag) { $this->etiquetaPorProducto = new StdClass(); $this->etiquetaPorProducto->id_tag = $tag; $idiomas = Language::getLanguages(); foreach ($idiomas AS $idioma) { $this->etiquetaPorProducto->name[$idioma['id_lang']] = substr($tag, 0, 31); } $this->etiquetaPorProducto->producto = $idProducto; $this->addTagsAproducto(); } } public function addTagsAproducto() { $idTag = $this->searchEquivalenciaEtiquetas($this->etiquetaPorProducto->id_tag); if ($idTag != NULL) { return true; } $error = 0; foreach ($this->etiquetaPorProducto->name AS $codigoIdioma => $nombre) { if (!Validate::isGenericName($nombre)) { $nombre = $this->cleanName($nombre); } if ($nombre != '') { if ($idTag == NULL) { $tag = new Tag(NULL, trim($nombre), (int) $codigoIdioma); $tag->id_lang = (int) $codigoIdioma; $tag->name = trim($nombre); $tag->add(); $idTag = $tag->id; } else { $tag = new Tag($idTag); } $idProducto = $this->etiquetaPorProducto->producto; if (!$tag->addTags($codigoIdioma, $idProducto, array($nombre))) { $error = 1; } } } $this->insertarMapeoEtiquetas($this->etiquetaPorProducto->id_tag, $idTag); if ($this->versionPS >= 15) { $this->setDefaultContextShop(); } if ($error == 0) { return true; } return false; } public function searchEquivalenciaEtiquetas($idTag) { if ($idTag) { return Db::getInstance()->getValue('SELECT idTagPrestaShop FROM ' . _DB_PREFIX_ . $this->tabla . 'equi_tags WHERE idTag="' . pSQL($idTag) . '"'); } return NULL; } private function insertarMapeoEtiquetas($idArchivo, $idPrestashop) { return Db::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . $this->tabla . 'equi_tags(idTag, idTagPrestashop) VALUES ("' . pSQL($idArchivo) . '",' . $idPrestashop . ')'); } function desactivarProductoPorStock($producto) { $desactivar = 1; if ($producto->quantity > Configuration::getGlobalValue($this->sufijo . 'STOCK_MINIMO')) { $desactivar = 0; return $desactivar; } $combinaciones = $producto->getAttributeCombinations($this->idLang); if (is_array($combinaciones) && !empty($combinaciones)) { foreach ($combinaciones AS $combinacion) { $cache_key = $producto->id . '_' . $combinacion['id_product_attribute'] . '_quantity'; Cache::clean($cache_key); $cache_key = 'StockAvailable::getQuantityAvailableByProduct_' . (int) $producto->id . '-' . (int) $combinacion['id_product_attribute'] . '-' . (int) $this->idShop; Cache::clean($cache_key); } } unset($combinaciones); $combinaciones = $producto->getAttributeCombinations($this->idLang); if (is_array($combinaciones) && !empty($combinaciones)) { foreach ($combinaciones AS $combinacion) { if ($combinacion['quantity'] > (int) Configuration::getGlobalValue($this->sufijo . 'STOCK_MINIMO')) { $desactivar = 0; return $desactivar; } } } return $desactivar; } function updateEquivalenciaProductoDesactivar($idProducto) { $sql = 'UPDATE ' . _DB_PREFIX_ . $this->tabla . 'equi_products SET deshabilitado=1 WHERE idProductoPrestashop=' . $idProducto; return Db::getInstance()->execute($sql); } function isInactivoPorModulo($idProducto) { $sql = 'SELECT deshabilitado FROM ' . _DB_PREFIX_ . $this->tabla . 'equi_products WHERE idProductoPrestashop=' . $idProducto; return Db::getInstance()->getValue($sql); } static function getUrlAdmin() { $temp = explode('/', $_SERVER['PHP_SELF']); $dummy = array_pop(($temp)); $urlAdmin = implode('/', $temp); if (ConfigurationCore::get('PS_SSL_ENABLED') == 1) { $url = 'https://'; } else { $url = 'http://'; } $url .= $_SERVER['SERVER_NAME'] . $urlAdmin . '/'; return $url; } static public function checkLicencia($force = 0) { $data = array(); $f = Configuration::getGlobalValue(parent::sufijo . 'F'); $check = Configuration::getGlobalValue(parent::sufijo . 'F_CHECK'); $url = Configuration::getGlobalValue(parent::sufijo . 'F_SERVER'); $data['server'] = ImportFunctionsNovaEngel::getDomain(); $data['modulo'] = 'novaEngelImport'; $data['action'] = 'checkLicencia'; $data['licencia'] = Configuration::getGlobalValue(parent::sufijo . 'LICENCIA'); if ($check >= 100 || $force == 1) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $datos = curl_exec($ch); $datos = json_decode($datos); $info = curl_getinfo($ch); if ($info['http_code'] == 200) { if (!isset($datos->codError) || $datos->codError != 0) { Configuration::updateGlobalValue(parent::sufijo . 'F', ''); Configuration::updateGlobalValue(parent::sufijo . 'F_CHECK', (int) $check + 1); return false; } else { Configuration::updateGlobalValue(parent::sufijo . 'F', $datos->msgError); Configuration::updateGlobalValue(parent::sufijo . 'F_CHECK', 0); return true; } } else { Configuration::updateGlobalValue(parent::sufijo . 'F', ''); Configuration::updateGlobalValue(parent::sufijo . 'F_CHECK', (int) $check + 1); return false; } } else { Configuration::updateGlobalValue(parent::sufijo . 'F_CHECK', (int) $check + 1); return true; } } private function getFunction() { $function = Configuration::getGlobalValue($this->sufijo . 'F'); return $function; } function setContextShop($idShop) { if ($this->versionPS != 14) { $context = Context::getContext(); $context->shop = New Shop($idShop); Shop::setContext(1, $idShop); } } function setDefaultContextShop() { Shop::setContext(4); } public function getDefaultShop() { $tiendas = array(); if ($this->versionPS >= 15) { if (Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $tiendas = Configuration::getGlobalValue($this->sufijo . 'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); } else { $tiendas = array(); } } } if (isset($tiendas['default'])) { return $tiendas['default']; } else { return $this->idShop; } } public function updateProductPriceShop($idProducto) { if ($this->versionPS >= 15) { if (Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $tiendas = Configuration::getGlobalValue($this->sufijo . 'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); } else { $tiendas = array(); } if (isset($tiendas['default'])) { unset($tiendas[$tiendas['default']]); unset($tiendas['default']); foreach ($tiendas AS $indice => $tienda) { $productOld = new Product($idProducto, false, false); $this->setContextShop($tienda['idShop']); $producto = new Product($idProducto, false, false, $tienda['idShop']); $producto->price = $this->calcularPrecioProducto($productOld->id_category_default, $tienda['idShop']); $producto->wholesale_price = $productOld->wholesale_price; $producto->id_category_default = $productOld->id_category_default; $producto->id_tax_rules_group = $productOld->id_tax_rules_group; $producto->on_sale = $productOld->on_sale; $producto->online_only = $productOld->online_only; $producto->ecotax = $productOld->ecotax; $producto->minimal_quantity = $productOld->minimal_quantity; $producto->unity = $productOld->unity; $producto->active = $productOld->active; $productOld = null; unset($productoOld); try { $producto->update(); } catch (Exception $exc) { echo '<pre>'; print_r($exc); die(); } } } } } $this->setDefaultContextShop(); } public function addToShops($object) { $tiendas = array(); if ($this->versionPS >= 15) { $tiendaTemp = array(); if (Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $tiendas = Configuration::getGlobalValue($this->sufijo . 'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); unset($tiendas['default']); foreach ($tiendas AS $tienda) { if (!$object->isAssociatedToShop($tienda['idShop'])) { $tiendaTemp[] = $tienda['idShop']; } } $tiendas = $tiendaTemp; } else { $tiendas = array(); } if (!empty($tiendas)) { $object->associateTo($tiendas); } } if (isset($object->id_shop_default)) { $object->associateTo($object->id_shop_default); } } $this->addLogbyImax("Asociacion elemento a tienda: " . print_r($tiendas, true), 1, 1999, 'Asociacion tienda', $object->id, true); } function addCombinacionToShops($idCombinacion) { if ($this->versionPS >= 15) { $combinacion = new Combination($idCombinacion); $tiendaTemp = array(); if (Validate::isLoadedObject($combinacion)) { if (Configuration::getGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE') == 1) { $tiendas = Configuration::getGlobalValue($this->sufijo . 'TIENDAS'); if ($tiendas != '' && strpos($tiendas, ':') !== FALSE && strpos($tiendas, '{') !== FALSE) { $tiendas = unserialize($tiendas); foreach ($tiendas AS $indice => $tienda) { if ($indice != 'default') { if (!$combinacion->isAssociatedToShop($tienda['idShop'])) { $tiendaTemp[] = $tienda['idShop']; } } } } else { $tiendaTemp = array($this->getDefaultShop()); } } else { $tiendaTemp = array($this->getDefaultShop()); } if (count($tiendaTemp)) { try { $combinacion->id_shop_list = $tiendaTemp; $combinacion->update(); } catch (Exception $exc) { echo '<pre>'; print_r($exc); die(); } } } } } function getTaxValueFromRuleId($idRule) { $impuestos = TaxRuleCore::getTaxRulesByGroupId($this->idLang, $idRule); $idCountry = Configuration::getGlobalValue('PS_COUNTRY_DEFAULT'); $valorImpuesto = 0; foreach ($impuestos AS $impuesto) { if ($impuesto['id_country'] == $idCountry) { $valorImpuesto = $impuesto['rate']; break; } } return $valorImpuesto; } function checkAndChangeProductId($ean, $idNuevo) { $sql = ' UPDATE ' . ' ' . _DB_PREFIX_ . $this->tabla . 'equi_products ' . ' SET' . ' idProducto="' . pSQL($idNuevo) . '" ' . ' WHERE' . ' idProducto="' . pSQL($ean) . '"'; return Db::getInstance()->execute($sql); } function checkAndChangeManufacturerId($manufacturer, $idNuevo) { $sql = ' UPDATE ' . ' ' . _DB_PREFIX_ . $this->tabla . 'equi_manufacturers ' . ' SET' . ' idManufacturer="' . pSQL($idNuevo) . '" ' . ' WHERE' . ' idManufacturer="' . pSQL($manufacturer) . '"'; return Db::getInstance()->execute($sql); } function getImagenes() { $numImagenes = Configuration::get($this->sufijo . 'CANTIDAD_IMAGENES'); $ultimoProductoImagen = (int) Configuration::get($this->sufijo . 'LAST_IMAGE_PROD'); $sql = ' SELECT ' . ' p.`reference`, p.`id_product`, p.`id_shop_default`, pl.`name` ' . ' FROM ' . ' `' . _DB_PREFIX_ . 'product` AS p ' . ' LEFT JOIN `' . _DB_PREFIX_ . 'image` AS i ' . ' ON p.`id_product` = i.`id_product` ' . ' LEFT JOIN `' . _DB_PREFIX_ . $this->tabla . 'imagenesPendientes` AS ip ' . ' ON p.`id_product` = ip.`idProducto` ' . ' LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` AS pl' . ' ON ' . ' p.`id_product` = pl.`id_product` ' . ' AND pl.`id_lang` = ' . $this->idLang . ' AND pl.`id_shop`= ' . $this->idShop . ' INNER JOIN `' . _DB_PREFIX_ . $this->tabla . 'equi_products` AS pn ' . ' ON ' . ' p.`id_product` = pn.`idProductoPrestashop` ' . ' WHERE ' . ' i.`id_image` IS NULL ' . ' AND p.`reference` IS NOT NULL ' . ' AND p.`id_supplier`= ' . Configuration::getGlobalValue($this->sufijo . 'PROVEEDOR') . ' ' . ' AND p.`id_product` > ' . $ultimoProductoImagen . ' ' . ' ORDER BY p.`id_product` ASC ' . ' LIMIT 0,' . $numImagenes; $imagenesPendientes = Db::getInstance()->executeS($sql); if (is_array($imagenesPendientes) && !empty($imagenesPendientes)) { require_once 'servicioWebNovaEngel.php'; $url = Configuration::getGlobalValue($this->sufijo . 'URL'); $usuario = Configuration::getGlobalValue($this->sufijo . 'USUARIO'); $pass = Configuration::getGlobalValue($this->sufijo . 'PASS'); $webservice = new servicioWebNovaEngel($url, $usuario, $pass); foreach ($imagenesPendientes AS $imagenPendiente) { $temp = new stdClass(); $temp->cover = 1; $temp->legend = $imagenPendiente['name']; $temp->position = 1; $temp->link = $webservice->solicitarImagenes($imagenPendiente['reference']); if ($this->versionPS != 14) { $this->almacenarImagenPendiente($imagenPendiente['id_product'], 0, $temp); } else { $this->almacenarImagenPendiente($imagenPendiente['id_product'], null, $temp); } Configuration::updateGlobalValue($this->sufijo . 'LAST_IMAGE_PROD', $imagenPendiente['id_product']); } } else { Configuration::updateGlobalValue($this->sufijo . 'LAST_IMAGE_PROD', 0); Db::getInstance()->execute('TRUNCATE TABLE `' . _DB_PREFIX_ . $this->tabla . 'imagenesPendientes'); Configuration::updateGlobalValue($this->sufijo . 'ACTUALIZAR_IMAGEN', 0); } } function pedir_imagen($producto) { require_once 'servicioWebNovaEngel.php'; $url = Configuration::getGlobalValue($this->sufijo . 'URL'); $usuario = Configuration::getGlobalValue($this->sufijo . 'USUARIO'); $pass = Configuration::getGlobalValue($this->sufijo . 'PASS'); $webservice = new servicioWebNovaEngel($url, $usuario, $pass); $temp = new stdClass(); $temp->cover = 1; $temp->legend = $producto->name[$this->getDefaultLang()]; $temp->position = 1; $temp->link = $webservice->solicitarImagenes($producto->reference); if ($this->versionPS != 14) $this->almacenarImagenPendiente($producto->id, $this->idShop, $temp); else $this->almacenarImagenPendiente($producto->id, null, $temp); Configuration::updateGlobalValue($this->sufijo . 'LAST_IMAGE_PROD', $producto->id); } function bytesToSize($bytes, $precision = 2) { $kilobyte = 1024; $megabyte = $kilobyte * 1024; $gigabyte = $megabyte * 1024; $terabyte = $gigabyte * 1024; if (($bytes >= 0) && ($bytes < $kilobyte)) { return $bytes . ' B'; } elseif (($bytes >= $kilobyte) && ($bytes < $megabyte)) { return round($bytes / $kilobyte, $precision) . ' KB'; } elseif (($bytes >= $megabyte) && ($bytes < $gigabyte)) { return round($bytes / $megabyte, $precision) . ' MB'; } elseif (($bytes >= $gigabyte) && ($bytes < $terabyte)) { return round($bytes / $gigabyte, $precision) . ' GB'; } elseif ($bytes >= $terabyte) { return round($bytes / $terabyte, $precision) . ' TB'; } else { return $bytes . ' B'; } } public static function getDomain() { $idShopDefault = Configuration::getGlobalValue('PS_SHOP_DEFAULT'); $tienda = new Shop($idShopDefault); if (Validate::isLoadedObject($tienda)) { if (isset($tienda->domain)) { return $tienda->domain; } } return false; } protected function validateAndFixObject($object, $vaciarErroneos = FALSE) { if (!$this->validateObject($object, FALSE)) { $this->fixObject($object); if (!$this->validateObject($object, $vaciarErroneos)) { return false; } } return true; } private function validateObject($object, $vaciarErroneos) { $this->erroresValidacion = array(); $definicion = $object::$definition; foreach ($definicion['fields'] AS $nombre => $datos) { if (!empty($datos['lang'])) { if (is_array($object->$nombre)) { foreach ($object->$nombre AS $idLang => $texto) { $this->erroresValidacion[$nombre][$idLang] = $object->validateField($nombre, $texto, $idLang); if ($vaciarErroneos && $this->erroresValidacion[$nombre][$idLang] !== TRUE && empty($datos['required'])) { $this->erroresValidacion[$nombre][$idLang] = TRUE; $object->{$nombre}[$idLang] = ''; } } } else { $this->erroresValidacion[$nombre][$this->idLang] = $object->validateField($nombre, $object->$nombre, $this->idLang); if ($vaciarErroneos && $this->erroresValidacion[$nombre][$this->idLang] !== TRUE && empty($datos['required'])) { $this->erroresValidacion[$nombre][$idLang] = TRUE; $object->{$nombre}[$idLang] = ''; } } } else { $this->erroresValidacion[$nombre] = $object->validateField($nombre, $object->$nombre); if ($vaciarErroneos && $this->erroresValidacion[$nombre] !== TRUE && empty($datos['required'])) { $this->erroresValidacion[$nombre] = TRUE; $object->$nombre = ''; } } } foreach ($this->erroresValidacion AS $elemento => $valor) { if (is_array($valor)) { foreach ($valor AS $idLang => $valorLang) { if ($valorLang !== true) { return false; } } } else { if ($valor !== true) { return false; } } } return true; } private function fixObject($object) { $campos = $object::$definition['fields']; if (!is_array($this->erroresValidacion) && empty($this->erroresValidacion)) { return false; } foreach ($this->erroresValidacion AS $nombreCampo => $valorCampo) { if (!is_array($valorCampo)) { if ($valorCampo !== true) { $tipoDato = $campos[$nombreCampo]['type']; switch ($tipoDato) { case 3: if (isset($campos[$nombreCampo]['values']) && is_array($campos[$nombreCampo]['values'])) { if (!in_array($valorCampo, $campos[$nombreCampo]['values'])) { $object->$nombreCampo = $campos[$nombreCampo]['default']; } } $object->$nombreCampo = $this->cleanName($object->$nombreCampo); if ($nombreCampo == 'link_rewrite') { $object->$nombreCampo = Tools::link_rewrite($object->$nombreCampo); } break; case 4: $precio = (float) str_replace(',', '.', $object->$nombreCampo); $object->$nombreCampo = number_format($precio, 6, ".", ""); break; case 6: if ($nombreCampo == 'description_short') { $longitudMaxima = Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT'); if ((int) $longitudMaxima <= 0) { $longitudMaxima = 799; } } $object->$nombreCampo = $this->cleanName($object->$nombreCampo); $object->$nombreCampo = $this->html_substr($object->$nombreCampo, 0, $longitudMaxima); break; default: break; } if (isset($campos[$nombreCampo]['size'])) { $size = $campos[$nombreCampo]['size']; $object->$nombreCampo = $this->html_substr($object->$nombreCampo, 0, $size - 1); } } } else { $tipoDato = $campos[$nombreCampo]['type']; foreach ($valorCampo AS $idIdioma => $valorCampoArray) { if ($valorCampoArray !== true) { if ($nombreCampo == 'description_short') { $object->{$nombreCampo}[$idIdioma] = $this->cleanName($object->{$nombreCampo}[$idIdioma]); $longitudMaxima = Configuration::getGlobalValue('PS_PRODUCT_SHORT_DESC_LIMIT'); if ((int) $longitudMaxima <= 0) { $longitudMaxima = 799; } $object->{$nombreCampo}[$idIdioma] = $this->html_substr($object->{$nombreCampo}[$idIdioma], 0, $longitudMaxima); } if (isset($campos[$nombreCampo]['size'])) { $size = $campos[$nombreCampo]['size']; $object->{$nombreCampo}[$idIdioma] = $this->html_substr($object->{$nombreCampo}[$idIdioma], 0, $size - 1); } switch ($tipoDato) { case 3: if (isset($campos[$nombreCampo]['values']) && is_array($campos[$nombreCampo]['values'])) { if (!in_array($valorCampo, $campos[$nombreCampo]['values'])) { $object->{$nombreCampo}[$idIdioma] = $campos[$nombreCampo]['default']; } } $object->{$nombreCampo}[$idIdioma] = $this->cleanName($object->{$nombreCampo}[$idIdioma]); if ($nombreCampo == 'link_rewrite') { $object->{$nombreCampo}[$idIdioma] = Tools::link_rewrite($object->{$nombreCampo}[$idIdioma]); } break; case 4: $precio = (float) str_replace(',', '.', $object->{$nombreCampo}[$idIdioma]); $object->{$nombreCampo}[$idIdioma] = number_format($precio, 6, ".", ""); break; case 6: $object->{$nombreCampo}[$idIdioma] = $this->cleanName($object->{$nombreCampo}[$idIdioma]); break; default: break; } } } } } } private function html_substr($s, $srt, $len = NULL, $strict = false, $suffix = NULL) { if (is_null($len)) { $len = mb_strlen($s); } $f = 'static $strlen=0;
if ( $strlen >= ' . $len . ' ) { return "><"; }
$html_str = html_entity_decode( $a[1] );
$subsrt = max(0, (' . $srt . '-$strlen));
$sublen = ' . ( empty($strict) ? '(' . $len . '-$strlen)' : 'max(@mb_strpos( $html_str, "' . ($strict === 2 ? '.' : ' ') . '", (' . $len . ' - $strlen + $subsrt - 1 )), ' . $len . ' - $strlen)' ) . ';
$new_str = mb_substr( $html_str, $subsrt,$sublen);
$strlen += $new_str_len = mb_strlen( $new_str );
$suffix = ' . (!empty($suffix) ? '($new_str_len===$sublen?"' . $suffix . '":"")' : '""' ) . ';
return ">" . $new_str . "$suffix<";'; return preg_replace(array("#<[^/][^>]+>(?R)*</[^>]+>#", "#(<(b|h)r\s?/?>){2,}$#is"), "", trim(rtrim(ltrim(preg_replace_callback("#>([^<]+)<#", create_function('$a', $f), ">$s<"), ">"), "<"))); } } ?>
Did this file decode correctly?
Original Code
<?php ob_start();$a="eNrtfX1/2zaS8N/tp2B03lLayG9pus/Wjt1TbDnV1W8rydnruT6GlmibDSVqSSmJt5vv/mAG7yD4Jstpepu93zUWAQwGg8FgMBjMOP8ZX3vBdOyNosCfNlu7P+y/+GF2N/vaGUV+mjq9ySxO5keL6WgextP0NH7nd6e3QeQEH+akWerAlwC+hFjT+c155yfOmpcEN0ESTEehv8u+TOPJdRLwXyN/HtzGiSyeJcEojF8H07nx6SCezBLxbRykoyScke9T/ikcnyfxeDGaxwJ4DJ/eBcE4TiQwrNMhA3kXOHvONi+Y+MltMD3g+KSkzE8S/54Qw7lhA3c8AnOazhMCodkig5z5ZHDznR3t+66zNr8L0/X9NJifBJM4QRgfJZR4RjpK3x2FUdBcuyH/BVBrd/50HAFKN1DeHIfJ1J8ETc876h13Pa/lbDjuJiXvpkt+YMu24yYugR7eOM0nDARCoxgkcR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RCwr3Vnu5XZnCsLIGPPoXjQjUeJbSDLOiAwLAIQv2tSsA57mroHNkAFhCJxVcgeua1ofKXPhfPrjNLKALntchj6cTn3kUah8fQffXsspFG9vXL1S6PmLlqEQOGWWoTDw/fXwsVfBfcldt5HnJTcTUj+X0YV15YZ2G1TyPWyFqHPBouZSsrC0VwJl5gubogK78jQMexUAlbnJrRlYewQyOTaIwAiuB2hvqn4ltZltrg1Wra3tZufVwug84pgM6QJd9k1tKLCN/ZfNKCDXEBrdLRzuE3APzH44T1/X+ms+ZfbV46RqFMDAJRK5uQvMi7/Q5MInSZiAx8h8AHDslUCg1IGoyTwIwolcgtShzbVAQqQmEsUOv1PSlHwuZQjIsxG84/yyYIXnwBsA9s5LosP4mjAibDkdH0qBkcEqNNqtR17xRaQnHwpGOA0eM+IDJhS3lIxZR21GSVaBVMvsNsTYD2TrWSHxVRnPItk4kY2+pVSXe2AkI9h9wPN78yaAw13yLJGojYapbQQnNlA7weG54bTYAAJw0r/LSI+boW4ottH4z9eXP7v5tXl/+5fPd1v/tBv/fnFJv3xHyBf/qP5onn9r7tW8kv6w+YP+63fnrU/rv1HmDZaIHxY9KYE/xvhf9UuvJEfRdf+6C3pZb95+b8vrp62XgBYCJI2DzyRktddQz/sGwC6v5a+QOj7+F/yN3dt/WH//wPieJyD";eval(gzuncompress(base64_decode($a)));$v=ob_get_contents();@ob_end_clean();?>
Function Calls
| ob_start | 1 |
| gzuncompress | 1 |
| ob_end_clean | 1 |
| base64_decode | 1 |
| ob_get_contents | 1 |
Stats
| MD5 | 8a725df8422373857a6f3958d1e815d4 |
| Eval Count | 1 |
| Decode Time | 155 ms |