Skip to content

Instantly share code, notes, and snippets.

require_once JPATH_SITE . '/templates//'.$template.'/includes/Mobile_Detect.php';
require_once JPATH_SITE . '\templates\\'.$template.'\includes\Mobile_Detect.php';
<!-- 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>
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_');
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_');
{% assign current_variant = product.selected_or_first_available_variant %} <span class="variant-sku">{{ current_variant.sku }}</span>
<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>
{% 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');
{% 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');
<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>