Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Fatal error on home page after installing the plugin #883

@ilearnio

Description

@ilearnio

Describe the bug

I'm getting a fatal error on home page after installing this plugin. This is because I'm displaying product via shortcode on home page.

I am going to prepare a PR regarding this issue.

Copy of this issue on WP https://wordpress.org/support/topic/fatal-error-on-home-page-after-successfull-payment/

2021/08/30 20:36:09 [error] 2677#0: *22739 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function get_price() on bool in /var/www/site.com/public/wp-content/plugins/woocommerce/includes/wc-product-functions.php:963
Stack trace:
#0 /var/www/site.com/public/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-cart-handler.php(533): wc_get_price_including_tax()
#1 /var/www/site.com/public/wp-includes/class-wp-hook.php(303): WC_Gateway_PPEC_Cart_Handler->inject_credit_messaging_configuration()
#2 /var/www/site.com/public/wp-includes/plugin.php(189): WP_Hook->apply_filters()
#3 /var/www/site.com/public/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-cart-handler.php(610): apply_filters()
#4 /var/www/site.com/public/wp-includes/class-wp-hook.php(303): WC_Gateway_PPEC_Cart_Handler->enqueue_scripts()
#5 /var/www/site.com/public/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
#6 /var/www/site.com/publ" while reading response header from upstream, client: 176.120.105.249, server: site.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9050", host: "site.com"
2021/08/30 21:15:16 [error] 2674#0: *23148 FastCGI sent in stderr: "Unable to open primary script: /var/www/site.com/public/cli/garbagecron.php (No such file or directory)" while reading response header from upstream, client: 185.191.34.215, server: site.com, request: "POST /cli/garbagecron.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9050", host: "site.com"

To reproduce

  1. Add a product to home page with a shortcode [product_page id="ID"]
  2. Navigate to home page

Expected behavior

Environment (please complete the following information):

  • WordPress Version: 5.8
  • WooCommerce Version: 5.3.0
  • PayPal (Express) Checkout Plugin Version: 2.1.2
  • Browser [e.g. chrome, safari] and Version: Chrome
  • Any other plugins installed

Additional details

System status
<!--If applicable, paste the system status here. Please ensure you redact or remove any identifying information. -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions