Skip to content

Instantly share code, notes, and snippets.

View IsaiChristian's full-sized avatar

Christian Isai IsaiChristian

  • 1eroTrader
  • Mexico
  • 10:15 (UTC -06:00)
View GitHub Profile
UPDATE ps_product_shop SET active=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET active=1 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);
@IsaiChristian
IsaiChristian / ContactController.php
Last active April 5, 2018 14:55
Agregar Captcha Formulario #Captcha #ps
if (Tools::isSubmit('submitMessage')) {
$extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg');
$file_attachment = Tools::fileAttachment('fileUpload');
$message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags.
$id_order = (int)$this->getOrder();
if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) {
$this->errors[] = Tools::displayError('Invalid email address.');
// add the 2 lines from here
} elseif (!($gcaptcha = (int)(Tools::getValue('g-recaptcha-response')))) {
$this->errors[] = Tools::displayError('Captcha error');
@IsaiChristian
IsaiChristian / AdminModelAdapter.php
Last active June 4, 2018 02:31
Extender AdminProduct #ps1.7 #backend #product
7** in src/PrestaShopBundle/Model/Product/AdminModelAdapter.php*/
$this->translatableKeys = array(
'name',
'description',
'description_short',
'frais_a_prevoir',
'link_rewrite',
'meta_title',
'meta_description',
'available_now',
@IsaiChristian
IsaiChristian / links.tpl
Created April 4, 2018 14:28
Link construction #Ps1.7 #Ps1.6
@IsaiChristian
IsaiChristian / global.tpl
Created April 3, 2018 17:52
[Prestashop] [1.6] [Structured Data.]
{* Structured Data Json - LD Microdata for Prestashop 1.6.X
*
* Add this code in your smarty global.tpl/header.tpl file to show Organization, WebPage, Website and Product Microdata in ld+json format.
* Requires Prestashop 'productcomments' module for review stars ratings.
* by Ruben Divall @rubendivall http://www.rubendivall.com
*}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
@IsaiChristian
IsaiChristian / GlobalVariables.tpl
Last active June 18, 2018 03:31
[Variables Globales] #globalvariables.tpl #prestashop #1.7 #smarty
{$currency|var_dump}:
{$currency.name} -> Nombre de la moneda activa.
{$currency.iso_code} -> Código ISO del idioma activado.
{$currency.sign} -> Símbolo de la moneda activa
{$currency.iso_code_num} -> Código ISO de la Moneda activa
{$shop|var_dump}:
{$shop.name} -> Nombre de la tienda en Prestashop 1.7
@IsaiChristian
IsaiChristian / 0_reuse_code.js
Last active February 20, 2018 19:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console