• Resolved abeldb

    (@abeldb)


    Hello!

    Fantastic plugin, congratulations!


    I wolud add variation or color on description/title archive page varition.

    Can you tell me a piece of code to add in function.php childteme to add variation (img or color) to show on description-tax archive page?

    Thanks in advance!

    —-
    Something similar to:

    add_action( 'woocommerce_archive_description', 'custom_att_display', 10 );
    function custom_att_display(){
        if(is_product_category()){
            global $product;
            $attribute_names = array('pa_color', 'pa_acabados', 'pa_materia');
            foreach( $attribute_names as $key => $attribute_name ) {
                $attribute_value = array_shift(wc_get_product_terms( $product->id, $attribute_name));
                if(!empty($attribute_img) || $attribute_img == '0' ){
                    echo $attribute_img;
                }
            }
        }
    }
Viewing 11 replies - 1 through 11 (of 11 total)
  • @abeldb

    Which theme are you using?

    Thank You

    Thread Starter abeldb

    (@abeldb)

    Hi!
    We’re using Enfold theme.

    Now, it only display description-tax on archives pages.

    Thanks in advance.

    Thread Starter abeldb

    (@abeldb)

    Hello!

    Please, can you tell me something about it?

    Thanks in advance

    Could you record me the area where you want to place it using tool like useloom.com

    Thank you

    Thread Starter abeldb

    (@abeldb)

    Hello!

    Well… images will be valid, right?

    In Archive-tax page, tittle or description div of pa_materia:
    https://i.postimg.cc/0QW9pfJR/Anotaci-n-2020-06-08-210006.jpg

    In Archive-tax page, tittle or description div of pa_color:
    https://i.postimg.cc/nL1FLZFL/Anotaci-n-2020-06-08-210006.jpg


    As tell you before, in my code example, please look as a reference,
    Will be something similar to:

    add_action( 'woocommerce_archive_description', 'custom_att_display', 10 );
    function custom_att_display(){
        if(is_product_category()){
            global $product;
            $attribute_names = array('pa_color', 'pa_acabados', 'pa_materia');
            foreach( $attribute_names as $key => $attribute_name ) {
                $attribute_value = array_shift(wc_get_product_terms( $product->id, $attribute_name));
                if(!empty($attribute_img) || $attribute_img == '0' ){
                    echo $attribute_img;
                }
            }
        }
    }

    —-
    We want to add the thumbnail of attributes: pa_materia, pa_acabados and pa_color, before title or description in respective archive tax pages.

    Thanks again in advance!

    • This reply was modified 4 years, 5 months ago by abeldb.
    • This reply was modified 4 years, 5 months ago by abeldb.

    @abeldb

    Where I can download the theme?

    Thank You

    Thread Starter abeldb

    (@abeldb)

    Hello!

    Enfold theme it’s avaliable in: https://themeforest.net/item/enfold-responsive-multipurpose-theme/4519990

    But, are you sure that it’s necessary?


    Can you adjust my code exemple for your plugin please?
    My code works fine with CPT (Custom Post Types), but it’s necessary adjust it for your plugin.

    Please help me, I start this issue 3 weeks ago.
    Thanks again in advance.

    Thread Starter abeldb

    (@abeldb)

    Ummm… maybe you can tell me how to get variation image?

    Something similar to
    $acabado = get_wp_term_image('pa_acabado', $term);
    or
    $acabado = wp_get_attachment_image_src ('pa_acabado', 'thumbnail', $term );
    or
    $acabado = get_woocommerce_term_meta( $term->term_id, 'pa_acabado_swatches_id_photo', true);

    In my case, this examples doesn’t works.
    Can you help me, please?

    Thread Starter abeldb

    (@abeldb)

    Hello,

    Would you tell me how to get variation image?
    Thanks!

    Thread Starter abeldb

    (@abeldb)

    Hello again!

    Can you help me?
    One month and half that I still waiting…

    Please!

    @abeldb

    Could you follow this process: https://www.loom.com/share/02f3320f7b624f41af7521f652b8aae6

    Thank You

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Variaton image on archive title’ is closed to new replies.