Skip to content

Instantly share code, notes, and snippets.

View objectivehtml's full-sized avatar

Justin Kimbrell objectivehtml

  • Woodland Park, CO
View GitHub Profile
@objectivehtml
objectivehtml / gist:4208306
Created December 4, 2012 20:24
Joining another table to an channel entries using Channel Data
class Showtimes_model extends CI_Model {
public function get_showtimes($params = array())
{
$default_params = array(
'select' => array(
'count(exp_showtimes.id) as \'total_showtimes\'',
'showtimes.*'
),
'join' => array(
public function checkout_complete($auth, $template = NULL, $return = NULL)
{
/*
NOTES: regarding an active session
1. logging in customer requires an active session. if run from a cul-de-sac payment gateway, the user won't be logged-in when they leave the gateway
2. Process discounts & inventory. Does this requires an active session. If so the session needs to be relaunched to handle this.
so...use checkout_complete_offsite
*/
$auth = array_merge(
{exp:cartthrob:cart_items_info}
{if segment_2 == "promo"}
<fieldset>
<h3>Coupon Code</h3>
<h4>Total: {cart_total} <i>(with tax)</i></h4>
{exp:cartthrob:add_coupon_form return="/subscribe"}
<form action="#" method="post" class="custom">
<a name="{exp:low_variables:single var="lv_renew_utilitytext_healthygen_shortcut_{user_language}"}"></a>
<fieldset id="healthy-generations">
<legend>{exp:low_variables:single var="lv_renew_utilitytext_healthygen_header_{user_language}"}</legend>
<img src="{lv_renew_utilitytext_healthygen_logo_{user_language}}" alt="lv_renew_utilitytext_healthygen_header_{user_language}" class="right" />{lv_renew_utilitytext_healthygen_intro_{user_language}}
<div class="row">
<div class="six mobile-two columns">
{exp:low_variables:parse var="lv_renew_form_donate_{user_language}"}
<code class=" language-ee">
<span class="token eetag"><span class="token bracket">{</span><span class="token tag_name"><span class="token exp">exp</span><span class="token class">:authenticate</span><span class="token colon">:</span><span class="token method">login_form</span></span>
<span class="token parameter"><span class="token name">auth_type</span><span class="token operator">=</span><span class="token quote">'</span><span class="token value">email</span><span class="token quote">'</span></span>
<span class="token parameter"><span class="token name">auth_type</span><span class="token operator">=</span><span class="token quote">"</span><span class="token value">email</span><span class="token quote">"</span></span>
<span class="token parameter"><span class="token name">username_field</span><span class="token operator">=</span><span class="token quote">"</span><span class="token value">email</span><span class="token quote">"</span></span>
<span class="token parameter"><span class="token name">clas
@objectivehtml
objectivehtml / gist:4089111
Created November 16, 2012 17:16
UPS Live Rates w/EE plugin
<!-- height, width, and length are optional -->
{exp:live_rates:ups
access_key=""
username=""
password=""
account_number=""
origin_postal_code=""
destination_postal_code=""
cartthrob_session="true|false"
public function set_permissions(&$obj, $member_id = 1)
{
if(!config_item('safecracker_registration_respect_permissions'))
{
$this->EE->session->set_cache(__CLASS__, 'member', array(
'logged_out_member_id' => $obj->logged_out_member_id,
'group_id' => $this->EE->session->userdata['group_id'],
'member_id' => $this->EE->session->userdata['member_id'],
'can_edit_other_entries' => $this->EE->session->userdata['can_edit_other_entries'],
'can_assign_post_authors' => $this->EE->session->userdata['can_assign_post_authors']
public function get_file_upload_groups()
{
if(!isset($this->session->cache['photo_frame']['upload_prefs']))
{
$groups = $this->db->get('upload_prefs')->result_array();
$this->session->set_cache('photo_frame', 'upload_prefs', $groups);
}
else
{
<ul>
{exp:assigned_entries
channel="some-channel"
assigned_entry_id="X"
prefix="var"
}
<li><a href="{var:url_title}">{var:title}</a></li>
{/exp:assigned_entries}
</ul>
jQuery(document).ready(function($){
// this will set JSON as the return data type, and identify update_cart as a callback function
var cart_form_options = {
success: update_cart, // post-submit callback
dataType: 'json'
};
// this is the callback script. whenever a form is updated, this script will be called
function update_cart(data, statusText, xhr, $form) {
// "data" is the returned data in json format