hyyan / woo-poly-integration

Looking for maintainers! - Wordpress WooCommerce Polylang Integration
https://wordpress.org/plugins-wp/woo-poly-integration/
MIT License
183 stars 66 forks source link

Woo+Poly+ Hyyan with virtual products #539

Closed albanalbanalban closed 3 years ago

albanalbanalban commented 3 years ago

Hello, I am using your extension to try to sell scripts on my labdal.net site ... Purchases on my site are made directly without prior connection (no customer account or basket). My scripts can only be downloaded via the order confirmation mail ("customer-completed-order") which contains the download link. The base of my site is in French with English and German versions. When my French customers order, everything is fine no problem. On the other hand, when they are English speakers (I have not yet had an order for Germans), they receive the order confirmation in French and especially the download link does not appear ... Which is a big problem . Have you ever had this kind of question? Can you please help me?

Thank you in advance.

WP: 5.6.1 - Woo: 4.9.2 - Polylang: 2.9.2

Jon007 commented 3 years ago

Hi, please give the full details as requested in the template,

a number of changes were made to email handling in June 2020 ( https://github.com/hyyan/woo-poly-integration/commits/master/src/Hyyan/WPI/Emails.php ) but not fully released onto wordpress.org until the new version 1.5 released yesterday. It would be worth trying that and then reopening with further details if problems persist.

albanalbanalban commented 3 years ago

Thank you I'll try this new version.

albanalbanalban commented 3 years ago

Hello again,

Well, version 1.5 of your plugin doesn't change anything. only my French customers receive the download link ... Would you like me to send you some examples or something?

WP: 5.6.2 - Woo: 5.0.0 - Polylang: 2.9.2 - HWPI: 1.5.0

Thank you for your help.

Jon007 commented 3 years ago

Sure yes, what’s the product type, what’s the base language? Are you using other plugins?

albanalbanalban commented 3 years ago

I start to found out the problem... for foreign orders (not French ones), in order-details.php

I don't know where to look in WP tables to verify !

Jon007 commented 3 years ago

can you reproduce the problem when Free Downloads WooCommerce is turned off?

albanalbanalban commented 3 years ago

I tried with an existing order, it's the same with Free Downloads WooCommerce turned off....

albanalbanalban commented 3 years ago

Hello Jonathan,

Okay, I tried (with my weak knowledge) to debug the problem, and I think I partly understood (but that does not allow me to solve it)! This is how I searched:

1) In order_details.php, the pb comes from: $ downloads = $ order-> get_downloadable_items (); which does not return anything!

2) The get_downloadable_items () function is located in woocommerce / includes / class-wc-order.php In this function the problem comes from: $ item_downloads = $ item-> get_item_downloads ();

3) The get_item_downloads () function is located in woocommerce / includes / class-wc-order-item-product.php In this function the problem comes from (line 375): $ customer_downloads = $ data_store-> get_downloads (array ('user_email' => $ order-> get_billing_email (), 'order_id' => $ order-> get_id (), product_id '=> $ product_id,)); in fact in this function the array is a filter. And this function does not review anything because of the "product_id" ....

After verification, all the orders placed are recorded with the base product_id (French in my case). Or order-detail uses the product_id of the language in which it was ordered ... and cannot find a product corresponding to the filter of the function $ data_store-> get_downloads...

CONCLUSION I think the problem comes from the registration of orders which does not take into account the country ... since the product id is that of the base product (French in my case).

Please give me your feedback, and the way to solve this problem. Thank you

Jon007 commented 3 years ago

I hadn't tried downloadable product before but I just tested and it worked fine:

There could be more advanced features of downloadable products which aren't working in some way but the basic support seems to work so closing this until we can show a problem with this plugin.

Please try:

  • creating a new downloadable product and translating it
  • try without additional plugins and template customisations It may be one of the other plugins is interfering with the process.

If data from another plugin needs to be synchronised or not between translations, see https://github.com/hyyan/woo-poly-integration/wiki/Product-Meta-and-Custom-Fields for guidance.

If stuck please open with more details - this issue doesn't comply with the requirements for issue reporting like including woocommerce status report