Jump to content

manudas

Members
  • Posts

    26
  • Joined

  • Last visited

Profile Information

  • Activity
    Agency

manudas's Achievements

  1. Ok, finalmente logré descubrir por qué y cómo se estaba traduciendo la URL. Era un módulo llamado sturl. En caso de que alguno de ustedes quiera hacer algo similar en el futuro, creo que esta es la forma de hacerlo. Dejaré este post abierto, así que si alguien busca el mismo problema en el futuro, tendrá alguna orientación. Gracias a todos por tomarse el tiempo de leer mi largo post, no importa que no hayan podido ayudar
  2. Ok so I finally managed to find why and how the url was being translated. It was a module called sturl. In case any of you ever want to do something like this, I think this is the way to go. I will leave this post open so if anybody googles the same issue in the future, they have some guidance. Thank you everybody for taking your time to read my long post, doesn't matter that you could not be of help
  3. Hola equipo, hola colegas desarrolladores y prestashopers, En primer lugar, mi versión de PrestaShop es 1.7.6. Estoy trabajando en una página existente que tiene diferentes segmentos para las URL de CMS. Permítanme explicarlo con un ejemplo: Esta es la URL en catalán: https://www.florestore.com/ca/contingut/lliurament Y esta es en español: https://www.florestore.com/es/contenido/envio Ambas tienen el ID_CMS = 1. Entonces, la pregunta es la siguiente: ¿Ven cómo cambian los segmentos de idioma y CMS en la URL? - Segmento de idioma: es o ca - Segmento de CMS: contingut o contenido El problema es que no puedo encontrar el lugar para cambiar esta traducción, ya sea contingut o contenido, en la interfaz de usuario del backend de la tienda. Si voy a Configurar -> Parámetros de la tienda -> Tráfico y SEO, llego a una sección en la que tengo lo siguiente: Ruta a la página: esto está dentro de un input -> "content/{rewrite}" Sin embargo, esto no ofrece ninguna posibilidad de traducción, y no puedo encontrar contingut o contenido aquí en absoluto. No hay un menú desplegable para el idioma en este campo. ¿Cómo es posible que ambas páginas funcionen y carguen ID_CMS = 1 si ninguno de los segmentos de URL encaja en la configuración de Tráfico y SEO? ¿Dónde puedo encontrar la traducción para este segmento de URL? Claramente debería estar en algún lugar... Voy a publicar lo mismo en el foro en inglés en la parte de traducciones, para llegar a un grupo más amplio de personas. Por favor, avísenme si no está permitido.
  4. Hi team, hi fellow developers && prestashopers! First of all, my prestashop version is 1.7.6 So the thing is that I am working in an existing page and they have different segments for cms urls. Let me explain with an example: This is the url in catalan: https://www.florestore.com/ca/contingut/lliurament And this one is in spanish: https://www.florestore.com/es/contenido/envio Both are CMS id_cms = 1 So then the question is the following: Do you see how the language and cms segments in the url are changing? - language segment: es or ca - cms segment: contingut or contenido The thing is that I cannot find the place to change this translation, either contingut or contenido in the store backend UI. if I go to Configure -> Store parameters -> Traffic and Seo I can get to a section in which I have the following: Page routing: this is inside an input -> "content/{rewrite}" However this is not offering any translation possibilities, neither I can find contingut or contenido here at all. No dropdown for language on this input. How can it be possible the both pages are working and loading id_cms = 1 if none of the url segments fits on the configuration in Traffic and Seo? Where can I find the translation for this url segment? Clearly it should be somewhere... I will be posting the same in the spanish forum to reach a wider group of people, please do let me know if it's not allowed
  5. Hola Ventura. Lo primero gracias por responder. Las tablas las crea correctamente. El problema surge, y no entiendo bien porque, cuando intenta insertar campos que no existen. Me explico. Hace un insert a la tabla general (que es codeextracts) e intenta meter en ella campos que corresponden a la tabla con sufijo shop, es decir (codeextracts_shop). Con lo cual al no tener esos campos en la tabla principal el sistema falla y lanza excepciones. Un saludo.
  6. Buenos días a todo el mundo. Publico en este foro lo mismo que en el foro de inglés, con vista a ver si alguien sabe ayudarme por aquí y para ayudar a alguien que pudiera tener el mismo problema Tengo muchas dudas acerca de como desarrollar un módulo con las características de multi tienda y multi lengua. Cuando usamos el método ObjectModel::add() tenemos lo siguiente (en la línea 489 de la clase ObjectModel de prestashop 1.7.1): if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) { return false; } Si miramos la función getFields vemos lo siguiente (en la línea 251): // For retro compatibility if (Shop::isTableAssociated($this->def['table'])) { $fields = array_merge($fields, $this->getFieldsShop()); } Aquí el script está mezclando dos arrays: el de campos específicos de la tienda y el de que no dependen de ella, devolviendo todos los campos en el mismo array. Así que luego, en el método insert que he copiado más arriba, está intentando insertar un grupo de atributos que no pertenencen a la tabla principal (la que no tiene el sufijo _shop). A continuación os pego la definición de mi "ObjectModel": public static $definition = array( 'table' => 'codeextracts', 'primary' => 'id', // 'multishop' => true, // 'multilang' => true, 'multilang' => true, 'multilang_shop' => true, 'fields' => array( 'id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => false), 'subreference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true), 'blockreference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true), 'text' => array('type' => self::TYPE_HTML, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true) ), ); Y este es el método con el que creo las tablas: public static function createContentTable() { $sq1 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'`( `id` int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (`id`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $sq2 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'_shop`( `id` int(10) unsigned NOT NULL auto_increment, `id_shop` int(10) unsigned NOT NULL, PRIMARY KEY (`id`, `id_shop`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $sq3 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'_lang`( `id` int(10) unsigned NOT NULL auto_increment, `id_lang` int(10) NOT NULL, `subreference` varchar(32) NOT NULL, `blockreference` varchar(32) NOT NULL, `text` text NOT NULL, PRIMARY KEY (`id`, `id_lang`), UNIQUE (`blockreference`, `subreference`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $result = Db::getInstance()->execute($sq1) && Db::getInstance()->execute($sq2) && Db::getInstance()->execute($sq3); return $result; } Alguien podría ayudarme y decirme que está mal?
  7. Good morning everyone there I have lots of doubs about how to develop a module with multishop and multilanguage characteristics. When using the ObjectModel::add() method we have the next (line 489 in ObjectModel PS 1.7.1): if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) { return false; } If we revise the getFields function we see the following (line 251): // For retro compatibility if (Shop::isTableAssociated($this->def['table'])) { $fields = array_merge($fields, $this->getFieldsShop()); } Here the script is merging the shop specific fields with the non-shop dependants fields, returning all in the same array, So later in the insert method showed before, It is trying to insert a group of attributes that are not master table (the one without _shop sufix). Please find attached the ObjectModel definition: public static $definition = array( 'table' => 'codeextracts', 'primary' => 'id', // 'multishop' => true, // 'multilang' => true, 'multilang' => true, 'multilang_shop' => true, 'fields' => array( 'id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => false), 'subreference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true), 'blockreference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true), 'text' => array('type' => self::TYPE_HTML, 'validate' => 'isString', 'required' => true, 'lang' => TRUE, 'shop' => true) ), ); And the table creation method: public static function createContentTable() { $sq1 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'`( `id` int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (`id`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $sq2 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'_shop`( `id` int(10) unsigned NOT NULL auto_increment, `id_shop` int(10) unsigned NOT NULL, PRIMARY KEY (`id`, `id_shop`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $sq3 = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.self::$definition['table'].'_lang`( `id` int(10) unsigned NOT NULL auto_increment, `id_lang` int(10) NOT NULL, `subreference` varchar(32) NOT NULL, `blockreference` varchar(32) NOT NULL, `text` text NOT NULL, PRIMARY KEY (`id`, `id_lang`), UNIQUE (`blockreference`, `subreference`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; $result = Db::getInstance()->execute($sq1) && Db::getInstance()->execute($sq2) && Db::getInstance()->execute($sq3); return $result; } Can somebody help and tell me what I'm doing wrong?
  8. Hi all. I´m trying to modify the default slider module to display content where the search bar is displayed in the default bootstrap theme, in ps 1.6 The problem is I´m not being able to get the slider module to display in this hook. I can register the module in the install method of slider module with $this->registerHook('displaySearch') then the module appears in the hook with the quick search module. But it's not being shown in this hook. I also added this method: public function hookdisplaySearch($params){ return hookdisplayTopColumn($params); } This should be enought to work, shouldn't this? The slider module is the default slider module of ps 1.6 modified to accept the displaySearch hook. Can anybody help me please?
  9. Solved. Using _PS_MODULE_DIR_ I was importing a file. AddJS needs to be input with a URL / URI. Changing _PS_MODULE_DIR_ for _MODULE_DIR_ made this work, because module_dir is a URL.
  10. I´m getting crazy... If I put a die("messege") before $this->addJS() call function in AdminProductController::postProcess(), I can read the message in the screen when installing the override and entering in the add product or edit product tab. So the code is executed till there. But I cant see the JS code to be added! This is how the override class include the js: $this->addJS(array( _PS_JS_DIR_.'productTabsManager.js', _PS_JS_DIR_.'admin-products.js', _PS_JS_DIR_.'attributesBack.js', _PS_JS_DIR_.'price.js', ...) I just change _PS_JS_DIR_.'price.js' for _PS_MODULE_DIR.'pricerules/js/price.js') without success. The program flow executes till at least the prior line where I did the die call, so... whats wrong ? I noticed that comenting the $this->addJS full call doesn´t change anything, so more mistery then... Where is added the /js/price.js ? Another, maybe, important detail may be the way this js is passed to the navigator: <script type="text/javascript" src="/telerosa/admin6919/../js/price.js"></script> It jumps from my admin folder to the previous one with .., and in the AdminProductController this is not being done because there it´s passed _PS_JS_DIR_.'price.js' to addJS call. As far as I know _PS_JS_DIR_ doesn't concatenate inside itself the admin dir. Any help will be appreciated
  11. Hi! I´m trying to override AdminProductController.php and this is working fine, with almost all my overrided functions, but I ´m trying to import another distinct prices.js located in my module folder (original is located in /rootfolder/js/ folder). The strange thing here is that js is not set in setMedia function but in postProcess (look at adminProductController of ps 1.5.6) and changing _PS_JS_DIR_.'price.js', to _PS_MODULE_DIR_.'pricerules/js/price.js', is not working If I look with the chrome inspector, I see the imported file is the original one and not my module js. Any ideas about what I´m doing wrong ?
  12. Hi! I have a method to create the new tables in my custom module, and to populate them. My problem is that populating the tables, I have to insert data with accents, ñ(s), ç(s) and other spanish or catalonian chars. Basically the name of all Spanish towns. But the php script function fails when it finds this kind of char in the sql script. What should I do to solve this ? Thanks in advance! I´m developing for the last 1.5 version, 1.5.6 I think
  13. Solved: adding this ittem to my field_list array: (is important that the associative index of array ('color') to be of the same case (lowercase)) 'color' => array( 'title' => $this->l('Color'), 'width' => 40, 'filter_key' => 'DATABASE_TABLE_COLOR_ATRIBUTTE'),
×
×
  • Create New...