Support » Plugin: Gift Wrapper for WooCommerce » add hooks where the “Add Gift Wrap” can appear

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Little Package

    (@littlepackage)

    @edumls

    Sure why not? I’m sure you could write some code, something like:

    function my_before_order_notes() {
        WC_Gift_Wrap()->wrapping->gift_wrap_action( '_after_cart' );
    }
    add_action( 'woocommerce_before_order_notes', 'my_before_order_notes' ) );

    Add that to your child theme functions.php file -or- use Code Snippets to add it to the frontend. And turn off the default Gift Wrapper locations (set them to “none”).

    FWIW I wrote that code in about two minutes so if it doesn’t quite work please pass it to your developer to have them finetune it. But that’s the idea!

    (edit) It’s easier to hook in outside cart/checkout forms, otherwise modal submits will create the error you see with the code above. Trick is to move the modal outside the form in the dom…

    Thread Starter edumls

    (@edumls)

    Thanks!!

    It works (appear in the choosed hook). There is only one error in the code with a duplicate “)” in the last line. I say it just for debugging 😉

    BUT, as you say, does not work correctly. Does not add gift wrap to the order and show an error.

    Now we test all the posibilities (thanks again!), we are going to think about where is the best place to put it.

    • This reply was modified 3 years ago by edumls.
    • This reply was modified 3 years ago by edumls.
    • This reply was modified 3 years ago by edumls.
    • This reply was modified 3 years ago by edumls.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add hooks where the “Add Gift Wrap” can appear’ is closed to new replies.