Home Forums WoodMart support forum Attribute archive page

Attribute archive page

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #93510

    luciushudson
    Participant

    Hi guys,
    I have a specific Product Attribute which I would like to create an archive page for this term, so that I can show the configured terms for this attribute listed with:
    – The term name
    – The term description
    – And an Image preview for this value

    Can you please help me out?
    I’m having a great trouble getting this archive page generated.

    The term name is Canvas Surface and its slug is: canvas-surface

    So far my only accomplishment was to register this attribute as taxonomy using this snippet on my functions.php file; and to get it to show up as available on the Menu Page:

    add_action( 'init', 'register_attribute_as_taxonomy' );
    function register_attribute_as_taxonomy() {
        register_taxonomy(
            'pa_canvas-surface',
            'product',
            array(
                'label' => __( 'Premium Canvas Surfaces' ),
                'rewrite' => array( 'slug' => 'canvas-surface' ),
                'hierarchical' => true,
            )
        );
    }

    FYI
    This would be much simpler if I used this term as a Category instead of as an Attribute.
    But it’s now suitable for the use that I’m giving to my Categories vs Attributes.

    #93515

    luciushudson
    Participant

    PD: If you can think of a work around, it would help as well; as long as the information from this terms …
    – The term name
    – The term description
    – And an Image preview for this value
    …is queried from the Attributes Terms information

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

    Artem Temos
    Keymaster

    Hello,

    You can enable archive option for any attribute in Dashboard -> Products -> Attributes https://gyazo.com/9809a59966c66bec20fd39f2419e4944

    Regards

    #93620

    luciushudson
    Participant

    Hi guys. You are not interpreting my email correctly.
    What I want is a woocommerce PAGE where all the terms of a specific attributes are shown with its description (and image if possible) in the same PAGE.
    I already enabled archives for each term of this attribute, and I can get a list/grid of all the products which meet that attribute. But that’s not what I’m looking for.
    My goal isn’t to show products on this archive page that I’ trying to get going, but the list of terms themselves (for this specific attribute: canvas surfaces)

    #93627

    Artem Temos
    Keymaster

    Sorry, but we are now confused about the request.

    What I want is a woocommerce PAGE where all the terms of a specific attributes are shown

    Do you mean to display products with all the terms from specific attribute? Unfortunately, there is no such option in WooCommerce. You can display archive for one attribute term only.

    #93846

    luciushudson
    Participant

    Do you mean to display products with all the terms from specific attribute?

    No.
    I mean to display products a LIST OF TERMS (with their description, and preferably image) from specific attribute?
    An archive page of terms, not of products.

    Is this option available on Woocommerce via hook or custom template?
    Or should I do it via a custom WordPress template with a wp_query for that taxonmy?

    I’m showing you on the screenshot attached (besides the snippet that I already pasted on the first question) my other attempt of achieving my goal.

    Maybe, since all the googling that I’m doing is focused on Woocommerce instead of WordPress itself, that’s why I’m not finding any answers…

    Sorry for the persistence!
    You guys are way more expert than me regarding Woocommerce, so that’s why I’m bothering.

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

    Artem Temos
    Keymaster

    So you need to show terms not products. Unfortunately, there is no option and working code for this in WooCommerce. The files you created are dedicated to showing products from particular terms. You will need some advanced PHP code for your idea but, unfortunately, we don’t have a ready to use solution. It is out of our theme support scope.

    #93902

    luciushudson
    Participant

    Hi Artem. Yes, I pictured that is out of the support scope. But I was hoping that you guys could point me in the right direction to reach mi goal, or suggest a possible workaround.

    Actually in between my last answer and this last yours: I DID SOLVE IT! 🙂

    Please take a look since I’ll bother with one last question:
    http://ec2-34-217-106-21.us-west-2.compute.amazonaws.com/premium-canvas-surfaces/

    Below the print_r you’ll see that I have my list of terms that I’ll be working on, and improving from here. For example: adding links each term ON THE SHOP…

    Do you have any suggestion/can you help me out in order to get the Image preview for each value ??
    I would like to bring them up on this page! 🙂

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

    Artem Temos
    Keymaster

    Hello,

    You can get this meta value with the following code

    get_term_meta( $term->term_id, 'image', true );

    Regards

    #94186

    luciushudson
    Participant

    Great Artem!
    worked like a charm!
    Thanks!!
    You can close this ticket

    #94236

    Artem Temos
    Keymaster

    Great, you are welcome.

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

The topic ‘Attribute archive page’ is closed to new replies.