Skip to content

Instantly share code, notes, and snippets.

@EHLOVader
EHLOVader / sidebar_cart.php
Created January 23, 2012 20:10 — forked from dardub/gist:1665293
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">
function style_forms() {
var ua = $.browser;
if (!(ua.msie && ua.version.slice(0,1) == "7"))
{
$('select, input:checkbox, input:radio').livequery(function(){
$(this).uniform();
});
}
}
<div id="write_review" class="clearfix">
<? if (isset($review_posted)): ?>
<p class="flash success">Your taste review has been successfully posted.</p>
<? else: ?>
<h3 id="review_link" class="clearfix"><a href="#" onclick="$('#review_form').removeClass('hidden'); $('#review_link').addClass('hidden'); return false;">Write Your Taste Review</a></h3>
<div id="review_form" class="hidden bottom_offset">
<ul class="form">
<li class="field">
<label><span class="label">Rating</span>
@EHLOVader
EHLOVader / pre_action.php
Last active October 7, 2015 21:18 — forked from GreatPotato/gist:3225912
Set shipping method automatically in LemonStand
<?php
/**
* Default shipping during checkout
* This snippet when added to the pre_action will allow you to default shipping selection.
*
* This is mostly useful when there is only one shipping option, this allows you to skip
* the shipping step of checkout entirely, simplifying things for your customers.
*
* This has been updated to use a dynamic method of pulling the first available shipping
* option from your list of available shipping options.
@EHLOVader
EHLOVader / gist:3706390
Created September 12, 2012 12:52 — forked from anonymous/gist:3706319
Blog File Module
<?php
class BlogFiles_Module extends Core_ModuleBase{
/**
* Creates the module information object
* @return Core_ModuleInfo
*/
protected function createModuleInfo(){
return new Core_ModuleInfo(
"Blog Files",
"Adds files to blog posts",
@EHLOVader
EHLOVader / gist:3706391
Created September 12, 2012 12:52 — forked from anonymous/gist:3706321
Blog Post page
<? if ($post): ?>
<h2><?= h($post->title) ?></h2>
<p>
Published by <?= h($post->created_user_name) ?>
on <?= $post->published_date->format('%F') ?>
Comment(s): <?= $post->approved_comment_num ?>
</p>
<?= $post->content ?>

Javascript Jabber
Your Prototype for Great Code

Shop Talk Show
Shoptalk is a podcast about front end web design, development and UX. Each week Dave & Chris will be joined by a special guest who is there to talk shop and help answer listener submitted questions.

Upfront Podcast
An in-depth discussion on the latest tooling, workflow and best practices for front-end developers, brought to you every week by Jack Franklin and Ben Howdle.

Accidental Dev

@EHLOVader
EHLOVader / gist:6902579
Last active December 25, 2015 02:29 — forked from GreatPotato/gist:6902395
Total number of items sold
<?php
$obj = new Shop_Product();
$obj->select('shop_products.id, sum(shop_order_items.quantity) AS "sold"');
$obj->join('shop_order_items', 'shop_products.id = shop_order_items.shop_product_id');
$obj->join('shop_orders', 'shop_order_items.shop_order_id = shop_orders.id');
$best_selling = $obj->where('shop_orders.payment_processed IS NOT NULL')->group('shop_products.id')->find_all();
@EHLOVader
EHLOVader / Page.php
Last active December 25, 2015 15:58 — forked from anonymous/gist:7001873
<?php
foreach($products as $p){
echo $p->categories[0]->name . ' ' . $p->sku . ' ' . $p->created_at . ' </br>';
}
<?php
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendCategoryModel', $this, 'extend_category_model');
}
public function extend_category_model($category, $context)
{