Skip to content

Instantly share code, notes, and snippets.

View mio31337's full-sized avatar
🎳
Multiprojecting

Mario Markovic mio31337

🎳
Multiprojecting
View GitHub Profile
/**
* Function to display variations sale prices only when a variation on sale is selected
*/
function action_wc_before_single_variation() {
?>
<script type="text/javascript">
(function($){
// Check for the show_variation event that triggers when a variation is selected.
$('form.variations_form').on('show_variation', function(event, data){
<?php
/**
* Change TAX behaviour to prevent recalculating prices with VAT if VAT is different for other countrie, but instead price with VAT stays as it is.
*/
add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' );
?>
<?php
/**
* Removes admin notices for outdated template files
*/
function remove_template_files_notice() {
remove_action( 'admin_notices', 'wc_template_file_check' );
}
add_action( 'admin_init', 'remove_template_files_notice' );
@mio31337
mio31337 / wp-disable-plugin-update.php
Created January 3, 2024 15:21 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
<?php
// Add this code to your theme's function.php file
/**
* Remove /kategorija/ from Yoast SEO canonical meta data
*/
function custom_yoast_canonical( $canonical ) {
if ( is_product_category() ) {
$category = get_queried_object();
$canonical = str_replace("kategorija/", "", get_term_link( $category, 'product_cat' ));