• Resolved antonmarklund

    (@antonmarklund)


    Hi,

    I get fatal error when tracking purchases. I replaced web hosting account name with “webhostname” and replaced folder name with “catalogname”

    I don’t use standard WooCommerce Checkout & thank you page. I use another checkout integrated with WooCommerce. ( https://woocommerce.com/products/klarna/ ) Should that be the problem?

    This is the error code:

    Fatal error: Uncaught Error: Call to a member function get_items() on boolean in /home/”webhostname”/”catalogname”/wp-content/plugins/pixel-caffeine/includes/supports/class-aepc-woocommerce-addon-support.php:208 Stack trace: #0 /home/”webhostname”/”catalogname”/wp-content/plugins/pixel-caffeine/includes/class-aepc-addon-factory.php(121): AEPC_Woocommerce_Addon_Support->get_purchase_params() #1 /home/”webhostname”/”catalogname”/wp-content/plugins/pixel-caffeine/includes/class-aepc-pixel-scripts.php(191): AEPC_Addon_Factory->get_parameters_for(‘purchase’) #2 /home/”webhostname”/”catalogname”/wp-includes/class-wp-hook.php(298): AEPC_Pixel_Scripts::track_standard_events(”) #3 /home/”webhostname”/”catalogname”/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #4 /home/”webhostname”/”catalogname”/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/”webhostname”/”catalogname”/wp-includes/general-template.php(2605): do_action(‘wp_footer’) #6 /home/”webhostname”/home/”webhostname”/”catalogname”/wp-content/plugins/pixel-caffeine/includes/supports/class-aepc-woocommerce-addon-support.php on line 208

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    yes, that should be the problem. Try to make a change in the Pixel Caffeine code, if you can.

    Open the file wp-content/plugins/pixel-caffeine/includes/supports/class-aepc-woocommerce-addon-support.php and go to line 206 (around there), in order to find the row:

    $order = wc_get_order( $wp->query_vars['order-received'] );

    Replace this row with:

    $order = wc_get_order( $wp->query_vars['order-received'] ?: intval( $_GET['order-received'] ) );

    Let me know if it works.

    Thread Starter antonmarklund

    (@antonmarklund)

    Hi again and thank you.

    I have not tried your method yet but I found a solution; I did disable the custom checkout thank you page that I had chosen in my checkout plugin Klarna Checkout.

    I don’t really understand code etc but could it be that Pixel Caffeine tries to collect order received data from default thank you page white I have a custom thank you page trough my Klarna Checkout plugin.

    If so…. maybe a update to Pixel Caffeine for the future could be to choose custom thank you page. I am not sure if all order data is sent trough with Klarna Checkout but I hope so.

    Plugin Author Antonino Scarfì

    (@antoscarface)

    The thing is that plugin use a different way to show the thank you page, without using the “official” way by WooCommerce, but the previous change in the plugin should fix. So, if you can try that change on the fly, you can test if it works. I’m unable to test it in my end.

    Anyway, I’ll add this change I suggested you in the next release of the plugin.

    Hi @antoscarface

    Thanks for the fast response. We adjusted the code but with no succes. Still get the same code at our order-received page. Do you need ftp-login?

    Kind regard,
    Marnick van Lith

    As additional info,

    It is working on our dev.volleyball-store.com website.
    This is a test domain. Can you see what is the difference? Both use autoptimze and the volleyball-store.com uses w3 total cacher in additional. I tried to disable this plugin but with no results. Could it be CND (cloud fare)

    Kind regard,
    Marnick van Lith

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Sorry for the late response.

    So, let me understand. Have you applied my fix in dev.volleyball-store.com and then it worked? Furthermore, you should clear the cache, with only deactivating it could not flush the cache properly. Also, check if there is some cache on the server side.

    Then, I cannot accept ftp or admin credentials, I’m sorry.

    Let me know, thanks.

    Thread Starter antonmarklund

    (@antonmarklund)

    I got rid of the “Fatal error Purchase tracking” when removing custom thank you page for my checkout solution.

    If your reply is related to my new support post about “Something goes wrong during the connection with facebook API. Please, try to refresh the page” it is for another domain.

    How do I reset cache as you mentioned? I’ve no caching plugin, using Mr.Bara theme from Themeforest.

    Plugin Author Antonino Scarfì

    (@antoscarface)

    I’m sorry, I was replying to @marnickvl 🙂 Thank you for sharing your solution, appreciated you solved.

    Thanks for the answer @antoscarface

    No, your plugin is running on dev. and our working domain http://www.volleyball-store.com
    However, the error does only show up on http://www.volleyball-store.com and not on dev.volleyball-store.com

    This is what I did:
    Deactivated plugins that weren’t on dev.volleyball-store.com, cached everything and openend http://www.volleyball-store.com/checkout/order-received
    But the problem was not solved.

    So it should be something else. I was suggesting CDN because I can’t disable that.

    I told you about the dev.volleyball-store.com/checkout/order-receveid because maybe you can spot some difference.

    We did change the code as suggested in this forum. Nothing seems to help.
    I really hope you can have a answer for us. The plugin worked great!

    Kind regard,
    Marnick

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    thanks for the congrats about the plugin, I’m really happy it worked great! 🙂

    About your issue, I don’t have the things clear very well. Have you some cache on http://www.volleyball-store.com/? have you checked about some server cache? Are you sure you have the plugin change I suggested you in this topic on that side?

    CDN should be for the static resources only.

    HI @antoscarface

    Yes, i’m 100% sure I added the code on the right place. And after disabling or changing something, I always clear all caches. All woo commerce settings are on default ( we asked our theme support).

    So i’m still bothering with this issue 🙁

    Hope you have some ideas for a solution..

    Kind regard,
    Marnick

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    very sorry for the inconvenience. It’s surely some conflict with some plugin or theme you are using.

    Try the same change I suggested before, but replace the suggested line with this:
    $order = wc_get_order( isset( $wp->query_vars['order-received'] ) ? $wp->query_vars['order-received'] : intval( $_GET['order-received'] ) );

    Make sure to clear all cache you have after the change and before to check.
    Let me know, thanks.

    No problem. We are using the Jupiter theme. I think you know it.

    I’ve adjusted the code (See screenshot)
    https://www.screencast.com/t/N8AD0yeyY

    Cleared and flushed all the caches. No results 🙁 I even disabled some plugins again, no results.

    Kind regard,
    Marnick van Lith

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi all,

    this issue is fixed by 1.2.3 version of the plugin. 🙂

    If you have this issue, please upgrade the plugin at least to 1.2.3 version.

    Best regards.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Fatal error Purchase tracking’ is closed to new replies.