File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ // Check to see if the cart is in the session data else default to null.
3+ // We do this because the $cart and $count variables are used extensively
4+ // below and will output warnings if we don't.
5+ if (isset ($ _SESSION ['cart ' ])) {
6+ $ cart = $ _SESSION ['cart ' ];
7+ $ count = count ($ cart );
8+ } else {
9+ $ cart = '' ;
10+ $ count = 0 ;
11+ }
12+ ?>
113 <div class="menu-wrap">
214 <div id="mobnav-btn">Menu <i class="fa fa-bars"></i></div>
315 <ul class="sf-menu">
3244 </li>
3345 </ul>
3446 <div class="header-xtra">
35- <?php
36- $ cart = $ _SESSION ['cart ' ];
37- $ count = count ($ cart );
38- ?>
3947 <div class="s-cart">
4048 <div class="sc-ico"><i class="fa fa-shopping-cart"></i><?php
4149 if ($ count !== 0 ) {
4452 <div class="cart-info">
4553 <small><?php
4654 if ($ count !== 0 && $ count !== 1 ) {
47- echo 'You have <em class="highlight"> ' . count ( $ cart ) . ' items</em> in your shopping cart. ' ;
55+ echo 'You have <em class="highlight"> ' . $ count . ' items</em> in your shopping cart. ' ;
4856 } else if ($ count === 1 ) {
4957 echo 'You have <em class="highlight"> 1 item</em> in your shopping cart. ' ;
5058 } else {
5462 <br>
5563 <br>
5664 <?php
57- $ count = count ($ _SESSION ['cart ' ]);
5865 if ($ count !== 0 ) {
5966 foreach ($ cart as $ key => $ value ) {
6067 $ navcartsql = "SELECT * FROM `products` WHERE `id`= $ key " ;
7784 } ?>
7885 <div class="ci-total">Subtotal: <?php echo getenv ('STORE_CURRENCY ' ) . $ cartTotal ; ?> </div>
7986 <div class="cart-btn">
80- <a href="<?php echo getenv ('STORE_URL ' ); ?> /cart.php">View Bag </a>
87+ <a href="<?php echo getenv ('STORE_URL ' ); ?> /cart.php">View Cart </a>
8188 <a href="<?php echo getenv ('STORE_URL ' ); ?> /checkout.php">Checkout</a>
8289 </div>
8390 <?php
You can’t perform that action at this time.
0 commit comments