Viewing 11 replies - 1 through 11 (of 11 total)
  • that specific part of the code is called in wc-kalkulator/views/woocommerce/cart.php

    <p class="wck-cart">
        <?php echo wp_kses($view->html, Sanitizer::allowed_html()); ?>
        <?php if (is_page('cart') || is_cart()): ?>
            <a href="<?php echo esc_attr($edit_link); ?>"><?php _e('Edit product', 'wc-kalkulator'); ?></a>
        <?php endif; ?>
    </p>

    i dont know where it is being called.. but it seems that its been called twice. I am investigating..

    Thread Starter bojutesi

    (@bojutesi)

    ye that i know but if u delete that and put something else IT was double to. IT seems that not a plugin mistake mayby. I dont know. Im not programist -:)

    that means that there some sort of loop before the code, that is calling that.. making it appear twice.. i am still looking. That particular code itself has nothing wrong..

    Somehow the $product_name seems to have the wck fields attached.. which makes this to happen. The developer would find this bug a lot quicker than me.. but i am still trying…

    as a workarround for temporary fix (needs further testing) you can replace the line 104 of wp-content/plugins/woocommerce/templates/cart from this one:
    echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $product_name ), $cart_item, $cart_item_key ) );
    to this one :
    echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );

    It’s a temporary fix that will be removed once you update your woocommerce…

    .. i am still looking for a reall fix on this… but this should help for the time being..

    better yet.. keep the unchanged cart.php on your woocommerce directory and make a new dicrecty called “cart” on your theme folder. Then copy the changed cart.php to that directory. That will keep the original file untouched unless you update your theme..

    If you still want to protect yourself to theme updates.. then you must create a child theme and make the updates there instead of the original theme location.

    Hope that it helps..

    Thread Starter bojutesi

    (@bojutesi)

    Ye i think is good. Thx a lot. Im testing now and i think is ok.

    Thread Starter bojutesi

    (@bojutesi)


    do I have to create the full directory path in the child theme or just the “cart” directory and paste the changed file there??

    p.s. OK i got it thx πŸ˜€

    • This reply was modified 2 years, 11 months ago by bojutesi.

    For anyone who sees this later, this was a bug in Woocommerce itself, and has been patched, bug fix will be released in Woocommerce 7.9.0 (Currently 7.8.2, so bug fix isnt live yet)

    a temporary work around is listed above (create cart folder in child theme, with cart.php inside, and copy the contents of https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/templates/cart/cart.php

    See bug fix change in woocommerce logs below

    https://github.com/woocommerce/woocommerce/blob/9d5c90dad8b627d1465c8a0d9df24f90bafb2efc/plugins/woocommerce/changelog/issues-38744-duplicate-filter

    https://github.com/woocommerce/woocommerce/commit/9d5c90dad8b627d1465c8a0d9df24f90bafb2efc#diff-1470770b8060b33be1db8bfa6ebb77aaef8204c09c738d3fb43666d626a7d12d

    Thread Starter bojutesi

    (@bojutesi)

    Yes its correct. But i have a another problem. When im on main home page the cart is looking like this:

    When im in cart page the cart is looking like this:

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Problem in cart’ is closed to new replies.