• Resolved Toygar Niron

    (@tniron)


    Hello,

    We have been using your plugin for 2 years and we are happy. We will publish a new version of our website in a few months and this site is multilingual so it includes multiple currencies.

    Our settings on our old site allow the user to earn 1% points for each sale made. But in multicurrency this seems a bit unfair.

    If the user wants to buy the product in USD, this means that he will earn 1 point for 100USD. However, if the user wants to buy the product in TRY, he gets 18 points because it is 100USD=1800TRY. How we can solve this problem?

    Our code that allows users to earn 1% points from each sale;

    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 = 1;
    	// 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 25% 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' );

    Thank you

    • This topic was modified 3 years, 7 months ago by Toygar Niron.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • A.Tariq

    (@arsalantariq)

    Hi @tniron,

    Thank you for contacting us, Our ‘Store Rewards’ feature provides the option to reward the user with points on purchasing a product. You can set a different reward for each product but that reward will be static. You cannot base the reward on the price of the product or any exchange rate or currency.
    So multi-currency shouldn’t have an effect on it.

    Please visit the below link to see our Store Rewards feature’s documentation.
    https://codex.mycred.me/chapter-iii/gateway/woocommerce/store-rewards/

    For more in-depth information you can open a support ticket on our website.

Viewing 1 replies (of 1 total)

The topic ‘Points For Purchase Multicurrency’ is closed to new replies.