This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Enable WooCommerce GPF feed item cache. | |
Plugin URI: http://docs.woothemes.com/document/google-product-feed/ | |
Description: Enables feed item caching in the Google Product Feed extension. | |
Version: 1.0 | |
Author: Lee Willis | |
Author URI: https://plugins.leewillis.co.uk/ | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/class-campaigns-db.php b/includes/class-campaigns-db.php | |
index bc572401..ee2e9892 100644 | |
--- a/includes/class-campaigns-db.php | |
+++ b/includes/class-campaigns-db.php | |
@@ -27,10 +27,21 @@ class Affiliate_WP_Campaigns_DB extends Affiliate_WP_DB { | |
if( defined( 'AFFILIATE_WP_NETWORK_WIDE' ) && AFFILIATE_WP_NETWORK_WIDE ) { | |
// Allows a single visits table for the whole network | |
- $this->table_name = 'affiliate_wp_campaigns'; | |
+ $visits_db = 'affiliate_wp_visits'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { | |
// If you need to modify the prices sent in the feed, you can modify the following | |
// properties of the feed_item object. | |
// The regular price of the item. | |
// $feed_item->regular_price_ex_tax | |
// $feed_item->regular_price_inc_tax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lw_crfw_return_redirect_url( $redirect_url, $cart ) { | |
if ( ! function_exists( 'wc_get_cart_url' ) ) { | |
WC()->frontend_includes(); | |
} | |
return wc_get_cart_url(); | |
} | |
add_action( 'crfw_return_redirect_url', 'lw_crfw_return_redirect_url', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_gpf_include_attribute_labels_in_title', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_crfwp_timing_options($options) { | |
$options['604800'] = __( 'One week', 'crwfp' ); | |
return $options; | |
} | |
add_filter( 'crfwp_timing_options', 'lw_crfwp_timing_options' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_gpf_remove_shipping_attrs($elements, $product_id) { | |
unset($elements['shipping_width']); | |
unset($elements['shipping_length']); | |
unset($elements['shipping_height']); | |
return $elements; | |
} | |
add_filter( 'woocommerce_gpf_elements_google', 'lw_gpf_remove_shipping_attrs', 11, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_exclude_shipping_weight( $feed_item ) { | |
$feed_item->shipping_weight = null; | |
return $feed_item; | |
} | |
add_filter( 'woocommerce_gpf_feed_item_google', 'lw_exclude_shipping_weight' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { | |
// Modify $feed_item->description here. | |
return $feed_item; | |
} | |
add_filter( 'woocommerce_gpf_feed_item_google', 'lw_woocommerce_gpf_feed_item_google', 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { | |
$feed_item->additional_elements['custom_label_0'] = array( 'My custom label' ); | |
return $feed_item; | |
} | |
add_filter( 'woocommerce_gpf_feed_item_google', 'lw_woocommerce_gpf_feed_item_google', 10, 2 ); |