Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KoolPal/d2f4dd6cd7f9f8b785538e0e69f921c0 to your computer and use it in GitHub Desktop.
Save KoolPal/d2f4dd6cd7f9f8b785538e0e69f921c0 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Move Variations above Short Description
Plugin URI: https://www.facebook.com/groups/advanced.woocommerce/permalink/2114573521890389/
Description: Move the variations and Add to Cart to be above the short description.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
add_action( 'woocommerce_before_single_product', 'change_single_product_layout' );
function change_single_product_layout() {
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', 15 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment