Skip to content

Instantly share code, notes, and snippets.

@DxDiagDx
Created August 4, 2020 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DxDiagDx/7638dcdd420d75ddfa3e7667707ef7f7 to your computer and use it in GitHub Desktop.
Save DxDiagDx/7638dcdd420d75ddfa3e7667707ef7f7 to your computer and use it in GitHub Desktop.
Woo: если товар простой, вариативный, сгруппированный или внешний/партнёрский
add_action( 'woocommerce_after_single_product_summary', 'bbloomer_single_product_type' );
function bbloomer_single_product_type() {
if( $product->is_type( 'simple' ) ){
// do something
} elseif( $product->is_type( 'variable' ) ){
// do something
} elseif( $product->is_type( 'external' ) ){
// do something
} elseif( $product->is_type( 'grouped' ) ){
// do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment