Get well soon chrome
Please can someone help me with this little problem. I don't know PHP very well at all but I've tried my best.
I'm using DPUv2 which is working great BTW! The problem is I have replaced the code from "<!--bof Add to Cart Box -->" to "<!--eof Add to Cart Box -->" in my "tpl_product_info_display.php" with this code that I got from another thread:
Code:
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
?>
<?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<?php
echo $display_qty;
?>
<div id="cartAdd" style="display:none;"> Wait ..... images are uploading ......<br>
This can take several minutes .... Please wait ...<br> <img border="0" src="/includes/templates/pc020/images/progress.gif" width="350" height="50"> </div><a href="javascript:ShowDiv()"></a> <div onclick="ShowDiv()">
<center><br>
<?
if ($pr_attr->fields['total'] > 0 && (!$_SESSION['customer_id'])) {
echo '<a href=index.php?main_page=login><b><font size="3" color="red">IMPORTANT:<br>You have to login before order this item<br>
--- Log in here ---</a></font></b>';
} else {
echo $display_button;
}
?>
</div>
</div>
<script language="javascript">
function ShowDiv()
{
document.getElementById("cartAdd").style.display = '';
}
</script>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
What it does is hides the add to cart function until the user logs in. I want this in order to prevent the user uploading files without logging in.
The problem, this has caused with DPU is that the price is displayed as 0 until the user logs in. I would like the user to be able to see the prices whether logged in or not.
I'm not very good at PHP but have played around to try and get the price to display with no luck. Does anyone have any idea if I could make this work.
Any help very much appreciated!!!
Bookmarks