Skip to content

Instantly share code, notes, and snippets.

@jonathandavis
jonathandavis / enhanced-storefront.php
Created November 9, 2012 18:20 — forked from kopepasah/shopp-account-menu.php
Creating an actual Shopp account menu for the account pages.
static function account_menuitem ($result, $options, $O) {
$Storefront = ShoppStorefront();
$page = current($Storefront->menus);
if (array_key_exists('url',$options)) return add_query_arg($page->request,'',shoppurl(false,'account'));
if (array_key_exists('action',$options)) return $page->request;
if (array_key_exists('classes',$options)) {
$classes = array($page->request);
if ($Storefront->account['request'] == $page->request) $classes[] = 'current';
return join(' ',$classes);
}
class MixProducts extends SmartCollection {
static $_slug = 'mixed';
static $_menu = false;
function smart ($options=array()) {
$this->slug = $this->uri = self::$_slug;
$defaults = array(
'name' => __('Mixed Products','Shopp'),
'relation' => 'AND',
<?php
add_filter('shopp_themeapi_purchase_itemunitprice')
function shopp_purchase_item_price ($result, $options, $O) {
$item = current($O->purchased);
$amount = $item->unitprice;
return money($amount);
}
/**
* Garbage collection routine for cleaning up old and expired
* sessions.
*
* 1.3 Added support for shopping session cold storage
*
* @author Jonathan Davis
* @since 1.1
* @version 1.3
*
<?php
add_filter('shopp_order_event_emails','disable_customer_order_notifications');
function disable_customer_order_notifications ($messages) {
unset($messages['customer']);
return $messages;
}
<?php
add_filter('shopp_order_event_emails','disable_customer_order_notifications');
function disable_customer_order_notifications ($messages) {
if ( 'email-order.php' == $messages['customer'][3] )
unset($messages['customer']);
return $messages;
}
<?php
/**
* Provides the installed database schema version from the database (if available)
*
* Queries the database to get the installed database version number. If not available,
* also checks the legacy
*
* @author Jonathan Davis
* @since 1.3
*
class RelatedProducts extends SmartCollection {
static $_slug = "related";
static $_menu = false;
var $product = false;
function smart ($options=array()) {
$this->slug = self::$_slug;
$where = array();
$scope = array();
diff --git a/core/model/Item.php b/core/model/Item.php
index 0a9329d..073999d 100644
--- a/core/model/Item.php
+++ b/core/model/Item.php
@@ -151,7 +151,7 @@ class Item {
$this->sale = str_true($Product->sale);
$this->freeshipping = ( isset($Price->freeshipping) ? $Price->freeshipping : false );
- $baseprice = ( $this->sale ? $Price->promoprice : $Price->price );
+ $baseprice = roundprice( $this->sale ? $Price->promoprice : $Price->price );
<?php
ob_start();
?>
<h5><?php _e('Using Advanced Order Search','Shopp'); ?></h5>
<table border="0" class="advsearch">
<tr><td><strong><?php _e('Email','Shopp'); ?>:</strong></td><td>help.desk@shopplugin.net</td></tr>
<tr><td><strong><?php _e('Transaction ID','Shopp'); ?>:</strong></td><td>txn:95M27911DT480180V</td></tr>
<tr><td><strong><?php _e('Gateway','Shopp'); ?>:</strong></td><td>gateway:"paypal express"<br />gateway:firstdata</td></tr>
<tr><td><strong><?php _e('Credit Card Type','Shopp'); ?>:</strong></td><td>cardtype:visa</td></tr>