8manos / wc-variations-radio-buttons

Let your customers choose product variations using radio buttons instead of dropdowns.
https://wordpress.org/plugins/wc-variations-radio-buttons/
GNU General Public License v2.0
62 stars 34 forks source link

variable subscription function #15

Open GoodGuyTaj opened 8 years ago

GoodGuyTaj commented 8 years ago

Call this function from the variable subscription to enable radio buttons. I will talk with WooThemes and see if they will let me post the whole variable-subcription.php file.

Mantish commented 8 years ago

Hi, Should this code be in a template file? Like templates/single-product/add-to-cart/variable-subscription.php ?

We would need the complete functional code to merge it. Let us know if you get to talk to WooThemes

thanks

GoodGuyTaj commented 8 years ago

Woothemes hasnt replied. Based on it being a GPLv3 license, I should be fine to post. I have updated the code to include the whole variable-subscription.php file.

Yes it should be in templates/single-product/add-to-cart/variable-subscription.php

Mantish commented 8 years ago

I was thinking we should put that template in a different folder like templates/extra and then in the readme add some instructions to use it. The reason for this is that I won't be able to actively support this feature, and make sure it works fine. By having it in the extra folder, whoever uses it would have to read the instructions and can be made aware of it. What do you think?

craighobson commented 7 years ago

Renaming the variable.php file to variable-subscriptions.php and replacing the file in the add-to-cart folder (in either the plugin or child theme) doesn't seem to work for Variable Subscriptions as suggested here: http://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/2459699-radio-buttons-for-attributes-variations

I'm using the default WooCommerce Storefront theme... Does this still work?

GoodGuyTaj commented 7 years ago

@Mantish

This should work fine. I wouldn't know how to structure that. Would that just be a php include?

GoodGuyTaj commented 7 years ago

@craighobson

Have you tried the code located here:

https://github.com/8manos/wc-variations-radio-buttons/pull/15/commits/d9122c904838d5e2298888828f44b5aeb10bb55a

The complete variable-subscription.php file is located at the link. Make sure you use the code in green.

You will need to update your variable-subscription.php file. I would HIGHLY recommend you do this in your child theme. Variable-subscriptions calls more parameters than just variables. Therefore renaming the file will not work.

Mantish commented 7 years ago

@GoodGuyTaj What I mean is just put the file in the templates/extra folder so it wouldn't work out of the box. Then, in the readme, we can put something like: Copy this file into your theme folder /woocommerce/single-product/add-to-cart/variable-subscription.php

GoodGuyTaj commented 7 years ago

@Mantish

That would be great!

dylk commented 7 years ago

Hi there. I am having this issue with variable subscriptions and this plugin also.

I tried adding the new variable-subscription.php to my child theme but the variable subscriptions is still broken.

Just wondering if you can provide any assistance? Is there perhaps a way to disable the radio buttons just for variable subscriptions so that they are still functional? Thanks!

GoodGuyTaj commented 7 years ago

@dylkelson

Hi. I assume you are not using the standard wordpress theme? Can you try the standard variable subscription on the standard wordpress theme and let us know if that works?

For my theme, I had to do some modifications to get the wc-variation-radio-buttons to work, but it was relatively minor php/html coding.

dylk commented 7 years ago

@GoodGuyTaj

Hi. Thanks for your reply. I tried it with the default 2016 theme and the variable subscriptions still isn't working. I also tried placing the updated variable-subscription.php directly into the subscriptions plugin to make sure it was using the new file, but no luck.

GoodGuyTaj commented 7 years ago

@dylkelson

That is very strange. The variable subscriptions should work on the default theme out of the box. What kind of errors are you getting?

Does wc-variations-radio-buttons not work either on the default them?

THe updated variable-subscription.php will likely not work without wc-variations-radio-buttons working.

dylk commented 7 years ago

@GoodGuyTaj

The variations still appear as a dropdown box and when one is selected the price doesn't appear. I have attached a screenshot with the radio button plugin enabled and disabled.

With the plugin enabled.

wc variations radio buttons enabled

With the plugin disabled.

wc variations radio buttons disabled
GoodGuyTaj commented 7 years ago

@dylkelson Ok. The price issue is an easy fix. Can you go ahead and start a thread in the issue tab?

clarkeverdel commented 7 years ago

I am having trouble getting this fix to work either.

The problem I'm having is that a wrong price is shown and doesn't change when picking a variation.

I am also using the Wooocommerce Subscriptions plugin, latest version.

scotthopkins commented 7 years ago

Hi - before I go messing around with code - Does anyone have this working please? Or have another solution? thanks...

FawadNL commented 5 years ago

Hi everyone,

I have updated the code to work with latest WC and WC Subscription plugin. Enjoy.

Basically what you need to keep during updating below code are:

The rest can be updated.

template here: https://gist.github.com/FawadNL/3ac090aeff2a0dcb06da6d4992f99309

styledev commented 5 years ago

@Mantish Can we get this PR accepted and pushed to WordPress Plugin Repo?