Updated OSB to work with KH 3.1
This commit is contained in:
@@ -25,11 +25,9 @@ class Controller_Cart extends Controller_TemplateDefault {
|
||||
// @todo - this should be a global config item
|
||||
$mediapath = Route::get('default/media');
|
||||
|
||||
$block = new block;
|
||||
|
||||
// If the cart is empty, we'll return here.
|
||||
if (! Cart::instance()->contents()->count_all())
|
||||
$block->add(array(
|
||||
Block::add(array(
|
||||
'title'=>_('Empty Cart'),
|
||||
'body'=>_('The cart is empty')
|
||||
));
|
||||
@@ -61,7 +59,8 @@ class Controller_Cart extends Controller_TemplateDefault {
|
||||
->set('mediapath',$mediapath);
|
||||
|
||||
// If we are a plugin product, we might need more information
|
||||
if ($item->product->prod_plugin AND method_exists($item->product->prod_plugin_file,'product_cart')) {
|
||||
// @todo If an admin, show a system message if cart_info doesnt exist.
|
||||
if ($item->product->prod_plugin AND method_exists($item->product->prod_plugin_file,'product_cart') AND Kohana::find_file('views',sprintf('%s/cart_info',strtolower($item->product->prod_plugin_file)))) {
|
||||
$output .= View::factory(sprintf('%s/cart_info',strtolower($item->product->prod_plugin_file)));
|
||||
|
||||
// @todo JS validation will need to verify data before submission
|
||||
@@ -70,14 +69,12 @@ class Controller_Cart extends Controller_TemplateDefault {
|
||||
$output .= '<div>'.Form::submit('submit',_('Checkout')).'</div>';
|
||||
$output .= Form::close();
|
||||
|
||||
$block->add(array(
|
||||
Block::add(array(
|
||||
'title'=>_('Your Items'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
$this->template->content = $block;
|
||||
|
||||
// Suppress our right hand tab
|
||||
$this->template->right = ' ';
|
||||
}
|
||||
@@ -99,7 +96,7 @@ class Controller_Cart extends Controller_TemplateDefault {
|
||||
echo Kohana::debug($cart->validate()->errors());
|
||||
|
||||
if ($cart->saved())
|
||||
Request::instance()->redirect('cart/index');
|
||||
Request::current()->redirect('cart/index');
|
||||
else
|
||||
throw new Kohana_Exception(_('There was a problem adding the item to the cart.'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user