• Resolved marcryu

    (@marcryu)


    Hi,

    Thank you for a great and lean plugin. πŸ™‚

    All is working super until I now need to exclude some products from cashback:

    1. When I set to product-wise/product category-wise at 5% on the settings page, ALL the products or product categories should by default enjoy 5% cashback right? Then I set the cashback to 0% on one specific product or product category, however, the 5% cashback is still given during checkout for that product or category which I supposedly have “disabled” cashback. Is it supposed to be like this? I had purged and disabled the cache when testing this.

    2. When the cashback is set to product-wise/product category-wise, every product listing is showing the cashback amount, which is distracting. Also, the amount of cashback is also wrong. There is always a $1 base amount added to the presented Cashback e.g. instead of $0.50 cashback, it shows $1.50 cashback. However, at checkout, the calculation is correct. So I’m puzzled.

    3. How do I remove the $X.XX cashback indication from all product listings?

    Appreciate any advice. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter marcryu

    (@marcryu)

    I have this snippet which you’d helped me with previously to adjust the cashback calculation. Could this be the reason for it not working when switching to product/category-wise?

    add_filter(‘woo_wallet_form_cart_cashback_amount’, ‘woo_wallet_form_cart_cashback_amount_callback’, 10);

    function woo_wallet_form_cart_cashback_amount_callback($cashback_amount) {
    $global_cashbak_type = woo_wallet()->settings_api->get_option(‘cashback_type’, ‘_wallet_settings_credit’, ‘percent’);
    $global_cashbak_amount = floatval(woo_wallet()->settings_api->get_option(‘cashback_amount’, ‘_wallet_settings_credit’, 0));
    $global_wallet_balance = woo_wallet()->wallet->get_wallet_balance( get_current_user_id(), ‘edit’ );
    if (‘percent’ === $global_cashbak_type) {
    $cashback_amount = $cashback_amount = (wc()->cart->get_subtotal() + wc()->cart->get_subtotal_tax()- $global_wallet_balance) * ($global_cashbak_amount / 100);
    }
    return $cashback_amount;
    }

    Plugin Contributor Moumita Adak

    (@moumitaadak)

    @marcryu Hi, Sorry for the delay in response.
    Yes, this code will only work for cart-wise cashback.

    Thank You

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

The topic ‘Product/Category-wise cashback not working as expected’ is closed to new replies.