kathyisawesome / wc-mnm-variable

Variable Mix and Match Products
2 stars 0 forks source link

Causes a Critical Error on BuddyBoss's theme #44

Closed simplicity17 closed 10 months ago

simplicity17 commented 10 months ago

The plugin worked great on the Hello theme, but we recently implemented BuddyBoss and their theme, and now when this extension is activated, it causes a critical error on the product pages it is associated with. When disabled, the regular Mix and Match extension works without issue. Screenshot 2023-11-30 at 1 11 37 PM

helgatheviking commented 10 months ago

I'm not really advertising this yet (because it's not realllly ready for broad use in production) so always surprised when people find it. :) could I ask how you came across it?

what version are you using? 1.0.rc.x? or 2.0.0-beta? 2.0 was entirely rebuilt with React for speed improvements. i would need more information about the actual error. You might be able to see it in your WooCommerce > Status > Log. I don't know anything about BuddyBoss and can't test against it at this time.

As a reminder, this is released AS IS. and especially if the problem is related to 1.0.x it might not get fixed unless it's something really easy, but also open to a PR if you want to help fix it.

simplicity17 commented 10 months ago

Hi,

Thanks so much for getting back to me!

I actually purchased the Mix and Match plugin for a client’s website (it’s huge with MemberPress, BuddyBoss, WooCommerce, etc.) and they had the Mix and Match plugin from years ago on their old eCommerce site. So we just repurchased the license to keep using it to sell their brochures and other items in bulk.

When on the WooCommerce store, I went to documentation for the Mix and Match plugin, then saw a link for Mini Extensions and came across the original version of this add-on where you posted a link for the new beta version! As I mentioned, it worked great on our Hello theme site but BuddyBoss seems to like to fight with everything, this plugin included! I am temporarily swapping back to the original add-on which seems stable (although again, BB is messing with the formatting).

I am using 2.0.0-beta, attached is the log from today, not sure if the errors are related to your plugin. I’ll also attach the BB theme files if you would like to investigate further.

I am not a full stack developer, my coding skills end at HTML and CSS and I can only barely understand Javascript so can’t be super useful here or else I would 100% want to get it up and running, I think this add-on makes the base plugin far more usable.

Not sure if you worked on the Mix and Match plugin in the WooCommerce store, but I’m actually having some trouble getting support for the base plugin, most recent version. WooCommerce won’t let me pick the plugin in the support area of their site and it the site says that the plugin is managed by Backcourt Development (not sure if that is you!) and their website doesn’t offer any contact information…having some trouble with formatting the mix and match grid with CSS, got as far as I could but cannot for the life of me get the input area to display wider than it is. Let me know if this is something you would be able to help with! Again, just if you are associated with Backcourt Development as I’ve had trouble getting in contact with them, don’t want to bug you! buddyboss-theme-2.4.70 (1).zip WooCommerce Log Nov 30 2023.txt

helgatheviking commented 10 months ago

Oh I think i see what happened.... the docu still references "Grouped" but at github I archived that and point people here. i've been away on sabbatical for a bit, but should probably update that docu until this is more polished.

You might want to go back to Grouped in the meantime. You could also try v 1.0.x but I know the client I was working on this for originally had performance issues (slow loading) which is what prompted the 2.0 re-factor.

Backcourt is my company... one of these days I will get all my branding aligned. :)

To open a ticket at WooCommerce.com you need to be logged into your WooCommerce.com account with the same email that purchased the license. If you can't log in, you can use my personal contact form and I will forward you into my support queue for my team to look at and assist with grid style question. Please include the email that the license is associated with.

helgatheviking commented 10 months ago
2023-11-30T18:08:07+00:00 CRITICAL Uncaught InvalidArgumentException: Overriding existing data with an already registered key is not allowed in /home/canfpo5/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:431
Stack trace:
#0 /home/canfpo5/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php(310): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->add_data('wcMNMVariableSe...', Array)
#1 /home/canfpo5/public_html/wp-content/plugins/wc-mnm-variable/includes/rest-api/class-wc-mnm-variable-store-api.php(550): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->add('wcMNMVariableSe...', Array)
#2 /home/canfpo5/public_html/wp-includes/class-wp-hook.php(324): WC_MNM_Variable_Store_API::preload_response('')
#3 /home/canfpo5/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#4 /home/canfpo5/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /home/canfpo5/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1702): do_action('woocommerce_var...')
#6 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/woocommerce/widgets/product-add-to-cart.php(50): woocommerce_template_single_add_to_cart()
#7 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(2265): ElementorPro\Modules\Woocommerce\Widgets\Product_Add_To_Cart->render()
#8 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/widget-base.php(609): Elementor\Controls_Stack->render_by_mode()
#9 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/widget-base.php(750): Elementor\Widget_Base->render_content()
#10 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/element-base.php(464): Elementor\Widget_Base->print_content()
#11 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/element-base.php(1375): Elementor\Element_Base->print_element()
#12 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/element-base.php(464): Elementor\Element_Base->print_content()
#13 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/element-base.php(1375): Elementor\Element_Base->print_element()
#14 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/base/element-base.php(464): Elementor\Element_Base->print_content()
#15 /home/canfpo5/public_html/wp-content/plugins/elementor/core/base/document.php(1739): Elementor\Element_Base->print_element()
#16 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php(418): Elementor\Core\Base\Document->print_elements(Array)
#17 /home/canfpo5/public_html/wp-content/plugins/elementor/includes/frontend.php(1179): ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document->print_elements_with_wrapper(Array)
#18 /home/canfpo5/public_html/wp-content/plugins/elementor/core/base/document.php(1183): Elementor\Frontend->get_builder_content(6391, false)
#19 /home/canfpo5/public_html/wp-content/plugins/elementor/modules/library/documents/library-document.php(76): Elementor\Core\Base\Document->get_content(false)
#20 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php(158): Elementor\Modules\Library\Documents\Library_Document->get_content(false)
#21 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/theme-document.php(173): ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document->get_content()
#22 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/documents/single-base.php(93): ElementorPro\Modules\ThemeBuilder\Documents\Theme_Document->print_content()
#23 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/woocommerce/documents/product.php(133): ElementorPro\Modules\ThemeBuilder\Documents\Single_Base->print_content()
#24 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/locations-manager.php(364): ElementorPro\Modules\Woocommerce\Documents\Product->print_content()
#25 /home/canfpo5/public_html/wp-content/plugins/elementor-pro/modules/theme-builder/classes/locations-manager.php(240): ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager->do_location('single')
#26 [internal function]: ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager->ElementorPro\Modules\ThemeBuilder\Classes\{closure}()
#27 /home/canfpo5/public_html/wp-content/plugins/elementor/modules/page-templates/module.php(207): call_user_func(Object(Closure))
#28 /home/canfpo5/public_html/wp-content/plugins/elementor/modules/page-templates/templates/header-footer.php(19): Elementor\Modules\PageTemplates\Module->print_content()
#29 /home/canfpo5/public_html/wp-includes/template-loader.php(106): include('/home/canfpo5/p...')
#30 /home/canfpo5/public_html/wp-blog-header.php(19): require_once('/home/canfpo5/p...')
#31 /home/canfpo5/public_html/index.php(17): require('/home/canfpo5/p...')
#32 {main}
  thrown in /home/canfpo5/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php on line 431

The error looks related to Elementor. I'm not exactly sure what it means.

simplicity17 commented 10 months ago

No worries, will just use grouped for now! Thanks for clarifying everything!

Elementor does do this weird thing where sometimes a critical error causes the website's "window" (in the screenshot I originally posted here) to be small instead of showing the traditional Wordpress critical error, but usually its because of a third party plugin conflict. So it might have been some sort of snowball effect.

And thank you for clarifying how to access support! I actually figured out the issue (thank you Reddit)... there was a max-width on the input field I wasn't seeing so when I set the width it wasn't working 🙄 Noted for next time though if there are any issues. Thanks again!

helgatheviking commented 10 months ago

You're welcome. I want to get this smoothed out soon.... but it's also been a way more massive undertaking that I could have predicted (and I predicted it being hard).

Woo seems to save critical errors into their Logs so that's always a good place to look for more info when you get a fatal error.

helgatheviking commented 10 months ago

image

Can confirm Buddy Boss isn't the source of the issue (though there are some funny looking plus/minus buttons). Again, the log suggests Elementor Pro, but unclear why.

Anyway, before switching, could you try changing this line

From:

Automattic\WooCommerce\Blocks\Package::container()->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add( 'wcMNMVariableSettings', $data );

to:

Automattic\WooCommerce\Blocks\Package::container()->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add( 'wcMNMVariableSettings', $data, true );

and see if that makes any difference.

simplicity17 commented 10 months ago

Hmmm that fixed the critical error but now the mix and match doesn’t appear at all on the frontend.

Emily McKenna Owner, Simplicity Design and Marketing @.***

https://simplicitydesign.business

On Nov 30, 2023, at 4:35 PM, Kathy @.***> wrote:

image.png (view on web) https://github.com/kathyisawesome/wc-mnm-variable/assets/507025/38353d3f-6522-4f05-a422-e24b52b15a16 Can confirm Buddy Boss isn't the source of the issue (though there are some funny looking plus/minus buttons). Again, the log suggests Elementor Pro, but unclear why.

Anyway, before switching, could you try changing this line https://github.com/kathyisawesome/wc-mnm-variable/blob/features/reactify/includes/rest-api/class-wc-mnm-variable-store-api.php#L550 From:

Automattic\WooCommerce\Blocks\Package::container()->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add( 'wcMNMVariableSettings', $data ); to:

Automattic\WooCommerce\Blocks\Package::container()->get( Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry::class )->add( 'wcMNMVariableSettings', $data, true ); and see if that makes any difference.

— Reply to this email directly, view it on GitHub https://github.com/kathyisawesome/wc-mnm-variable/issues/44#issuecomment-1834596546, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA7344S4WVOQV76Y52QBN3YHD3ZXAVCNFSM6AAAAABABUJFUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGU4TMNJUGY. You are receiving this because you authored the thread.

helgatheviking commented 10 months ago

@simplicity17 Hi Emily, it will be impossible for me to test in your setup, but I think the recent 2.0 beta 2 might resolve your issue. Check it out on a staging site if you have time. Closing this for now.

helgatheviking commented 10 months ago

@simplicity17 I made some changes recently that I hope will help resolve the issue. https://github.com/kathyisawesome/wc-mnm-variable/releases/tag/2.0.0-beta.2

Happy holidays!

simplicity17 commented 9 months ago

Hi Kathy,

Thanks so much for your updates, sorry for my delayed response! So I installed your plugin on my staging site and while the formatting is better, now when you change the variation, the options within that variation won’t necessarily update…

For instance, I have my variations setup as box quantities of 10 copies, 25 copies, and 50 copies, so first you pick the number of copies and then you pick the items you want in that box up to that quantity amount.

On the frontend, I can swap from 10 to 25 to 50, but then if I go back to a lower amount it seems to get stuck on 50 quantity in the counter at the bottom. (Ignore 20/25 not matching up, that was just me mis-naming the variation).

See video recording: https://drive.google.com/file/d/1BCmkh3gYEpNSnjYNlEdKxkV_E9NoZlIY/view?usp=sharing

Emily McKenna Owner, Simplicity Design and Marketing @.***

https://simplicitydesign.business

On Dec 20, 2023, at 7:37 AM, Kathy @.***> wrote:

@simplicity17 https://github.com/simplicity17 I made some changes recently that I hope will help resolve the issue. https://github.com/kathyisawesome/wc-mnm-variable/releases/tag/2.0.0-beta.2

Happy holidays!

— Reply to this email directly, view it on GitHub https://github.com/kathyisawesome/wc-mnm-variable/issues/44#issuecomment-1864403598, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA7342AQPSX3HCKRHKZRXTYKLLXVAVCNFSM6AAAAABABUJFUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUGQYDGNJZHA. You are receiving this because you were mentioned.

helgatheviking commented 9 months ago

Hi Emily, can you confirm that you are using release https://github.com/kathyisawesome/wc-mnm-variable/releases/tag/2.0.0-beta.3 ? If so I'll open a new issue and take a look at the end of January when I'm back from vacation. Happy 2024!

simplicity17 commented 9 months ago

I was actually using beta.2, so I uninstalled it and installed beta.3 but still having the same issue. No rush at all on this! I ended up setting it up without the plugin on the live site, just a bonus if we can get it to work on the staging site so that I can implement later.

Enjoy your vacation and happy new year!

Emily McKenna Owner, Simplicity Design and Marketing @.***

https://simplicitydesign.business

On Jan 10, 2024, at 9:31 PM, Kathy @.***> wrote:

Hi Emily, can you confirm that you are using release https://github.com/kathyisawesome/wc-mnm-variable/releases/tag/2.0.0-beta.3 ? If so I'll open a new issue and take a look at the end of January when I'm back from vacation. Happy 2024!

— Reply to this email directly, view it on GitHub https://github.com/kathyisawesome/wc-mnm-variable/issues/44#issuecomment-1886102898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA7344UVUJS2E44G5EN4LLYN5FIZAVCNFSM6AAAAABABUJFUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBWGEYDEOBZHA. You are receiving this because you were mentioned.

helgatheviking commented 9 months ago

@simplicity17 fyi - i have moved that bug into it's own issue #48 and have identified the root of the problem. Hope to have a fix soon.