Mark-Tomlinson / markup-by-attribute-for-woocommerce

Price markup by attribute term for WooCommerce
GNU General Public License v3.0
3 stars 3 forks source link

Variation Limit #16

Closed joshua295 closed 3 years ago

joshua295 commented 4 years ago

When I get to anymore than 550 variations the plugin doesn't seem to update the prices correctly. They all reset to the regular price. Is there anything that can be done to get past this? Thanks.

Mark-Tomlinson commented 4 years ago

Is it possible for you to check your debug.log and see if the task is timing out or taking another fatal error? I've discovered that WooCommerce is not well-equipped to handle more than a few hundred variations. My personal test system can't handle more than 350 variations -- even without the plugin. I typically hit a maximum execution time limit while writing to the database in wp-db.php.

Meanwhile, I'll try to recreate what you are seeing, so we can see if there is a possible fix. How many variations do you have? How many attributes, and how many options with each?

joshua295 commented 4 years ago

Hi Mark, Thanks for coming back to me so quick. Unfortunately I dont have the knowledge on how to check the debug.log. I was updating the prices for every 100 variations I created and it definatelty hit a reset at around 500. I have around 1500 variations but the more I can create the better really. This specific product has 4 attributes. 1st has 11 options, 2nd has 12 options, 3rd has 3 options and 4th has 3 options.

Thanks for creating this plugin also! Its already a game changer!

Mark-Tomlinson commented 4 years ago

Wow, 11 × 12 × 3 × 3 equals 1188 variations. I recreated exactly that on my test system, removed the Markup by Attribute plugin, and tried to price them. I could do no more than 449 before my system timed out.

Here is the message I received in my debug.log. For reference, “execution time” is the amount of time the server is actually executing instructions, and amounts to several minutes of clock time. Thirty seconds of execution time is exceedingly long. PHP Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/wpdev/wp-includes/wp-db.php on line 1357 The timeout always occurs in wp-db.php, although on different line numbers, indicating that most of the execution time happens while WordPress is writing or reading from its database.

So, it appears, the issue is with WooCommerce rather than the plugin. I don’t know how WooCommerce could change this without fundamentally rewriting how the [Set regular prices] function works.

There are only two ways around this that I can think of.

Sorry I couldn't be more helpful.