Forums / Templates, Stylesheets, Page Layout / Help? not in stock, add to cart button gone. How to fix this?

Help? not in stock, add to cart button gone. How to fix this?

Views: 1,151

Results 1 to 2 of 2
3 Feb 2011, 3:34 AM
#1
dramacydril avatar

dramacydril

New Zenner

Join Date:
Jul 2010
Posts:
18
Plugin Contributions:
0

Help? not in stock, add to cart button gone. How to fix this?

Hi

my store:
http://www.spysecurityshop.nl

I changed a file to display stock status. (i got this from the dutch zencart forum)

What i have now:
Green image = in stock (1 to 2 days shipping)
orange image = low stock (1 to 2 days shipping)
red image = not in stock (3 to 6 days shipping)

If its in stock the "add to cart" button displays fine, but if the product is not in stock (red) then the add to cart button is gone.

I want to display the add to cart button no matter the stock status.

Does anyone know how to fix this or help me?

Thanks in advance

ps. This is what i changed:

in : public_html\includes\templates\template_default\templates\tpl_product_info_display.php

i changed:

<?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>

to:

<table border="0" cellpadding="1" cellspacing="0" width="100%"> <tbody><tr> <?php

if ($products_quantity >= 1) {
echo '<td class="voorraad" width="24"><img alt="Artikel op voorraad" src="' . $template->get_template_dir('groen.gif', DIR_WS_TEMPLATE, $current_page_base,'images') . '/groen.gif" /></td>';
echo '<td class="voorraad">' . TEXT_IN_STOCK2 . '</td>';
}
if ($products_quantity == 0) {
echo '<td class="voorraad" width="24"><img alt="Artikel op voorraad" src="' . $template->get_template_dir('oranje.gif', DIR_WS_TEMPLATE, $current_page_base,'images') . '/oranje.gif" /></td>';
echo '<td class="voorraad">' . TEXT_NO_STOCK1 . '</td>';
}
if ($products_quantity <= -1) {
echo '<td class="voorraad" width="24"><img alt="Artikel niet op voorraad" src="' . $template->get_template_dir('rood.gif', DIR_WS_TEMPLATE, $current_page_base,'images') . '/rood.gif" /></td>';
echo '<td class="voorraad">' . TEXT_NO_STOCK . '</td>';
}
?>

</tr> </tbody></table>

in: Public_html\includes\languages\dutch(of ander taal)\product_info.php

i added:
define('TEXT_PRODUCT_QUANTITY', ' aantal op voorraad');
define('TEXT_IN_STOCK2', ' deliverytime: 1 to 2 days');
define('TEXT_NO_STOCK1', ' deliverytime: 1 to 2 days');
define('TEXT_NO_STOCK', ' deliverytime: 3 to 6 days');

3 Feb 2011, 4:05 AM
#2
dramacydril avatar

dramacydril

New Zenner

Join Date:
Jul 2010
Posts:
18
Plugin Contributions:
0

Re: Help? not in stock, add to cart button gone. How to fix this?

Nevermind:smile: I have this figured out.

What i did was:

Configuration --> Stock --> Show sold out image in place of add to cart, i set this to 0.

Now i can add products to the cart no matter the stock status.