Home Forums WoodMart support forum add image under “wd-product-brands set-mb-s woodmart-product-brands”

add image under “wd-product-brands set-mb-s woodmart-product-brands”

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #399100

    loralora
    Participant

    Hello

    Please help me how to add “acf” image under “wd-product-brands set-mb-s woodmart-product-brands”

    i don’t know php well, i tried this but it didn’t work.
    your help?

    add_action( 'woocommerce_single_product_summary', 'display_image_logo_acf', 40 );
    function display_image_logo_acf() {
        global $product;
    
    add_image_size( 'new-size', 254, 340, true );
    $image = get_field('prod_logo');
    $size = 'new-size'; // (thumbnail, medium, large, full)
    
    if( $image ) {
      echo  class="wd-product-brands-links woodmart-product-brands-links" wp_get_attachment_image( $image, $size );
    }
    }
    • This topic was modified 3 years, 10 months ago by loralora.
    Attachments:
    You must be logged in to view attached files.
    #399239

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Sorry but we could not help with Customizations.

    This is beyond our limitations and support policy.

    You can try modifying the single product layout using our layout builder:
    https://xtemos.com/docs-topic/single-product-page-builder/

    Best Regards

    #399384

    loralora
    Participant

    I understood about the code.

    Then I ask you for help with a hook to add my code to this particular field.

    add_action( 'woocommerce_single_product_summary', 'display_image_logo_acf', 0 );
    function display_image_logo_acf() {
    
    add_image_size( 'new-size_prod_logo', 120, 40, true );
    $image = get_field('prod_logo');
    $size = 'new-size_prod_logo'; // (thumbnail, medium, large, full)
    if( $image ) {
       echo wp_get_attachment_image( $image, $size );   
     }
    }
    

    On the picture:

    In red: the element that I have added with the code (it works well).
    Green Arrow: This is where I need to move the code.
    Lettuce Branch: This is where I need to add the code.

    Please share the hook.

    Attachments:
    You must be logged in to view attached files.
    #399386

    loralora
    Participant

    If there is no hook, please provide a php file for redefinition, for a child theme

    #399480

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    You can find the file under “woodmart/woocommerce/content-single-product.php” and customize at your own risk.

    Best Regards

    #399575

    loralora
    Participant

    OKAY, WHICH LINES CAN I PUT THIS BETWEEN?

    #399707

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Sorry but we could not help in Customizations. This is beyond our limitations and support policy.

    Best Regards

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