Skip to content

Instantly share code, notes, and snippets.

@autumned
autumned / archive-product.php
Created March 26, 2016 18:04
WP Woocommerce Sorting by Price Buttons
<div class="product_filter">
<?php
$order = get_query_var('order') ? get_query_var('order') : false;
$orderby = get_query_var('meta_key') ? get_query_var('meta_key') : false;
$ord_asc = '';
$ord_desc = '';
if(($orderby != false && $orderby == '_price') && $order != false){
if($order == 'ASC') $ord_asc = 'order_active_link';
if($order == 'DESC') $ord_desc = 'order_active_link';
@autumned
autumned / GroupSeperator.php
Last active August 29, 2015 13:56
modx GroupSeperator
//Here is the snippet code:
<?php
$output = '';
$groupTag = $scriptProperties['groupTag'];
$snip = $scriptProperties['snippet'];
if(!isset($scriptProperties['outputSeparator'])) {
$scriptProperties['outputSeparator'] = '||';
}
<?php
class nameExp extends Exception{
function __construct($msg){
$msg .= " name!<br />";
parent::__construct($msg);
}
}
class loginExp extends Exception{
function __construct($msg){
$msg .= " login!<br />";/