Skip to content

Instantly share code, notes, and snippets.

View .php
require_once JPATH_SITE . '/templates//'.$template.'/includes/Mobile_Detect.php';
View .php
require_once JPATH_SITE . '\templates\\'.$template.'\includes\Mobile_Detect.php';
View .html
<!-- Go to www.addthis.com/dashboard to customize your tools --> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5a1b02308c3d6c83"></script>
View .php
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'mysql username');
define('DB_PASSWORD', 'password’);
define('DB_DATABASE', 'database name');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');
View .php
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'mysql username');
define('DB_PASSWORD', 'password’);
define('DB_DATABASE', 'database name');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_');
View .liquid
{% assign current_variant = product.selected_or_first_available_variant %} <span class="variant-sku">{{ current_variant.sku }}</span>
View .liquid
<p class="product_name">
{% if template == 'index' %}
<a href="{{ product.url }}">{{ product.title | truncate:50 }}</a>
{% else %}
<a href="{{ product.url | within: collection }}">{{ product.title | truncate:50 }}</a>
{% endif %}
{% assign current_variant = product.selected_or_first_available_variant %} <span class="variant-sku">{{ current_variant.sku }}</span>
</p>
View .liquid
{% javascript %}
jQuery(document).ready(function($) {
// PRODUCTS VIEW GRID/LIST
if ( typeof $.cookie('productSortView') == 'undefined' ) {
$.cookie('productSortView', 'list', {path: '/'});
}
else if ( $.cookie('productSortView') == 'grid' ) {
$('#view_list').removeClass('active');
$('#view_grid').addClass('active');
View .liquid
{% javascript %}
jQuery(document).ready(function($) {
// PRODUCTS VIEW GRID/LIST
if ( typeof $.cookie('productSortView') == 'undefined' ) {
$.cookie('productSortView', 'grid', {path: '/'});
}
else if ( $.cookie('productSortView') == 'list' ) {
$('#view_grid').removeClass('active');
$('#view_list').addClass('active');
View gist:0efbc9c97bc25e6856f4f7e65fc3842d
<ul class="product_view">
<li id="view_list" data-view="list">
<i class="fa fa-th-list" aria-hidden="true"></i>
</li>
     <li id="view_grid" data-view="grid" class="active">
<i class="fa fa-th" aria-hidden="true"></i>
</li>
</ul>