• Hello,

    By default The component product names are positioned under the composite product in cart and checkout. They are viewed in one line and separated by (;) mark.

    I will be glad if you could offer me some help in order to view those component product names in a list style without (;) mark.

    So instead of : product a; product b; product c;

    it will be :

    ?product a

    ?product b

    ?product c

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support miemie

    (@miemie)

    Hi @ibrahimal3ed,

    Are you wrong with another plugin?
    You can check our demo site and you can see that by default, our component product names appear in a list style without (;) mark in the cart and checkout as the screenshot below:
    https://prnt.sc/1dc63jd
    https://prnt.sc/1dc6yyc
    Regards,

    Thread Starter ibrahimal3ed

    (@ibrahimal3ed)

    @miemie
    sorry I didn’t explain it well.
    Its not by default.
    In the settings >> option [Hide component products on cart & checkout page] >> select [ yes but show component product names under composite ]

    This is the result
    https://i.ibb.co/CHPtnBJ/Capture.png

    So instead of : product a; product b; product c;

    I want it to be :

    ?product a

    ?product b

    ?product c

    Plugin Author WPClever

    (@wpclever)

    Hi @ibrahimal3ed

    Please add below snippet (How to add custom code?):

    add_filter( 'wooco_order_component_product_names', 'your_wooco_order_component_product_names', 99, 1 );
    function your_wooco_order_component_product_names( $names ) {
    	return '<ul>' . str_replace( '; ', '', $names ) . '</ul>';
    }
    
    add_filter( 'wooco_order_component_product_name', 'your_wooco_order_component_product_name', 99, 1 );
    function your_wooco_order_component_product_name( $name ) {
    	return '<li>' . $name . '</li>';
    }
    Thread Starter ibrahimal3ed

    (@ibrahimal3ed)

    @wpclever
    At first, I would like to thank you for your help. I do really appreciate it.

    However, it looks like there is a minor issue that appears with ‘variable product’ attributes.

    as you can notice in the image the attribute appeared with a prefix &#8211. This is the issue.

    capture

    • This reply was modified 3 years, 4 months ago by ibrahimal3ed.
    • This reply was modified 3 years, 4 months ago by ibrahimal3ed.
    • This reply was modified 3 years, 4 months ago by ibrahimal3ed.
    Plugin Author WPClever

    (@wpclever)

    Sorry about that!

    Please change the whole previous snippet to:

    add_filter( 'wooco_order_component_product_names', 'your_wooco_order_component_product_names', 99, 1 );
    function your_wooco_order_component_product_names( $names ) {
    	return '<ul>' . str_replace( '; ', '', html_entity_decode( $names ) ) . '</ul>';
    }
    
    add_filter( 'wooco_order_component_product_name', 'your_wooco_order_component_product_name', 99, 1 );
    function your_wooco_order_component_product_name( $name ) {
    	return '<li>' . $name . '</li>';
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘change the view of component product names’ is closed to new replies.