el.severo
Forum Replies Created
-
I’ve ended up using:
class_exists( 'WC_Email' )and it seems to work.Got to the final question:
if(is_front_page()) { //SHOW ONLY ON HOME PAGE //BUG: THIS GETS DISPLAYED TO WOOCOMMERCE CONFIRMATION E-MAIL }Why this gets displayed to the WooCommerce confirmation e-mail?
- This reply was modified 5 years, 11 months ago by el.severo.
What’s even more strange even if I have the following part:
if ( is_product_category() == true || is_product() == true || is_front_page() == true || is_front_page() == true) { $_currencies = $this->settings->get_list_currencies(); $_converted_price = number_format(($price * $_currencies["RON"]['rate']), 2, '.', ''); $return = '<span class="woocommerce-Price-amount amount">' . $formatted_price . '</span><span class="converted-price"> ' . $_converted_price . " " . $_currencies["RON"]['custom'] . '</span>'; }The second currency gets displayed, now I’m wondering how the e-mail part is being built.
Hi guys,
Thanks for the feedback, I’d share more context in order to understand better:
Here’s a snapshot of the confirmation order:
https://i.imgur.com/N9Z62Em.pngAnd current code:
if ( !is_order_received_page() && !is_view_order_page()) { $_currencies = $this->settings->get_list_currencies(); $_converted_price = number_format(($price * $_currencies["RON"]['rate']), 2, '.', ''); $return = '<span class="woocommerce-Price-amount amount">' . $formatted_price . '</span><span class="converted-price"> ' . $_converted_price . " " . $_currencies["RON"]['custom'] . '</span>'; }I am displaying two currencies on the site, and when I make the order / payment I send the national currency to the third parties (payment processor & courier).
Since the plugin does not have support for displaying multiple currencies I come up with this customisation but now I have to detect the confirmation e-mail part in order to hide the second currency (since its converted again).
Solved using this:
// Replace translatable text by force add_filter( 'gettext', function( $translated_text, $text, $domain ) { // Billing [field name] if ( $text === 'Billing %s' && $domain === 'woocommerce' ) { $translated_text = '%s'; } // Return return $translated_text; }, 10, 3 );Credits: https://frique.me/blog/change-billing-and-shipping-field-names-in-the-woocommerce-checkout-errors/ .
Forum: Plugins
In reply to: [Checkout Field Manager (Checkout Manager) for WooCommerce] Add Amount@sabke2: Have you solved this issue? Looking forward! π
@albert0346: Have you solved this? Looking forward for a similar solution π
Forum: Plugins
In reply to: [Bon Toolkit] Bon Toolkit NOT working in WordPress 4.4@llona: You need to change the code.
As you can see this is the only change that I had to make.
Forum: Plugins
In reply to: [Bon Toolkit] Bon Toolkit NOT working in WordPress 4.4@mikkiprio: you need to check the apache logs or the logs of the PHP. I don’t have any clue if I don’t have more info…
Check the logs πForum: Plugins
In reply to: [Bon Toolkit] Bon Toolkit NOT working in WordPress 4.4@mikkiprio: do you have the same environment? (PHP version, apache: version, modules), WordPress version. etc. ?
Forum: Plugins
In reply to: [Bon Toolkit] Call to undefined function bon_toolkit_set_options()Solve it out, did a PR here
Forum: Plugins
In reply to: [Bon Toolkit] Bon Toolkit NOT working in WordPress 4.4@mikkiprio: see this