[Resolved] Add custom text before price for furniture category.

Home Forums Support [Resolved] Add custom text before price for furniture category.

Home Forums Support Add custom text before price for furniture category.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1257490
    _blank

    Hi

    My client would like to add the text “From” before the Price for just the furniture category archive.
    Is it best to use PHP snippet for woocommerce_after_shop_loop_item_title to do this or can you help with the code?

    Thanks
    Scott

    #1257785
    David
    Staff
    Customer Support

    Hi there,

    Simplest way is with with some CSS like so:

    .woocommerce ul.products li.product .price .amount:before {
        content: 'From ';
    }
    #1258275
    _blank

    Hi David,

    Thanks that does work for every product.
    But they want to do it just to the “Furniture” category
    https://www.salvesengraham.com/product-category/furniture/

    Thanks
    Scott

    #1258714
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this instead:

    .woocommerce.term-furniture ul.products li.product .price .amount:before {
        content: 'From ';
    }
    #1259044
    _blank

    Hi Tom,

    That worked thanks!
    I just noticed on the Furniture product pages we have a row of related products in that category too.

    Tried added this CSS but didn’t work.

    .woocommerce.term-furniture .woocommerce-LoopProduct-link .related ul.products li.product .price .amount:before {
    content: ‘From ‘;

    Hope you can help.

    Thanks
    Scott

    #1259242
    David
    Staff
    Customer Support

    Try this CSS instead:

    .woocommerce ul.products li.product_cat-furniture .price .amount:before {
        content: 'From ';
    }
    #1259326
    _blank

    Hi David,

    Thats brilliant worked perfectly.

    Many Thanks
    Scott

    #1259354
    David
    Staff
    Customer Support

    Glad we could be of help

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.