jdizzle

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • jdizzle
    Participant
    Post count: 12

    Works, thank you for the quick fix!

    jdizzle
    Participant
    Post count: 12

    asking this gets added so i don’t need to change the core files.
    it’s in /class-woo-wallet-cashback.php

    in both functions:

    calculate_cashback_form_order
    please change
    $order->get_subtotal(‘edit’)
    to
    $order->get_total(‘edit’)

    calculate_cashback_form_cart
    please change
    wc()->cart->get_subtotal(‘edit’)
    to
    wc()->cart->total

    jdizzle
    Participant
    Post count: 12

    yes they should using total instead of subtotal. OR have the option to choose so.

    @subrata

    jdizzle
    Participant
    Post count: 12

    I know its not recommended, but i changed the top-up product to virtual and downloadable. That way Woocommerce completes the order automatically.

    jdizzle
    Participant
    Post count: 12

    yes, just found it. its already a shortcode created for the use of the plugin within its core files.
    it’s

    [mini-wallet]

    jdizzle
    Participant
    Post count: 12

    Final fix. but would be nice to have this documented somewhere.

    add_filter(‘woo_wallet_cashback_notice_text’, ‘cash_back_text’);

    function cash_back_text() {
    $cashback_amount = woo_wallet()->cashback->calculate_cashback();
    if (is_user_logged_in()) {
    echo sprintf(__(‘Upon placing this order a cashback of %s will be credited to your wallet.’, ‘woo-wallet’), wc_price($cashback_amount, woo_wallet_wc_price_args()));
    } else {
    echo sprintf(__(‘TEST log in to avail %s cashback from this order.’, ‘woo-wallet’), esc_url(get_permalink(get_option(‘woocommerce_myaccount_page_id’))), wc_price($cashback_amount, woo_wallet_wc_price_args()));
    }
    }

    When in the else statement you can put whatever text you want. as you can see i put test as a test lol

    jdizzle
    Participant
    Post count: 12

    you could use jquery to select it after the page finishes rendering.

    If their balance is 0, it can’t be shown without hacking it together.

    You can use this filter.
    add_filter( ‘woo_wallet_payment_is_available’, ‘__return_true’);
    But will need to do some more work arounds for error messages etc.

    It also creates the order still, but no payment gets captured (holding the order). You can work around this though.

    jdizzle
    Participant
    Post count: 12

    Not a bug. Requires custom coding.

    Instead of giving $50, give them $10.
    OR
    Hire a developer who can setup a conditional php statement to disable woo-wallet as payment if cart total is less than a desired amount.
    I’m no way affiliated with woo-wallet might I add.

    I’ll give you some tips to point you in the right direction. These filters turn on and off woo-wallet payment options.

    //disables woo-wallet
    add_filter( ‘woo_wallet_payment_is_available’, ‘__return_false’, -1);
    //Always show woo-wallet as option hack
    add_filter( ‘woo_wallet_payment_is_available’, ‘__return_true’);

    //This Woocommerce filter you can filter out which payments you want available.
    add_filter( ‘woocommerce_available_payment_gateways’, ‘your_unset_gateways_function’ );

    your_unset_gateways_function being the function which you run your conditional statements to whether or not you should show or disable the woo-wallet.

    Hope this helps.
    Best,
    JD

    PS I personally don’t do a credit program on registration as it’s too easy to manipulate.

    jdizzle
    Participant
    Post count: 12

    check the FAQ of the documentation.
    https://wpgenie.org/woocommerce-simple-auctions/documentation/#faq

    It has the exact question and answer you are looking for.

    jdizzle
    Participant
    Post count: 12

    This can’t be done without modifying core code. But you could try this depending on your setup.
    add_filter( ‘woocommerce_no_available_payment_methods_message’, ‘top_up_balance_error’ );
    function top_up_balance_error() {
    //edit content to what you would like.
    //make sure to add link to your wallet or add credits page.
    $content = ‘Your balance is not enough. Top-up now to complete checkout’;
    return $content;
    }

    This will change the output for when there are no available payment methods from the generic

    “Sorry, there is no available payment method for your current state…. etc”

Viewing 10 posts - 1 through 10 (of 10 total)
WhatsApp