Change Position of Add to Cart Button in WooCommerce

3d Animation

In WooCommerce, to change the position of the price and the add to cart button, you first need to remove it from its usual position and specify its new position. The example code below moves the price and the add to cart button just below the title at the top.


// Move price below title
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 6 );

// Move Add to Cart (includes variations) below price
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 7 );

To move the price below the short description use the code below.


 // Woocommerce move price below short description
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 20);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 10);