From a7a60a96d8cd99b405433e4c9682a16f91d2d183 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 11 Jan 2013 14:12:04 +1100 Subject: [PATCH] Removed the need for price_base/price_setup in products table --- .../classes/Controller/Admin/Product.php | 1 - .../product/classes/Controller/Product.php | 12 +++++++----- modules/product/classes/Model/Product.php | 4 ---- .../product/views/product/admin/update.php | 4 ---- modules/product/views/product/view.php | 19 +++---------------- 5 files changed, 10 insertions(+), 30 deletions(-) diff --git a/modules/product/classes/Controller/Admin/Product.php b/modules/product/classes/Controller/Admin/Product.php index 14c6646d..1ca43eea 100644 --- a/modules/product/classes/Controller/Admin/Product.php +++ b/modules/product/classes/Controller/Admin/Product.php @@ -55,7 +55,6 @@ class Controller_Admin_Product extends Controller_TemplateDefault_Admin { 'prod_plugin_file'=>array('label'=>'Plugin Name'), 'prod_plugin_data'=>array('label'=>'Plugin Data'), 'price_type'=>array('label'=>'Price Type'), - 'price_base'=>array('label'=>'Price Base'), 'taxable'=>array('label'=>'Taxable'), 'count_services()'=>array('label'=>'Services'), 'count_invoices()'=>array('label'=>'Invoices'), diff --git a/modules/product/classes/Controller/Product.php b/modules/product/classes/Controller/Product.php index 463f9ea8..39eae48e 100644 --- a/modules/product/classes/Controller/Product.php +++ b/modules/product/classes/Controller/Product.php @@ -11,6 +11,9 @@ * @license http://dev.leenooks.net/license.html */ class Controller_Product extends Controller_TemplateDefault { + /** + * Show a list of product categories + */ public function action_categorys() { $output = '
'; $output .= ''; @@ -32,6 +33,7 @@ class Controller_Product extends Controller_TemplateDefault { /** * Show the available topics in a category + * * @todo Only show categories according to their validity dates * @todo Obey sort order */ @@ -92,10 +94,10 @@ class Controller_Product extends Controller_TemplateDefault { } Block::add(array( - 'title'=>$po->product_translate->find()->description_short, + 'title'=>$po->description_short(), 'body'=>View::factory($this->viewpath()) ->set('record',$po), - )); + )); } } ?> diff --git a/modules/product/classes/Model/Product.php b/modules/product/classes/Model/Product.php index 1ff381ee..760e82d0 100644 --- a/modules/product/classes/Model/Product.php +++ b/modules/product/classes/Model/Product.php @@ -26,10 +26,6 @@ class Model_Product extends ORM_OSB { ); protected $_display_filters = array( - 'price_base'=>array( - array('Tax::add',array(':value')), - array('Currency::display',array(':value')), - ), 'price_type'=>array( array('StaticList_PriceType::display',array(':value')), ), diff --git a/modules/product/views/product/admin/update.php b/modules/product/views/product/admin/update.php index 654daaea..d8cc64a9 100644 --- a/modules/product/views/product/admin/update.php +++ b/modules/product/views/product/admin/update.php @@ -9,10 +9,6 @@   status); ?> - - Base Price - price_base); ?> - Price diff --git a/modules/product/views/product/view.php b/modules/product/views/product/view.php index d5dafb31..64b3b3f9 100644 --- a/modules/product/views/product/view.php +++ b/modules/product/views/product/view.php @@ -1,20 +1,6 @@ product_translate->where('product_id','=',$record->id)->and_where('language_id','=','fr')->find(); - -// If there isnt a translated page, show the default language -// @todo - default language should come from configuration -if (! $translate->loaded()) - $translate = $record->product_translate->where('product_id','=',$record->id)->and_where('language_id','=',1)->find(); - // @todo Need to add in product attributes // @todo Need to add in product plugins - echo Form::open('cart/add'); ?> @@ -27,7 +13,7 @@ echo Form::open('cart/add');
- + @@ -39,7 +25,8 @@ echo Form::open('cart/add'); prod_plugin_file && method_exists($record->prod_plugin_file,'contract_view')) { $pio = new $record->prod_plugin_file; - echo ''; + // @todo This is a hack, need to work out the correct recur_price_schedule dynamically + echo ''; } ?>
description_full; ?>description_long(); ?> show_thumb()) echo $a; ?>
'.$pio->contract_view($record->prod_plugin_data,$record->price_base,$record->price_setup).''.$pio->contract_view($record->prod_plugin_data,$record->price(0,1,'price_base'),$record->price(0,1,'price_setup')).'