Hello,
I have a problem or two.
I have 2 products with a lot of variations, 224 varations for product 1 and 112 variations of product 2.
I know that these are a lots of variations but the customer has a necklace with 4 colors, 28 letters/simbols, 2 sizes (4*28*2 = 224 SKUs) and a bracelet with 4 colors and 28 letters/simbols (4*28 = 112 SKUs).
On the product page it seems to work, but I've created a view with all product variations (SKU1, SKU2, SKU3..) each one with the Add2Cart form inline..so there are about 9 (items per page) Add2Cart rendered in page.
I can see the view result, the forms renders, but if I try to change a value in one of these Add2Cart forms the ajax response show a php memory exausted error, I've tried also bringing the php memory to 1GB but it still breaks. The same happens if I refresh the view with Ajax changing the exposed sorting select.
Maybe via Ajax the form is plenty of unecessary data?
The same issue reflects in a HUGE data cached inside the cache_form table, trying to set no_cache = true to the form breaks it.
Must be the Add2Cart form generation code optimized?
Thanks for any help.
Comments
Comment #1
rszrama commentedI'm not sure - we have a live site that regularly renders Add to Cart forms referencing thousands of products, so even with all of yours on the same page it wouldn't come close to the memory requirements of our larger sites. I doubt they're running PHP at 1G+ RAM. That said, when you upped the memory limit, did you look in your Drupal status report to ensure the limit increase worked?
If we're to determine if this is actually a bug in Commerce, we're going to need more information... but I'm not really sure what to ask for. Can you pursue this further and see what leads you turn up? Nothing you've presented sounds like a normal cause for concern, but you might look into related issues pertaining to multiple Add to Cart forms on the same page.
Comment #2
reysharks commentedCan I see the site you're talking about with thousand of SKUs on the same add2cart form?
I'll give you more infos soon, maybe it's a contributor module to raise the memory...
The mem raise worked 'cause I received a memory exausted error of 1gb instead of 512mb :P
Comment #3
rszrama commentedAhh, ok. Missed that. : )
Check out http://www.eurocentres.com for mega Add to Cart forms.
Comment #4
bojanz commentedPossibly related: #1863776: Don't store the full node in the add to cart form state.
Comment #5
reysharks commentedNice suggestion, but no..it didn't solve my problem, but it could be related..
Comment #6
bojanz commented#2819375: Do not make entries in "cache_form" when viewing forms that use #ajax['callback'] (Drupal 7 port)