Home Forums WoodMart support forum ECHO WooCommerce attributes IMAGES

ECHO WooCommerce attributes IMAGES

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #165450

    damianmerino
    Participant

    Is there any way to echo via php the images of the attributes labels?

    I need to echo the attributes IMAGES somewhere else in the SAME product page.

    I’ve managed to echo the attributes text using this piece of php code but I need to output the IMAGES instead.

    <?php
    function nt_product_attributes() {
    global $product;
        if ( $product->has_attributes() ) {
    
            $attributes = ( object ) array (
            'capacity'              => $product->get_attribute( 'pa_capacity' ),
            'size'            => $product->get_attribute( 'pa_size' ),
            );
        return $attributes;
        }
    }
    
    $attributes = nt_product_attributes();
    echo $attributes->capacity;
    echo $attributes->size;
    
    ?>

    Thank you for you help! 🙂

    #165487

    Hello,

    First of all thanks for choosing our Theme, we are glad to be you in WoodMart WordPress family :-).

    If you want to display the attribute labels on product image then you can enable the “Show attribute label on products” option from Products >> Attributes >> Edit (Your specific attribute).

    Screenshot: https://jmp.sh/cUDLNYD
    Screenshot: https://jmp.sh/eJvxg7s

    OR

    If you want to display the swatches images, then you can upload your image inside the specific attribute from “Image preview for this value” option inside the Products >> Attributes >> Configure Items.

    Also you can follow the below documentation:
    https://xtemos.com/docs/woodmart/variable-products-swatches/

    There is no other option display the labels via php code.

    Best Regards.

    #165496

    damianmerino
    Participant

    Hello again,

    I think you have misunderstood my question….

    Those options are ALREADY ENABLED and SHOWING ON THE PRODUCT PAGE – what I want to do is show those images AGAIN in a sticky bar I have set up, so they will show in the product AND on the sticky bar

    Please check example here… https://imgur.com/D7GZYTp

    #165519

    Hello,

    I have seen your screen shot and got your point that you want to display attribute images again on sticky bar.

    Unfortunately there is no such option in theme settings to do this, it requires customization and this is beyond our limitations and support policy.

    Best Regards.

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