Jump to content

vblanch

Members
  • Posts

    61
  • Joined

  • Last visited

1 Follower

Contact Methods

Profile Information

  • Activity
    Freelancer

Recent Profile Visitors

8,606,348 profile views

vblanch's Achievements

Newbie

Newbie (1/14)

88

Reputation

1

Community Answers

  1. Hi there bellini13, thanks for your answer. Yes you addressed the issue. However it's not the ideal solution, since I have customers using the validator over my software and complaning about the "errors" (yes it reports the unescaped strings as errors, not as warnings). It's hard to explain the reason to people who aren't programmers. Anyway I will do the comment thing and explain. I guess I have no other option. Cheers
  2. I have a similar problem. I want to show HTML code (an image with a link) in my module but the validator keeps telling me to escape HTML. If I do, the button is not displayed (displays the HTML code instead!). The point is, some of my customers complained that PrestaShop Cloud is NOT acepting non-validated modules, even if sold in other markets outside PrestaShop. Any ideas on how to solve this? Thanks! *Edit: Just tried "unescape" command in Smarty but the validator got me This is getting ridiculous... so we can't render HTML in our modules?
  3. I know this answer comes very, very late but the previous response is not correct. If you have MySQL warnings and errors enabled, this will disrupt the page from rendering in case the column doesn't exist, and in fact won't update the table. I found a solution for this: In your installation function you could do something like this: public function install(){ ... if(!$this->maybeUpdateDatabase()) return false; } Then the function to update your database is: //function used to upgrade the module table private function maybeUpdateDatabase(){ $sql = 'DESCRIBE '._DB_PREFIX_.$this->table_name; $columns = Db::getInstance()->executeS($sql); $found = false; foreach($columns as $col){ if($col['Field']=='your_column'){ $found = true; break; } } if(!$found){ if (!Db::getInstance()->execute(' ALTER TABLE `'._DB_PREFIX_.$this->table_name.'` ADD `your_column` text DEFAULT NULL')); return false; } return true; } The trick here is the MySQL command "Describe" which generates an array of arrays with the columns of the table. Then the key "Field" in every individual array indicates the name of the column. If not found, update the table and add the new column. Hope this helps somebody, and sorry moderators to resurrect this Cheers
  4. Buenas, una opción es buscar la función que crea las categorías, montarte un archivo php y ejecutarlo. Mira en la classe CategoryCore, situada en el archivo "classes/CategoryCore.php". Ahí he encontrado las funciones: public function __construct($id_category = null, $id_lang = null, $id_shop = null) public function add($autodate = true, $null_values = false) public static function addToShop(array $categories, $id_shop) Crea una nueva categoría: $category_old = new Cateogory($id_de_tu_categoria_a_copiar); $category = new Category(null, $category_old->id_lang, $category_old->id_shop); Luego con lo que veas dentro de la clase, tendrás que asignarle un nombre (puedes copiarlo de otra categoría, etc) y finalmente hacer el add() y el addToShop(). Con eso tendría que bastar. O eso o te montas un script que haga los inserts directamente en las tablas category, category_shop y category_group (si te hace falta). ¡De todas formas mírate el archivo PHP que te he indicado antes, allí están casi todas las respuestas! Saludos
  5. Buenas a todos! Quisiera saber si os pasa a todos o solo a mí, pero desde que han cambiado el foro parece ser que el subforo de módulos de pago está bloqueado...? Quería poner un post ahí ya que he actualizado un módulo, pero no me deja. Gracias
  6. I can copypaste the code that I have, hope it helps: if (_PS_VERSION_ < '1.5'){ global $currentIndex; $className = 'AdminModules'; $token = Tools::getAdminToken($className.intval(Tab::getIdFromClassName($className)).intval($this->context->cookie->id_employee)); $adminlink = $currentIndex.'&token='.$token;//.'index.php?tab=AdminModules'; $token_products = Tools::getAdminToken('AdminCatalog'.intval(Tab::getIdFromClassName('AdminCatalog')).intval($this->context->cookie->id_employee)); }else{ $adminlink = $this->context->link->getAdminLink('AdminModules'); $token_products = Tools::getAdminToken('AdminProducts'.intval(Tab::getIdFromClassName('AdminProducts')).intval($this->context->cookie->id_employee)); } This should get the correct token for the product catalog. Then in the TPL I have: {if version_compare($smarty.const._PS_VERSION_,'1.5','>=')} <td><a class="button" href="index.php?controller=AdminProducts&id_product={$product['id_product']}&updateproduct&token={$token_products}" target="_blank"">{l s='Edit' mod='yourmodule'}</td> {else} <td><a class="button" href="index.php?tab=AdminCatalog&id_product={$product['id_product']}&updateproduct&token={$token_products}" target="_blank"">{l s='Edit' mod='yourmodule'}</td> {/if} Hope it helps!
  7. Put the link of the shop or send it to me and I will take a look at the code.
  8. I think it's possible adding some sort of product variations, but I never tried something like that sorry. You better install a PrestaShop and try!
  9. If you know where's that shop I could take a look, or you could simply email the owner and ask Cheers
  10. Hi there, first of all... do you really need to install 1.4? It's a very outdated version, better use 1.6 if you can! Second, the token doesn't work the same way in PS1.4, I have the code somewhere and I can post it here but as I said before, you better move to 1.6, because you will lack support for that version in the future. Cheers.
  11. Hello streetwear, did you try the free module for blogging? If it doesn't work, you can find other blog modules (paid), just google "Prestashop blog module" and you should find some! Cheers
  12. Hi there Owen Ho, I've found a similar question in here, hope it helps: http://www.prestashop.com/forums/topic/164821-random-product-display-on-featured-page/ Cheers!
  13. In case any of you find it useful: If you are using PS1.5.x I made a new module to accept payments in Bitcoins and other altcoins. Check it out in the "free modules" section. It's called Cryptocurrency. It's not available for PS 1.6 though (yet). Cheers.
  14. Por lo que cuesta, tendrían que darte un buen soporte. Ponte en contacto con ellos.
×
×
  • Create New...