in woocommerce Single Product pages, i have moved the tabs at the bottom of the page to the opposite side of the main image. i have also turned short description into a tab too.
the problem that persists is that the tabs are duplicated and still show up in the original place. how do i stop this and just make them appear opposite to the image. also i am using a plugin called ppom and i would like that to still appear in its original place which is under the normal position of the tabs.
The code I have used to move the tabs to the right of the image is:
function new_woocommmerce_ppom_price() {
wp_enqueue_script( 'ppom-price', PPOM_URL.'/js/ppom-price.js', array('jquery','ppom-inputs'), PPOM_DB_VERSION, false);
wp_enqueue_script('new_woocommerce_ppom_price', get_stylesheet_directory_uri(). '/woocommerce-product-addon/js/new_woocommerce_ppom_price.js', array('jquery','ppom-inputs'), PPOM_DB_VERSION, true);
}
add_action( 'wp_enqueue_scripts', 'new_woocommmerce_ppom_price',50);
remove_action( 'woocommerce_single_product_summary','woocommerce_template_single_add_to_cart', 30 );
add_action( 'woocommerce_after_single_product_summary','woocommerce_template_single_add_to_cart', 30 );
// Add short description to a custom product tab
add_filter( 'woocommerce_product_tabs', 'add_custom_product_tab', 10, 1 );
function add_custom_product_tab( $tabs ) {
$custom_tab = array(
'custom_tab' => array(
'title' => __( "Short description", "woocommerce" ),
'priority' => 10,
'callback' => 'short_description_tab_content'
)
);
return array_merge( $custom_tab, $tabs );
}
// Custom product tab content
function short_description_tab_content() {
global $post, $product;
$short_description = apply_filters( 'woocommerce_short_description', $post->post_excerpt );
if ( ! $short_description ) {
return;
}
echo '<div class="woocommerce-product-details__short-description">' . $short_description . '</div>'; // WPCS: XSS ok.
}
// Remove short description
//
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 30 );