Skip to content

Instantly share code, notes, and snippets.

@caovillanueva
caovillanueva / tess.tpl
Last active February 12, 2024 06:03
[PS 1.7 remove checkbox susribe to newsletter in new account] #ps17
El botón "Recibir ofertas de nuestras socios del formulario de registro" puedes quitarlo desde la pestaña Parámetros de la tienda -> Ajustes de los clientes -> Opción -> Activar ofertas de asociados: http://victor-rodenas.com/configuracion-de-las-opciones-generales-de-los-clientes-en-prestashop-1-7/#Opciones_generales_clientes_en_Prestashop_17
El botón "Suscribirse a nuestra newsletter", si vas a la pestaña a módulos - módulos y servicios - dentro de módulos instalados, en el modulo: Suscripción al BoletÍn entre otras cosas al tenerlo instalado te añado el campo "Suscribirse a nuestra newsletter", ya que entre los hooks que se instala se instala por ejempo en el hook -> additionalCustomerFormFields -> como puedes ver en la pestaña Diseño -> Posiciones de los módulos -> Mostrar hooks no posicionables -> Bloque additionalCustomerFormFields
The thead is old, but to disable the "Sign up for our newsletter" option on customer checkout form, go to :
Design > Positions
@caovillanueva
caovillanueva / text.tpl
Created February 12, 2024 05:29
[PS display or hide taxes in products] #ps17
Please go to BO > Customers > Groups, check whether you set “Price display method” to “Tax excluded” for all groups. then check whether the two customers in same groups.
more details here:
https://www.sunnytoo.com/forums/topic/prices-appear-without-taxes
@caovillanueva
caovillanueva / file.sql
Last active October 27, 2023 16:45
[PS1.7] Query get all categories tree format. #ps17
//$sql_tree = 'SELECT c.id_category,c.id_parent, CONCAT( LPAD( "", c.`level_depth` , "-" ) , cl.`name` ) AS NAME, cs.position ,level_depth ';//Display more info
$sql_tree = 'SELECT c.id_category as idcat ';
$sql_tree .= 'FROM ps_category c ';
$sql_tree .= 'LEFT JOIN ps_category_lang cl ON (c.id_category = cl.id_category AND id_lang = "1") ';
$sql_tree .= 'LEFT JOIN ps_category_group cg ON (cg.`id_category` = c.id_category) ';
$sql_tree .= 'LEFT JOIN `ps_category_shop` cs ON (c.`id_category` = cs.`id_category` ) ';
$sql_tree .= 'WHERE c.id_category > "2" ';
$sql_tree .= 'AND cl.id_lang="1" ';
$sql_tree .= 'AND c.active="1" ';
@caovillanueva
caovillanueva / file.html
Last active May 16, 2023 14:23
[Top menu fix scroll menu] Keep the menu always visible. More info in : http://jsfiddle.net/aG6DK/27/ #javascript
<header>
<h1>header</h1>
</header>
<div id="container">
<nav>
<ul>
@caovillanueva
caovillanueva / Customer.php
Created March 2, 2023 14:48
[PS17 Add extra fields for costumers in 1.7.8] Display fields in front and backend 100%Symphony for ver. 1.7.8. Do not use this tutorial with previous versions. #ps17
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
*/
use PrestaShop\PrestaShop\Adapter\CoreException;
use PrestaShop\PrestaShop\Adapter\ServiceLocator;
/***
@caovillanueva
caovillanueva / info.txt
Last active February 27, 2023 19:25
[BC run stencil on localhost] Step by step how to do it. #Bigcommerce
More info to install:
https://developer.bigcommerce.com/stencil-docs/ZG9jOjIyMDcwMA-installing-stencil-cli
IF get error "Error: Cannot find module 'node-sass'" follow the next steps:
Just before removing your node_modules or clean your cache, which cost you time, try running
npm rebuild node-sass --force
@caovillanueva
caovillanueva / orderpage
Created February 16, 2023 18:42
[Uncaught ReferenceError: jQuery is not defined] Error displayed in checkout page. #PS17
Check in performance backend..
CCC (Combine, Compress and Cache)
Disabled Smart cache for JavaScript OFF
Delete cache and try again
@caovillanueva
caovillanueva / file.txt
Created January 17, 2023 17:49
[PS set a product as new] Hot to set any products as new #PS17
you can define new value of date_add field in ps_product_shop table
@caovillanueva
caovillanueva / custom.js
Created November 22, 2022 19:27
[PS:1.6 Force to postal code Canada] Remove spaces and all letter switch to upercase #PS16,#PS17
/*
* Custom code goes here.
* A template should always ship with an empty custom.js
*/
/*
MARKETING MEDIA CUSTOM CODE
*/
//Force to use uppercase in zipcodes in address. Also delete spaces (Canada post module only works with uppercase chars.)
$(function() {
$('input[name=postcode]').keyup(function() {
@caovillanueva
caovillanueva / text.txt
Created October 17, 2022 17:46
[PDF download insteaad of opening] Trick to force download file #PS17
If this problem is stil in the to do's list for anyone the solution for the latest Prestashop version (1.7.6.8) for opening PDF's or other documents in browser windows is to change 2 things:
1. Change the controllers/front/AttachmentController.php file like so:
ORIGINAL:
header('Content-Disposition: attachment; filename="' . utf8_decode($a->file_name) . '"');
CHANGED:
header('Content-Disposition: inline; filename="' . utf8_decode($a->file_name) . '"');
2. Change the .htaccess content of this line:
<FilesMatch "\.pdf$">
Header set Content-Disposition "Attachment" /// Alter this line like so: Header set Content-Disposition "Inline"