Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
- AuthorPosts
jimbo.kuskyn
ParticipantAwesome! Thanks a lot! 🙂
jimbo.kuskyn
ParticipantThank you, Sarmistha!
One more question, related to the same Registration process.
Once the User gets fully registered, he is redirected to this page, which has two buttons.
I’ve been trying to get them hidden, but I am unable to. (tried via dashboard, checking the php/css, etc.).Do you have any suggestions?
Thanks a million!
jimbo.kuskyn
ParticipantThanks a lot! This worked
jimbo.kuskyn
ParticipantHi again,
While searching for more, I can see that there were others searching to do the same, so I was wondering if you could help me customise the code below (I am rubbish as a coder! 🙂
The website I found this is here – https://forums.envato.com/t/woocommerce-limit-a-product-to-only-be-purchased-once-per-user/75797/7
// Don't run on parents of variations, // this will already check variations separately if ( $product->is_type( 'variable' ) ) { return $purchasable; } // Get the ID for the current product (passed in) $product_id = $product->is_type( 'variation' ) ? $product->variation_id : $product->id; // return false if the customer has bought the product / variation if ( wc_customer_bought_product( wp_get_current_user()->user_email, get_current_user_id(), $product_id ) ) { $purchasable = false; } // Double-check for variations: if parent is not purchasable, then variation is not if ( $purchasable && $product->is_type( 'variation' ) ) { $purchasable = $product->parent->is_purchasable(); } return $purchasable;
Once again, thanks a lot for all your help!
- AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)