Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 104029

varktech.com on "[Plugin: WooCommerce - excelling eCommerce] identify if particular product has been purchased"

$
0
0

One approach would be to:
(1)grab a copy of my plugin http://wordpress.org/plugins/minimum-purchase-for-woocommerce/
(2) hack the core/vtmin-apply-rules.php file, function vtmin_minimum_purchase_check(), to do just what you want. Remove all of the function's code, and then create new code to verify 'purchased' or loop through the cart class and verify if 1450 purchased. If not, add your message to the cart class with the following: $vtmin_cart->error_messages[] = array ('msg_from_this_rule_id' => $rule_id_list, 'msg_from_this_rule_occurrence' => '', 'msg_text' => $message );
(3) the hacked plugin will do the rest, injecting the message in a nice format at the top of the cart.
(4) create a 'minimum purchase rule' (which in this case will do your function only) to cover all user roles, to activate the works.

and Bob's your uncle, Fanny's your aunt.

Vark


Viewing all articles
Browse latest Browse all 104029

Trending Articles