• Hi, we have updated Bricks theme to the last version Bricks 2.2 and got some issuews withyour Tips plugin.

    we have it in the cart page (www.zgruzinska.sk) and once you choose tips amount, it normally applies, but active is still “No tips” button.

    Please help us to fix this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Janilyn T

    (@janilyn409)

    Hi @aleksandreeu ,

    Please clear the caches and cookies on your site and browser after updating major plugins and themes. If you use any caching plugin, please make sure to purge caches.

    You might want to check it in an Incognito tab or Private one to be sure. Or simply wait for some time before checking back.

    We do not have any technical support agent on this forum so we cannot provide any instructions regarding this issue, unfortunately.

    Best regards.

    jollyninjapirate

    (@jollyninjapirate)

    I have the same problem (but with the elementor pagebuilder).

    No amount of cache and cookie cleaning fixes the problem.
    Logging in as an admin fixes it, but for non-admin user (the majority) it does not work.

    Here is what I did to fix it:

    In get_tips() (line 111), $active_tips is only read from the WC session.
    But in ajax_apply_tip() (lines 200-225), when $ct_session (WC customer session) is null, which happens for guests, the tip is only saved to $_SESSION, not the WC session.
    So the cart fee is applied correctly via the apply_tips() fallback (which does check $_SESSION), but get_tips() never finds it and always marks “No Thanks” as active.

    The fix is to add the same $_SESSION fallback to get_tips() that already exists in apply_tips().

    @aleksandreeu
    Update includes/class-frontend.php with these lines:

    if ( 
    empty( $active_tips )
    && isset( $_SESSION['wpcot_tips'] )
    && $_SESSION['wpcot_tips']
    )
    {
    $active_tips = unserialize( $_SESSION['wpcot_tips'] );
    }

    Directly below line 111 ( $active_tips = $wc_session->get( 'wpcot_tips' );)

    So the code would look like this:

    public function get_tips() {
    ob_start();
    $wc_session = WC()->session;
    $active_tips = $wc_session->get( 'wpcot_tips' );

    if (
    empty( $active_tips )
    && isset( $_SESSION['wpcot_tips'] )
    && $_SESSION['wpcot_tips']
    )
    {
    $active_tips = unserialize( $_SESSION['wpcot_tips'] );
    }

    $tips = Wpcot_Helper()->get_tips( 'apply' );
    ...

    @janilyn409 Please add this fix to your main plugin branch!
    Currently I have to maintain a fork of the plugin and merge your updates manually.

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

You must be logged in to reply to this topic.