add_action('woocommerce_after_add_to_cart_button', 'ok2web_product_price_recalculate');
function ok2web_product_price_recalculate()
{
global $product;
echo ' Итого:
';
$price = $product->get_price();
$currency = get_woocommerce_currency_symbol();
wc_enqueue_js("
$('[name=quantity]').on('input change', function() {
var qty = $(this).val();
var price = '" . esc_js($price) . "';
var price_string = (price*qty).toFixed(2);
$('#subtot > span').html(price_string +'" . esc_js($currency) . "');
}).change();
");
}
function ok2web_product_price_recalculate() {
global $product;
echo ‘<div id=»subtot»> Итого: <span class=»woocommerce-Price-amount amount»></span></div>’;
$price = $product->get_price();
$currency = get_woocommerce_currency_symbol();
wc_enqueue_js( »
$(‘[name=quantity]’).on(‘input change’, function() {
var qty = $(this).val();
var price = ‘» . esc_js( $price ) . «‘;
var price_string = (price*qty).toFixed(2);
$(‘#subtot > span’).html(price_string +'» . esc_js( $currency ) . «‘);
}).change();
» );
}
Ошибка в этой строчке: echo ‘<div id=»subtot»> Итого: <span class=»woocommerce-Price-amount amount»></span></div>’;
Пишет: Syntax error, unexpected t_string, expecting "," or ";"