• Activating the “Credit card with Oney” payment option conflicts with product related PHP based custom blocks in the admin.
    I have a CPT named “Diets” and a PHP based custom block that allows editors to add product previews in the Gutenberg editor for the diets (and other CPTs).
    If the “Credit card with Oney” option is selected in the Netopia plugin, the admin pages containing the product preview block will no longer work, throwing the following error:

    Fatal error: Uncaught Error: Call to a member function get_cart_total() on null in /home/stage/public_html/wp-content/plugins/netopia-payments-payment-gateway/oney/oney-add-on-netopia.php:195 Stack trace: #0 /home/stage/public_html/wp-includes/class-wp-hook.php(324): oneynetopia_single_product_page() #1 /home/stage/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /home/stage/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /home/stage/public_html/wp-content/themes/kindora-v2_child/woocommerce/single-product/add-to-cart/simple.php(67): do_action() #4 /home/stage/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘…’) #5 /home/stage/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1729): wc_get_template() #6 /home/stage/public_html/wp-includes/class-wp-hook.php(324): woocommerce_simple_add_to_cart() #7 /home/stage/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #8 /home/stage/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #9 /home/stage/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1720): do_action() #10 /home/stage/public_html/wp-content/themes/kindora-v2_child/template-parts/woocommerce/quick-view-product-card.php(75): woocommerce_template_single_add_to_cart() #11 /home/stage/public_html/wp-includes/template.php(812): require(‘…’) #12 /home/stage/public_html/wp-includes/template.php(745): load_template() #13 /home/stage/public_html/wp-includes/general-template.php(206): locate_template() #14 /home/stage/public_html/wp-content/themes/kindora-v2_child/template-parts/blocks/product-card.php(45): get_template_part() #15 /home/stage/public_html/wp-includes/template.php(812): require(‘…’) #16 /home/stage/public_html/wp-includes/template.php(745): load_template() #17 /home/stage/public_html/wp-includes/general-template.php(206): locate_template() #18 /home/stage/public_html/wp-content/themes/kindora-v2_child/blocks/main-diet/block.php(67): get_template_part() #19 /home/stage/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(738): include(‘…’) #20 /home/stage/public_html/wp-includes/class-wp-hook.php(324): acf_block_render_template() #21 /home/stage/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #22 /home/stage/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #23 /home/stage/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(712): do_action() #24 /home/stage/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(610): acf_render_block() #25 /home/stage/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/blocks.php(533): acf_rendered_block() #26 /home/stage/public_html/wp-includes/class-wp-block.php(519): acf_render_block_callback() #27 /home/stage/public_html/wp-includes/blocks.php(2061): WP_Block->render() #28 /home/stage/public_html/wp-includes/blocks.php(2113): render_block() #29 /home/stage/public_html/wp-includes/class-wp-hook.php(324): do_blocks() #30 /home/stage/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #31 /home/stage/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1871): apply_filters() #32 /home/stage/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(575): WP_REST_Posts_Controller->prepare_item_for_response() #33 /home/stage/public_html/wp-includes/rest-api/class-wp-rest-server.php(1230): WP_REST_Posts_Controller->get_item() #34 /home/stage/public_html/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request() #35 /home/stage/public_html/wp-includes/rest-api.php(547): WP_REST_Server->dispatch() #36 /home/stage/public_html/wp-includes/rest-api.php(2925): rest_do_request() #37 [internal function]: rest_preload_api_request() #38 /home/stage/public_html/wp-includes/block-editor.php(753): array_reduce() #39 /home/stage/public_html/wp-admin/edit-form-blocks.php(80): block_editor_rest_api_preload() #40 /home/stage/public_html/wp-admin/post.php(187): require(‘…’) #41 {main} thrown in /home/stage/public_html/wp-content/plugins/netopia-payments-payment-gateway/oney/oney-add-on-netopia.php on line 195

  • You must be logged in to reply to this topic.