• Resolved rainsey

    (@rainsey)


    After updating woocommerce, we have the following error on our amp pages. All non amp pages work fine. Any fix?

    <b>Fatal error</b>: Uncaught Error: Call to a member function get_type() on null in /home/thewoolr/public_html/wp-content/themes/zorka/lib/woocommerce-lib.php:244
    Stack trace:
    #0 /home/thewoolr/public_html/wp-includes/class-wp-hook.php(288): zorka_woocommerce_product_add_to_cart_text(‘Add to cart’)
    #1 /home/thewoolr/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(‘Add to cart’, Array)
    #2 /home/thewoolr/public_html/wp-content/plugins/woocommerce/includes/class-wc-product-simple.php(55): apply_filters(‘woocommerce_pro…’, ‘Add to cart’, Object(WC_Product_Simple))
    #3 /home/thewoolr/public_html/wp-content/plugins/amp-woocommerce-pro/amp-woocommerce.php(134): WC_Product_Simple->add_to_cart_text()
    #4 /home/thewoolr/public_html/wp-content/plugins/amp-woocommerce-pro/include/styles_script.php(7): ampforwp_product_details_generator(‘array’)
    #5 /home/thewoolr/public_html/wp-includes/class-wp-hook.php(286): amp_woocommerce_pro_custom_style(Object(AMP_Post_Template))
    #6 /home/thewoolr/public_html/wp-includes/class-wp-hook.p in <b>/home/thewoolr/public_html/wp-content/themes/zorka/lib/woocommerce-lib.php</b> on line <b>244</b>

    • This topic was modified 6 years, 4 months ago by rainsey.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rainsey

    (@rainsey)

    I fixed our php error by reinstalling the “Schema & Structured Data For WP” plugin. i previously installed this plugin and removed it as we use WPSSO pro.

    Unfortunately, installing amp for wp and amp for woocommerce only causes the php error due to installing the new structured data plugin using ampforwp > settings > structured data.

    Please fix the php error caused when “Schema & Structured Data For WP” plugin is disabled or uninstalled. A reinstall of ampforwp and amp for woocommerce did not fix the issue.

    thanks

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @rainsey,

    That’s really strange and I have also tested it a lot by installing and disabling the Schema & Structured Data For WP but I am unable to recreate the issue – https://take.ms/0hDbE

    Will you please contact us on [email protected] and we will look into it

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php error get_type() null’ is closed to new replies.