Из-за последних обновлений WooCommerce у меня возникла проблема со старой пользовательской темой. К сожалению, я не могу изменить тему, поэтому мне нужно еще go с ошибкой.
Я думаю, что проблема может быть в get_price_ html ();
После извлечения кода:
$variation_id = wc_get_product_id_by_sku($variation->SKU);
$prod_variation = wc_get_product($variation_id);
$regular_price = $prod_variation->regular_price;
$sale_price = $prod_variation->sale_price;
$change = (float)(($variation->StartPrice/$regular_price)-1);
$price_html = $prod_variation->get_price_html();
здесь ошибка:
There has been a fatal PHP error - the server said:
Uncaught Error: Call to a member function get_price_html() on bool in /var/www/vhosts/xxx.it/httpdocs/shop/wp-content/themes/sportime-ecommerce/functions.php:417
Stack trace:
#0 /var/www/vhosts/xxx.it/httpdocs/shop/wp-includes/class-wp-hook.php(288): my_custom_ebay_listing_filter(Object(ItemType), Array, Array, '26443')
#1 /var/www/vhosts/xxx.it/httpdocs/shop/wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(ItemType), Array)
#2 /var/www/vhosts/xxx.it/httpdocs/shop/wp-content/plugins/wp-lister-ebay/classes/model/ItemBuilderModel.php(185): apply_filters('wplister_filter...', Object(ItemType), Array, Array, '26443')
#3 /var/www/vhosts/xxx.it/httpdocs/shop/wp-content/plugins/wp-lister-ebay/classes/model/ListingsModel.php(1260): ItemBuilderModel->buildItem('2558', Object(EbatNs_Session), true)
#4 /var/www/vhosts/xxx.it/httpdocs/shop/wp-content/plugins/wp-lister-ebay/classes/core/EbayController.php(611): ListingsModel->reviseItem('2558', Object(E
In file: /var/www/vhosts/xxx.it/httpdocs/shop/wp-content/themes/sportime-ecommerce/functions.php (line 417)
Please contact support in order to resolve this.
If this error is related to memory limits or timeouts, you need to contact your server administrator or hosting provider.
Спасибо!