New Landing How can we help? Atelier Move buy button to underneath product price?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Posted in: Atelier
  • #267321
    Buysmartuk
    Member
    Post count: 22

    Hi,

    Is there a way to move the buy button underneath product price quickly and simply?

    I just wanted to check before seeking advice about how to hack it via a child theme.

    I can see in sf-woocommerce.php the function ‘sf_product_price_rating’ is hooked to ‘woocommerce_single_product_summary’ and assume its an ordering thing on actions.

    Also the buy button for single variation is on action ‘woocommerce_single_variation’.

    Any advice would be greatly appreciated.

    Many thanks!

    #267327
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide a mockup image of how you would like it to be so we can seek for a solution?
    Thanks

    -Rui

    #267338
    Buysmartuk
    Member
    Post count: 22

    I’ll try this quickly.

    [PRODUCT PRICE]
    [BUY BUTTON]
    [PRODUCT SHORT DESCRIPTION]
    [CATEGORIES & TAGS]
    [SHARE]

    Ive already used child version of content-single-product.php to move the title of product and crumbs to be full width above the image and right hand side product summary container.

    If you still need an image let me know.

    Many thanks for your help!

    #267400
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    thanks just need a link to a product page to see what you have and how to adjust it with css.

    -Rui

    #267426
    Buysmartuk
    Member
    Post count: 22
    This reply has been marked as private.
    #267748
    David Martin – Support
    Moderator
    Post count: 20834

    Please add this to: Theme Options => Custom JS.

    if ( jQuery("form.cart").length > 0 ) {
        jQuery("form.cart").insertBefore( ".product-short" );
    }
    #267809
    Buysmartuk
    Member
    Post count: 22

    Hi,

    Hmmm not entirely what I was looking for its more a hacky way.

    function xyz_tweak_product_page(){
    	remove_action( 'woocommerce_single_product_summary', 'sf_product_share', 45 );
    	remove_action( 'woocommerce_single_product_summary', 'sf_product_short', 20 );
    	add_action( 'woocommerce_after_add_to_cart_form', 'sf_product_short', 20 );
    }

    I kind of got it running this way for now by adding this to functions.php. Unfortunately at the moment I have to run it at the end of sf-woocommerce.php but would prefer a hook which occurs at the end of that files actions happening to catch it without effecting that core file directly.

    Any ideas what action I could hook into?

    Many thanks.

    #267811
    Buysmartuk
    Member
    Post count: 22
    This reply has been marked as private.
    #267832
    David Martin – Support
    Moderator
    Post count: 20834

    Ok, I did not realise you wanted a hook specifically – Your function is broadly correct but should be within the child theme functions.php file.

    Why not add content-single-product.php to your child theme. Then add your own action before the price to avoid changing the action order or existing hooked functions.

    Ex, below within content-single-product.php

    				<?php 
    					// WooCommerce Title
    					woocommerce_template_single_title();
    				?>

    You could add,

    ``

    You can then hook like this in your child theme: ` add_action( ‘sf_single_product_after_title_before_content’, ‘woocommerce_template_single_add_to_cart’ );
    `

    #269204
    Buysmartuk
    Member
    Post count: 22

    Oh sorry 🙂

    This looks really interesting I will give it a whirl and let you know how I get on but this looks a lot more maintainable.

    Many thanks!

    #269284
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to David.
    Mohammad

Viewing 11 posts - 1 through 11 (of 11 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