Jump to content

cactus20

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • First Name
    p
  • Last Name
    p

Recent Profile Visitors

54 profile views

cactus20's Achievements

Newbie

Newbie (1/14)

0

Reputation

1

Community Answers

  1. Hola Soy nuevo en PrestaShop llevo varios días buscando la solución a mi problema y estoy por pensar que no estoy haciendo lo correcto. En primer lugar he creado un modulo que se carga en la página del home. Hasta aquí todo bien. En la vista de ese modulo creo unas lista que tienen enlaces y van a ir a una pagina propia, es decir custompage.tpl (no existe en prestashop) Para hacer esto he sobreescrito el controladorProduct para añadiste un nuevo método y desde ese método llamar a custompage.tpl Eso es correcto?? se debe hacer así. y por otro lado en la vista de mi modulo, el que se muestra en el home, no consigo llamar al controlador product con el método nuevo y los parámetros que deben llegar a ese controlado? Como se haría eso Un saludo y gracias de antemanos
  2. I fix the problem... when we develop a module in prestashop first we create and install, after that we'll include the functionality. If our module use class and controller we have to override it, so we put inside the override file into the our module new class and controller and when we call them don't work. The solution is put the same file in the main override folder too. When prestashop install the module do the same. The problem is that we create this file before install.
  3. Hi guys, I override the Product.php class in Prestashop 1.6 My file looks like this in mymodule/override/classes/Product.php class Product extends ProductCore{ public function getProductByTag($id_tags) { $list_product = []; $product_list = (Db::getInstance()->execute(' SELECT pt.`id_product` FROM `'._DB_PREFIX_.'product_tag` pt WHERE cp.`id_tag` = '.(int)$id_tags.'') ); foreach ($product_list as $product) { $item_product = (Db::getInstance()->execute(' SELECT pl.`name` FROM `'._DB_PREFIX_.'product_lang` pl WHERE cp.`id_product` = '.(int)$product.'') ); array_push($list_product, $item_product); } return $list_product; } public static function getAllTags(){ $sql = 'SELECT `name` FROM `'._DB_PREFIX_.'tag`'; $productTags = Db::getInstance()->ExecuteS($sql); return $nameTag; } public static function test(){ return "testing"; } } Now I what to use this function in my own module, I try this $productTags = Product::test(); But I received this error, Call to undefined method Product::test() any idea what I am missing Thanks in advances!
  4. Thanks Ndiaga I see, but where you call a function that it is in the Product controller public function getByTag($tag_name){ .... }
  5. Sorry ndiaga, I don't understand very well you solution... I explain better.. I have a module create by myself, this module call to homeparadise.tpl view with some parameters like this $this->context->smarty->assign(array( 'products' => $products, 'categories' => $allCategories, 'tag_element' => $country_tag )); return $this->display(__FILE__, 'homeparadise.tpl'); So now I homeparadise.tpl I show the info like that {foreach from=$v item=value} {* {$product|print_r}; *} <a href="{$link->getProductLink({$product.id_product})}"> 'my_link' => $this->context->link->getModuleLink('module_name', 'controller_name'), <img src="{$img_dir}img_paradise/{$tag_element[$value]}.jpg" class="img-responsive" alt="UP3 company"/> <div class="country_name">{$tag_element[$value]|escape:html:'UTF-8'}</div> </a> {/foreach} I need to change this <a href="{$link->getProductLink({$product.id_product})}"> to call a new function that I create in Product controller How to do that in PrestaShop? Thanks in advances!
  6. Hi ndiaga for you reply, I override my controller I have a new function call getTagsProducts but I don't know create a link in my view to call this function using getProductLink
  7. Hi guys, I think that I have the solution, I am override the ProductController to add new function and call a new view too, but my question is, how create a hyperlink to this new function? thanks in advances!
  8. Hi guys, I create a module in prestashop to show in home page. My product in prestashop have categories (chocolate, cheese, candy...) and tags (usa, uk, china, spain...), my module show a list of all tags and a second list with categories. When I click in a tag I have to show all product with this tags.... for example if I click un "usa" I have to show chocolate ---- 3items Cheese ---- 2 items Candy ---- 4 items and all this product are from usa tags By other hands when I click in categories for example "cheese" I have to create a list with Usa cheese--- 2 items Uk cheese --- 4 items Spain cheese --- 5 items What is the best way to do that? Create other module to do this functionality and show this in product-list.tpl. What is the best way to do that? Thanks in advance.
  9. Hola Ventura gracias por responder pero por ejemplo dentro de el modulo en la carpeta raiz tengo el modulo "blocknewproducts" que tambien aparece dentro del template. Pero los archivos que contienen son totalmente distintos. Dentro del tema de dicho modulo solo aparece un fichero .tpl que si lo modifico no hace ningun cambio sobre la vista que ve el usuario. Sin embargo si modifico cualquieras de las vista de modulo "blocknewproducts" que esta en la raiz concretamente blocknewproducts_home.tpl si veo cambios en el home. Entonces pregunto cual debo modificar y ademas porque son distintos ambos modulos. Saludos
  10. Hola soy nuevo desarrollando prestashop, me he leido la documentacion y he creado mi primer modulo y mi template pero aun asi tengo un par de dudas que no encuentro el por que. 1.- Que diferencia hay entre la carpeta modulo que hay en la raiz y la que esta dentro de la plantilla (si aparentemenet es lo mismo)? 2.- Cuando cree mi modulo lo inclui dentro de la carpeta de modulo que esta dentro del template y no lo veia, entonces lo coloque en la carpeta modulo de la raiz y aparecio. Deben ir siempre alli los modulos que cree. No se borran al actualizar el PrestaShop. 3.- para customizar el theme lo que dice fue crearlo con la propia plataforma con la opcion de crear una desde la que ya existe en la pagina del index, pone los nuevos productos con este hook {$HOOK_HOME_TAB_CONTENT} que debe ser el modulo homefeatured, este modulo esta duplicado en la raiz y dentro del template solo tiene un fichero, si quisiera modificar el contenido cual tendria que editar. Muchas gracias de antemano.
  11. Hi everyone, I am following the tutorial of PrestaShop page to create a new module. http://doc.prestashop.com/display/PS16/Displaying+content+on+the+front+office But i have problem with Transplant module.. My install function have this two hooks $this->registerHook('leftColumn') && $this->registerHook('header') && so in views/templates/hook forlder I create blockmymodule.php (this is the name of my method) and into this file I have public function hookDisplayLeftColumn($params) and public function hookDisplayRightColumn($params) But when I go to Transplant a module don't see any position and if I save I obtain a error messages: Hook cannot be loaded. Any idea? Thanks in advance
  12. Hi everyone, I am try to install Prestashop in my local server and the installation don't finish, but I don't recibe any error, I check all requirement, and all is fine. If i inspect the browser I obtain this error GET http://localhost/...prestashop/js/jquery/jquery-1.11.0.min.js index.php:14 GET http://localhost/.../prestashop/js/jquery/plugins/jquery.chosen.js install.js:25 Uncaught ReferenceError: $ is not defined(anonymous function) @ install.js:25 database.js:25 Uncaught ReferenceError: $ is not defined(anonymous function) @ database.js:25 index.php:172 Uncaught ReferenceError: $ is not defined I check this file jquery-1.11.0.min.js and jquery.chosen.js and exist! any suggestion? Thanks in advance!
  13. Hola, soy nuevo con prestashop y tengo que modificar la plantilla que vienen por defecto o crear una nueva, para cambiar todo el estilo. Ya he creado un tema nuevo para modificar, pero no se por donde empezar ni cual es el "index.php" de prestashop, o la pagina de inicio. Alguna ayuda respecto a esto... por donde debo empezar... ya he buscado en la documentacin pero no me ha orientado mucho. Muchas Gracias
×
×
  • Create New...