Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am considering my current shop to one that uses woocommerce and I am having an issue with the product variations. I am selling fabric by the yard in 1/4 yard increments and when I set up the product variation, it shows up on the product page as "From:XX," with "XX" being the lowest priced variation, which in this case is the 1/4 yard increment. I need the one yard increment to show on the product page with text to read "price per yard" rather than "from..." The variations themselves work, but the labeling is wrong. Where in the script can I make changes in to get the correct price selected and the text changed? Thanks in advance.

share|improve this question

closed as off-topic by ialocin, G. M., Johannes Pille, birgire, Rarst Aug 22 at 20:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

You can use WooCommerce built-in filter/hooks to modify the output for pricing. I believe the filter you want is woocommerce_variation_price_html; you can find the documentation at WooCommerce Docs. It's going to require some PHP coding to do.

But a simple solution may be to use simple products using the quantity to determine your total pricing. So in your case set the price per 1/4 yard and allow the customer to indicate the number of '1/4 yards' they would like to purchase.

WooCommerce would then show the price per 1/4 yard and you could do away with the overhead of variations.

share|improve this answer
Thanks for the info. I was able to change the text to my liking (in the filter that you suggested), but I still cannot change the pricing. Right now, the price is pulled from "min_price". I need to get the price from the fourth option in my variable string. I'm not sure what to type in, however. Please advise. –  GVH Feb 2 '13 at 23:23
Without code examples there is little that I can do to help. –  Stephen Feb 3 '13 at 14:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.