Uzair007 Posted November 15, 2013 Share Posted November 15, 2013 I want the customer to order his/her products if it is currently not in the stock but also want to show him/her a message that your product will be delivered in 8 weeks. Plz plz help me ASAP Quote Link to comment Share on other sites More sharing options...
bsmither Posted November 15, 2013 Share Posted November 15, 2013 Welcome Uzair007! Glad to see you made it to the forum. Is this message to be shown on a "per-product" basis? That is, only "Widget", currently out of stock, can be delivered in 8 weeks. The out of stock product, "Wabbit", however, cannot. If this message can be applied globally, then there are at least two edits: the skin template file content.product.php and the class file catalogue.class.php. In content.product.php, find where you want the message to appear, and add: {if $CTRL_OUT_OF_STOCK}Put your message here.{/if} In catalogue.class.php, near line 220, starts the logic to set the 'out' flag that indicates whether a product is out of stock. The 'out' flag is initially set to false. Then, a test is made to determine if this product must be handled according to its stock level -- 'use_stock_level'. For this to work, you must enable Use Stock Level in the product's Edit screen. If we are using stock levels to allow/disallow purchasing, there follows a pair of nested tests -- is the stock level zero, then if so, is an out of stock item allowed to be purchased. If not, set 'out' to true and 'allow_purchase' to false. We need to set 'out' to true regardless of whether to allow an out of stock item to be purchased. Near lines 221-228, find: if ((int)$stock_level <= 0) { // Out of Stock if (!$GLOBALS['config']->get('config', 'basket_out_of_stock_purchase')) { // Not Allowed $allow_purchase = false; $out = true; } } Change to: if ((int)$stock_level <= 0) { // Out of Stock $out = true; if (!$GLOBALS['config']->get('config', 'basket_out_of_stock_purchase')) { // Not Allowed $allow_purchase = false; } } For completeness, also near lines 889-896, find:if ((int)$stock_level <= 0) { // Out of Stock if (!$GLOBALS['config']->get('config', 'basket_out_of_stock_purchase')) { // Not Allowed $product['ctrl_purchase'] = false; $product['out'] = true; } } Change to:if ((int)$stock_level <= 0) { // Out of Stock $product['out'] = true; if (!$GLOBALS['config']->get('config', 'basket_out_of_stock_purchase')) { // Not Allowed $product['ctrl_purchase'] = false; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.