Skip to content
Snippets Groups Projects
Commit c15e79b5 authored by Demian Katz's avatar Demian Katz
Browse files

Replaced explicit \VuFind\Cart calls with cart() view helper.

parent f389cc39
Branches
Tags instance/fid_adlr/staging/20200513
No related merge requests found
<? $account = $this->layout()->account; ?> <? $account = $this->layout()->account; ?>
<a id="logo" href="<?=$this->url('home')?>"></a> <a id="logo" href="<?=$this->url('home')?>"></a>
<div id="headerRight"> <div id="headerRight">
<? $cart = \VuFind\Cart::getInstance(); if ($cart->isActive()): ?> <? $cart = $this->cart(); if ($cart->isActive()): ?>
<div id="cartSummary" class="cartSummary"> <div id="cartSummary" class="cartSummary">
<a id="cartItems" title="<?=$this->transEsc('View Book Bag')?>" class="bookbag" href="<?=$this->url('cart-home')?>"><strong><span><?=count($cart->getItems())?></span></strong> <?=$this->transEsc('items')?> <?=$cart->isFull() ? '(' . $this->transEsc('bookbag_full') . ')' : ''?></a> <a id="cartItems" title="<?=$this->transEsc('View Book Bag')?>" class="bookbag" href="<?=$this->url('cart-home')?>"><strong><span><?=count($cart->getItems())?></span></strong> <?=$this->transEsc('items')?> <?=$cart->isFull() ? '(' . $this->transEsc('bookbag_full') . ')' : ''?></a>
<a id="viewCart" title="<?=$this->transEsc('View Book Bag')?>" class="viewCart bookbag offscreen" href="<?=$this->url('cart-home')?>"><strong><span id="cartSize"><?=count($cart->getItems())?></span></strong> <?=$this->transEsc('items')?><span id="cartStatus"><?=$cart->isFull() ? $this->transEsc('bookbag_full') : '&nbsp;'?></span></a> <a id="viewCart" title="<?=$this->transEsc('View Book Bag')?>" class="viewCart bookbag offscreen" href="<?=$this->url('cart-home')?>"><strong><span id="cartSize"><?=count($cart->getItems())?></span></strong> <?=$this->transEsc('items')?><span id="cartStatus"><?=$cart->isFull() ? $this->transEsc('bookbag_full') : '&nbsp;'?></span></a>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
$this->headScript()->prependScript("path = '" . rtrim($this->url('home'), '/') . "';"); $this->headScript()->prependScript("path = '" . rtrim($this->url('home'), '/') . "';");
// Deal with cart stuff: // Deal with cart stuff:
$cart = \VuFind\Cart::getInstance(); $cart = $this->cart();
if ($cart->isActive()) { if ($cart->isActive()) {
$this->headScript()->appendFile("jquery.cookie.js"); $this->headScript()->appendFile("jquery.cookie.js");
$this->headScript()->appendFile("cart.js"); $this->headScript()->appendFile("cart.js");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment