Home › Forums › WoodMart support forum › Attribute archive page
Attribute archive page
- This topic has 10 replies, 2 voices, and was last updated 6 years, 3 months ago by
Artem Temos.
-
AuthorPosts
-
December 3, 2018 at 7:20 pm #93510
luciushudsonParticipantHi 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 valueCan 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.December 3, 2018 at 7:30 pm #93515
luciushudsonParticipantPD: 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 informationAttachments:
You must be logged in to view attached files.December 4, 2018 at 7:07 am #93559
Artem TemosKeymasterHello,
You can enable archive option for any attribute in Dashboard -> Products -> Attributes https://gyazo.com/9809a59966c66bec20fd39f2419e4944
Regards
December 4, 2018 at 7:59 am #93620
luciushudsonParticipantHi 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)December 4, 2018 at 8:36 am #93627
Artem TemosKeymasterSorry, 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.
December 4, 2018 at 4:50 pm #93846
luciushudsonParticipantDo you mean to display products with all the terms from specific attribute?
No.
I mean to displayproductsa 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.December 4, 2018 at 7:22 pm #93888
Artem TemosKeymasterSo 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.
December 4, 2018 at 9:03 pm #93902
luciushudsonParticipantHi 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.December 5, 2018 at 7:11 am #93946
Artem TemosKeymasterHello,
You can get this meta value with the following code
get_term_meta( $term->term_id, 'image', true );
Regards
December 5, 2018 at 7:48 pm #94186
luciushudsonParticipantGreat Artem!
worked like a charm!
Thanks!!
You can close this ticketDecember 6, 2018 at 7:05 am #94236
Artem TemosKeymasterGreat, you are welcome.
-
AuthorPosts
The topic ‘Attribute archive page’ is closed to new replies.
- You must be logged in to create new topics. Login / Register