Forum Replies Created

Viewing 15 replies - 46 through 60 (of 75 total)
  • Thread Starter Masidus

    (@masidus)

    Hi there,

    Thank you for your reply!

    We’ve already moved the ‘Have a coupon?’ box down to above the order notes box and would like the ability to move the gift wrap also.

    View post on imgur.com

    From working on previous issues, I am foreseeing that this might be more difficult than appears as I searched for a long time for custom code to make the form system work for the coupon dialogue.

    This is due to the fact that the action which is hooked to the ‘Apply Coupon’ button is ‘submit’, so if simply moved inside the checkout form, when the button is pressed to apply to coupon, it instead fires the submit for the whole checkout.

    I achieved this by following a guide which used JS to accomplish this – https://tamstradingpost.com/move-the-woocommerce-coupon-field-anywhere/

    The code I used personally is –

    /*Coupon move checkout*/
    
    /**
     * Need the jQuery UI library for dialogs.
     **/
    function ttp_scripts() {
        wp_enqueue_script('jquery-ui-dialog');
    }
    add_action('wp_enqueue_scripts', 'ttp_scripts');
    
    /**
     * Processing before the checkout form to:
     * 1. Hide the existing Click here link at the top of the page.
     * 2. Instantiate the jQuery dialog with contents of 
     *    form.checkout_coupon which is in checkout/form-coupon.php.
     * 3. Bind the Click here link to toggle the dialog.
     **/
    function ttp_wc_show_coupon_js() {
        /* Hide the Have a coupon? Click here to enter your code section                                                
         * Note that this flashes when the page loads and then disappears.                                                
         * Alternatively, you can add a filter on                                                                       
         * woocommerce_checkout_coupon_message to remove the html. */
        wc_enqueue_js('$("a.showcoupon").parent().hide();');
    
        /* Use jQuery UI's dialog feature to load the coupon html code                                                  
         * into the anchor div. The width controls the width of the                                                     
         * modal dialog window. Check here for all the dialog options:                                                         
         * http://api.jqueryui.com/dialog/ */
        wc_enqueue_js('dialog = $("form.checkout_coupon").dialog({                                                      
                           autoOpen: false,                                                                             
                           width: 500,                                                                                  
                           minHeight: 0,                                                                                
                           modal: false,                                                                                
                           appendTo: "#coupon-anchor",                                                                  
                           position: { my: "left", at: "left", of: "#coupon-anchor"},                                   
                           draggable: false,                                                                            
                           resizable: false,                                                                            
                           dialogClass: "coupon-special",                                                               
                           closeText: "Close",                                                                          
                           buttons: {}});');
    
        /* Bind the Click here to enter coupon link to load the                                                         
         * jQuery dialog with the coupon code. Note that this                                                               
         * implementation is a toggle. Click on the link again                                                          
         * and the coupon field will be hidden. This works in                                                           
         * conjunction with the hidden close button in the                                                               
         * optional CSS in style.css shown below. */
        wc_enqueue_js('$("#show-coupon-form").click( function() {                                                       
                           if (dialog.dialog("isOpen")) {                                                               
                               $(".checkout_coupon").hide();                                                            
                               dialog.dialog( "close" );                                                                
                           } else {                                                                                     
                               $(".checkout_coupon").show();                                                            
                               dialog.dialog( "open" );                                                                 
                           }                                                                                            
                           return false;});');
    }
    add_action('woocommerce_before_checkout_form', 'ttp_wc_show_coupon_js', 10);
    
    /**                                                                                                                 
     * Show a coupon link before order notes section.                                                                                                      
     * This is the 'coupon-anchor' div which the modal dialog
     * window will attach to.
     **/
    function ttp_wc_show_coupon() {
        global $woocommerce;
    
        if ($woocommerce->cart->needs_payment()) {
            echo '<p style="padding-bottom: 1.2em;"> Have a voucher? <a href="#" id="show-coupon-form">Click here to enter your code</a>.</p><div id="coupon-anchor"></div>';
        }
    }
    add_action('woocommerce_before_order_notes', 'ttp_wc_show_coupon', 10);

    Hope this helps, many thanks!

    Thread Starter Masidus

    (@masidus)

    Hello,

    Is it possible for you to help me with the above coding please?

    I have tried again and again to make it work and it seems to be a simple change so if you could post the solution that would be greatly appreciated!

    Again, I simply want to change the text on the ‘Add to Cart’ button to ‘Add to Basket’

    Many thanks!

    Thread Starter Masidus

    (@masidus)

    Hi @makewebbetter

    Thank you for your swift reply and I did see the small section on the product page on the website which mentions this however could not find any further info in the documentation so was unsure of whether to purchase or not – a small note of this somewhere in the official documentation would prevent the same confusion for others in the future.

    My apologies for the mistake and again thank you for getting back to me so quickly – I really appreciate your time!

    Hope you and the team are all keeping well, all the best!

    Solution - The ability to target Product Categories within the plugin is ONLY available in the PRO version.

    Thread Starter Masidus

    (@masidus)

    Hello,

    Thank you for your message however I am unable to get the code to work.

    Would it be possible for you to upload the correct code to implement the changes?
    – All I need to do is change ‘Add to Cart’ to ‘Add to Basket’

    Many thanks!

    Thread Starter Masidus

    (@masidus)

    I have cleared the cache and there is no change unfortunately.

    Regarding my first question – is it possible to change the checkout-2 slug created by the plugin?

    Let me know if you need any further info, hope you’re well!

    Thread Starter Masidus

    (@masidus)

    Hi @rynald0s

    Thank you for your response and that was exactly it, caching has been invalidated on those pages now and everything is working great!

    Apologies for the question haha; I was over-complicating the issue and such a simple fix never even crossed my mind so much appreciated!

    Hope you’re well, many thanks!

    Solution:

    Caching plugin was caching the checkout page and worked after invalidating
    - checkout
    - my-account
    - cart
    Thread Starter Masidus

    (@masidus)

    Thank you very much for your swift reply!!

    I have just disabled copy protection so you can right click now 🙂

    Let me know if there’s anything else you need, thank you so much!

    Thread Starter Masidus

    (@masidus)

    Hi Antonino,

    Thank you for your message and for releasing the fix, I look forward to trying it out!

    Hope you’re well 🙂

    Thread Starter Masidus

    (@masidus)

    Excellent thank you for your time!

    I’ve submitted a support ticket to coupon plugin so hopefully that will be fixed in the near future.

    Also I’ve left a review for the plugin; again thank you for providing us with Matomo, it’s the definitely the best free platform!

    Thread Starter Masidus

    (@masidus)

    Hi @tsteur,

    No worries at all and thank you for your swift reply!

    Upon searching for the Diagnostics I clicked onto the Troubleshooting tab and manually invalidated the Matomo cache which has completely solved my problems!

    There are some problems which are evident in the logs still however relating to another plugin and I think there are some conflicts occurring, hence I will email you the logs regardless and if you wouldn’t mind taking a look that would be hugely appreciated.

    Thank you for your time and again such an amazing plugin – if anyone is thinking about downloading this and you haven’t already, DO IT and never rely upon Google Analytics or Facebook Analytics again!! (Especially if you run eCommerce – Facebook ads tracking is shockingly poor!)

    All the best!

    SOLUTION - Matomo > Diagnostics > Troubleshooting > 'Clear Matomo Cache'

    • This reply was modified 6 years, 3 months ago by Masidus.
    • This reply was modified 6 years, 3 months ago by Masidus.
    Thread Starter Masidus

    (@masidus)

    Hi @yukikatayama,

    Thank you for your reply!

    So the latest update to WooCommerce 4.0 has fixed this issue, howeevr I am still unable to personalise the text string as before.

    I’m looking to change the text for minimum and maximum spend to also reflect the coupon name in the message string, so for example – “The minimum spend for coupon ‘COUPON_NAME’ is £xx.” instead of the current – “The minimum spend for this coupon is £xx.”

    Many thanks!

    Having the same issue with the checkout and also the persistency of the coupon code: If for example you add products which do not satisfy the requirements of the coupon (like minimum price) and then you edit the contents of the cart to rectify this, the coupon is not reapplied.

    @highrollerusa What was the plugin that you found which works for you?

    Many thanks!

    • This reply was modified 6 years, 4 months ago by Masidus.
    Thread Starter Masidus

    (@masidus)

    Hi @webtoffee and thank you for your swift reply!

    Version is latest (1.4.2) and the site is https://watkinsprints.co.uk

    If there’s any furhter information that you require then feel free to drop me another line.

    Many thanks!

    Amazing, thank you for your reply and I look forward to the implementation!

    There are a few ways to achieve this but the main question is how did you enter the title in the first instance?

    The easiest way would to use your page builder and simply duplicate the title you made and set it to ‘Only for Mobile’ or something for that degree. Then conversely, change the original to ‘Hide for Mobile’.

    If this isn’t the case, then you either need to assign a class to the text to be able to edit it via Custom CSS or you’ll need to install a child theme (if you haven’t already done so) and look into editing your WooCommerce product page layout via edits to the functions.php file.

    This way you can inject and remove functions and areas until your hearts content and this will be reflected throughout the products pages.

    Hope this helps!

Viewing 15 replies - 46 through 60 (of 75 total)