Author Topic: Cant' add more child products!  (Read 921 times)

untiponormale

  • Beginner
  • *
  • Posts: 4
Cant' add more child products!
« on: October 26, 2015, 22:40:11 pm »
Hello, I'm trying to set up an ecommerce with a large variety of attributes and the final price depending on the options selected, as you can see here:
http://www.latipografiaonline.net/vina_bonnie_v2.1_for_Joomla_v3.4.1/volantini/volantini-a5-1-detail
I found very useful the new multivariant approach, but I'm experiencing some problems after creating around 145 child products (while I needed to reach something as 550 different combinations  :-\)
If I try to add some other child products it just redirect me to virtueMart dashboard without saving...

Do you know anything about this issue?

PS: I could also have less child products combinations turning the two last multivariant ramifications , "Tipo di carta" and "Servizi Grafici", into simple string custom fields, because their value don't affect the final price. However the problem in this scenario is that if a customer changes one of the multivariant fields, the value of the string custom fields is reset to their default. Is there a way to "remember" the customer choice of these attributes?

FDT

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Cant' add more child products!
« Reply #1 on: February 21, 2017, 11:56:31 am »
Cant' add more then 110 child products, i have the same problem, please help (VirtueMart 3.0.19)

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2265
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Cant' add more child products!
« Reply #2 on: February 22, 2017, 02:45:36 am »
In the product model loop. The problem is here :
Code: [Select]
while (!empty($child->product_parent_id)) {
$runtime = microtime (TRUE) - $this->starttime;
if ($runtime >= $this->maxScriptTime) {
vmdebug ('Max execution time reached in model product getProduct() ', $child);
vmError ('Max execution time reached in model product getProduct() ' . $child->product_parent_id);
break;
}
else {
if ($i > 10) {
vmdebug ('Time: ' . $runtime . ' Too many child products in getProduct() ', $child);
vmError ('Time: ' . $runtime . ' Too many child products in getProduct() ' . $child->product_parent_id);
break;
}
}

If you use more then 10 level the loop stop or max execution time

Another problem can be this :
Code: [Select]
if ($this->memory_limit<$mem = memory_get_usage(FALSE)) {
vmdebug ('Memory limit reached in model product getProduct('.$virtuemart_product_id.'), consumed: '.round($mem,2).'M');
vmError ('Memory limit reached in model product getProduct() ' . $virtuemart_product_id);
return false;
}

Your server have to low memory to support so many products. If you can (no stock) try to use other custom fields, this can save memory and execution time too.

FDT

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Cant' add more child products!
« Reply #3 on: February 23, 2017, 10:15:12 am »
Thanks for reply i ll try do it

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Cant' add more child products!
« Reply #4 on: February 24, 2017, 07:59:33 am »
Patrick, 10 levels,... means 10 parents. But you can have 550 variants with only one parent. So the problem is not there. It is more likely a memory issue.

When people reported this problem, the number is always different. So it seems to be a problem with either the server OR browser (needs to send the form). It can also be the maximum POST limit. it could also make sense to split the whole thing. Create a parent with the two options "Tipo di carta" and "Servizi Grafici", with a generic child variant. Use this both products to add your Multivariant.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2265
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Cant' add more child products!
« Reply #5 on: February 24, 2017, 11:37:00 am »
Max, you mean i'm an idiot ?
I can read the code and know that this is 10 parent > child levels

FDT

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Cant' add more child products!
« Reply #6 on: March 13, 2017, 14:26:39 pm »
Hi, need help
What can be done to correct the problem? You wrote that can be a problem with the server OR browser. We have a dedicated server with good parameters, up to the latest updates on version 3.16, we added more than 200 products. But now not more than 110. Tanks for reply

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2265
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Cant' add more child products!
« Reply #7 on: March 13, 2017, 16:13:11 pm »
Hi FDT,
VM 3.16 do not exist, so i suppose vm 3.0.16 and last direct update is vm 3.0.18.
Because 3.0.18 have some bugn best is to use 3.0.18.6 or beta 3.0.19.6.
Of course try this on a copy and not live site, because this can break plugins,template layouts or other extensions using Virtuemart.
In some server, max allowed memory is set to 128M as default, check if you can set this to 512M.
Another problem can be PHP max_post_size, or max upload size.
You can change this mostly in your server panel in PHP settings
or
php.ini
post_max_size=8M
upload_max_filesize=8M

.htaccess, httpd.conf or virtualhost
php_value post_max_size 8M
php_value upload_max_filesize 8M

Another problem can be max_input_vars to.


FDT

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Cant' add more child products!
« Reply #8 on: March 23, 2017, 08:39:48 am »
Hi,
Thanks for all replies
we found the solution
First we increased the memory size for:
Memory_limit = 256M
Post_max_size = 256M
Upload_max_filesize = 256M
But it didn't help.

When the size of this variable was increased max_input_vars to 10,000, our problem is solved.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Cant' add more child products!
« Reply #9 on: March 23, 2017, 14:02:07 pm »
It is fixed in vm3.2.1, the reason was a too small customfield_params column in the database. Changed to text now.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/