• Resolved massiiv

    (@massiiv)


    Hi!

    I am getting an error with the “Customer completed switch order” e-mail template under “New Subscription Details” section:

    Warning: Invalid argument supplied for foreach() in /data01/virt81201/domeenid/www.disainiguru.ee/htdocs/wp-content/plugins/kadence-woocommerce-email-designer/templates/woo/emails/customer-completed-switch-order.php on line 35

    The part in question:
    <?php foreach ( $subscriptions as $subscription ) : ?>
    <?php do_action( ‘woocommerce_subscriptions_email_order_details’, $subscription, $sent_to_admin, $plain_text, $email ); ?>
    <?php endforeach; ?>

    Hopefully you can help me out, thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey,
    I assume you are seeing this within the customizer correct? Can you make sure the order you are previewing with has a subscription product in the order?

    Ben

    Thread Starter massiiv

    (@massiiv)

    Hey,

    yes, in the customizer and I do have a subscription product in the order. I only have one product (variable subscription) and 4 of it’s variations.

    I am also using the WooCommerce PDF Invoices & Packing Slips… maybe this does affect something? Version. 2.30.

    Also: My site is in another language, all other bits are being translated but the “New subscription Details” heading…?

    Thanks,

    • This reply was modified 5 years, 7 months ago by massiiv.

    Divi does some mess with the customizer but I’ve already added support for it. I doubt that is your issue.

    Is the order you are previewing the result of a switch? Or a standard purchase?

    It’s really difficult for plugins like woocommerce subscriptjons to create a preview of some subscription changes if they’ve not taken place.

    Ben

    Thread Starter massiiv

    (@massiiv)

    Result of a switch.

    I even did the whole process from the “client’s side” by logging in, changing my subscription and when I received the email it is faulty like in the customizer.( but with no error code, just the english heading and blank space)

    I am also using the WooCommerce PDF Invoices & Packing Slips… maybe this does affect something? Version. 2.30.

    Also: My site is in another language, all other bits are being translated but the “New subscription Details” heading…?

    Thanks,

    Hmm, that whole section is copied directly from the subscriptions plugin. What version of the plugin are you using?

    Is your site multilingual?

    Ben

    Thread Starter massiiv

    (@massiiv)

    WooCommerce Subscriptions – Versioon 2.5.7

    Site is not multilingual but I have used Loco translate to translate the WooCommerce Subscriptions (My bad on the heading translation part – it was missing
    – now that issue is fixed).

    ok, I see the issue, I’m not sure I’ll be able to get the preview to function but I’m going to try. The normal email is working fine it’s just styled wrong and there is an extra “order details” header this is because woocommerce subscriptions and woocommerce core use the same file name but with totally different file contents.. why? who knows. I’ll have an update out soon.

    Ben

    Thread Starter massiiv

    (@massiiv)

    Ok, that is great to hear. Thank you, sir.
    I can live with the error in the preview but it would be great to loose the extra “oder details” since it is confusing to customers.

    Much appreciated

    The update is out with a fix for that and preview.

    Ben

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.