Skip to content

Instantly share code, notes, and snippets.

@klikdiva
klikdiva / gist:e8769beb2c6d2654880935e5c3d1fb99
Created March 5, 2020 18:29 — forked from stuartduff/gist:5805532
Change the word Products in the WooCommerce breadcrumb trail
add_filter( 'woo_breadcrumbs_trail', 'woo_custom_filter_breadcrumbs_trail', 10 );
function woo_custom_filter_breadcrumbs_trail ( $trail ) {
foreach ( $trail as $k => $v ) {
if ( strtolower( strip_tags( $v ) ) == 'products' ) {
$trail[$k] = 'Photos';
break;
}
}
return $trail;
} // End woo_custom_filter_breadcrumbs_trail()
@klikdiva
klikdiva / wc-custom-tracking-code-for-thanks-page.php
Created February 23, 2020 02:36 — forked from woogists/wc-custom-tracking-code-for-thanks-page.php
[Frontend Snippets] Custom tracking code for the thanks page
/**
* Add custom tracking code to the thank-you page
*/
add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
function my_custom_tracking( $order_id ) {
// Lets grab the order
$order = wc_get_order( $order_id );
<?php
/**
* Plugin Name: Custom Fields for WooCommerce
* Description: Add custom fields to WooCommerce products
* Version: 1.0.0
* Author: Gareth Harris
* Author URI: https://catapultthemes.com/
* Text Domain: cfwc
* WC requires at least: 3.4.0
* WC tested up to: 3.4.2
@klikdiva
klikdiva / plugins.php
Created February 10, 2020 19:09 — forked from anonymous/plugins.php
Add extra info to WooCommerce product
<?php
/**
* Plugin Name: Pharmacy
* Plugin URI: http://domain.com
* Description: Add extra info for pharmacy products
* Author: Your name
* Author URI: http:// domain.com
* Version: 1.0
*/
@klikdiva
klikdiva / wc-add-shop-loop.php
Created February 10, 2020 19:02 — forked from bekarice/wc-add-shop-loop.php
Add WooCommerce product meta to the shop loop
/**
* Will add information to the shop loop above the "Add to cart" button
* This example will use post meta (custom fields) and display them if set
* Tutorial: http://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
**/
function skyverge_shop_display_post_meta() {
global $product;
@klikdiva
klikdiva / wc-add-shop-loop.php
Created February 10, 2020 19:02 — forked from bekarice/wc-add-shop-loop.php
Add WooCommerce product meta to the shop loop
/**
* Will add information to the shop loop above the "Add to cart" button
* This example will use post meta (custom fields) and display them if set
* Tutorial: http://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
**/
function skyverge_shop_display_post_meta() {
global $product;
@klikdiva
klikdiva / wc-add-shop-loop.php
Created February 10, 2020 19:02 — forked from bekarice/wc-add-shop-loop.php
Add WooCommerce product meta to the shop loop
/**
* Will add information to the shop loop above the "Add to cart" button
* This example will use post meta (custom fields) and display them if set
* Tutorial: http://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
**/
function skyverge_shop_display_post_meta() {
global $product;