Skip to content

Instantly share code, notes, and snippets.

@foxp2
foxp2 / oscommerce tip
Created September 26, 2012 15:16
boxe category only for subcategory
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
@foxp2
foxp2 / controller.php
Created November 22, 2012 08:04
github osCommerce Team Members sidebar
<?php
/**
* osCommerce Website
*
* @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @copyright Copyright (c) 2012 FoxP2; http://www.oscommerce.fr
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Site\Website\Module\Template\Widget\github_coders_sidebar_nav;
@foxp2
foxp2 / coders_navbar.html
Created November 22, 2012 08:06
View of osCommerce Team Members
<li class="nav-header"><i class="github-icon-person icongithubnavbar"></i>{lang}navbutton_github_coders{lang}</li>
{loop publicMembers}
<li id="snIndex"><a href="{link}Github|Website|Member{link}">#login#</a></li>
{loop}
</ul>
</div>
@foxp2
foxp2 / repos_member.html
Created November 28, 2012 15:14
widget repos list
<div class="container">
<div class="span8">
<div class="row">
{loop reposMember}
<h3><i class="#fork#"></i> {lang}repositerie{lang} : #name#</h3>
<ul class="nav nav-tabs">
<li class="active"><a href="{link}Github|Website|Member{link}" onclick="javascript:getTab('resume#id#')" data-toggle="tab">{lang}resume{lang}</a></li>
<li><a href="{link}Github|Website|Member{link}" onclick="javascript:getTab('details#id#')" data-toggle="tab">{lang}details{lang}</a></li>
<li><a href="{link}Github|Website|Member{link}" onclick="javascript:getTab('stats#id#')" data-toggle="tab">{lang}stats{lang}</a></li>
</ul>
@foxp2
foxp2 / 1 - base.html.twig
Last active December 15, 2015 01:49
Integration of Twig Template Engine in osCommerce 2.4 Multiple inheritance between templates !
{# file: includes/modules/templates/twig/content/base.html.twig #}
<!DOCTYPE html>
<html {{ constant('HTML_PARAMS') | raw}}>
<head>
{% block head %}
<meta charset="{{ constant('CHARSET') }}" />
<title>{{ title }}</title>
<base href="{{ base_href }}" />
<link rel="icon" type="image/png" href="public/images/oscommerce_icon.png" />
<meta name="generator" content="osCommerce Online Merchant" />
@foxp2
foxp2 / TwigModules.php
Last active December 15, 2015 01:49
Bootstrap Slider for NewProducts Module called in main.html.twig with a simple tag {{ moduleproductsnew() | raw}}
<?php
/**
* osCommerce Online Merchant
*
* @copyright Copyright (c) 2013 osCommerce; http://www.oscommerce.com
* @copyright (c) 2013, James W Burke
* @copyright Copyright (c) 2013 modified by FoxP2; http://www.oscommerce.fr
* @license GNU General Public License; http://www.oscommerce.com/gpllicense.txt
*/
class TwigModules extends Twig_Extension
@foxp2
foxp2 / gist:5194837
Last active November 9, 2023 15:55
Preview of new TwigTemplate Class
<?php
/**
* osCommerce Online Merchant
*
* @copyright Copyright (c) 2013 osCommerce; http://www.oscommerce.com
* @copyright Copyright (c) 2013 FoxP2; http://www.oscommerce.fr
* @license GNU General Public License; http://www.oscommerce.com/gpllicense.txt
*/
class TwigTemplate
{
@foxp2
foxp2 / gist:5232673
Created March 24, 2013 17:10
dynamic loading of products options templates
{# here we load dynamic options templates #}
{% if nb_product_attribute > 0 %}
{% block product_attribute %}
{% import 'products_options.html.twig' as display_options %}
<h4>{{ constant('TEXT_PRODUCT_OPTIONS') }}</h4>
{% for option in content %}
{{ attribute(display_options, option.potemplate, [option.data,option.poname,option.id,option.selected_attribute]) }}
{% endfor %}
{% endblock %}
{% endif %}
@foxp2
foxp2 / base.html.twig
Last active December 15, 2015 15:58
automactic & smart loader for each column. Example with twig_bm_categories extending bm_categorie class and its template file
{% block columnleft %}
<div id="columnTwigLeft" class="span{{ GridColumnWidth }}">
{% for boxe in boxes %}
{% if boxe.boxe != null and boxe.group == 'boxes_column_left' %}
{% include [boxe.boxe, TwigExtension]|join with{'data': boxe.data, 'title' : boxe.title } %}
{% endif %}
{% endfor %}
</div>
{% endblock %}
@foxp2
foxp2 / main.html.twig
Last active December 16, 2015 17:28
osCommerce 2.4 shopping cart with Twig
{# Copyright (c) 2013 FoxP2; http://www.oscommerce.fr #}
{# file: includes/apps/cart/view/template/classic/main.html.twig #}
{% extends "base.html.twig" %}
{% block appcontent %}
<div id="bodyContent" class="span{{ GridContentWidth }}">
{% block shoppingcarttitle %}
<h1 class="title-app">{{ constant('HEADING_TITLE') }}</h1>
{% endblock %}
{{ form('cart_quantity', link('cart', 'update'), 'post', null, true) | raw }}
{% for hf in hidden_field %}