Skip to content

Instantly share code, notes, and snippets.

View prestarocket's full-sized avatar

Adonis Karavokyros prestarocket

View GitHub Profile
# PrestaShop
#
# VERSION 0.1
# DOCKER-VERSION 0.2
from ubuntu:12.04
# make sure the package repository is up to date
run echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
run apt-get update
@prestarocket
prestarocket / ProductController.php
Created June 25, 2013 17:43
Prestashop : Override Product controller : array feature with id feature as key
<?php
class ProductController extends ProductControllerCore
{
public function initContent()
{
FrontController::initContent();
if (!$this->errors)
server {
listen 80;
server_name MY.WEBSITE.TLD;
root /Users/ME/Sites/FOLDER;
client_header_buffer_size 16k;
large_client_header_buffers 16 16k;
# qsa
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
wget http://prestashop.googlecode.com/files/prestashop_1.4.8.2.zip
unzip prestashop_1.4.8.2.zip
rm -rf css/
rm -rf favicon.ico
rm -rf img/
rm -rf index.html
rm -rf picture_library/
rm -rf prestashop_1.4.8.2.zip
rm -rf test/
server {
listen 80;
server_name MY.WEBSITE.TLD;
root /Users/ME/Sites/FOLDER;
client_header_buffer_size 16k;
large_client_header_buffers 16 16k;
# qsa
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
@prestarocket
prestarocket / social.js
Created September 15, 2012 20:02 — forked from yannickcr/social.js
Insert GooglePlus and Facebook buttons (use the HTML5 embedding code)
/*
* Google Plus
*
* Include Google Plus One if there is a "g-plusone" button in the page
*
*/
$(document).ready(function() {
if (!$('.g-plusone').length) return;
window.___gcfg = {lang: 'fr-FR'};
@prestarocket
prestarocket / blockcms.tpl
Created June 5, 2012 04:59
prestashop : nofollow blockcms
<!-- MODULE Block footer -->
<div class="block_various_links" id="block_various_links_footer">
<h4>{l s='Informations' mod='blockcms'}</h4>
<ul>
{foreach from=$cmslinks item=cmslink}
{if $cmslink.meta_title != ''}
<li class="item"><a href="{$cmslink.link|addslashes}" title="{$cmslink.meta_title|escape:'htmlall':'UTF-8'}" rel="nofollow">{$cmslink.meta_title|escape:'htmlall':'UTF-8'}</a></li>
{/if}
{/foreach}
<!-- <li class="last_item">{l s='Powered by' mod='blockcms'} <a href="http://www.prestashop.com" rel="nofollow">PrestaShop</a>&trade;</li> -->
@prestarocket
prestarocket / prestashop-product-override-attribut
Created June 4, 2012 14:08
Prestashop : override product for order groupe attribut by name and not by public name
<?php
class Product extends ProductCore {
public function getAttributesGroups($id_lang)
{
return Db::getInstance()->ExecuteS('
SELECT ag.`id_attribute_group`, ag.`is_color_group`, agl.`name` AS group_name, agl.`public_name` AS public_group_name, a.`id_attribute`, al.`name` AS attribute_name,
a.`color` AS attribute_color, pa.*
FROM `'._DB_PREFIX_.'product_attribute` pa
@prestarocket
prestarocket / metabox
Created April 11, 2012 17:08 — forked from shawnsandy/metabox
meta-box
<?php /**
* *****************************************************************************
* Add Metaboxes
* *****************************************************************************
*/
//add_action( 'add_meta_boxes', 'cwpt_custom_metaboxes' );
function cwpt_custom_metaboxes(){
add_meta_box('cwpt_preview', 'Site Preview', 'cwpt_preview_box', 'cwp_custom_options', 'normal', 'high');
@prestarocket
prestarocket / bootstrap_buttons.less
Created April 9, 2012 09:27 — forked from charliepark/bootstrap_buttons.less
A Less Implementation of the Bootstrap Buttons Generator
.customButton(@cHue: 201, @cSaturation: 1, @cLightness: .4, @cDelta: .1, @cMultiplier: 1.5) {
.cTextColor(@a, @b) when (@a < .5) { color: #fff; .cAlphaShadow(0, -1, 1, 0, (@b * 3.3)); }
.cTextColor(@a, @b) when (@a > .5) { color: #333; .cAlphaShadow(0, 1, 1, 255, (@b * 3.3)); }
.cTextColor(@a) { -webkit-font-smoothing: antialiased; }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e > 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, 1); }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e < 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, @e); }
@cHighlight: percentage(@cLightness + @cDelta);
@cLowlight: percentage(@cLightness - @cDelta);
@cSuperLowLight: percentage(@cLightness - @cDelta * @cMultiplier);