New Landing How can we help? Atelier Changing order and removing items from product summary.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Posted in: Atelier
  • #212442
    mccaul
    Member
    Post count: 28

    Could somebody please explain how to change/reorder the woocommerce product attributes (Title/Price/Description), that are currently created through the do_action( 'woocommerce_single_product_summary' ); call in content-single-product.php ?

    In theory these should all be adjustable with a few calls in functions.php to reorder/remove them with calls such as:

    
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'sf_product_share', 45 );
    

    However, they have no effect.

    I can add into the page with add_action commands to woocommerce_single_product_summary, but not remove/re-order what is there.

    #212659
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    You would need to edit the content-single-product.php file

    – Kyle

    #213348
    mccaul
    Member
    Post count: 28

    Hi Kyle,

    I had tried that, but call the woocommerce file about 1/2 way down, which controls half of the items posted.

    
    <?php
    	/**
    	* woocommerce_single_product_summary hook
    	*
    	* @hooked woocommerce_template_single_title - 5
    	* @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' );
    ?>			
    

    Deleting that one line of code removes everything south of the price from the product page.
    (stock status, description, meta, sharing, etc… )

    The way the code is commented, it implies that all of these can be changed, removed, or re-ordered with standard remove_action calls in function.php …
    However, having tried this, it doesn’t seem to work.

    I can add new actions to the woocommerce_single_product_summary, which will appear anywhere I like depending on the priority I give it, but I can’t remove the items as listed in the SwiftIdeas comments in that php file.

    #213501
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    This will not control the order of the items on the page as such, please open the file content-single-product.php.

    There you will see the standard:

    1)

    Title: <h1><?php the_title(); ?></h1>

    2

    Price: Starts on Line 111 to Line 121.

    You can reorder them within that file.

    Thanks,
    David.

    #213578
    mccaul
    Member
    Post count: 28

    Hi Dean,

    I understand that, and had used that to get rid of the breadcrumbs and next/previous buttons above the title.

    However, everything rendered beneath the price, is all done with the one call to ‘do_action’.

    It’s all of those I’d like to re-oder or remove, and that doesn’t seem possible under the standard practice ‘remove_action’ command?

    #213774
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    From what I read in this article below after you successfully remove them using the remove_action you need to add them again with different priorities(this will determine their order in the page).

    Reorder Product Page Contents – WooCommerce

    Take a look at it. Hope it helps.

    -Rui

    #213784
    mccaul
    Member
    Post count: 28
    This reply has been marked as private.
    #214417
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    The only hooks I can confirm I can remove are the “Add to cart” and “Meta”.

    Within my child theme functions.php:

    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

    The title/price/rating/pagination and comments are above the action: do_action( 'woocommerce_single_product_summary' ); within content-single-product.php.

    It looks like the comments above the do_action need to be updated to reflect this.

    I’ll request a response from the developer so we can clarify this.

    Thanks,
    David.

    #214720
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @mccaul

    At the moment they are directly in the content-single-product.php file as David said. I’ll get this re-worked for the next feature release.

    – Ed

    #217618
    tonn
    Member
    Post count: 85

    Hi Ed,

    I was just wondering if the changes were implemented in the latest 1.74 release?

    Many thanks,

    #217629
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    No – they are planned in for v1.80 however.

    Thanks,

    – Ed

    #217643
    tonn
    Member
    Post count: 85

    No problem. Thanks Ed

    #217645
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Thanks Ed.
    -Rui

    #269239
    keysilinares
    Member
    Post count: 165

    Has this been updated? I wish to have my short product description below ‘add to cart’ and ‘variations’. Please advise. Thanks!

    #269277
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Yes it has, follow David’s instructions above

    – Kyle

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register