Philip R
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce 10.5.0 (and 10.5.1) breaks order attribution@lovingbro This is inaccurate. One user experienced the issue and did not have Fluid Checkout installed.
@chihsuan documented perfectly what the issue is, and how it can affect other plugins.
By removing all the other posts, you removed all the important and helpful context from this thread. Please consider an exception to your strict forum policy for the purposes of this thread. Everyone else’s posts were perfectly on point. They may help others dealing with the same issue — both website administrators and plug-in developers who will need to update their code accordingly.
Forum: Plugins
In reply to: [WooCommerce] WooCommerce 10.5.0 (and 10.5.1) breaks order attributionThanks very much. In the meantime, I found that rolling back WooCommerce to 10.4.3 restores attribution reporting, until this is resolved.
Forum: Plugins
In reply to: [WooCommerce] WooCommerce 10.5.0 (and 10.5.1) breaks order attributionI have definitely isolated the issue to a difference between WooCommerce 10.4.3 and 10.5.0, so it’s WooCommerce that the cause of the new conflict.
Someone else has reported this problem, you may wish to follow it.
https://ww.wp.xz.cn/support/topic/from-7th-of-february-order-origins-always-unknown/
@oalili I found the problem. The offender? WooCommerce itself. The problem surfaced with the 10.5.0 update, and is still present with the 10.5.1 update. Rolling back to 10.4.3 fixed it for me. This was the very last thing I tried, after updating the theme and all other plugins.
I am using the Flatsome Theme. I have a staging instance where everything is identical except for the WooCommerce version, so feel reasonably certain this is the problem.
It is a good thing, too, because I have already received 2 card attacks that were stopped by PayPal while Block unknown origin was exposed. OopSpam is the only reliable solution I have found, so I have re-enabled it.
Has anyone else experienced this problem? If people don’t use OopSpam they may not notice it unless they are looking at the origin of an order.
Thank you @oalili. I do have twice-daily automatic backups of the database. If you could point me in the right direction for how to access the tables for storing the spam and valid entries , I would appreciate it. I am still troubleshooting the underlying issue and this would help.
@oalili I am still troubleshooting the underlying issue. When I downgraded to 1.2.60 (using WP Rollback) I lost the info in the Spam entries and Valid entries pages that had been generated up to that point. It would be helpful to look at that information. Is it possible to recover it?
@oalili Thank you! I have updated to 1.2.62.
Regarding my site, the only other thing that I can think of that has happened in the time that the problem appeared has been the Cloudflare settings, as well as some work on the WordPress database that my developer colleague made. If you like, I can follow up with you on email to send you those Cloudflare settings, if it would help pinpoint the issue. The information you provided about a small JavaScript snippet on the checkout page to collect metadata possibly being interfered with could be a helpful clue.
@oalili That’s amazing, thank you for your prompt response! May I just clarify:
- I do not have Rocket Loader nor any Page Rules enabled in Cloudflare. (I do have Minify JavaScript files enabled in WP Rocket, but this setting hasn’t changed, and previously there were no problems). So, for the moment, I will disable “Block orders from unknown origin” to prevent the issue, as you suggest
- Once you issue the plugin update, do I understand correctly that I will be able to re-enable “Block orders from unknown origin”, and not need to make any changes to my existing Cloudflare settings, and that legitimate orders will no longer get flagged?
@oalili Thank you. We will continue there. For the benefit of others, I have also recently applied the WooCommerce 10.5 update, and I wonder if anyone else has experienced a problem after applying the WooCommerce 10.5 update.
@oalili thank you. After investigating further, I don’t think that the issue is actually related to the plug-in update. I’ve downgraded to the previous version, 1.2.60 and the problem remains. It’s possible that it was coincidental with some Cloudflare settings that I had applied. I’ve sent you a more detailed message on your contact email, and I’m hopeful of a reply there. Thank you.
Review submitted!
Forum: Plugins
In reply to: [Kadence WooCommerce Email Designer] WooCommerce Product Vendors Support@karlalevelup Thanks. Obviously I found the solution with the assistance of AI, but it seems to work well. I have just manually applied this fix to the latest 1.5.18 update of the plugin and tested again, and my fix continues to work. I hope you will be able to incorporate this into a future update.
Forum: Plugins
In reply to: [Kadence WooCommerce Email Designer] WooCommerce Product Vendors SupportThe following suggestion to insert a guard for WooCommerce Product Vendors appears to work. I offer the solution to @victormonk in the event that you wish to test and merge it into the plugin itself. Please see below…
…
What’s actually breaking
1. Product Vendors has its own email templates
WooCommerce Product Vendors ships its own email templates, including:
woocommerce-product-vendors/templates/emails/order-email-to-vendor.phpwoocommerce-product-vendors/templates/emails/email-order-details.phpwoocommerce-product-vendors/templates/emails/plain/order-email-details.php(Stack Overflow)
Those templates know how to restrict order items to a single vendor. 2. Kadence globally hijacks all email templates
In the Kadence plugin file
kadence-woocommerce-email-designer/kadence-woocommerce-email-designer.php
there is this method:function filter_locate_template( $template, $template_name, $template_path ) { // Make sure we are working with an email template. if ( ! in_array( 'emails', explode( '/', $template_name ) ) ) { return $template; } // ... }Inside this function, Kadence ignores where the template actually came from and forces WooCommerce to use its own copy under
templates/woo/emails/...for anything that looks like an email template.That means:
- When Product Vendors tries to load its vendor-specific
email-order-details.php, - Kadence intercepts and instead uses Kadence’s generic
templates/woo/emails/email-order-details.php, - That generic template just calls
wc_get_email_order_items( $order, ... )on the full order, exactly like core WooCommerce.(WooCommerce GitHub)
Result: vendor emails see all order items, not just their own. The simplest safe fix: don’t let Kadence touch Product Vendors templates
We can fix this by slightly changing
filter_locate_template()so that it skips templates that belong to WooCommerce Product Vendors and lets that plugin handle its own emails.Step 1 – Open the Kadence main plugin file
File path:
wp-content/plugins/kadence-woocommerce-email-designer/kadence-woocommerce-email-designer.phpSearch inside it for:
function filter_locate_template( $template, $template_name, $template_path ) {You should see the beginning of the function like this:
function filter_locate_template( $template, $template_name, $template_path ) { // Make sure we are working with an email template. if ( ! in_array( 'emails', explode( '/', $template_name ) ) ) { return $template; } // clone template. $_template = $template; // Get the woocommerce template path if empty. if ( ! $template_path ) { global $woocommerce; $template_path = $woocommerce->template_url; } // Get our template path. $plugin_path = KT_WOOMAIL_PATH . 'templates/woo/'; // ... }Step 2 – Insert a guard for WooCommerce Product Vendors
Right after the “Make sure we are working with an email template” check, add this block:
function filter_locate_template( $template, $template_name, $template_path ) { // Make sure we are working with an email template. if ( ! in_array( 'emails', explode( '/', $template_name ) ) ) { return $template; } // --- BEGIN: do not override WooCommerce Product Vendors templates --- // If the resolved template lives inside the WooCommerce Product Vendors plugin, // leave it alone so vendors still see their vendor-specific items only. if ( $template && false !== strpos( wp_normalize_path( $template ), 'woocommerce-product-vendors/templates/' ) ) { return $template; } // --- END: do not override WooCommerce Product Vendors templates --- // clone template. $_template = $template; // Get the woocommerce template path if empty. if ( ! $template_path ) { global $woocommerce; $template_path = $woocommerce->template_url; } // Get our template path. $plugin_path = KT_WOOMAIL_PATH . 'templates/woo/'; // ... (rest of the original function remains unchanged) }What this does:
- When WooCommerce has already resolved a template path like
wp-content/plugins/woocommerce-product-vendors/templates/emails/order-email-to-vendor.php,
Kadence now immediately returns it and does not swap in its own email template. - So Product Vendors’ own
order-email-to-vendor.phpand its ownemail-order-details.phpare used again, which correctly limit items to that vendor.
Step 3 – Upload and test
- Save the file.
- Clear any opcode cache if your host uses one (optional but helpful).
- Place a test order with products from multiple vendors.
- Check vendor emails:
- Each vendor should again see only their own products.
- Admin / store owner still sees the full order.
Trade-offs & notes
- Kadence styling won’t apply to Product Vendors’ vendor emails after this change.
They’ll go back to the Product Vendors default HTML/layout, but they’ll be correct. - This change is inside the plugin, so:
- When Kadence WooCommerce Email Designer updates, your edit may be overwritten.
- Keep a note of this patch so you can re-apply it after updates.
- A more advanced solution would be to:
- Copy Product Vendors’
order-email-to-vendor.phpinto your theme, and - Manually blend in Kadence’s HTML structure while still using the vendor-specific item logic.
If you want to go that route, I can sketch that template for you too.
- Copy Product Vendors’
Quick summary
- The bug isn’t in
order-email-to-vendor.phpitself; it’s Kadence forcing all email templates (including Product Vendors’ ones) through its own genericemail-order-details.php. - By adding a small guard in
filter_locate_template()to skip templates fromwoocommerce-product-vendors/templates/, you restore the proper vendor-only behavior while keeping Kadence for all the core WooCommerce emails.
Forum: Plugins
In reply to: [Kadence WooCommerce Email Designer] WooCommerce Product Vendors SupportHi @kriskorn – thank you so much for sharing this information and your file. That is very generous of you to share it. I will study it further.
I still am hopeful of a reply from @victormonk and the Kadence team that addresses this issue, as you have described it perfectly, and I do use the Kadence plugin regularly. Perhaps your file will be helpful to them in devising a solution.