Hi
i created a product has 1 stock. but if i click two times to add to cart button. it adds two products to cart. it is very big problem because there is only 1 product.
if product has 1 stock. it shoudnt sale two. when i click to add to cart button stock must be '0' untill logout end.
sorry about broken english but it is relly big trouble for me.
besides if i confirmed the cart but didnt finished the proses. ( i mean no credit cart confirm, no sale, stocks is changing)
Hi,
http://forum.virtuemart.net/index.php?topic=108215.msg362064#msg362064
But actually you didn't mention your joomla and virtuemart version you are using.
Regards
j2.5 vm 2.10
did you read the post after all? did you solve it?
no i couldnt solve it. The posts dont show a solution for me. they recommend notify option but notify option doesnt stop double order. you can still buy a product twice time which doesnt exist in stock
someone say something about cart.php but i couldnt understand it
For me is working. just testing it again. When i click again add-to-cart does not let me to add it twice.
i tried again again and again. when i click the add to cart button second time it adds to cart second product. when i click third time. it adds 3 products
please click http://shop.ng-style.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=2746&virtuemart_category_id=14 (http://shop.ng-style.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=2746&virtuemart_category_id=14)
and see
(by the way. thanks for quick help)
Hello,
i think the problem is that you have commend the quantity box controls from product page that includes code for the validation. if you want to hide them it's better to use css and not commend them.
Please test it again with the right configuration and by restoring the lines you commented on the productdetails template (addtocart).
Regards
i already use css to remove quantity. now i upload the original vm product detail page. problem still there. should i use original css too.
thanks again
i remove "language Javascript Fix"
i think it s okey now
hi,
i don't think original CSS you cause any issues. I tested many times on two installations and is working (2.0.10 and 2.0.11e).
I have configure the product status as: In Stock:2, Booked:0, Low stock: 1, max product quantity:nothing
Then under configuration -> shopfront on the Action when a Product is Out of Stock i have select Displays 'Notify Me' instead of 'Add To Cart' button.
Test it and works fine.
Quote from: ntunay on October 03, 2012, 10:26:30 AM
i remove "language Javascript Fix"
i think it s okey now
hmm ... didn't see any javascript issues on your site but didn't check if something misses. Also you will need "Using the product Scripts". Some time languages is an issue.
So, you find the solution :)
i guess i did :)
but quantity button came back :o
i didnt understand why
hide it with CSS and clean your browser cache, i think you have commented that lines inside your template
i dont know why its not working again.
i really dont know what is wrong. it is adding again out of stock product
i installed vm 2.10 again. noting is changed
hi,
as you told before you think was working without template overrides?
i don't know why this happen on your installation. Can you try on a test product without custom fields or any child products?
i created a dummy product witout child product or custom field . it works.
ok,
So, there is an issue with the child products i suppose because may be there is stock available ...
Try now with your custom fields without child products. If it is working them try to select from the backend Do not Display Product, if child products also out of stock, to see what happens.
It could be a bug, or may be something that haven't been tested.
Regards
take a look here: http://forum.virtuemart.net/index.php?topic=100480.0
and here:
http://forum.virtuemart.net/index.php?topic=102211.msg339667#msg339667
http://forum.virtuemart.net/index.php?topic=99299
i add my dummy product a custom field. and problem back. i think problem is the custom field
Hi,
Check the posts i gave you before
Regards
ok i read the post and i already made custom fiels this way.
addtocart.php has these code
$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>
but if i remove this code ($this->product->product_in_stock - $this->product->product_ordered) < 1)
noting is changing.
shopfunctionsf.php has these code
public function getAddToCartButton($orderable){
if($orderable){
$html = '<input type="submit" name="addtocart" class="addtocart-button" value="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" title="'.JText::_('COM_VIRTUEMART_CART_ADD_TO') .'" />';
} else {
$html = '<input name="addtocart" class="addtocart-button-disabled" value="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" title="'.JText::_('COM_VIRTUEMART_ADDTOCART_CHOOSE_VARIANT') .'" />';
}
return $html;
}
and cart.php has these
if ($stockhandle!='none' && $stockhandle!='risetime') {
$productsleft = $product->product_in_stock - $product->product_ordered;
// TODO $productsleft = $product->product_in_stock - $product->product_ordered - $quantityincart ;
if ($quantity > $productsleft ){
if($productsleft>0 and $stockhandle='disableadd'){
$quantity = $productsleft;
$errorMsg = JText::sprintf('COM_VIRTUEMART_CART_PRODUCT_OUT_OF_QUANTITY',$quantity);
$this->setError($errorMsg);
vmInfo($errorMsg.' '.$product->product_name);
// $mainframe->enqueueMessage($errorMsg);
} else {
$errorMsg = JText::_('COM_VIRTUEMART_CART_PRODUCT_OUT_OF_STOCK');
$this->setError($errorMsg); // Private error retrieved with getError is used only by addJS, so only the latest is fine
// todo better key string
vmInfo($errorMsg. ' '.$product->product_name);
// $mainframe->enqueueMessage($errorMsg);
return false;
}
}
}
i strugled with these codes but i coulnt find the codes which make stock control for child products or main products
i think it is controling main products stock situation not child products
i add these code
<?php echo JHTML::link($product->link, $this->product->product_in_stock); ?>
to see stock on the page bu t is shows main product stock. what is the child product stock code
sorry it took so much. but i am really deperate
is there anyone who can help me?
It is a virtuemart problem because i tried on another site. Child product has no stock control
Hello,
I think is not working with child products ... someone else if have the solution could help you out with that.
I think in vm2.2 this will have been corrected but i am not sure.
did you try 2.0.12d?
Regards
Same issue here. I tested with vm 2.0.18a and still same bug. If you have a child product with stock variant then you can add it multiple times in cart no matter if its stock goes empty.
I tested the same thing with the ordinary single product without children and there "add to cart" doesn't actually add the product in cart if quantity is beyond stock.
Anyone has ever found a solution for this?
Thanx