This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Address_handler{ | |
static $allowed_actions = array('GET','POST'); | |
function GET($request){ | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DummyTest extends SapphireTest{ | |
function testNothing(){ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The actual content to show up. Can also put $Content here to have DB field included. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyForm extends Form{ | |
/** | |
* Override saveInto to allow custom form field to model field mapping. | |
*/ | |
function saveInto($dataObject,$fieldList = null){ | |
$this->mapFieldNames($fieldList); | |
parent::saveInto($dataObject,$fieldList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class RegionShippingModifier extends OrderModifier{ | |
//TODO: allow defining regions / prices with databobjects in SiteConfig | |
static $db = array( | |
'Region' => 'Varchar' | |
); | |