Skip to content

Instantly share code, notes, and snippets.

View dardub's full-sized avatar

Darren dardub

View GitHub Profile
$manufacturers = Shop_Manufacturer::create();
$manufacturers->where('exists (select * from shop_manufacturers, shop_products
where shop_products.manufacturer_id = shop_manufacturers.id
and shop_products.id = 3984)');
/* returns MySQL error executing query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from shop_manufacturers, shop_products
where shop_prod' at line 6
*/
@dardub
dardub / gist:2638754
Created May 8, 2012 19:42
nested breadcrumbs
<!-- start breadcrumbs -->
<? if ( isset($category) && $category instanceof Shop_Category ):
$parent_categories = $category->get_parents(true);
?>
<ol class="breadcrumbs">
<? foreach ($parent_categories as $parent_category): ?>
<li class="<?= $parent_category->id == $category->id ? 'last' : null ?>">
<? if ($parent_category->id != $category->id): ?><a href="<?= $parent_category->page_url('/category') ?>"><? endif ?>
<?= h($parent_category->name) ?>
<? if ($parent_category->id != $category->id): ?></a><? endif ?>
function style_forms() {
var ua = $.browser;
if (!(ua.msie && ua.version.slice(0,1) == "7"))
{
$('input:checkbox, input:radio').livequery(function(){
$(this).uniform();
});
}
}
@dardub
dardub / gist:1665293
Created January 23, 2012 20:08
lemonstand side cart
<? $items = Shop_Cart::list_active_items();
$total = Shop_Cart::total_price();
$total_qty = Shop_cart::get_item_total_num();
?>
<div class="box base-mini mini-cart">
<div class="head">
<h4> &nbsp; My Cart</h4>
</div>
<div class="actions">