I have an ecommerce site that I did not build but I am editing. I have 3 categories that I do not want the “add to cart” button and the “qty” button to show up. I want it to display a message instead. I have been successful with doing this with 1 of the categories but can not come up with the correct combination of code to get it to work for all 3 categories. Any help would be appreciated.
[php]// Add to cart or login
if (hasAccessByLevel(6, ‘LTE’, $userName) && $cat != “jewelry”){
if (isset($error)) {
echo ("<div class=“error”>
$error
“);
}
echo(”<form name=“addtocart” method=“post” action=“plugins/addtocart.php” id=“addtocart”><input name=“sku” type=“hidden” value="$product[sku]"/>");
if (isset($cat)){
echo("<input name=“category” type=“hidden” value="$cat"/>");
}
if (!empty($eCatalogReturnURL)){
echo("<input name=“eCatalogReturnURL” type=“hidden” value="$eCatalogReturnURL"/>");
}
echo("
<input name=“qty” type=“text” id=“qty” value="$product[minimum]" maxlength=“4” style=“width:40px; margin-left:5px; margin-bottom:10px;”/> |
<input type=“submit” name=“addtocart” value=“Add to Cart” class=“btn”/>");
if (!empty($eCatalogReturnURL)){
echo(“
If add to cart is successful, you will be redirected back to the flip-page catalog.
”);}
} else {
if ($cat == “jewelry”) {
echo (“Please contact customer service to purchase Boutique items.”);
}
elseif ($displayType == "full") {
echo("<h3>You must log in to purchase this item:</h3><a class=\"btn\" href=\"register.php\" style=\"margin-right:7px;\" >Register</a><a class=\"btn\" href=\"login.php\">Log in</a>");
} elseif ($displayType == "basic") {
echo("<h3>You must log in to purchase this item:</h3><a class=\"btn\" href=\"javascript:self.close();\" onclick=\"window.opener.location.href='register.php';\" style=\"margin-right:7px;\" >Register</a><a class=\"btn\" href=\"javascript:self.close();\" onclick=\"window.opener.location.href='login.php';\">Log in</a>");
}
}
echo ("");[/php]