Subscription module for SilverStripe
-
Member has subscription.
-
Organisation has a subscription (list of members).
-
Subscription many_many Member.
-
Subscription has an expiry date.
-
Subscription period calculator.
<?php | |
class MyAdmin extends LeftAndMain{ //or ModelAdmin | |
private static $url_segment = "myadmin"; | |
function alternateAccessCheck(){ | |
return !$this->config()->hidden; | |
} | |
} |
RewriteCond %{REQUEST_URI} !/maintenance.html$ | |
RewriteCond %{REMOTE_HOST} !^888\.888\.888\.888 | |
RewriteRule $ /maintenance.html [R=302,L] |
<% if $Me.MoreThanOnePage %> | |
<div class="pagination"> | |
<a href="$FirstLink" class="pagination_first">First</a> | |
<% loop $Me.PaginationSummary %> | |
<% if $CurrentBool %> | |
<span class="pagination_num pagination_current">$PageNum</span> | |
<% else %> | |
<% if $Link %> | |
<a class="pagination_num" href="$Link">$PageNum</a> | |
<% else %> |
<?php | |
//in Order class | |
public function getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null) { | |
$components = parent::getComponents($componentName, $filter = "", $sort = "", $join = "", $limit = null); | |
if($componentName === "Items" && get_class($components) !== "UnsavedRelationList"){ | |
$query = $components->dataQuery(); | |
$components = new OrderItemList("OrderItem", "OrderID"); | |
if($this->model) $components->setDataModel($this->model); |
<?php | |
if((isset($_SESSION['FilterTypes'])) && $types = $_SESSION['FilterTypes']){ | |
$products = $products->innerJoin("ProductVariation","PV.ProductID = Product_Live.ID","PV"); | |
$y = 0; | |
foreach ($types as $type){ | |
$products = $products->innerJoin("ProductVariation_AttributeValues","PVA".$y.".ProductVariationID = PV.ID","PVA".$y); | |
$wheres = array(); | |
foreach ($type as $value){ | |
$wheres[] = "PVA".$y.".ProductAttributeValueID = ".$value; |
<?php | |
/** | |
* Playing with how one might go about creating an order via Class/Object calls. | |
* | |
* @see http://inchoo.net/ecommerce/magento/programmatically-create-order-in-magento/ | |
* | |
*/ | |
$order = new Order(); |
<?php | |
/* | |
* Provides a way to create, store and render addresses. | |
* | |
* Updates to addresses will cause a new address to be created, if it has been used in the past. Otherwise the existing address is updated. | |
* | |
*/ | |
class Address extends DataObject{ |
<?php | |
class Address_handler{ | |
static $allowed_actions = array('GET','POST'); | |
function GET($request){ | |
} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Clone this to play with Ember 1.12.1"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.12.1/ember.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.12.1/ember-template-compiler.js"></script> | |
<meta charset="utf-8"> | |
<title>Ember 1.12.1</title> | |
<style id="jsbin-css"> |