Hi,
Have you guys use any "show sold out" contribution with sppc??
I used this ---> http://addons.oscommerce.com/info/4884 before I use SPPC 4.21a,
and its too difficult for me to use them together......so I removed this and installed SPPC.
now the SPPC is successfully installed, but I think I still need to show show out products in my site,
so I found this: http://addons.oscommerce.com/info/3076
This one seems more simple to use, but I don`t know how to mix SPPC and this sold out contribution together.......
the last file to be modified is catalog/includes/modules/product_listing.php ,
The instruction says:
Go to catalog/includes/modules/product_listing.php
Find: (about line 144)
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
Replace with:
<!-- sold out -->
$quantity = tep_db_fetch_array(tep_db_query("select products_quantity from products where products_id like '".$listing["products_id"]."'"));
$lc_align = 'right';
if (intval($quantity['products_quantity'])<1) {
$lc_text = tep_image_button('button_sold_out.gif', IMAGE_BUTTON_SOLD_OUT) . ' ';
} else {
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
}
<!-- sold out -->
But the same code is modified for SPPC......Like this
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; // EOF Separate Pricing per Customer
I tried to keep the changes that SPPC needed, and add the others codes the sold out conb needed, Like this:
//sold out start
$quantity = tep_db_fetch_array(tep_db_query("select products_quantity from products where products_id like '".$listing["products_id"]."'"));
$lc_align = 'right';
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
if (intval($quantity['products_quantity'])<1) {
$lc_text = tep_image_button('button_sold_out.gif', IMAGE_BUTTON_SOLD_OUT) . ' ';
} else {
//sold out end
}
// EOF Separate Pricing per Customer
and now ALL products shown sold out in my site!!! :'(
and anyone tell me what I did wrong???
Thanks a million!!
Fung