• Resolved mqasimae

    (@mqasimae)


    I want to add an invoiced description against each sale which occurs via woocommerece.

    Basically there is a field in eway called invoice description, just want to know if there is a hook which we can use to add the product name to this field.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @mqasimae – you should be able to use the following filter: woocommerce_eway_description

    I haven’t actually set this up locally before, so I don’t have any suggestions as to how to make that change, but let me know if you have any questions.

    – Joey

    Thread Starter mqasimae

    (@mqasimae)

    Hi @jricketts4 , i am assuming that we will need to use this filter in a hook. Any suggestions which would that be. We will need an order object and an eway object i guess.

    Joey – a11n

    (@jricketts4)

    Hi @mqasimae – the filter is actually the hook, it’s currently:

    'InvoiceDescription' => apply_filters( 'woocommerce_eway_description', '', $order ),

    You would need to adjust the contents of that by using something like:

    add_filter( 'woocommerce_eway_description', 'your_function');

    It may take some adjusting, but the actual parameters can be found in the ‘includes’ folder of the plugin’s filed: class-wc-eway-api.php

    Thread Starter mqasimae

    (@mqasimae)

    Thanks @jricketts4

    I have achieved this by using WC()->cart->get_cart() in setDesc function.

    add_filter( ‘woocommerce_eway_description’, ‘setDesc’);

    Joey – a11n

    (@jricketts4)

    Thanks for letting us know @mqasimae!

    @mqasimae @jricketts4 Hi there – would either of you be able to provide a complete snippet that I can use to implement the above solution? I want to achieve the same thing – which is to use the product name as the description in eWay – at the moment it’s just blank. Thank you very much in advance.

    • This reply was modified 3 years, 8 months ago by gemt.

    HI @gemt – we won’t be able to provide a full snippet, so we highly recommend contacting one of the services on our Customizations page: https://woocommerce.com/customizations/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Invoice Description’ is closed to new replies.