Last active
January 28, 2024 20:32
-
-
Save BFTrick/e19bd2bb648558ca78279c3d5ba9524e to your computer and use it in GitHub Desktop.
A demo plugin to move the WooCommerce sinmple product price lower
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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