Skip to content

Instantly share code, notes, and snippets.

View bonniemercer's full-sized avatar

Bonnie Mercer bonniemercer

View GitHub Profile
@sybrew
sybrew / remove-woocommerce-message-part.php
Last active October 15, 2021 05:24
Removes "Continue Shopping" message from WooCommerce after item has been added to cart.
<?php
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) {
$start = strpos( $string, '<a href=' ) ?: 0;
$end = strpos( $string, '</a>', $start ) ?: 0;
return substr( $string, $end ) ?: $string;
} );
@katzueno
katzueno / vew.php
Last active August 31, 2018 07:06
concrete5 Manual Nav custom template to support external link's new window and nav_target page attribute
<?php defined('C5_EXECUTE') or die(_("Access Denied."));
/**
* concrete5.6.x Package 'Manual Nav' Custom Template
* @package Manual Nav
* @author Jordan Lev
* @author Katz Ueno
* @copyright Copyright (c) 2015 Katz Ueno. (http://katzueno.com)
* @license http://www.concrete5.org/license/ MIT License
* to support External Link's tareget="_blank"
* and page attribute 'nav_target'
@maxrice
maxrice / wc-rename-checkout-coupon-field.php
Last active July 5, 2023 19:34
WooCommerce - rename the "Have a Coupon?" message and "Apply Coupon" field on the checkout
<?php
// rename the "Have a Coupon?" message on the checkout page
function woocommerce_rename_coupon_message_on_checkout() {
return 'Have a Promo Code?' . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'woocommerce_rename_coupon_message_on_checkout' );
// rename the coupon field on the checkout page
@dziudek
dziudek / new_gist_file
Created August 13, 2013 10:35
Change ordering of the sale price and original price in WooCommerce
/**
*
* Code used to change the price order in WooCommerce
*
**/
function PREFIX_woocommerce_price_html( $price, $product ){
return preg_replace('@(<del>.*?</del>).*?(<ins>.*?</ins>)@misx', '$2 $1', $price);
}