Critical Error on form submission
-
My client informed me this morning that the websites Yith RAQ form wasn’t submitting, and instead goes to a blank page with critical error message ” There has been a critical error on this website.” I have now activated the debug report and got this:
Parse error: syntax error, unexpected ‘}’, expecting end of file in /home/customer/www/wiredisplays.co.nz/public_html/wp-content/themes/Divi-Child/woocommerce/emails/plain/request-quote.php on line 60
There has been a critical error on this website.
I am not familiar with php coding, but on putting this log into chat gpt it said i needed to remove that bracket and make sure that the various brackets were matching. It is in relation to me adding a plain email template (client needed this), but there appears to be something fishy with it! (oddly, it has been in place for 3 weeks and only caused critical error yesterday). I’ve removed the bracket on line 60, and now the form sends correctly – but now I’m not receiving it in my inbox! (as test). I’ve tested the smtp server (wpmail and brevo), and its working, it sends the test email. I’m a bit stumped. Here is the php code if anyone has a clue it would be appreciated?!
code
<?php
/**
* Plain Text Email Template
*
* @package YITH\RequestAQuote
* @version 1.5.3
* @since 1.0.0
* @author YITH <[email protected]>
*
* @var $email_heading string
* @var $raq_data array
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
echo esc_html( $email_heading . "\n\n" );
/* translators: %s: user name */
echo sprintf( esc_html__( 'You have received a quote request from %s. The request is the following:', 'yith-woocommerce-request-a-quote' ), esc_html( $raq_data['user_name'] ) ) . "\n\n";
echo "****************************************************\n\n";
do_action( 'yith_ywraq_email_before_raq_table', $raq_data );
echo "\n";
if ( ! empty( $raq_data['raq_content'] ) ) :
foreach ( $raq_data['raq_content'] as $item ) :
if ( isset( $item['variation_id'] ) ) {
$product = wc_get_product( $item['variation_id'] );
} else {
$product = wc_get_product( $item['product_id'] );
}
echo esc_html( $product->get_name() ) . ' ' . esc_html( yith_ywraq_get_product_meta( $item, false ) ) . ' | ';
echo esc_html( $item['quantity'] );
echo ' ' . esc_html( WC()->cart->get_product_subtotal( $product, $item['quantity'] ) );
echo "\n";
endforeach;
endif;
echo "\n****************************************************\n\n";
do_action( 'yith_ywraq_email_after_raq_table', $raq_data );
if ( ! empty( $raq_data['user_message'] ) ) {
echo esc_html__( 'Customer message', 'yith-woocommerce-request-a-quote' ) . "\n";
echo esc_html( $raq_data['user_message'] ) . "\n\n";
}
echo esc_html__( 'Customer details', 'yith-woocommerce-request-a-quote' ) . "\n";
echo esc_html__( 'Name:', 'yith-woocommerce-request-a-quote' );
echo esc_html( $raq_data['user_name'] ) . "\n";
echo esc_html__( 'Email:', 'yith-woocommerce-request-a-quote' );
echo esc_html( $raq_data['user_email'] ) . "\n";
echo "\n****************************************************\n\n";
echo esc_html( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.