September 28, 2013 at 11:43 pm #64651
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
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
Which hook will you be using?
October 2, 2013 at 12:18 am #65056
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
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.
October 28, 2013 at 12:10 am #69410
Maybe this will be what you’re asking for?
Here is the code from the content-single-product.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
* 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(); ?>>
* 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”>
* 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 –>
* 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
The do actions are the hooks but there’s nothing there for the button.
Don’t Woo offer support for this product?
October 28, 2013 at 8:52 am #69443
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:
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.
You must be logged in to reply to this topic.