Hi OpenGlobal,
I think i'm in the right place now

Using latest VM 2.0.12
I have an odd error that I am trying to track down, not sure if its a bug or configuration. I am using productdetails overrides:
TEMPLATE/html/com_virtuemart/productdetails
default.php
default_addtocart.php
default_showprices.php
here is the overview:
1. I added a Custom field of type plugin in virtuemart, VM custom stockable variants, here I added various flavours, e.g. lemon, orange, raspberry etc as a dropdown list.
2. Next I found I had to create some child products, even though I already had these from migration of vm 1.19, anyway not too worried about this, too much DB hacking will probably take more time than actually adding new child products. I like the way I can add different flavours and only use the ones I want to to be mapped to the specific products that I need to have flavours for, or at least it seems this way currently.
3. Next I started testing the functionality, everything seems to works fine, if my products have a quantity greater than 0. I can also add the new child product to the cart.
4. Until, consider the following example:
4a. Raspberry has 0 stock, lemon and orange have greater than 0 stock
4b. I select Raspberry and the Notifyme link appears, which is correct and how I want it to work
4c. Next I select Lemon, but this time instead of having a value of '1' I have a value of 'undefined', if i refresh my web browser, the value is reset to '1' again (and so is the flavour ::EDIT:: no this is not true sorry, refresh keeps the flavour name but puts a 1 in the quantity box), in this state of 'undefined' I am unable to add the product to the cart.
Therefore it is the change back from Notifyme to a product that has stock where the problem occurs.
I tracked it down in Firebug to:
<div class="addtocart-bar"><span class="quantity-box"><input class="quantity-input js-recalculate" type="text" value="undefined" name="quantity[]"></span><span class="quantity-controls js-recalculate">
My default_addtocart.php override for displaying the quantity box looks like:
<?php // Display the quantity box
$stockhandle = VmConfig::get('stockhandle', 'none');
if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($this->product->product_in_stock - $this->product->product_ordered) < 1) {
?>
<a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id='.$this->product->virtuemart_product_id); ?>" class="notify"><?php echo JText::_('COM_VIRTUEMART_CART_NOTIFY') ?></a>
<?php } else { ?>
<!-- <label for="quantity<?php echo $this->product->virtuemart_product_id; ?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
<span class="quantity-box">
<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if ( isset($this->product->min_order_level) && (int) $this->product->min_order_level > 0) {
echo $this->product->min_order_level;
} else {
echo '1';
} ?>" />
</span>
<span class="quantity-controls js-recalculate">
<input type="button" class="quantity-controls quantity-plus" />
<input type="button" class="quantity-controls quantity-minus" />
</span>
<?php // Display the quantity box END ?>
All my products and child products have a minimal purchase quantity of 1 and I have tried changing this override but with not much success so far, e.g. removed, changed, adapted the following:
<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int) $this->product->min_order_level > 0) { echo $this->product->min_order_level; } else { echo '1';} ?>" />
Maybe I am completely overlooking something,
Any help on this would be most appreciated
Cheers
d_a_w_g_y
[attachment cleanup by admin]