function my_woocommerce_update_product( $id ) {
$product = wc_get_product( $id );
$already_set = get_post_meta( $id, '_set_default_price', true );
$price = $product->get_price();
//
//
if ( $price == "0" ) {
$postinfo = get_field('group-select');
$postid = get_field('id_groups_products');
//
$highprice = get_field('high-price', $postid);
$defaultprice = get_field('default-price', $postid);
$smallprice = get_field('small-price', $postid);
//
if( get_field('group-select') == 'high' ):
$product->set_regular_price( $highprice );
$product->save();
endif;
if( get_field('group-select') == 'default' ):
$product->set_regular_price( $defaultprice );
$product->save();
endif;
if( get_field('group-select') == 'small' ):
$product->set_regular_price( $smallprice );
$product->save();
endif;
update_post_meta( $id, '_set_default_price', 'yes' );
}
}
add_action( 'woocommerce_update_product', 'my_woocommerce_update_product' );
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide"><img
src="//li1.cdbcdn.com/oh/7b256133-cc05-4dad-aba6-8ef144a9a55f.jpg?f=32&w=910&h=450&mode=crop"
alt=""></div>
<div class="swiper-slide"><img
src="//li1.cdbcdn.com/oh/7b256133-cc05-4dad-aba6-8ef144a9a55f.jpg?f=32&w=910&h=450&mode=crop"
alt=""></div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>