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'm playing around with woocommerce and I followed their instructions to do my own single-product template by copying to my theme's folder within the structure they recommend.

So the thing is that the product page is working pretty well, but I'm facing some issues when is a variable product involved.

My question is, are there any hook or something to display the variations associated with that specific product, something like when you add product's attributes manually like:

<?php echo apply_filters('single_add_to_cart_text', __( 'ADD TO MY BASKET', 'woocommerce' ), $product->product_type); ?>

That will add the single add to cart button individually, is there a similar code to display the product variations? Thanks a lot.

share|improve this question
add comment

1 Answer 1

No afraid not, there really isn't a hook/filter that displays the variations.

If you've copied all the template files to your themes directory you need to look at ..THEME..\woocommerce\single-product\add-to-cart\variable.php to see how WooCommerce displays the product variations.

share|improve this answer
    
Thanks for your answer Stephen, I will try this. In fact I copied the code within variable.php within my template but I got error. The thing is that I'm not using the woocommerce's default <?php woocommerce_get_template_part( 'content', 'single-product' ); ?> because that inserts the entire thing as a block and I hate to not have control of individual data. I will try to use INCLUDE for variations.php –  Jaypee Jan 21 '13 at 15:44
    
Sounds like you're making a lot of extra work for yourself. Look at using the 'standard' WooCommerce/WordPress flow and modifying the content parts in the single-product directory. –  Stephen Jan 21 '13 at 15:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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