У меня есть код, в который мне нужно вставить значение на основе условия: **///////// ЗДЕСЬ МОЙ КОД /////////**
Здесь я переопределил файл шаблона single-product/add-to-cart/variation.php Woocommerce через мою активную тему:
{{{ data.variation.variation_description }}}
{{{ data.variation.price_html }}}
{{{ data.variation.custom_field}}}
///////// HERE MY CODE /////////
{{{ data.variation.availability_html }}}
The condition should check the value of the variable `{{{ data.variation.custom_field}}}` and if this data is greater than 10 then the code should print "Yes".
**Something like**:
if( $data.variation.custom_field > 10 ){
echo "yes";
}
But it's not working. I guess, this should be done using Javascript instead of php but I don't know how grab the variable value.
Подробнее здесь: https://stackoverflow.com/questions/667 ... al-display