Skip to content

Instantly share code, notes, and snippets.

View francoispeyret's full-sized avatar
🦏

fpeyret francoispeyret

🦏
View GitHub Profile
@francoispeyret
francoispeyret / 0_reuse_code.js
Created March 10, 2017 13:22
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
@francoispeyret
francoispeyret / php5 to php7
Created March 17, 2017 09:42
Switch PHP5 vers PHP7
sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart
@francoispeyret
francoispeyret / front.js
Created June 14, 2018 12:46
Opartdevis bug ES6 correction for IE11
function OpartDevisPopulateSelectCarrier(data) {
//decode jsoon;
data = $.parseJSON(data);
if (data['prefered_order']) {
// get prefered carrier order
var order = data['prefered_order'].split(',');
var carrierSelect = $('#opart_devis_carrier_input');
@francoispeyret
francoispeyret / faq.js
Created June 20, 2018 13:47
faq.js improvement slideToggle
/**
* Roll out answer
*/
$(".gomakoil_faq_page .questions").click(function (e) {
e.preventDefault();
var answer_page_link = $(this).find(".icon_fag");
var answer_block = $(this).next();
if ($(this).hasClass('as_url')) {
@francoispeyret
francoispeyret / front.js
Created July 4, 2018 06:59
OpartDevis correction de correction
//---//
for (var k=0; k < order.length; k++) {
if ($('#selected_carrier').val() == order[k]) {
var selected = 'selected';
} else {
var selected = '';
}
carrierSelect.append('<option value="' + order[k] + '" ' + selected + '>' + data[order[k]]['name'] + ' - ' + data[order[k]]['price'] + ' '+currency_sign+' (' + data[order[k]]['taxOrnot'] + ')</option>');
@francoispeyret
francoispeyret / product.tpl
Created May 13, 2019 08:19
product img prestashop 1.6
<img id="bigpic" itemprop="image"
src="{$img_dir}lazy-blank.png"
data-src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}"
title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"
alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"
width="{$largeSize.width}" height="{$largeSize.height}">
@francoispeyret
francoispeyret / product-cover-thumbnails.tpl
Created May 13, 2019 08:21
Product img prestashop 1.7
<img
src="{$product.cover.bySize.large_default.url}"
alt="{if $product.cover.legend}{$product.cover.legend}{else}{$product.name}{/if}"
width="{$product.cover.bySize.large_default.width}"
itemprop="image"
data-id-img="{$product.cover.id_image}">