Jump to content

lain

Members
  • Posts

    51
  • Joined

  • Last visited

Profile Information

  • Activity
    Developer

Recent Profile Visitors

3,557,700 profile views

lain's Achievements

Newbie

Newbie (1/14)

9

Reputation

  1. Hi, I found this thread in google trying to hide/exclude some CMS pages from prestashop in-page sitemap (not sitemap.xml) If somebody reach this thread as I did, here is the solution in PS 1.4.5.1 in yourtheme/sitemap.tpl change {foreach from=$categoriescmsTree.cms item=cms name=cmsTree} <li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li> {/foreach} to {foreach from=$categoriescmsTree.cms item=cms name=cmsTree} {if $cms.id_cms==1} {else} <li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li> {/if} {/foreach} where $cms.id_cms==1 is the CMS page´s ID you want to exclude for example, to exclude CMS 1,2 and 3 it would be {if $cms.id_cms==1 || $cms.id_cms==2 || $cms.id_cms==3}
  2. Hi, I found this thread in google trying to hide/exclude some CMS pages from prestashop in-page sitemap (not sitemap.xml) If somebody reach this thread as I did, here is the solution in PS 1.4.5.1 in yourtheme/sitemap.tpl change {foreach from=$categoriescmsTree.cms item=cms name=cmsTree} <li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li> {/foreach} to {foreach from=$categoriescmsTree.cms item=cms name=cmsTree} {if $cms.id_cms==1} {else} <li><a href="{$cms.link|escape:'htmlall':'UTF-8'}" title="{$cms.meta_title|escape:'htmlall':'UTF-8'}">{$cms.meta_title|escape:'htmlall':'UTF-8'}</a></li> {/if} {/foreach} where $cms.id_cms==1 is the CMS page´s ID you want to exclude for example, to exclude CMS 1,2 and 3 it would be {if $cms.id_cms==1 || $cms.id_cms==2 || $cms.id_cms==3}
  3. Hola, la solución aquí: http://www.prestashop.com/forums/topic/254564-meter-productos-en-el-carrito-en-multiplos-de-x-prestashop-1451
  4. Hola, esta es la solución que he empleado en 1.4.5.1 dentro de CartController.php en la línea 173~ después de: if (!sizeof($this->errors)) { if ($add AND $qty >= 0) { y antes de: /* Product addition to the cart */ if (!isset(self::$cart->id) OR !self::$cart->id) { añadimos esto: // inicio modificación if ((int)$idProductAttribute) $minimal_quantity = Attribute::getAttributeMinimalQty((int)$idProductAttribute); else $minimal_quantity = $producToAdd->minimal_quantity; if ($qty%$minimal_quantity!= 0) { // $this->errors[] = Tools::displayError('You can only only add this item to your cart with a quantity multiple of ').' '.$minimal_quantity; die('{"hasError" : true, "errors" : ["Este producto únicamente puede ser añadido al carrito en cantidades multiplos de '.$minimal_quantity.'. Por ejemplo: '.($minimal_quantity).', '.($minimal_quantity*2).', '.($minimal_quantity*3).', '.($minimal_quantity*4).'... "]}'); } // fin modificación ahora en "themes/laplantillaqueusemos/js/product.js cambiar: if ($('#quantity_wanted').val() < minimal_quantity) por: // código viejo // if ($('#quantity_wanted').val() < minimal_quantity) if ($('#quantity_wanted').val()%minimal_quantity!=0) Si se quiere el mensaje de "la cantidad múltiplo de..." en un site multi idioma habrá que emplear '.Tools::displayError('Error in English.').' y agregar las correspondientes traducciones
  5. Hello, what I did was to create a variable in frontcontroller.php which contains group id. Then in TPL files add an IF to check if customer belongs certain group and show custom content like percent group discount, stroked prices or anything For example, I only have 1 special group, so to show old price only on this group I use code above and this {convertPrice price=$product.price_without_reduction} in product-list.tpl to show group prices before discount. I could add -10% label too. On the same way, it is possible to add an IF ELSEIF for any groups you want and add custom "-10%", "-15%" labels. Anyway, I guess PS saves group discounts somewhere and you could get it using code.
  6. Thank you vekia, your idea fixed my problem, using shop database and PS_CONFIGURATION table to save variable value temporarily was the solution. Thank you again
  7. Anyway, someone knows how to do that? call a function, modify a variable and use this variable in another function
  8. It doesnt sound dumb, functions are called separately, I am the dumb I will try to explain what I am doing: I want to use mail::send when a customer is changed from inactive to active when you edit a customer, function one is executed to print in screen customer fields, I try to save customer status into a variable. When you save from editing customer its executed function two, here I want to compare old customer status(variable from function one) and actual customer status and if it changes... { .. mail::send .. }
  9. Hello again vekia, first of all thank you for your help defining the variable in function __construct allows me to use variable in function one and function two, thats ok BUT variable can not be modified in function one and get this modified value from function two. If function one modifies variable value, when function two call this variable, it has the original value from function __construct, not the value from function one. I hope you can understand me
  10. anyway it doesnt work function one() { $this->variableSample = "asdf"; echo $this->variableSample; } function two() { $secondvar = $this->variableSample; echo $this->variableSample; echo $secondvar; } echo from first function is showed but echo´s from second function arent
  11. Hello vekia, thanks for answering I have tried $this->variableSample="Sample text!"; and just used $variableSample in the same function or another function but unsuccessfully. $variableSample keeps empty
  12. Thank you Paul but the problem using $this->context->smarty->assign('variable', $variable); Is that I get an error: Fatal error: Call to a member function assign() on a non-object in W:\var\www\server\administrator\tabs\AdminCustomers.php on line 874 Some times I have used $smarty->assign('variable', $firstvariable); in "FrontController.php" to use $variable in tpl files, but in that case, from "AdminCustomers.php" I cant use $smarty->assign or $this->contest->smarty->assign. Anyway, as I said, I want to use $variable from function one() in function two()
  13. Hello, I am working in "AdminCustomers.php" trying to save a value in a variable from one function and use this variable/value in another function but unsuccessfully I tried using global $variable; public $variable; $smarty->assign('variable', $firstFunctionVar); $this->context->smarty->assign('variable',$firstFunctionVar); I am sure its a dummy thing. thank you
  14. Well, it seems that files are bit different from 1.4.5.1(my version) to 1.5.x (your version) I have not any store running on 1.5.x so I cant test it but it looks that changing Tools::redirect('index.php?controller=authentication'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); to Tools::redirect('index.php?controller=authentication2'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); and then in "AuthController2.php" change the AuthControllerCore to AuthControllerCore2 and: public $php_self = 'authentication'; to public $php_self = 'authentication2'; etc... etc... But, as I said, its not tested on 1.5.x.
×
×
  • Create New...