Skip to content

Instantly share code, notes, and snippets.

var mapicon = new google.maps.MarkerImage("resources/images/icon_map2x.png", null, null, null, new google.maps.Size(65,65));
/**
* Remove shipping name from the label in Cart and Checkout pages
*/
add_filter( 'woocommerce_cart_shipping_method_full_label', 'wc_custom_shipping_labels', 10, 2 );
function wc_custom_shipping_labels( $label, $method ) {
if ( $method->cost > 0 ) {
if ( WC()->cart->tax_display_cart == 'excl' ) {
$label = wc_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
$label .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>';
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@kittenlane
kittenlane / 1-remove-woocommerce-tabs.php
Last active November 30, 2023 20:07
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
/* START Make the cart table responsive */
/* http://css-tricks.com/responsive-data-tables/ */
@media screen and (max-width: 600px) {
/* Force table to not be like tables anymore */
.woocommerce-page table.shop_table,
.woocommerce-page table.shop_table thead,
.woocommerce-page table.shop_table tbody,
.woocommerce-page table.shop_table th,
.woocommerce-page table.shop_table td,
@kittenlane
kittenlane / yoast_seo_metabox.php
Last active August 29, 2015 14:20
Move Yoast SEO metabox to bottom
//* Move Yoast metabox to bottom
add_filter( 'wpseo_metabox_prio', 'metaboxbottom');
function metaboxbottom() {
return 'low';
}
@kittenlane
kittenlane / add_currency_code_suffix.php
Created May 3, 2015 22:49
Add currency code as suffix to prices in WooCommerce
//* http://www.codemyownroad.com/add-currency-code-suffix-prices-woocommerce/
// Location: add to functions.php
// Output: displays $0.00 AUD on all pages
function addPriceSuffix($format, $currency_pos) {
switch ( $currency_pos ) {
case 'left' :
$currency = get_woocommerce_currency();
$format = '%1$s%2$s&nbsp;' . $currency;
break;
@kittenlane
kittenlane / canvas-to-woocommerce-pagination.functions.php
Created February 4, 2015 04:23
Replace WooCanvas Default Pagination with WooCommerce Pagination
/**
* Replace WooCanvas Default Pagination with WooCommerce Pagination
**/
add_action('init','alter_woo_hooks');
function alter_woo_hooks() {
remove_action( 'woocommerce_after_main_content', 'canvas_commerce_pagination', 01, 0 );
}
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 1 );
@kittenlane
kittenlane / image-replacement.css
Created February 3, 2015 01:47
CSS image replacement with text indent, replaces the -9999px hack.
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@kittenlane
kittenlane / woo-pagination-functions.php
Last active August 8, 2017 16:34
Add 'View All' to WooCommerce pagination
<?php /* Add to functions.php */
// If using Canvas: Replace WooCanvas Default Pagination with WooCommerce Pagination
add_action('init','alter_woo_hooks');
function alter_woo_hooks() {
remove_action( 'woocommerce_after_main_content', 'canvas_commerce_pagination', 01, 0 );
}
add_action( 'woocommerce_pagination', 'woocommerce_pagination', 1 );