How can i get attribute from xpath?

How do I get a selected attribute term description to show on the page?

  • I am working in Wordpress with the Whitelight theme. I'm pretty new but know enough to be dangerous :)I have set up my attribute terms and added it to the variable product's page. Since they are scents, I would like to have the description (that I wrote when creating the term) appear on the product page. How this possible? Thanks! Happy Day!

  • Answer:

    So what you have are custom fields you've added to individual items? If so, then you'll be using http://codex.wordpress.org/Function_Reference/get_post_meta calls to get those out. More details required about where you're entering this data, if you're using custom post types, whether this is theme dependent, etc.

Snackpants at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

I'm not working in the custom fields section of the product. The best I can explain it is that I am setting up a "global" custom attribute for all products - this is where my description is input. Then, I edit the individual products by calling it a variable product and choosing from a list of terms that I set up in the first set. This does yield a proper drop down box with the terms I've chosen for that product. I would like for the description that I wrote for that term within the attribute. Does that make sense?

Snackpants

What plugins are you using to get these fields? Are you using http://wordpress.org/extend/plugins/advanced-custom-fields/? Or something else? You're speaking far too generally. WP is very customizable but I still don't have a sense of how you're inputting these "globals" and so don't have an idea of where they're getting stored. So, I have no idea how to programmatically retrieve them.

artlung

Okay, like I said, I know enough to be dangerous so I truly apologize for my faulty question and thank you for your patience! I assume that WooCommerce is the plug in that affects this. Whitelight is a WooCommerce theme.

Snackpants

This, then: http://wp-types.com/learn/create-an-ecommerce-wordpress-site/create-custom-fields-and-taxonomies/ then adding them to the view a la http://wp-types.com/learn/create-an-ecommerce-wordpress-site/single-product/. Sorry, I don't know much about WooCommerce. I suspect what you actually need is a WooCommerce expert. Add that to the tags on your question.

artlung

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.