Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1427885

    Hello there,

    i tried to insert individual text after the shipping rates in cart page.
    Link to image where i show on which position the text should appear: https://cloud.boehm.media/index.php/s/eCiPLPnZiJwMekK

    So i tried to use the hook “woocommerce_cart_totals_after_shipping” (as mentioned in the visual hook page of: https://www.businessbloomer.com/woocommerce-visual-hook-guide-cart-page/).
    Unfortunately it appears on top of the shipping section :-(
    This is the result: (Link to image) https://cloud.boehm.media/index.php/s/cyuPC0lHch6XKjK

    I hope, you can name me the right hook.

    Thanks a lot
    Kind regards
    Bernd

    #1428027

    Hey boehmmedia,
    I believe that you do have the right hook, but that you have not added any html tags to add text into the table, since I assume that your function looks something like this with just plan text:

    add_action('woocommerce_cart_totals_after_shipping', 'why_pay_shipping');
    function why_pay_shipping() {
    if (WC()->cart->cart_contents_total) {
    echo '▸ Warum bezahle ich Versandkosten';
     } 
    } 

    and you are getting this result:
    Enfold_Support_4090.jpeg
    to add the text into the table you need to add a table tag like this:

    add_action('woocommerce_cart_totals_after_shipping', 'why_pay_shipping');
    function why_pay_shipping() {
    if (WC()->cart->cart_contents_total) {
    echo '<td colspan="2" style="text-align:center;">▸ Warum bezahle ich Versandkosten</td>';
     } 
    } 

    this is the new result:
    Enfold_Support_4092.jpeg
    please give this a try.

    Best regards,
    Mike

    #1428058

    Hi Mike,

    thanks a lot for help :-) and sorry, that i doesn’t share my code :-(
    As i want to illustrate my issue i forget to copy the code into the post :-(

    With your help now it works. I have not realised that the shipping fees are ordered in a table.
    Your code works fine.

    Kind regards
    Bernd

    #1428061

    Hi,

    No problem! Glad @Mike was able to help you out. Please feel free to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hook for Woocommerce Cart Page after Shipping’ is closed to new replies.