Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1080873

    Hi
    In ref. to this topic I wanted to do something similar.
    If we use this visual guide as the base line (I could not find one visual guide for Enfold?) I want to move woocommerce_after_single_product_summary up under “woocommerce_before_add_to_cart_form” but NOT related products – but the “long product description” and the TABS (I do use a plugin for extra customized tabs) including the additional info?- Here is a link to the TAB manager

    Goal is to first get the Title and the short product description – then all the tabs starting with the “LONG Product description”
    After all that tekst – visitors can then add variations / add ons and stuff to the cart

    How? – please add the snippet for me to paste in my child functions.php thx!
    Or files to place in the child folders?

    Does anyone maybe have a better design – woocommerce template?
    Should we start a WooCommerce Template collection?

    • This topic was modified 5 years, 9 months ago by Netzie.
    #1083357

    Hey Peter,

    Thank you for using Enfold.

    The snippets are already available on the visual guide page. All you need to do is remove a specific hook and add it back with a different priority value. The priority value is the integer at the very end of the action hook, which defines where the element is going to be inserted. If you want to start from scratch, just add this code in the functions.php file to remove the default product elements.

    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
    

    You can then add them back with this snippet, adjusting the priority value to suit your needs.

    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
    
    

    The snippet above will render the product elements as follows in response to the priority value:

    Title – 5
    Rating – 10
    Price – 10
    Excerpt – 20
    Add to Cart – 30
    Meta Info – 40
    Sharing – 50

    Best regards,
    Ismael

    #1083838

    Hey Ismael,

    Thanks a million…
    Here is what I did… (and it worked for me:
    I added this to my functions.php

    add_action('init', 'avf_move_product_output');
    function avf_move_product_output() {
    	remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
    	remove_action(    'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 1 );
    	add_action( 'woocommerce_before_add_to_cart_form', 'woocommerce_output_product_data_tabs', 15 );
     
    }
    

    But I want more… (Need your magic again)
    I want to add a copy of the Add-to-cart (including the variations (if any) (see picture)
    You can also see a BIGGER products where I have some ADD ONES (WooCommerce Add On plugins here: https://dashcambilkamera.dk/shop/4k-blackvue-dr900s-2ch-dashcam/
    This makes the single product page extra long (under the “fold”) – That’s the reason for moving the Add to Cart button up (as a copy)
    Maybe someone has a better idea? or style??
    See picture here https://imgur.com/xUQ4uO7

    Best regards

    Netz

    • This reply was modified 5 years, 8 months ago by Netzie.
    #1084351

    Hi,

    Thanks for the update.

    You should probably include this in the init hook that you’ve just created.

    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 11 );
    

    We set the priority from 30 to 11, so the add to cart renders right after the product title.

    Best regards,
    Ismael

    #1084359

    Hi Ismael,

    Thanks – I added the code to my functions.php
    But it add that “Add Ons” options as well See this Pic
    Or this for a BIG product with a lot of Add ons :-)

    How can I avoid those and only add the Variation (if any) and the Add to cart (also the “ViaBill – payment info)??
    Thanks for your time

    Peter

    • This reply was modified 5 years, 8 months ago by Netzie.
    #1085737

    Hi,

    Thanks for the update.

    Is that from a plugin? Looks like the plugin is using the same hook to render those add ons. Please ask the plugin authors for the exact hook and callback name so that we can remove them if necessary.

    Best regards,
    Ismael

    #1086057
    This reply has been marked as private.
    #1086937

    Hi,

    Have your tried asking the plugin authors for the name of the callback or function used to render the mix and match products? And please confirm the name of the woocommerce template hook that they used.

    Best regards,
    Ismael

    #1087014

    They are NOT willing to offer any info at all :-(

    #1087102

    Hi,

    Yes, that would help. Please provide the download link in the private field. Or post the FTP details in the private field.

    Best regards,
    Ismael

    #1087488
    This reply has been marked as private.
    #1088487

    Hi,

    Looks like the plugin is using the “woocommerce_before_add_to_cart_button” hook to display the product add on. We can’t override it though. Please ask the plugin author if it’s possible to remove that action and use the “display” callback on another hook.

    Best regards,
    Ismael

    #1089768

    Hi Ismael,
    They are not willing at all :-(
    Are they any other way to fix or work around this?
    Or should I find another plugin where the plugin author is more forthcoming?

    #1090937

    Hi,

    Thanks for the update.

    You can use the following code. That should move the add ons right after the product sharing section and before the product tabs.

    add_action('init', 'ava_remove_pao_display', 30);
    function ava_remove_pao_display() {
        global $Product_Addon_Display;
        remove_action( '<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_before_add_to_cart_button', array( $Product_Addon_Display, 'display' ), 10 );
        add_action( '<a href='https://refer.wordpress.com/r/84/woocommerce/' target='_blank' rel="nofollow">woocommerce</a>_single_product_summary', array( $Product_Addon_Display, 'display' ), 60 );
    }

    Best regards,
    Ismael

    #1090949

    Hi Ismael,
    Your magic is great!! Thx.
    The code (striped for the auto-link to wordpress :-) ) does the trick – But when adding options to a product and clicking the cart button now adds the product without options! – So I decided to stay with the move of options and cart.
    Thanks for your time and effort

    Netzie

    #1091143

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Customizing Woocommerce single product product template?’ is closed to new replies.