Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with new products


godino1

Recommended Posts

Posted

Is there any way to change/modify the below so that only new products that are not out of stock show up.

 

As i don't want out of stock items to appear in the new product page.

 

Please any help would be grateful.

 

 

$products_new_query_raw = "select p.products_id, pd.products_name, pd.products_description, p.products_quantity, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

Posted
Is there any way to change/modify the below so that only new products that are not out of stock show up.

 

As i don't want out of stock items to appear in the new product page.

 

Please any help would be grateful.

$products_new_query_raw = "select p.products_id, pd.products_name, pd.products_description, p.products_quantity, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

There is a whole routine in the shopping_cart.php to check for out of stock, but it's quite complex. If you go into admin and "deactivate" any item that is out of stock, that should do it. There is also a contribution out there that does that automatically. I went looking for it for you, but couldn't find it.

 

Search the contributions, maybe you can find a search term I didn't think of.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Posted

Thank you but i don't really want to deactivate the product because then it wouldn't show elsewhere.

 

what i want is all new products pages and modules to show all new products but no out of stocks or expected soon products to show.

 

then product listing to show all coming soon/expected, all in stock and all out of stock. Customers can use the product filter i've installed so they can separate in and out of stocks when they want.

 

plus i've installed a coming soon page. This works fine only shows item that are out of stock but are expected to come in soon.

 

So need to add some code to new products to prevent it showing all the expected soon products which have no stock at present.

Posted

Another option i was looking at was doing a instock only checkbox so tick to show only in stock lines.

 

But need help as i haven't got it working yet.

 

<?php

$products_new_array = array();

$products_new_query_raw = "select p.products_id, pd.products_name, pd.products_description, p.products_quantity, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

//if (isset($HTTP_GET_VARS['instock']))

// {

$products_new_query_raw .= "and p.products_quantity > 0 ";

}

$products_new_query_raw .= "order by p.products_date_added DESC";

 

can anyone help me out sorting out the above.

 

 

Please any help is grateful.

 

 

?>

<td align="center" class="main">

<? echo tep_draw_checkbox_field('instock', 1, false, 'onClick="this.form.submit()"') . HEADER_INSTOCK; ?></td>

</td></tr></table></form></td></tr>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...