Home Forums WoodMart support forum show Before "Add to cart button" text area in specific product category

show Before "Add to cart button" text area in specific product category

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #174240

    nicksfikas
    Participant

    Hi,
    I want to show the Html code in Before “Add to cart button” text area for specific product categories. Can you help me?
    thanks

    #174248

    nicksfikas
    Participant

    Basically I want to show it only for products that have a specific attribute

    #174249

    Hello,

    I visited the URL you provided. Unfortunately, you could not add HTML Block in the before Add to Cart Button for separate product categories.

    You need to use it in the product short description area from edit product for specific products of the category.

    Screenshot for Clarification: https://ibb.co/ZB3GwJx

    Best Regards.

    #174250

    nicksfikas
    Participant

    I want to show the Html for all the products with a specific attribute.

    #174251

    nicksfikas
    Participant

    what about the child? How about adding a code in the child theme?

    #174280

    Hello,

    You need to add the following code into your child theme functions.php file.

    add_action( 'woocommerce_before_add_to_cart_form', 'htdat_content_after_addtocart_button' );
    function htdat_content_after_addtocart_button() {
    
        // NOTE: replace your category slugs for 'category-01' and 'category-02'
        if ( is_product() && has_term( array( 'accessories', 'furniture' ), 'product_cat' ) ) {
       	 echo '<div style="clear: both"></div>';
       	 echo do_shortcode ('[html_block id="2965"]');   	 
        }  
     
    }

    NOTE: replace your category slugs for ‘accessories’ and ‘furniture’ and replace the html block shortcode with yours.

    Best Regards.

    #174385

    nicksfikas
    Participant

    but I want to show the Html code only for products that have value in specific attribute

    #174462

    Hello,

    Unfortunately, we could not provide you with the code you want. Because it’s WooCommerce plugin customization.

    You can try contacting the WooCommerce support for this. Or you can use any third party plugin that better meets your requirements.

    Best Regards.

    #175697

    nicksfikas
    Participant

    no, you did not understand
    I want the code that you sent me but I want to check for a product attribute, not a category

    #175738

    Hello,

    As I mentioned in my previous reply. Unfortunately, we could not provide you with the code you want. Because it’s WooCommerce plugin customization.

    You can try contacting the WooCommerce support for this. Or you can use any third party plugin that better meets your requirements.

    Best Regards.

    #175747

    nicksfikas
    Participant

    but it has to do with your theme’s function

    #175769

    Artem Temos
    Keymaster

    Sorry, but we don’t have a code for such a purpose. It may require additional code customization but it is out of our theme support scope.

    Regards

    #176846

    nicksfikas
    Participant

    it is your theme function.
    You sent me a code for categories, why won’t you send me a code for attributes?

    #176853

    Artem Temos
    Keymaster

    No, it is not our native theme’s function and it can work for the categories only. We don’t have a snippet for product attributes. Sorry, but additional code customizations are out of our theme support scope.

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