0

I'm trying to organize the product page so that there's a second "add to cart" button below the product's description for a variable product. Ideally I really would like for the product price and variable drop down selector to also be copied under the description, however I can settle for just the button if necessary.

I was able to successfully create a working duplicate of the add to cart button using the following code which I found here.

add_action( 'woocommerce_single_variation', 'second_button_single_variation', 30 );
function second_button_single_variation() {
global $product;
echo '<br>
    <button type="submit" class="single_add_to_cart_button button alt">'. esc_html( $product->single_add_to_cart_text() ).'</button>';}

However, it places the new add to cart button directly below the regular add to cart button (see here). Any idea how I can move it below the product description?

Or, if someone has a solution for copying the entire top section (add to cart button, product price, and variable selector dropdown) below the product description, I would love to hear it!

JipJipJimmy
  • 23
  • 2
  • 8
  • Have a look at this excellent visual guide by "businessbloomer.com" and adjust your hook and priority accordingly: https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/ – Chri.s Jan 04 '18 at 11:19
  • Here's the website (stackingcookware.com) but I'm constantly working on it so it may change. – JipJipJimmy Jan 04 '18 at 11:21
  • @Chri.s Oh wow that's an excellent guide! However, being a novice coder (at best) how would I go about "copying" those specific sections that I'm interested in? Or can you just provide an example and that I can play around with? – JipJipJimmy Jan 04 '18 at 11:26

0 Answers0