Home Forums WoodMart support forum html tags appear in product title in cart

html tags appear in product title in cart

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

    nacho7807
    Participant

    Hi there.
    It is happening to me in all the work that I do with woodmart theme that the html tags that I apply in product titles to give styles, appear on the cart page.
    Can we fix it somehow?
    In the forum I have seen a client with similar problems but no solution has been found.
    Thanks
    Greetings

    Attachments:
    You must be logged in to view attached files.
    #287353

    Hello,

    Please remove all the tags from the Product title, Woocommerce does not support.

    If you want to add the styles to the title, you can change the font by means of the Advanced typography option, which allows you to choose the item from a drop-down or insert your custom CSS class. Please navigate to the Theme Settings > Typography > Advanced Typography.

    Here is the documentation providing more detailed instructions: https://xtemos.com/docs/woodmart/advanced-typography-settings/

    Best Regards

    #287448

    nacho7807
    Participant

    Hi there.
    I have found the problem. Therefore I have found the solution. The problem lies in your theme files: woodmart > woocommerce > cart > cart.php.
    I have replaced the following lines:

    83. echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, esc_html( $_product->get_name() ), $cart_item, $cart_item_key ) . ‘ ‘ );
    87. echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, sprintf( ‘%s‘, esc_url( $product_permalink ), esc_html( $_product->get_name() ) ), $cart_item, $cart_item_key ) );

    For these others:

    83. echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, $_product->get_name(), $cart_item, $cart_item_key ) . ‘ ‘ );
    87. echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, sprintf( ‘%s‘, esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );

    All this I have done in child theme.

    This solves the problem of embedding html tags in the product title on the cart page.

    Regards

    Attachments:
    You must be logged in to view attached files.
    #287687

    Hello,

    Thank you for sharing the information.\

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)