Genesis & WooCommerce; hook needed to move add to cart button

Community Forums Forums General Discussion Genesis & WooCommerce; hook needed to move add to cart button

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  djw2 1 year, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #64651

    djw2
    Participant
    Post count: 31

    I have a client site using the Midnight Genesis theme and WooCommerce with the swatches extension. In some cases there are over 50 swatches for a product (finger nail polishes) and I need to move the ‘Add to Cart’ button from the bottom of the list of swatches to the top.

    Can anyone help me identify a hook I need and how to use it? I really don’t know how to modify hooks/php at all.

    Here is a page of WooCommerce hooks: http://docs.woothemes.com/document/hooks/http://docs.woothemes.com/document/hooks/

    This is to move the ‘Add to Cart’ button on a single product page, from the bottom to somewhere at the top of the page.

    (The site is currently private and I can’t share a URL. Sorry.)

    Thanks for any help!

    #64897

    djw2
    Participant
    Post count: 31

    Can anyone help me out with this? WooCommerce just offered links to the page of hooks, but no help with how to move them (beyond their scope).

    I would really appreciate the help of somone who knows what I need to do.

    Thanks for any suggestions.

    #64908

    braddalton
    Participant
    Post count: 10681

    Which hook will you be using?


    #65056

    djw2
    Participant
    Post count: 31

    I don’t actually know which hook to use. I thought ‘woocommerce_after_single_product’, but I don’t know if that will make it appear above the swatches and nearer the large product image or not.

    The site is live now, so I can share a link.

    Here’s one page example: http://impactsalonsales.com/product/prisma-pixie-2/
    But you won’t see the Add to Cart at all, because that is only for logged in members that are certified nail techs.

    The Add to Cart button currently sits at the bottom of all the swatches and I would like it to be at the top.

    Thanks so much for responding! I hope you can help.

    #65130

    braddalton
    Participant
    Post count: 10681

    I also saw all those hooks and there’s more for eCommerce than for the theme.

    Is there any example code of how to filter or hook in the cart?

    If it where Genesis then it would be easy.


    #69410

    djw2
    Participant
    Post count: 31

    Brad,

    Maybe this will be what you’re asking for?

    Here is the code from the content-single-product.php

    <?php
    /**
    * The template for displaying product content in the single-product.php template
    *
    * Override this template by copying it to yourtheme/woocommerce/content-single-product.php
    *
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly
    ?>

    <?php
    /**
    * woocommerce_before_single_product hook
    *
    * @hooked woocommerce_show_messages – 10
    */
    do_action( ‘woocommerce_before_single_product’ );
    ?>

    <div itemscope itemtype=”http://schema.org/Product” id=”product-<?php the_ID(); ?>” <?php post_class(); ?>>

    <?php
    /**
    * woocommerce_show_product_images hook
    *
    * @hooked woocommerce_show_product_sale_flash – 10
    * @hooked woocommerce_show_product_images – 20
    */
    do_action( ‘woocommerce_before_single_product_summary’ );
    ?>

    <div class=”summary entry-summary”>

    <?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’ );
    ?>

    </div><!– .summary –>

    <?php
    /**
    * woocommerce_after_single_product_summary hook
    *
    * @hooked woocommerce_output_product_data_tabs – 10
    * @hooked woocommerce_output_related_products – 20
    */
    do_action( ‘woocommerce_after_single_product_summary’ );
    ?>

    </div><!– #product-<?php the_ID(); ?> –>

    <?php do_action( ‘woocommerce_after_single_product’ ); ?>

    #69425

    braddalton
    Participant
    Post count: 10681

    The do actions are the hooks but there’s nothing there for the button.

    Don’t Woo offer support for this product?


    #69443

    djw2
    Participant
    Post count: 31

    The response I received when I asked Woo Support for help with this was:

    “You can do this with template changes and/or via hooks:

    http://docs.woothemes.com/document/template-structure/

    http://docs.woothemes.com/document/hooks/

    Unfortunately these types of customizations/modification are beyond what I can help you with here due to our support policy.”

    So I had to look elsewhere.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.