English Order email does not include variation information #170
Comments
Please try again with the latest version, now released as Hyyan WooCommerce Polylang Integration 1.0. Having said that, I'm just retesting it and in my plain test installation:
If I then turn off both woo-poly-integration and polylang, I get the same result... so this is in the WooCommerce templates themselves. Please check and confirm back here. |
I did a test order and the variation information was not in either email. |
Well, if you are confirming that the variation information is not in the email when Polylang and woo-poly are turned off then it's not an issue with this plugin... |
I disabled woo-poly and now I see the variation information in the email to the admin. |
I enabled woo-poly again and the variation information is gone again. Additional information:
|
was is that in base language or second language? |
Base language. |
Ok, here's the issue: Order.php l. 118** function translateProductNameInOrdersDetails You can tell this by adding a the first line of this function: You'll get the name of the product variation on the emails etc but it will always be in shop base language. At first sight, the addition of the product links seems a nice feature and indeed it seems hugely lame that the standard WooCommerce customer emails do not include any links at all (!!), however it probably shouldn't be the job of this plugin to modify the email templates in this way. |
I also have a reason for the apparent inconsistent behaviour:
Observationally I have the following formats in a shop built over the last year:
So the correct solution may have the following elements:
Logically saving the name correctly must be better than trying to hook and change the name everywhere it may be used. |
wooCommerce 3.0 has some code for this too: class-wc-product-variation-data-store-cpt-php ll.73-83
|
ok, this is getting complicated, I was going to report it to wooCommerce, but there's a related checkin 5 days ago and added to the 3.0.8: woocommerce/woocommerce#15315 Basically wooCommerce 3.0.7 still has problems with the variation description in Cart and indeed therefore in Orders.
(The attribute Blue is renamed but the description for Cart/Order is never quite updated properly) How wooCommerce does the link: On the previous comment, generate_product_title() is a protected function of an internal data class so that’s not readily accessible for override from outside of WooCommerce. So, related to all this is how WooCommerce-Polylang is working: at a variation level, WooCommerce-Polylang adds it's own reference to ensure that variation details are normally retrieved from the master language copy of the variation - see issue #168 I believe apply a temporary fix by using a filter "woocommerce_product_variation_get_name". There is another curious alternative mentioned, to turn off the product attributes in Title which means that they should instead be printed after the title. |
Ok, THIS IS FIXED IN WOOCOMMERCE!!! tested with latest code https://github.com/woocommerce/woocommerce "Version 3.1.0-beta" and with the woo-poly translateProductNameInOrdersDetails() function turned off, Also if wanted the |
Might be WooCommerce 3.1 rather than 3.0.8, looking at woocommerce blog: https://woocommerce.wordpress.com/ |
note, it looks like woocommerce/woocommerce#15315 was dropped from 3.0.8 at the last minute, but is still slated for 3.1 with more thorough review. Typical result may be eg:
|
I am running WordPress 4.7.5, WooCommerce 3.0.7 and a master branch version of Hyyan WooCommerce Polylang (downloaded 15 May, after WC 3 changes were committed).
When the order emails are sent to the customer and the admin the variation information is not present.
The products are variable products with variations created for each value in the single attribute.
For products with more than one attribute it has variations created for one attribute. In this case the other attribute info does appear in the email.
When I disable Hyyan WooCommerce Polylang the variation information does appear in the emails.
Product box in email: Unicorn Fantasy Dog Bandana
When plugin disabled: Unicorn Fantasy Dog Bandana - 12inch
I tried experimenting with the 'woocommerce_order_item_name' filter to see the value of $item_name but it was always null!
I tried to isolate the issue by disabling the add_filter call for 'translateProductNameInOrdersDetails' function in Hyyan\WPI\Order.php's __construct() but it resulted in a NULL product name!
I am happy to try out any ideas and add debug messages.
The text was updated successfully, but these errors were encountered: