Skip to content

Instantly share code, notes, and snippets.

@caovillanueva
caovillanueva / override\controllers\front\ProductController.php
Last active February 20, 2018 19:43
PS1.7 Display manufacturer name on product page. ALTERNATIVE WAY: {if isset($product_manufacturer->id)} <a class="PrManufName" href="{$product_brand_url}">{$product_manufacturer->name}</a> {/if} ***********************
<?php
class ProductController extends ProductControllerCore
{
public function initContent(){
$manufacturer_name = "";
if($this->product->id_manufacturer > 0)
{
$manufacturer = new Manufacturer($this->product->id_manufacturer, $this->context->language->id);
@caovillanueva
caovillanueva / main--fr-CA--numbers
Last active May 25, 2018 16:07
PS1.7 Currency format custom (In 1.7 version you cant custom $ via Backoffice)Check the follows files to check where put the changes.public_html / translations / cldr #PS17
Check this for sign decimals:
before:
"symbols-numberSystem-latn":{"decimal":",",.........
after:
"symbols-numberSystem-latn":{"decimal":".",.........
Check this for price format:
"standard":"#,##0.00\u00a0\u00a4"....
also change "grow up" string ":
@caovillanueva
caovillanueva / footer.tpl
Last active March 21, 2018 19:15
[Include TPL file PS1.6] How to include simple tpl file #PS16
@caovillanueva
caovillanueva / file.tpl
Last active July 3, 2020 18:51
[PS 1.6 - Format links] #PS16 #PS17
PRESTASHOP 1.6
CMS:
<a href="{$link->getPageLink('cms',null,null,'id_cms=1')}">
<a href="{$link->getCMSLink('4', 'about-us')}" title="{l s='About Us'}">
<a href="{$link->getCMSLink('4', null)}"> When get various languages
----------------
CATEGORY:
index.php?id_category=16&controller=category
@caovillanueva
caovillanueva / footer-cright.tpl
Last active February 25, 2020 22:02
[FooterCopyright]Add copyrighttext to website dyamically #PS16 #PS17
@caovillanueva
caovillanueva / style.css
Created March 22, 2018 18:48
[horizontal flip x element] flip x to image or element #CSS
transform: scaleX(-1);
@caovillanueva
caovillanueva / file.tpl
Last active February 25, 2020 18:16
[PS1.6 PS1.7 Format text, replace HTML tags in translate string] Replace specific elements using smarty #PS16 #PS17
For PS1.6
{l s='[1]Welcome[/1] [2]%s[/2]!' sprintf=[$whatever] tags=['<strong>', '<i class="name_class">']}
For PS1.7
{l s='Call us: [1]%phone%[/1]' sprintf=['[1]' => '<span>', '[/1]' => '</span>', '%phone%' => $contact_infos.phone] d='Shop.Theme.Global'}
with link:
nav.tpl
{l
@caovillanueva
caovillanueva / .htaccess
Created March 23, 2018 17:39
[Set settings vars]Set variables inside apache config #htaccess
php_value max_input_vars 3000
@caovillanueva
caovillanueva / apache.conf
Last active March 23, 2018 18:00
[More fast server]Try using the follow lines in apache.conf #htaccess
edit httpd.conf and disable the loading of the CGI module by commenting this line:
LoadModule cgi_module modules/mod_cgi.so
# Make the server more faster CAO
AcceptFilter http none
AcceptFilter https none
HostnameLookups Off
@caovillanueva
caovillanueva / file.tpl
Created March 29, 2018 21:28
[Global variables PS1.6] Display all global #PS16
$base_dir (root folder of your shop)
$base_dir_ssl (root folder of your shop using HTTPS protocol)
$content_dir (root folder of your shop depending on the SSL settings)
$img_ps_dir (root folder containing images “/img/”)
$img_dir (images folder in your current theme directory)
$css_dir (css folder inside the current theme folder)
$js_dir (JavaScript inside the theme folder)
$tpl_dir (theme root folder)
$modules_dir (modules root folder)
$mail_dir (mail templates root folder)