• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

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

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: add to cart button, midnight, WooCommerce

  • This topic has 7 replies, 2 voices, and was last updated 10 years, 1 month ago by djw2.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • September 28, 2013 at 11:43 pm #64651
    djw2
    Member

    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!

    September 30, 2013 at 9:03 pm #64897
    djw2
    Member

    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.

    September 30, 2013 at 11:56 pm #64908
    Brad Dalton
    Participant

    Which hook will you be using?


    Tutorials for StudioPress Themes.

    October 2, 2013 at 12:18 am #65056
    djw2
    Member

    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.

    October 2, 2013 at 4:36 pm #65130
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes.

    October 28, 2013 at 12:10 am #69410
    djw2
    Member

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

    October 28, 2013 at 5:25 am #69425
    Brad Dalton
    Participant

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

    Don't Woo offer support for this product?


    Tutorials for StudioPress Themes.

    October 28, 2013 at 8:52 am #69443
    djw2
    Member

    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.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble