Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Last active January 28, 2024 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BFTrick/e19bd2bb648558ca78279c3d5ba9524e to your computer and use it in GitHub Desktop.
Save BFTrick/e19bd2bb648558ca78279c3d5ba9524e to your computer and use it in GitHub Desktop.
A demo plugin to move the WooCommerce sinmple product price lower
<?php
/*
Plugin Name: WooCommerce Move Product Page Price Lower
Plugin URI: https://gist.github.com/BFTrick/e19bd2bb648558ca78279c3d5ba9524e
Description: A demo plugin to move the WooCommerce sinmple product price lower
Version: 1.0
Author: Patrick Rauland
Author URI: http://speakinginbytes.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: woocommerce-move-product-price
Domain Path: /languages
*/
// We're going to run our code after WooCommerce is loaded
add_action( 'woocommerce_loaded', 'mastering_woocommerce_lower_product_price', 20 );
// For our simple product's we're going to move the product price lower down the page.
// May be theme dependent. This code was tested against Storefront
function mastering_woocommerce_lower_product_price( ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 35 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment