Home / Forums / Space themes support forum / Fatal error review reminder & abandoned cart php files
Home › Forums › Space themes support forum › Fatal error review reminder & abandoned cart php files
Fatal error review reminder & abandoned cart php files
- This topic has 4 replies, 2 voices, and was last updated 2 months, 2 weeks ago by
Artem Temos.
-
AuthorPosts
-
March 5, 2026 at 12:45 am #710991
patrik.vargaParticipantHi!
I have 2 fatal errors in debug log, with review reminder and abandoned cart emails.
Could you add a fix for these in Spance Dashboard Patcher?Bug Report for XTS Hitek Theme Developer
Issue: PHP 8 Fatal Error in WooCommerce Email TemplatesDescription: There is a TypeError occurring in the
review-reminder.php
and
abandoned-cart.php
WooCommerce email templates within the XTS Hitek theme when running on PHP 8+.Error Message: Uncaught TypeError: current(): Argument #1 ($array) must be of type array, false given
Root Cause: In both templates, the image source is retrieved using the following logic:
php
// In review-reminder.php
current( wp_get_attachment_image_src( $data[‘image_id’], ‘thumbnail’ ) )
// In abandoned-cart.php
current( wp_get_attachment_image_src( $product->get_image_id(), ‘thumbnail’ ) )
If an image is missing or has been deleted from the media library, the WordPress function wp_get_attachment_image_src() returns a boolean false. Passing false to the current() function triggers a Fatal Error in PHP 8+, causing a 500 Internal Server Error and halting the email sending process.Proposed Solution: The code should verify that wp_get_attachment_image_src() returns a valid array before attempting to access its elements. If it doesn’t, it should safely fall back to the WooCommerce placeholder image.
Example Fix:
php
$image_src = wc_placeholder_img_src();
if ( ! empty( $data[‘image_id’] ) ) {
$src_data = wp_get_attachment_image_src( $data[‘image_id’], ‘thumbnail’ );
if ( is_array( $src_data ) && ! empty( $src_data[0] ) ) {
$image_src = $src_data[0];
}
}
And then output $image_src in thetag instead of chaining current() directly onto the function call.
March 5, 2026 at 5:55 pm #711120Hello,
Thank you for the report. We will check this and fix in our next theme update.
Kind Regards
April 10, 2026 at 6:24 pm #715697
patrik.vargaParticipantHello! Do you know when the next Hitek Update is expected? I submitted the bug ticket a month ago, but since then there has been no patch or template update.
April 14, 2026 at 9:52 am #715918Hello,
There is no ETA for the next update. If you want, we can fix this directly on your website. To do this, please send us your admin access.
Kind Regards
April 14, 2026 at 12:23 pm #715944Hello,
We have released a new patch for this issue – 715940. Please apply and let us know if it helps.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register