niklas.buschner
Forum Replies Created
-
Update: We just checked the labels today and your last update (2.10.2) seems to cause the bug. The version before was also fine. Would be great if you could provide a quick fix. Thanks!
Forum: Plugins
In reply to: [Variation Swatches for WooCommerce] Compatibility issue with Product BundlesI have the same problem with the official WooCommerce Product Bundles extension (https://woocommerce.com/products/product-bundles/).
My issue is as follows:
I have a product that is defined as a bundled product. The bundle consists of 4 products. Two of those product have 2 variation. In the bundle configuration I can say that I only want to show 1 of the variation. Additionally I can say that I want this variation to be predefined so that the user does not have to choose it manually. This last feature of predefining does not work. I am presented with the error: Please select an option to proceed.
Additionally I just noticed that I am not able to add a bundled product to cart, even when I can select a variation. This seems to be the same problem as described by the original author. The variation attribute is empty, so I am notified that attribute ABC is required and the product cannot be added to the cart.
Do you have a suggestion on how to make this work? Thanks for your help!
Accidentally posted in the wrong plugin forum, sorry!
Further notice: What seems strange to me, is that we have 3 translation input fields in the string translation. I thought that this may be related to the implementation of the de_DE_formal language files which we did while the shop was already up and running. Concerning this I also noticed a lot of JSON files in the wp-content/languages/ and wp-content/languages/plugins folder (screenshot below). Do you see a connection between this?
- This reply was modified 4 years, 11 months ago by niklas.buschner.
EDIT for my reply above: Not all body texts of the shipment notifications are correctly translated. I already notified the plugin author of WooCommerce Germanized about this and he told me that it would require some more detailed work on the translation support for the shipment notification mails in WPML.
Hey Sergey, when can I expect your reply? Just to give you a quick heads-up on what is working now and what is not.
I implemented the following code in class-wcml-emails.php. This is basically the fix the author of WooCommerce Germanized suggested.
public function filter_refund_emails_strings( $value, $object, $old_value, $key ) { if ( ! in_array( $email->id, array( 'customer_refund_order' ) ) ) { return $value; } if ( in_array( $key, array( 'subject_partial', 'subject_full', 'heading_partial', 'heading_full' ) ) && $object->object ) { $translated_value = $this->get_refund_email_translated_string( $key, $object ); } return ! empty( $translated_value ) ? $translated_value : $value; }
With this fix, the customers receive the tracking notification of WooCommerce Germanized correctly but only in the German language.
Now I additionally implemented the fix provided by WPML team:
In wp-content/plugins/woocommerce-germanized/packages/woocommerce-germanized-shipments/templates/emails/customer-shipment.php after line 19 add:
/* * WPML fix: send mail in the order lang, not in the admin lang */ if (class_exists('sitepress')) { $current_lang = apply_filters( 'wpml_current_language', NULL ); $order_lang = get_post_meta( $order->id, 'wpml_language', true ); if ($order_lang != '') { do_action( 'wpml_switch_language', $order_lang ); } }
and after line 80:
/* * WPML fix: send mail in the order lang, not in the admin lang. Switch back to current lang */ if (class_exists('sitepress')) { do_action( 'wpml_switch_language', $current_lang ); }
This works partially, since the body text of the shipment notification is now correctly translated to english if the order language is englisch.
But what is still not working as expected is the mail subject and header. If I write nothing into the mail administration input fields, I receive the php warnings described earlier:
Undefined variable: email in .../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php on line 301 Notice: Trying to get property 'id' of non-object in .../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php on line 301
If I put strings into the input fields, those are correctly saved and used but even with a string scan through WPML plugin localization, I don’t get correctly translated header and subject strings for the shipment notification mail.
What is really strange now, is that when I searched for english equivalents of the german shipment notification strings, those seem to be correctly implemented but not used. Now I tried to make a translation vice-versa, where I put my german strings that I put into the mail administration, into the WPML string translation, but this also did not work.
Actually I find it quite hard to handle two support tickets and a forum thread. I would highly appreciate a decent and complete fix or workaround, since the current situation is disappointing for me and my client.
Thanks!
- This reply was modified 4 years, 11 months ago by niklas.buschner.
Hey Sergey thanks for your quick reply!
Hello Sergey, I already went through the whole process with the official WPML support and they also provided a staging environment where I reproduced the issue.
1. Customer buys something
2. We create a shipping with the integrated DHL API from WooCommerce Germanized plugin
3. Customer should receive a mail that says ‘Your order is shipped’ but instead (when WooCommerce Multilingual is active) receives ‘Your order is refunded’We tracked down the issue to being related with WooCommerce Multilingual
Is this detailed enough for you?
Here ist the link to the official WPML ticket: https://wpml.org/forums/topic/woocommerce-multilingual-and-woocommerce-germanized-compatibility-issue/
Hello Sergey,
I already did this in the first post but I can post it again:
WooCommerce Germanized offers an integrated management of DHL shipments and also provides an e-mail that is sent to users.
In the shop, a shipment is created and marked as “shipped”, but the customer receives a strange mix by mail from the refund and shipping notification. The subject and header of the mail is refund, but the content of the mail is related to the shipping notification as desired.
We have checked the problem and the problem arises when WooCommerce Multilingual is activated. Without WooCommerce Multilingual the problem does not arise. We have already communicated this to WooCommerce Germanized. We were asked to communicate this to the WooCommerce Multilingual team as well.
So I received support from the plugin author of WooCommerce Germanized and WPML now. Unfortunately there seems to be confusion on the WPML site, because I was provided with a fix that (according to the plugin author of WooCommerce Germanized, who also provided me with a fix) has nothing to do with my actual problem. The plugin author of WooCommerce Germanized now suggested to post my problem here so it receives a decent solution.
The plugin author of WooCommerce Germanized provided the following fix. In inc/class-wcml-emails.php of WooCommerce Multilingual you see this code:
public function filter_refund_emails_strings( $value, $object, $old_value, $key ) { if ( in_array( $key, array( 'subject_partial', 'subject_full', 'heading_partial', 'heading_full' ) ) && $object->object ) { $translated_value = $this->get_refund_email_translated_string( $key, $object ); } return ! empty( $translated_value ) ? $translated_value : $value; }
There I should check above $object, which e-mail object it is. Example:
if ( ! in_array( $email->id, array( 'customer_refund_order' ) ) ) { return $value; }
This worked, so when I sent a Tracking notification via WooCommerce Germanized the customer actually received the mail with the right subject and header and not the subject that the order was refunded.
Only problem is that I don’t see how to implement a translation, since I get the following warning in the WooCommerce mail configuration fields, which prevents me from implemented translatable strings there:
Undefined variable: email in .../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php on line 301 Notice: Trying to get property 'id' of non-object in .../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php on line 301
Now WPML support provided me with this fix:
In wp-content/plugins/woocommerce-germanized/packages/woocommerce-germanized-shipments/templates/emails/customer-shipment.php after line 19 add:
/* * WPML fix: send mail in the order lang, not in the admin lang */ if (class_exists('sitepress')) { $current_lang = apply_filters( 'wpml_current_language', NULL ); $order_lang = get_post_meta( $order->id, 'wpml_language', true ); if ($order_lang != '') { do_action( 'wpml_switch_language', $order_lang ); } }
and after line 80:
/* * WPML fix: send mail in the order lang, not in the admin lang. Switch back to current lang */ if (class_exists('sitepress')) { do_action( 'wpml_switch_language', $current_lang ); }
According to the plugin author of WooCommerce Germanized this has nothing to do with my actual problem and the ticket at WPML was already closed.
Since I am engaged in the tickets for quite a while now and don’t really see any progress in the matter other than the fix provided by WooCommerce Germanized plugin author, I hope that my post helps to find a solution.
- This reply was modified 4 years, 11 months ago by niklas.buschner.
Just now
Vielen Dank für die schnelle Antwort: Dann verstehe ich es richtig, dass auch für die neuen Versandmails eine standardm??ige englische übersetzung hinterlegt ist?
Forum: Plugins
In reply to: [Germanized for WooCommerce] DHL Erweiterung – Vielen Dank! :DIch schlie?e mich @retroreiz an. Wir m?chten auch keine Telefonnummer der Kunden auf das Label drucken. Hiermit gab es schon mehrfach ?rger und das wollen wir definitiv vermeiden.
Beim DHL for WooCommerce Plugin haben wir es mit folgendem Snippet in der functions.php gel?st. Ggf. k?nnten wir hier einfach den Filter auf die neue Integration von Germanized anpassen und den Code ansonsten recyclen?
Danke für den Support im Voraus!
// DHL Shipping Labels without Phone (GDPR) add_filter('pr_shipping_dhl_label_args', 'remove_phone_number', 10, 2); function remove_phone_number($args, $order_id) { if(isset($args['shipping_address']['phone'])){ unset($args['shipping_address']['phone']); } return $args; } // DHL Shipping Labels without Mail (GDPR) add_filter('pr_shipping_dhl_label_args', 'remove_email_number', 10, 2); function remove_email_number($args, $order_id) { if(isset($args['shipping_address']['email'])){ unset($args['shipping_address']['email']); } return $args; }
- This reply was modified 5 years ago by niklas.buschner. Reason: typos
Forum: Plugins
In reply to: [Mailchimp for WooCommerce] How to send the user language to MCI’m also interested in an explanation on how to get this done.
I don’t really know how, but I solved the issue ??
edit: It was related to the cookie notice plugin. For now I deactivated it since the workarounds or improvements didn’t work for me.
Will there be a official update with an improved functionality concerning cookie notice banners soon?
- This reply was modified 5 years, 5 months ago by niklas.buschner.