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

variable subscription function #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GoodGuyTaj
Copy link

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.

Call this function from the variable subscription to enable radio buttons
@Mantish
Copy link
Member

Mantish commented Aug 23, 2016

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
Copy link
Author

GoodGuyTaj commented Aug 24, 2016

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
Copy link
Member

Mantish commented Sep 16, 2016

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
Copy link

craighobson commented Oct 16, 2016

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
Copy link
Author

@Mantish

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

@GoodGuyTaj
Copy link
Author

GoodGuyTaj commented Oct 22, 2016

@craighobson

Have you tried the code located here:

d9122c9

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
Copy link
Member

Mantish commented Nov 7, 2016

@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
Copy link
Author

@Mantish

That would be great!

@dylk
Copy link

dylk commented Nov 15, 2016

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
Copy link
Author

@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
Copy link

dylk commented Nov 15, 2016

@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
Copy link
Author

GoodGuyTaj commented Nov 15, 2016

@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
Copy link

dylk commented Nov 15, 2016

@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
Copy link
Author

GoodGuyTaj commented Nov 15, 2016

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

@clarkeverdel
Copy link

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
Copy link

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

@FawadNL
Copy link

FawadNL commented Nov 6, 2018

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:

  • function print_attribute_radio (line 13 - 24)
  • variations table (line 50 - 91)

The rest can be updated.

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

@styledev
Copy link

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

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

Successfully merging this pull request may close these issues.

8 participants