add_filter('woocommerce_single_product_summary', 'in_stock', 11);
function in_stock()
{
global $product;
if (is_product()) {
if ($product->stock_status == 'outofstock') {
$return_string = '<p class="stock out-of-stock">Нет в наличии</p></div>';
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30);
} else {
$return_string = '
<p class="stock in-stock">В наличии</p>
<a href="/oplata/" rel="attachment wp-att-416"><img class="alignnone size-full wp-image-416" src="https://pro-alarm.ru/wp-content/uploads/2018/08/pay_sistem.png" alt="" width="164" height="26" /></a>
</div>';
}
}
echo $return_string;
}
add_action( 'woocommerce_single_product_summary', 'after_title_single_product', 5 );
function after_title_single_product(){
echo '<div class = "priceandnotinstock">';
}
<script>
$(function(){
$('#form').submit (function(e){
e.preventDefault();
var data = $(this).serialize();
$.ajax({
type: "POST",
url: "test.php",
data: data,
success: function (result){
$('#result').html(result);
}
});
});
});
</script>
<form id="form">
<input type="text" name="test">
<input type = "submit">
</form>
<div id="result">
</div>