Support » Plugin: Mailchimp for WooCommerce » abandoned cart error

  • Resolved CatR

    (@catr)


    My store has been connected to Mailchimp for some time and the order data is syncing ok if I look at the transactional side, but the abandoned cart emails are never triggered.

    The log is full of entries like this (I have removed the email address and full path on the server):

    2020-09-04T08:52:37+00:00 NOTICE action_scheduler.queue_job :: MailChimp_WooCommerce_Cart_Update queued :: obj_id b53b68a1ed8651c1ceb7abff36f5fa92
    2020-09-04T08:52:43+00:00 ERROR abandoned_cart.error :: email: t******.com :: attempting product update :: <p>lines.item:0: Required fields were not provided: price</p>
    2020-09-04T08:52:43+00:00 ERROR abandoned_cart.error :: Error Code 400 :: <p>lines.item:0: Required fields were not provided: price</p> on 1833 in ../plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

    Please assist

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author ryanhungate

    (@ryanhungate)

    @catr thanks for writing in. Can you please confirm the current plugin version running on your site?

    The “price” should most certainly be there. Can you please enable the DEBUG feature of the logs, and then try to add items to the cart? This will provide a readable log that would help diagnose things with product id’s and also whether or not the price is not being synced properly.

    I’ll look out for your response here.

    Dear Ryan

    Thanks for the reply.

    I am using v2.4.5 of the plugin.

    I have set the level to debug and put something in my cart. I will update when this has triggered the abandoned cart behaviour.

    Thanks

    Hi again Ryan

    Here is the details from the log. Apart from the price issue the currency code is also incorrect – this is set in the plugin to be ZAR not USD. The store is also ZAR.

    2020-09-15T11:15:44+00:00 NOTICE action_scheduler.queue_job :: MailChimp_WooCommerce_Cart_Update queued :: obj_id 3**
    2020-09-15T11:16:59+00:00 DEBUG api.addCart :: Adding Cart :: c**@gmail.com :: Array
    (
    [id] => 3**
    [customer] => Array
    (
    [id] => 3**
    [email_address] => c**.com
    [opt_in_status] =>
    [orders_count] => 0
    [total_spent] => 0
    )

    [checkout_url] => https://thoclor.com/checkout/?mc_cart_id=****
    [currency_code] => USD
    [order_total] => 0
    [lines] => Array
    (
    [0] => Array
    (
    [id] => ***
    [product_id] => 2326
    [product_variant_id] => 2326
    [quantity] => 1
    )

    )

    )

    2020-09-15T11:16:59+00:00 ERROR abandoned_cart.error :: email: c**@gmail.com :: attempting product update :: <p>lines.item:0: Required fields were not provided: price</p>
    2020-09-15T11:17:00+00:00 DEBUG api.addCart :: Adding Cart :: c**@gmail.com :: Array
    (
    [id] => 3***
    [customer] => Array
    (
    [id] => 3***
    [email_address] => c**.com
    [opt_in_status] =>
    [orders_count] => 0
    [total_spent] => 0
    )

    [checkout_url] => https://thoclor.com/checkout/?mc_cart_id=3***
    [currency_code] => USD
    [order_total] => 0
    [lines] => Array
    (
    [0] => Array
    (
    [id] => 3***
    [product_id] => 2326
    [product_variant_id] => 2326
    [quantity] => 1
    )

    )

    )

    2020-09-15T11:17:00+00:00 ERROR abandoned_cart.error :: Error Code 400 :: <p>lines.item:0: Required fields were not provided: price</p> on 1833 in [removed]/public_html/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

    • This reply was modified 2 months, 1 week ago by CatR.
    Plugin Author ryanhungate

    (@ryanhungate)

    @catr sorry for the delay in responding – and thank you for the debug logs. This certainly helps us diagnose things. I went to the site but it looks as if I can’t shop there because of a location issue – I’m in the US.

    I do see something that might be worth looking into – that it says you need to have a “subscription” in order to buy the product. I’m also thinking that we might need to do something different in the “cart submission” for products of this nature. Seems as if you might need to configure the product or the subscription before the “get_price” functionality of WooCommerce works for us to pass in the proper pricing.

    I think that we could do a little testing on our end and push out a proper fix for this very quickly with a little info from you.

    Can you please tell us what “type of product” these are? Are you using the WooCommerce subscriptions? Does the product require you to select things before it can calculate the proper pricing?

    Thanks!

    CatR

    (@catr)

    Hi Ryan

    Yes that’s right re the location – only for South African shoppers.

    No you don’t need a subscription to buy the product, you can buy it once off or on subscription. This only applies to one product. The price is the same no matter which option you choose, just the frequency of payment (once off, once a month, once every 6 weeks, once every 8 weeks) would change.

    I use Woocommerce Subscriptions plus their All Products for Woocommerce Subscriptions which allows you to add subscription options to any regular product.

    We do also have wholesale products that are only available to certain roles using the Wholesale Suite by Rymera.

    Perhaps this setup is too complex for the abandoned cart to work? If so that’s fine just let me know.

    Thanks

    Plugin Author ryanhungate

    (@ryanhungate)

    @catr sorry for the delay – but we’ve just pushed out a patch in version 2.4.7 which should address this issue you’ve brought to our attention. Please let us know if this did the trick for you too!

    Thanks @ryanhungate

    I checked MailChimp and it is indeed sending abandoned cart emails now – so I think the problem is fixed.

    Plugin Author ryanhungate

    (@ryanhungate)

    @catr thanks so much for verifying the solution worked. We really appreciate you bringing this to our attention – I bet this resolved many other stores that didn’t know it was not working, so thanks again!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.