I am in the process of re-designing a client gallery site for my photography company and I'm having a bit of trouble getting a certain menu to display. This is a PHP file that is called by an include () tag in the index.php file.
Basically the main menu is working but for some reason it's not showing the cart code even though there are products in the cart. I'm assuming this is the code that's most important:
The problem is however, it's not printing anything on the page. I was worried that it may be something with the CSS; however, I can't even pull it up when I do a search of the source code that is generated off the PHP which means it's not showing up period. Does anyone know why this not working?
The full PHP file is below.
Basically the main menu is working but for some reason it's not showing the cart code even though there are products in the cart. I'm assuming this is the code that's most important:
Code:
<?php
if(($ctotal > 0)OR($cartItems > 0)==true) {
if($ctotal > 0) {
print showPrice($ctotal)." ";
}
printLinks(2, $ctotal, $cartItems);
}
?>
The problem is however, it's not printing anything on the page. I was worried that it may be something with the CSS; however, I can't even pull it up when I do a search of the source code that is generated off the PHP which means it's not showing up period. Does anyone know why this not working?
The full PHP file is below.
Code:
<?php if(( $_SESSION['pc_client_login'] !== true) || ($_SESSION['pc_client_id'] == NULL ))
{
printLinks(3, $ctotal, $cartItems);
} else {
printLinks(4, $ctotal, $cartItems);
}
?>
<?php
function printLinks($location, $ctotal, $cartItems) {
global $tr,$setup, $addOnFeature;
$links = whileSQL("pc_menu_links", "*", "WHERE link_location='$location' AND link_status='1' ORDER BY link_order ASC ");
while($link = mysql_fetch_array($links)) {
if($link['link_text_field'] == "store_top_link") {
if(isset($addOnFeature['accessories'])) {
$cs = doSQL("pc_acc_settings", "*", "");
if($cs['store_status'] == "1") {
if($lc> 0) { print " "; } $lc++;
print "<li><a href=\""; if($_REQUEST['action'] == "payment") { print $setup['url']."/"; } print "".$link['link_url']."\">".$cs['store_top_link']."</a>";
}
}
} else {
if($lc> 0) { print " "; } $lc++;
if(!empty($link['link_text_field'])) { print "<li><a href=\""; if($_REQUEST['action'] == "payment") { print $setup['url']."/"; } print "".$link['link_url']."\">".$tr[$link['link_text_field']]; } else { print "<a href=\"".$link['link_url']."\">".$link['link_text']; } print "</a>";
}
}
}
?>
<?php
if(!function_exists(photoCartIncluded)) { die("Direct file access denied"); }
if((( $_SESSION['pc_client_login'] == true) AND ($_SESSION['pc_client_id'] !== NULL ))OR(($ctotal > 0) OR ($cartItems>0))==true){ ?>
<?php if(( $_SESSION['pc_client_login'] == true) AND ($_SESSION['pc_client_id'] !== NULL ) == true) {
$client = doSQL("pc_clients", "*", "WHERE client_id='".$_SESSION['pc_client_id']."' ");
if(!empty($client['client_id'])) {
updateSQL("pc_clients", "client_last_active=NOW(), client_ip='".$_SERVER['REMOTE_ADDR']."' WHERE client_id='".$client['client_id']."' ");
}
print "</ul><br><br><h1>My Menu</h1><ul>";
printLinks(1, $ctotal, $cartItems);
}
?>
<?php
if(($ctotal > 0)OR($cartItems > 0)==true) {
if($ctotal > 0) {
print showPrice($ctotal)." ";
}
printLinks(2, $ctotal, $cartItems);
}
?>
<?php } ?>
<?php
if(customerLoggedIn()) {
$ctotal = doSQL("pc_customer_credits", "SUM(credit_amount) AS tot", "WHERE credit_customer='".$_SESSION['pc_client_id']."' ");
if($ctotal['tot']>0) { ?>
<div class=tables>
<?php
$credit_message = str_replace("[CREDIT_AMOUNT]",showPrice($ctotal['tot'])."", "".$tr['credit_statement']."");
print $credit_message;
?>
</div>
<?php } ?>
<?php } ?>