Author Topic: What bugs do you know of in stockable variants plugin  (Read 167656 times)

farangprod

  • Beginner
  • *
  • Posts: 17
Re: What bugs do you know of in stockable variants plugin
« Reply #300 on: October 04, 2013, 17:58:03 pm »
I can't replicate your problem. I can't order any 10m2 ones. I can order 4 black 4m2 and 2 white 4m2.

OpenGlobal E-commerce

i have updated vm to 2.0.24 and now, you're right, idon't have this problem anymore... i just can add 10 items in cart even if i have only 2 in stock!

Florentp

  • Jr. Member
  • **
  • Posts: 86
Re: What bugs do you know of in stockable variants plugin
« Reply #301 on: October 15, 2013, 15:55:40 pm »
Something weird that i never complain about before... The fact that stockable variants plugin add thousands of javascript lines in my categories pages.
For example on this page : beta.indienboutique.fr/fr/homme/t-shirts

Stockable variants plugin add like 4000 javascript lines on the page ! It's huge !
Can it be lighter, or maybe in a separated file ?
Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique

OpenGlobal

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 316
    • OpenGlobal E-commerce Web Design in Gloucester
Re: What bugs do you know of in stockable variants plugin
« Reply #302 on: October 15, 2013, 16:01:36 pm »
Unfortunately no. Because you can order from the category page, every product needs to have it's javascript added to the category page too.

The ability to order from the category page was added fairly recently compared to the stockable functionality. It would be better to rewrite the whole stockable plugin so that the javascript doesn't need to be added for each product individually. But we're intending to rewrite the Generic Cart Variant to combine the functionality instead.

OpenGlobal E-commerce

Florentp

  • Jr. Member
  • **
  • Posts: 86
Re: What bugs do you know of in stockable variants plugin
« Reply #303 on: October 15, 2013, 16:55:27 pm »
What about add an option to active or unactive the insert of javascript code for website like mine,
which are not using a "add to cart" fuction directly from category page ?
Web programmer. Passionate.
PHP, SQL, Javascript, JQuery, css.
Skype : florent.indienboutique

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #304 on: October 30, 2013, 13:03:50 pm »
Hi,

I have just upgraded to 2.0.24 and I have this problem with stockable.php:

If you are using stockable variants and have got 5 T-shirts, 2 black and 3 white. If you select 3 black, it will add only 2 (which is ok), but if you Add to Cart again, you get 4 into the cart (which is wrong), It never should be more than 2 and a "Notify me" sign should show up. I have already set this option in VM>Configuration

I have tried this code below but If I use it I get a blank page in 2.0.24

Is it any way to solve this issue? Thanks

Quote
For those who also want to prevent users from adding more items than you have in stock to their cart (by clicking the Add to Cart button multiple times), change the plgVmOnAddToCart() function in stockable.php (near the end of the file) to the following:
Code: [Select]
public function plgVmOnAddToCart(&$product){
$customPlugin = JRequest::getVar('customPlugin',0);

if ($customPlugin) {
$db = JFactory::getDBO();
$query = 'SELECT  C.* , field.*
FROM `#__virtuemart_customs` AS C
LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
WHERE `virtuemart_product_id` =' . $product->virtuemart_product_id.' and `custom_element`="'.$this->_name.'"';
$query .=' and is_cart_attribute = 1';
$db->setQuery($query);
$productCustomsPrice = $db->loadObject();
if (!$productCustomsPrice) return null;
// if ( !in_array($this->_name,$customPlugin[$productCustomsPrice->virtuemart_custom_id]) ) return false;
$selected = $customPlugin[$productCustomsPrice->virtuemart_customfield_id]['stockable']['child_id'];

if (!$child = $this->plgVmCalculateCustomVariant($product, $productCustomsPrice,$selected) ) return false;
if ($child->product_sku)
$product->product_sku = $child->product_sku;
if ($child->product_name)
$product->product_name = $child->product_name;
$product->product_in_stock = $child->product_in_stock;

$this->stockhandle = VmConfig::get('stockhandle','none');
if ('disableit' == $this->stockhandle || 'disableit_children' == $this->stockhandle || 'disableadd' == $this->stockhandle) {
if (!class_exists ('VirtueMartCart')) {
require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php');
}
$cart = VirtueMartCart::getCart ();print_r($product);print_r($cart);

$orderedQuantity = $product->quantity;
foreach ($cart->products as $cartProduct) {
if ($cartProduct->virtuemart_product_id == $product->virtuemart_product_id) {
$orderedQuantity += $cartProduct->quantity;
if ($orderedQuantity > $product->product_in_stock) {
return false;
}
}
}
}
}
}
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

OpenGlobal

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 316
    • OpenGlobal E-commerce Web Design in Gloucester
Re: What bugs do you know of in stockable variants plugin
« Reply #305 on: October 30, 2013, 22:28:09 pm »
Here is the latest version that I have, not sure if this is the same as 2.0.24.

OpenGlobal E-commerce

[attachment cleanup by admin]

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #306 on: October 31, 2013, 12:30:46 pm »
Thanks OpenGlobal,

I have changed my stockable.php for yours but the product doesn't get added to the cart and I get a pop up saying "Continue shopping - Undefined" and nothing happens.  :P
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

OpenGlobal

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 316
    • OpenGlobal E-commerce Web Design in Gloucester
Re: What bugs do you know of in stockable variants plugin
« Reply #307 on: October 31, 2013, 15:01:36 pm »
Can you give me a link.

OpenGlobal E-commerce

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #308 on: November 01, 2013, 13:11:44 pm »
Here's a link with an example   :)

I have also noticed that after update to 2.0.24 prices don't show up in the product page (as you'll see in the linked page)
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3579
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: What bugs do you know of in stockable variants plugin
« Reply #309 on: November 01, 2013, 13:35:34 pm »
Hello :)

Works good with Firefox 25.0 and with Explorer 8.06, both on Windows XP. But the first product takes a veeeeery long until it drops into the basket on IE 8.
I can add both verde and bianco versions of the skateboards. New lines added for each addition. But the price is hidden though.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #310 on: November 01, 2013, 13:53:07 pm »
Thank you Jörgen,

The problem is that now I have a stock of 3 products in green and 5 in blue. If you press "Add to cart" again and again, it will add them regardless of the real available stock.


Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3579
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: What bugs do you know of in stockable variants plugin
« Reply #311 on: November 01, 2013, 14:08:41 pm »
Hello Limonbay

I thought Your last reply said "Continue shopping - Undefined", so I didn´t check the stock values.

I can only add 2 of the blue = blanco ???, shouldn´t it say white ???
and 3 of the green = verde at one time, but repeatedly I can add this time after time into the shopping cart.

It looks like the stock control is only executed once per row in the shopping cart, not per SKU.

I have not tested what will happen when I come to checkout, but I believe there will be a negative stock :(

regards


Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #312 on: November 01, 2013, 14:55:46 pm »
Quote
I thought Your last reply said "Continue shopping - Undefined"

That was if I use stockable.php proposed by OpenGlobal. If I use the original 2.0.24 version it has this price not shown and stock control problem.  :)
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24

OpenGlobal

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 316
    • OpenGlobal E-commerce Web Design in Gloucester
Re: What bugs do you know of in stockable variants plugin
« Reply #313 on: November 02, 2013, 15:08:33 pm »
I'm not seeing the "Continue shopping - Undefined" message on your link and it looks like all of the products have the price missing, not just the stockable plugin ones. Is it a problem iwth your template?

OpenGlobal E-commerce

Limonbay

  • Jr. Member
  • **
  • Posts: 54
  • Piercing life
    • Piercings
Re: What bugs do you know of in stockable variants plugin
« Reply #314 on: November 02, 2013, 20:49:52 pm »
Hi OpenGlobal,

I have the same problem with joomla default template. Example
Piercings y complementos
http://www.limonbay.com
Joomla 2.5.14
Virtuemart 2.0.24