• Resolved moshe

    (@moshe1111)


    I use code associated with your plugin that returns points at fixed percentages on each product.
    Is it possible to set on one product, which will return to the customer only a certain number of points, and will not include the other points received on the other products, but only a certain number of points as pre-selected?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @moshe1111,
    Thank you for contacting us, are you referring to product reward?

    Thread Starter moshe

    (@moshe1111)

    Hi
    YES

    • This reply was modified 4 years, 3 months ago by moshe.

    Hi @moshe1111,
    myCred has a built-in product reward option you can set the reward on each product individually.

    Thread Starter moshe

    (@moshe1111)

    Although the code continues to work on the site does it not work on a manually configured product (on the edit page of the product in the widget)?

    Hi @moshe1111,

    If you are using the built-in reward option for product please make sure to remove the code as it will reward the user 2 times.

    Thanks!

    Thread Starter moshe

    (@moshe1111)

    Hi
    This is exactly my problem right now.
    Can’t use to purchase coupons without canceling the code?

    Thread Starter moshe

    (@moshe1111)

    /**
     * Woo Point Rewards by Order Total
     * Reward store purchases by paying a percentage of the order total
     * as points to the buyer.
     * @version 1.1
     */
    function mycred_pro_reward_order_percentage( $order_id ) {
    
    	if ( ! function_exists( 'mycred' ) ) return;
    
    	// Get Order
    	$order   = wc_get_order( $order_id );
    	$cost    = $order->get_subtotal();
    
    	// Do not payout if order was paid using points
    	if ( $order->payment_method == 'mycred' ) return;
    
    	// The percentage to payout
    	$percent = 3;
    
    	// Load myCRED
    	$mycred  = mycred();
    
    	// Make sure user only gets points once per order
    	if ( $mycred->has_entry( 'reward', $order_id, $order->user_id ) ) return;
    
    	// Reward example 3% in points.
    	$reward  = $cost * ( $percent / 100 );
    
    	// Add reward
    	$mycred->add_creds(
    		'reward',
    		$order->user_id,
    		$reward,
    		'Reward for store purchase',
    		$order_id,
    		array( 'ref_type' => 'post' )
    	);
    
    }
    add_action( 'woocommerce_order_status_completed', 'mycred_pro_reward_order_percentage' );
    Thread Starter moshe

    (@moshe1111)

    How to make it not include certain product IDs

    Hi @moshe1111,
    Above mentioned code works for the order total and not on the products. So we can’t exclude certain product ID’s through this code.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Global points on products that will not affect a single product’ is closed to new replies.