Skip to content

Instantly share code, notes, and snippets.

@soldier99
soldier99 / gist:28963ed6d21127b0addc445dda4ebc68
Created August 21, 2017 06:17
Woocommerce Change the add to cart button INTO View Product button
// Change the add to cart button INTO View Product button
// =================================================================================================================
add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' );
function add_product_link( $link ) {
global $product;
echo '<a href="'.$product->get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '</a>';
}
@soldier99
soldier99 / gist:36fc9a294ebc94232a0d9dcacea9a8ac
Created August 24, 2017 18:33
Leverage browser caching
Header unset Pragma
FileETag None
Header unset ETag
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
@soldier99
soldier99 / CSS
Last active July 14, 2018 11:35
Woocommerce sale flash badges: New, Featured and save percentage
/* Woocommerce regular Sale badge */
.woocommerce span.onsale {
left: 0;
top: -10;
font-weight: 600 !important;
min-width: 100px !important;
text-align: center;
}
.woocommerce ul.products li.product .onsale {