KL
Size: a a a
KL
М
KL
KL
М
М
М
GK
GK
Иi
А
А
AY
AY
AY
AY
AY
П
BS
add_action('wp_enqueue_scripts', 'sortable');
function sortable() {
global $product;
if ( $product instanceof WC_Product && ! $product->is_type( 'variable' ) ) {
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/sortable.js', array( 'jquery' ),'',true );
}
}
UPD нашел
add_action('wp_enqueue_scripts', 'sortable');
function sortable() {
if(is_product()){
global $post;
$post_id = $post->ID;
$product = wc_get_product( $post_id );
$type = $product->get_type();
if( $type == 'variable' ){
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/sortable.js', array( 'jquery' ),'',true );
}
}
}
A
add_action('wp_enqueue_scripts', 'sortable');
function sortable() {
global $product;
if ( $product instanceof WC_Product && ! $product->is_type( 'variable' ) ) {
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/sortable.js', array( 'jquery' ),'',true );
}
}
UPD нашел
add_action('wp_enqueue_scripts', 'sortable');
function sortable() {
if(is_product()){
global $post;
$post_id = $post->ID;
$product = wc_get_product( $post_id );
$type = $product->get_type();
if( $type == 'variable' ){
wp_enqueue_script( 'custom-js', get_stylesheet_directory_uri() . '/js/sortable.js', array( 'jquery' ),'',true );
}
}
}