Skip to content

Instantly share code, notes, and snippets.

@juaniyyo
juaniyyo / PrestashopValetDriver.php
Created October 15, 2024 15:28 — forked from n3b0r/PrestashopValetDriver.php
Prestashop 8 Laravel Valet driver
<?php
namespace Valet\Drivers\Custom;
use Valet\Drivers\ValetDriver;
class PrestaShopValetDriver extends ValetDriver
{
public static $ps_exclusions = ['ajax.php', 'dialog.php', 'ajax_products_list.php', 'autoupgrade/', 'filemanager/'];
@juaniyyo
juaniyyo / provincias_portugal.sql
Last active November 18, 2022 14:10
Provincias portugal
INSERT INTO `ps_state` (`id_country`, `id_zone`, `name`, `iso_code`, `tax_behavior`, `active`) VALUES(15, 17,'Açores','PT-AC','0','1'),
(15, 17,'Aveiro','PT-AV','0','1'),
(15, 17,'Beja','PT-BE','0','1'),
(15, 17,'Braga','PT-BR','0','1'),
(15, 17,'Bragança','PT-BA','0','1'),
(15, 17,'Castelo Branco','PT-CB','0','1'),
(15, 17,'Coimbra','PT-CO','0','1'),
(15, 17,'Évora','PT-EV','0','1'),
(15, 17,'Faro','PT-FA','0','1'),
(15, 17,'Guarda','PT-GU','0','1'),
@juaniyyo
juaniyyo / .gitignore
Created September 6, 2022 15:46 — forked from prestarocket/.gitignore
Gitignore PrestaShop 1.7
# Cache, temp and personal files
/.htaccess
*.log
npm-debug.log.*
.sass-cache/
/cache/*
download/*
/img/*
/log/*
@juaniyyo
juaniyyo / fix_bug_multi_feature.sql
Created June 24, 2022 11:00
Fix error de multiples caracteristicas
SELECT id_feature_value FROM `ps_feature_product` WHERE `id_product` = product_id;
DELETE FROM `ps_feature_value_lang` WHERE id_feature_value IN
(SELECT id_feature_value FROM `ps_feature_product` WHERE `id_product` = product_id);
DELETE FROM `ps_feature_value` WHERE `id_feature_value` IN
(SELECT id_feature_value FROM `ps_feature_product` WHERE `id_product` = product_id);
@juaniyyo
juaniyyo / borrar_error_multi_features.sql
Created May 31, 2022 10:37
Bug prestashop. Borrar las features repetidas miles de veces en un producto
SELECT * FROM `ps_feature_value` WHERE id_feature_value IN (
SELECT id_feature_value FROM ps_feature_product WHERE id_product = 1592
)
DELETE FROM `ps_feature_product` WHERE `id_product` = 1592;
@juaniyyo
juaniyyo / update_clients_todocampers.sql
Created May 10, 2022 07:37
Actualización de clientes todocampers para limpieza gestoría
CREATE TABLE `ps_cliente_temporal` (
`id_customer` int(10) UNSIGNED NOT NULL,
`email` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL,
`company` varchar(255) DEFAULT NULL,
`siret` varchar(14) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `ps_cliente_temporal` ADD PRIMARY KEY (`id_customer`);
@juaniyyo
juaniyyo / docker-compose.yml
Created October 28, 2021 00:40
Docker Wordpress-Mysql8.0-Mailhog-Phpmyadmin
version: '3'
services:
db:
image: mysql:latest
volumes:
- ./db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@juaniyyo
juaniyyo / ps_orders_update_procedure.sql
Last active October 26, 2021 09:56
Actualizar la tabla ps_orders para el campo custom => carrier_weight
DROP PROCEDURE IF EXISTS _tmp_update_orders;
DELIMITER $$
CREATE PROCEDURE _tmp_update_orders()
BEGIN
DECLARE cursor_List_isdone BOOLEAN DEFAULT FALSE;
DECLARE cur_id_order INT;
DECLARE cursor_List CURSOR FOR
SELECT id_order FROM ps_orders
;
@juaniyyo
juaniyyo / check_auto_increment.sql
Created August 30, 2021 16:07
Comprobar cual es el siguiente valor de un columna "auto_increment"
SELECT auto_increment + 1 AS NEXT_ID
FROM `information_schema`.`tables`
WHERE table_name = "table_name" AND table_schema = "database_name"
@juaniyyo
juaniyyo / letsencrypt.sh
Last active September 30, 2021 15:00
LetsEncrypt proceso de renovación.
certbot certonly \
--manual \
--preferred-challenges=dns \
--email mail@mail.com \
--server https://acme-v02.api.letsencrypt.org/directory \
--agree-tos \
-d "domain.com.es, *domain.com.es"