• Hi,

    Any way I can add a class in cart/checkout item line so I can style the “force sell” products somewhat different?

    Or a filter hook or something I can use for this?

Viewing 1 replies (of 1 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi,

    “force sell” products are just standard products. You can edit them like any other WooCommerce product in the cart.

    Code would be something like


    add_filter( 'woocommerce_cart_item_class', 'cart_item_class_78356783443856', 10, 3 );
    function cart_item_class_78356783443856( $class, $cart_item, $cart_item_key ) {
    if ( ! empty( $cart_item['linked_to'] ) ) {
    $class .= ' your-custom-class';
    }

    return $class;
    }

    Regards,
    Dmytro

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.