Reorder single product content
-
Hello,
Trying reorder the content on single product page, so that is what i want:
1. TITLE (OK)
2. PRICE (OK)
3. WISHLIST (NOT OK)
4. ADD TO CART (NOT OK)Now i have 2 issues:
A. Display the price below the title worked, but can’t remove the price from the default place (woocommerce_template_single_price – 10)B. Trying reorder the wishlist above ‘add to cart’ but doesn’t work.
Found another topic in this forum explain that it can possible the theme overriding the default WooCommerce hooks.
So i’m searching and disable the themes single-product templates, but it gives the same issues.Here you can see the hooks in a default page (without reordering) with Xstore theme.
And here my code:
/** Reorder content single product page **/ /** change periority number **/ /** * Hook: Woocommerce_single_product_summary. * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single_sharing - 50 * @hooked WC_Structured_Data::generate_product_data() - 60 */ /** PRICE **/ /** REMOVE FROM DEFAULT POSITION 10 **/ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); /** ADD TO POSITION 6 **/ add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 6 ); /** WISHLIST SHORTCODE **/ function wk_wishlist_shortcode() { do_shortcode( '[yith_wcwl_add_to_wishlist]' ); } /** ADD WISHLIST TO POSITION 7, ABOVE ADD TO CART **/ add_action( 'woocommerce_single_product_summary', 'wk_wishlist_shortcode' , 7 ); /** ADD TO CART **/ /** REMOVE FROM DEFAULT POSITION 30 **/ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); /** ADD TO POSITION 8 **/ add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 8 );
The code from Xstore’s single product template:
... <div class="<?php echo esc_attr( $infor_class ); ?> product-information"> <div class="product-information-inner"> <div class="fixed-content"> <?php if(!etheme_get_option('product_name_signle')): ?> <h4 class="title"><?php esc_html_e('Product Information', 'xstore'); ?></h4> <?php endif; ?> <?php /** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single_sharing - 50 */ do_action( 'woocommerce_single_product_summary' ); ?> <?php if(etheme_get_option('share_icons')): ?> <div class="product-share"> <?php echo do_shortcode('[share title="'.__('Share Social', 'xstore').'" text="'.get_the_title().'"]'); ?> </div> <?php endif; ?> </div> </div> </div><!-- Product information/ END -->
…
The biggest issue and most important, how can i remove the price below the cart button????
- This topic was modified 6 years, 11 months ago by . Reason: Adding code snippet single product template - Xstore theme
The page I need help with: [log in to see the link]
- The topic ‘Reorder single product content’ is closed to new replies.