Deceased
- Join Date:
- Jan 2007
- Location:
- Australia
- Posts:
- 6,263
- Plugin Contributions:
- 4
Change the Qty Available from Numerical to Text
Mike_Dean:
This is what I ended up with
<?php $products_out = $products_quantity ; if ($products_out == 9999) $products_out = 'Thanks Rod, you did it'; if ($products_out == 7777) $products_out = '7-10 Days';
Sorry to tell you this, but I have just identified a possible problem. For this to work you'll need to disable the stock control, because if someone buys one of these products their counts will also be reduced and the comparisons will fail.
If you do wish to maintain stock control then the following modification will probably work:
<?php $products_out = $products_quantity ; if ($products_out >= 9000) $products_out = 'Thanks Rod, you did it'; if ($products_out >= 8000) $products_out = '7-10 Days'; You'll then need to initialise the product quantities to 9999 & 8999, etc, This will allow you to sell up to 1000 of each of these items before it starts to output the wrong information. As long as you reset the quantitys back to 9999, 8999, etc before the 1000 are sold you'll have no problem. Another solution would be to identify the code that decrements the product_quantity field and prevent it from occuring if it is one of these 'special' quantities. Cheers Rod