I tried commenting out the stock conditional test code to force "add to cart" to display, but no luck. I put this edited tpl_document_register_info_disply.php in the custom template overrides folder, but it has no effect. Right now, the only way I can get the add-to-cart button to display for my virtual product is by faking a quantity in stock.
includes/templates/[MY CUSTOM TEMPLATE]/templates/tpl_document_register_info_display.php
Code:
<?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>' : '');
// DIANAB COMMENT don't hide quantity box!
// 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);
// } //this is part of the if/else hide quantity box
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php //if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty;
echo $display_button;
?>
</div>
<?php //} // display qty and button ?>
Bookmarks