• Kari Sharp

    (@karisharp)


    Hi —

    I am trying to use CSS to conditionally manipulate the labels and would really love it if the items were classed with the label text that they contain so you can differentiate between the labels.

    I added this code to class-wc-stock.base.php in various locations to add the class (I don’t see a way to add this file to my child theme to keep it from being overwritten… is that possible?):

    elseif ( $this_obj->backorders_allowed() && $this_obj->backorders_require_notification() ) {
    $availability = __( $available_on_backorder, ‘woocommerce’ );
    $availability_class = trim($availability);
    $availability_class = str_replace(” “, “-“, $availability_class);
    $availability_class = strtolower($availability_class);
    $class = ‘available-on-backorder available_on_backorder_color ‘ . $availability_class;

    Thanks!

    • This topic was modified 4 years ago by Kari Sharp.
  • The topic ‘Feature Request: Add class name of custom stock status label text’ is closed to new replies.