• Resolved eltoine

    (@eltoine)


    Hi, we use your plugin URL Coupons for Woocommerce and I see that it does just work, when a client is logged in? Why is it not possible for customers who are not logged in?

    This should also work for these clients. Can you please help me?

    Please check:

    https://shaveclick.ch/?coupon=test

    you can create then an account to see that it works just with logged users.

    Thanks

    Elton Ferati

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

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    Sorry for the late reply. I’ve just replied to your question posted on our website.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    I’ve just replied to you on our site, but just in case, I’m posting same here:

    This is now fixed in the latest plugin v1.2.3. To make the coupons work for the guests with an empty cart, you need to enable the new “Force session start” checkbox in plugin’s settings (in “WooCommerce > Settings > URL Coupons”).

    Please give it a try and let me know if there are still any issues.

    Thread Starter eltoine

    (@eltoine)

    Hi mate.

    Thanks for your answer and fixing. BUT:

    When I open a product page, at the top now its written:

    “Voucher applied successfully.” without clicking at the “Buy” button.

    This message should NOT appear directly at the top of the product page, without clicking the Buy button.

    No message should be visible.

    Can you fix that too?

    Then its great! ??

    Thanks.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    Thanks for the feedback. Let me check if I can do that. Will get back to you as soon as possible.

    Thread Starter eltoine

    (@eltoine)

    Hi. Did you have time to check it? thx.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    Unfortunately, no. Will be doing that on Sunday, sorry about the delay.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    I’ve worked on the task with notices and here what I’ve came up with:

    Solution 1. Simplest solution – add product to the cart via URL, e.g.:

    https://example.com/product/test-product/?coupon=test&add-to-cart=2950

    I.e. we are adding product 2950 via add-to-cart argument. In this case, notice is displayed and we have a product in the cart. However, I understand, that sometimes this is not good enough, for example, when we want user to choose a variation of a variable product, so:

    Solution 2. First you need update the plugin to the latest v1.2.4. After that you need to add this PHP snippet, e.g. to your (child) theme’s functions.php file:

    
    add_action( 'alg_wc_url_coupons_after_coupon_applied', 'my_alg_wc_url_coupons_after_coupon_applied' );
    if ( ! function_exists( 'my_alg_wc_url_coupons_after_coupon_applied' ) ) {
        /**
         * Save and clear notices after applying URL coupon.
         */
        function my_alg_wc_url_coupons_after_coupon_applied() {
            $all_notices = WC()->session->get( 'wc_notices', array() );
            wc_clear_notices();
            WC()->session->set( 'my_alg_wc_url_coupons_notices', $all_notices );
        }
    }
    
    add_action( 'wp_head', 'my_alg_wc_url_coupons_notices' );
    if ( ! function_exists( 'my_alg_wc_url_coupons_notices' ) ) {
        /**
         * Display saved notices when cart is not empty.
         */
        function my_alg_wc_url_coupons_notices() {
            if ( function_exists( 'WC' ) && ! WC()->cart->is_empty() && ( $delayed_notices = WC()->session->get( 'my_alg_wc_url_coupons_notices', array() ) ) && ! empty( $delayed_notices ) ) {
                WC()->session->set( 'my_alg_wc_url_coupons_notices', null );
                WC()->session->set( 'wc_notices', $delayed_notices );
            }
        }
    }
    

    I.e. this snippet will force notice to be delayed until there is some product added to the cart.

    Please give it a try and let me know what you think.

    Thread Starter eltoine

    (@eltoine)

    Hi. For your Information, we use your Plugin for a Coupon site, where there are all new Clients who have not already added products, so this must really work from your Plugin ??

    Can you not update your Plugin with that funcionality, I am sure, all People who use this Plugin want not to shaow at the product page already without doing anything (adding to cart) the Information that the Coupon is already set.

    the more we have in the functions.php the worse is the loading time ??

    I would really appreciate if you could give an update without adding something in the functions.php..

    By the way, i wanted to test it but it Comes: “syntax error, unexpected ‘&'”

    The first line “add_action( 'alg_wc_url_coupons_after_coupon_applied', 'my_alg_wc_url_coupons_after_coupon_applied' ); ”

    Plugin Author Algoritmika

    (@algoritmika)

    @eltoine,

    Ok, will be adding it a bit later today. Will get back to you shortly…

    As for the error – it looks that there is something wrong with the copied code – probably single quotes symbols (') are replaced with HTML entities. Anyway, that shouldn’t be important when I add it to the plugin…

    Thread Starter eltoine

    (@eltoine)

    ok thanks a lot my friend, i wait for the updated Version.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    As promised, we’ve just released new plugin v1.2.6. There I’ve added new “Delay notice” checkbox option to the plugin’s “General” settings section (in “WooCommerce > Settings > URL Coupons”). After enabling the option, the plugin will do the following:

    1. When URL coupon is applied, it will check if cart is empty. If it’s empty, then no notices will be displayed, and they will be saved for later instead.
    2. When some product is added to the cart (i.e. cart becomes not empty), then those saved notices are displayed.

    Please give it a try and let me know if something is not working as expected.

    And if you like the plugin, please consider leaving me a rating.

    Thread Starter eltoine

    (@eltoine)

    Hi, I updated and now it works PERFECT! THANKS A LOT FOR THE GREAT SUPPORT!!

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @eltoine,

    Glad to hear it’s solved ?? Let me know if you need anything else. And thank you for the review, really appreciate it!

    Thread Starter eltoine

    (@eltoine)

    Hi, again me, since we use your plugin, many clients write us, that when they add a product to cart and go to cartpage, they get the message No products in the cart and the cart is empty. I tried it many times and i really see that its true. When i put the product a second time into the cart, then it works.

    Check: shaveclick.ch/?coupon=test

    Maybe sometimes it works but often it really does not work.

    We use WP Rocket for caching, i read something in google that this could may be the reason wjy this happens.

    Can you please urgently help fixing that?

    The couponcode “test” is just for testing.

    Please contact me as soon s possible.

    We also have second shop: linsenklick.ch/?coupon=test

    Here same problem.???

    Thread Starter eltoine

    (@eltoine)

    Please check, but first clear cache of browser or use incognito mode..if you want i cn send you also screen record video to show you..

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘works just for logged users?’ is closed to new replies.