Afternoon Jerome,
Nope, the function of the pre-order pluging is clear enough, but I want (need) to use it to overcome the fact that it is still not possible to have back-orders in Hikashop.
I do find some problems with the pre-order plugin as is.
For normal products, if product “real” quantity = 0 and the pre-order stock is exhausted the product stock message is still showing "No stock, pre-order available" instead of the normal “No stock” message.
For the product variants it is working as it should so in above situation the “No stock” message is displayed.
In both situations the add to cart button is no longer available, so that is okay.
From product_preorderclass.php
if($pre_order < 0)
$pre_order = -1;
$product->product_preorder = $pre_order;
and from productpreorder.php
if($pre_order == -1 && $qty == 0) {
$product->product_quantity = -1;
continue;
}
From the above I assume that you do allow for a negative (-1) value for the pre-order stock, since a higher negative value is turn gated to -1 and not to 0.
If I use a negative value of -1 as the preorder stock, then this will happen:
product_quantity = 0 => product_preorder = -1 => product_quantity remains 0
In the front end the total stock is shown as +1 but if you try to order it shows the not enough stock message.
product_quantity = +1 => product_preorder = -1 => product_quantity will now show +1
In the front end the total stock is shown as +2 and as soon as you sell one item the you get the not enough stock message if you try to order the last showing item.
I did test this with Joomla 3.8.6 Protostar and Beez3 template, HikaShop Business 3.3.0 and PHP Version 5.4.16
It's not that I want to be nitpicking or maybe I am just stupid, but it seems to me that it's not working as it should.