diff --git a/modules/host/classes/controller/task/host.php b/modules/host/classes/controller/task/host.php index a6757137..a565a88e 100644 --- a/modules/host/classes/controller/task/host.php +++ b/modules/host/classes/controller/task/host.php @@ -64,10 +64,10 @@ class Controller_Task_Host extends Controller_Task { // Limit to show only those by the requested category. if ($cats) { - if (! $so->product->avail_category_id OR ! preg_match('/^a:/',$so->product->avail_category_id)) + if (! $so->product->avail_category OR ! preg_match('/^a:/',$so->product->avail_category)) continue; - $pc = unserialize($so->product->avail_category_id); + $pc = unserialize($so->product->avail_category); if (! array_intersect($pc,array_keys($cats))) continue; diff --git a/modules/product/classes/controller/product.php b/modules/product/classes/controller/product.php index 314d62ba..4f99cd5e 100644 --- a/modules/product/classes/controller/product.php +++ b/modules/product/classes/controller/product.php @@ -55,7 +55,7 @@ class Controller_Product extends Controller_TemplateDefault { $co = ORM::factory('product_category',$_GET['cid']); // If the product category doesnt exist, or doesnt match the product - if (! $co->loaded() OR ! in_array($co->id,unserialize($po->avail_category_id))) + if (! $co->loaded() OR ! in_array($co->id,unserialize($po->avail_category))) Request::current()->redirect('product_category/index'); Breadcrumb::name('product/view',$co->name); diff --git a/modules/product/classes/model/product.php b/modules/product/classes/model/product.php index fce47fde..d02cff5e 100644 --- a/modules/product/classes/model/product.php +++ b/modules/product/classes/model/product.php @@ -23,7 +23,6 @@ class Model_Product extends ORMOSB { protected $_sorting = array( 'position'=>'asc', - 'sku'=>'asc', ); protected $_display_filters = array( @@ -121,10 +120,16 @@ class Model_Product extends ORMOSB { public function show_thumb() { $mediapath = Route::get('default/media'); - $thumb = $mediapath->uri(array('file'=>'img/thumbnails/'.$this->thumbnail)); + $thumbfile = sprintf('prod_thmb_%s',$this->id); - // @todo Change the ALT to the product name. - echo HTML::image($thumb,array('alt'=>_('Thumb Nail'))); + // @todo This needs to be optimised. By nice if find_files could return the HTML path too. + if (Kohana::find_file('media/img/thumbnails',$thumbfile,'png')) { + $thumb = $mediapath->uri(array('file'=>'img/thumbnails/'.$thumbfile.'.png')); + + // @todo Change the ALT to the product name. + echo HTML::image($thumb,array('alt'=>_('Thumb Nail'))); + } else + echo ''; } /** @@ -149,7 +154,7 @@ class Model_Product extends ORMOSB { $results = array(); foreach ($this->where('active','=',TRUE)->find_all() as $po) { - if ($c = unserialize($po->avail_category_id) AND in_array($cat,$c)) + if ($c = unserialize($po->avail_category) AND in_array($cat,$c)) array_push($results,$po); } diff --git a/modules/product/views/product/view.php b/modules/product/views/product/view.php index 9835c1e8..c9a72a78 100644 --- a/modules/product/views/product/view.php +++ b/modules/product/views/product/view.php @@ -28,22 +28,22 @@ echo Form::open('cart/add');
description_full; ?> | -thumbnail) $record->show_thumb(); ?> | +show_thumb()) echo $a; ?> | |
'.$pio->product_view($record->prod_plugin_data).' | '; } ?>|||
'.$pio->contract_view($record->prod_plugin_data,$record->price_base,$record->price_setup).' | '; } ?>|||
'.$pio->feature_summary().' | '; @@ -53,11 +53,11 @@ echo Form::open('cart/add');|||
SKU | +Recurring Billing Schedule | Currency | |
sku;?> | +@@ -72,14 +72,6 @@ echo Form::open('cart/add'); | price_type);?> | taxable);?> |
Recurring Billing Schedule | -- | ||
- | - |
display('cert'); ?>
cert; ?>