Jump to content
Sign in to follow this  
poj

No_Stock_No_Checkout

Recommended Posts

Thank you for the great contribution.

However when I try to use it with my store, something's wrong.

 

When I try to edit the product_info.php as instructed, I can't find the

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

But found this instead

<td align="right" class="main"><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

So I try to edit it to

                <?php

        if ($product_info['products_quantity'] <=0) { ?>

<td align="right" class="main"><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA); ?></td>

          <?php

        } else { ?>

<td align="right" class="main"><input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

          <?php

        } ?>

 

But it didn't work.

At the product info page of every item, only show the "not avaliable" button.

 

Even the product quantity is higher than 0, it still show 'not avaliable' button.

And I can't put any product into shopping cart.

 

What have I done wrong?

anyone can help?

Thank you.

Share this post


Link to post
Share on other sites

Poj,

 

Doesn?t look like 2.2ms2 code, but your mod looks correct?

changed  ?tep_image_submit? to ?tep_image_button?

 

Since it always evaluates to ?true?

 

check around line 72, does it look like?

    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

you may need to add ?p.products_quantity? to the query

 

Juxi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×