Zab Allah Zab Allah - 1 year ago 99
PHP Question

Woocommerce Google Product Feed

I'm using

and the
WooCommerce Google
product feed plugin.

Is there anyway to write a function, that would go through all my products, and if the price of the product is under $25, it checks off
"hide from feed"
on the product?

Any help would be appreciated

Answer Source

edit plugin file: woocommerce_gpf_frontend.php

right before return apply_filters( 'woocommerce_gpf_exclude_product', $excluded, $woocommerce_product->id, $this->feed_format );

add this line of code:

// hide products of $25 and lower, exclude from product feed. 

    if ( $woocommerce_product->get_regular_price() < 25 ){
                $excluded = true;

bang bang!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download