Title: ehsan991's Replies | WordPress.org

---

# ehsan991

  [  ](https://wordpress.org/support/users/ehsan991/)

 *   [Profile](https://wordpress.org/support/users/ehsan991/)
 *   [Topics Started](https://wordpress.org/support/users/ehsan991/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ehsan991/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ehsan991/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ehsan991/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ehsan991/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ehsan991/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Wallet for WooCommerce] interfere with Woocommerce](https://wordpress.org/support/topic/interfere-with-woocommerce/)
 *  Thread Starter [ehsan991](https://wordpress.org/support/users/ehsan991/)
 * (@ehsan991)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/interfere-with-woocommerce/#post-15683032)
 * The problem was solved with a small change
    I put the code so that others can
   use it as well
 *     ```
       // Deny purchase if already purchased
       add_filter( 'woocommerce_is_purchasable', 'deny_purchase_if_already_purchased', 9999, 2 );
        function deny_purchase_if_already_purchased( $is_purchasable, $product ) {
          if ( is_user_logged_in() && wc_customer_bought_product( '', get_current_user_id(), $product->get_id() ) && get_post_status()!='private' ) {
             $is_purchasable = false;
             echo "already_purchased";
          }
          return $is_purchasable; 
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Wallet for WooCommerce] interfere with Woocommerce](https://wordpress.org/support/topic/interfere-with-woocommerce/)
 *  Thread Starter [ehsan991](https://wordpress.org/support/users/ehsan991/)
 * (@ehsan991)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/interfere-with-woocommerce/#post-15650902)
 * Thank you very much, it was very helpful
    But when the wallet-product is in the
   cart, the cart page does not open
 * debug.log:
 * #35 {main}
    thrown in mywebsite/wp-content/plugins/woocommerce/includes/class-
   wc-cart.php on line 2032
    -  This reply was modified 3 years, 11 months ago by [ehsan991](https://wordpress.org/support/users/ehsan991/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Wallet for WooCommerce] interfere with Woocommerce](https://wordpress.org/support/topic/interfere-with-woocommerce/)
 *  Thread Starter [ehsan991](https://wordpress.org/support/users/ehsan991/)
 * (@ehsan991)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/interfere-with-woocommerce/#post-15647206)
 * I found that, this plugin use WooCommerce to charge wallets ( Private Product)
 * how can i change my code only for Public Products ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Wallet for WooCommerce] shortcode for transactions list](https://wordpress.org/support/topic/shortcode-for-transactions-list/)
 *  Thread Starter [ehsan991](https://wordpress.org/support/users/ehsan991/)
 * (@ehsan991)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/shortcode-for-transactions-list/#post-15644233)
 * awesome . thanks

Viewing 4 replies - 1 through 4 (of 4 total)