Hi - I have found a problem with search results - they all show as out of stock! I have the SPPC mod added. I have tried in vain to find the error. Can anyone point me in the right direction?
Thanks
This is a discussion on search box results within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi - I have found a problem with search results - they all show as out of stock! I have ...
Hi - I have found a problem with search results - they all show as out of stock! I have the SPPC mod added. I have tried in vain to find the error. Can anyone point me in the right direction?
Thanks
I can not see this issue on your site ... search works fine! Can you give a few more details about the issue - perhaps a screen shot showing the problem. Regards,
pgmarshall
_______________________________
Okay I see the Green Button (out of stock) - but I can not work how you got that there ... have you change the product_listing.php code (includes/modules)? Regards,
pgmarshall
_______________________________
Also your articles sections appears to have crashed! Regards,
pgmarshall
_______________________________
Hi - I changed the out of 'stock gif' to 'click here' (although you cannot click it!) as a quick work around. I think somewhere in the code it thinks that all products have a stock of 0 so puts this out of stock gif on. I imagine the error is somewhere in the SPPC code added to advanced search.php.
Like I said - this is not default osCmax code ... have you changed this? I don't know what SPPC code you are talking about being added to advanced search results? Post the contents of catalog/includes/modules/product_listing.php Regards,
pgmarshall
_______________________________
Hi - I have now looked at the product_listing.php and remember adding code to create a non clickable OUT OF STOCK button. If I change back to the original then the search function brings up the basket image for all of search results, even out of stock ones, which is an improvement. The code causing the problem in product_listing.php is in bold with a few lines either end to show where it is;
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
// out of stock - $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 ($listing['products_quantity'] != 0){
$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_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
}else{
$lc_text = tep_image_button('button_out_of_stock.gif', IMAGE_BUTTON_OUT_OF_STOCK) . ' ';
}
break;
// EOF: MOD - Separate Pricing per Customer - Added on may lines [$x]
Hope this is clear!
Hi - Managed to get it to work - had to change <> to >; and include the [Sx] which is part of SPPC thus:
If ($listing[$x]['products_quantity'] > 0){
$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_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
}else{
$lc_text = tep_image_button('button_out_of_stock.gif', IMAGE_BUTTON_OUT_OF_STOCK) . ' ';
}
Thanks for pointing me in the right direction!
Hi - Found another issue with this - if you go to admin-configuration-product listing and set display product quantity as 0 (ie do not display) then the shop part works fine; but any search will show out of stock for all products. Change it back (to 5 for example) and stock shows on the shop part still works and now the search also works.
Bookmarks