Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Price and SKU next to each label #21

Open
Mantish opened this issue Dec 6, 2016 · 5 comments
Open

Show Price and SKU next to each label #21

Mantish opened this issue Dec 6, 2016 · 5 comments

Comments

@Mantish
Copy link
Member

Mantish commented Dec 6, 2016

This would only work for products with a single variable attribute, and we would probably need a setting to enable it

@JiveDig
Copy link

JiveDig commented Feb 27, 2017

Came here looking for the same thing. A simple solution that's very easy to implement is to pass the variation ID to the woocommerce_variation_option_name filter here https://github.com/8manos/wc-variations-radio-buttons/blob/master/templates/single-product/add-to-cart/variable.php#L25. That way we can add whatever variation specific data we want to each variation.

@yaniv691
Copy link

@Mantish, any thoughts of adding support for showing the price for each variation?
@JiveDig, can you please explain how this can be done using your suggestion? Thanks!

@JiveDig
Copy link

JiveDig commented Oct 23, 2017

Barely remember what I was going for, but based on my comment I think it means to change this:
$filtered_label = apply_filters( 'woocommerce_variation_option_name', $label );
to this:
$filtered_label = apply_filters( 'woocommerce_variation_option_name', $label, $id );

@yaniv691
Copy link

Thank your very much, but how would I go about showing the price for each variation using your code?
I'm a Woocommerce rookie :-)

@Mantish
Copy link
Member Author

Mantish commented Oct 24, 2017

@yaniv691 I haven't made any progress to support this.

I think we would need to match the attribute to the corresponding variation in $available_variations. Maybe using the woocommerce_variation_option_name as JiveDig suggest, but it can also be coded as part of the print_attribute_radio function.

The other way to do this is via Javascript. I haven't really look at how to do it, but it should be possible.

Anyway, I don't think there's a straightforward solution. Let us know if you make any progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants