This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prestashop 1.6 : {$link->getModuleLink()} | |
Prestashop 1.7 : {url entity='module' name='myModule' controller='myController' params = ['paramKey1' => $paramValue1, 'paramKey2' => $paramValue2]} | |
Example : {url entity='module' name='marketplace' controller='productupdate' params=['edited' => 1, 'id' => $id]} | |
Prestashop 1.6 : {$link->getPageLink()} | |
Prestashop 1.7 : { url entity='myPageName' params = ['paramKey1' => $paramValue1, 'paramKey2' => $paramValue2]} | |
Example : { url entity='my-account' params=['edited' => 1, 'id' => $id]} | |
Prestashop 1.6 : {$link->getCategoryLink()} | |
Prestashop 1.7 : {url entity='category' id=$id_category id_lang=$id_lang} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |