Coder Social home page Coder Social logo

Comments (21)

crftwrk avatar crftwrk commented on June 20, 2024 1

If AJAX cart is disabled, theme has the same functionality as the default themes. However, let's wait for the example, then we can check.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024 1

Disabling everything you mentioned until here, will then redirect me to the checkout.

This gives you the answer. You should disable AJAX cart as usual and then delete/check each snippet in js/theme.js and woocommerce/js/woocommerce.js. Once you find the culprit snippet, we can take a closer look.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024 1

if you want to investigate further, it is still broken on your own site

Of course, because AJAX cart is enabled. Subscription plugin with this settings does not work together with AJAX cart. You have to disable it.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024 1

The difference is that your subscription is limited to one of any status

Me https://dev.bootscore.me/product/subscription-variable/

me

You https://dev.bootscore.me/product/subscriptions/

yours

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

We do not have this plugin and cannot reproduce this issue. Please make sure that you share always a link to a reduced test case in bug reports.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

We do not have this plugin and cannot reproduce this issue. Please make sure that you share always a link to a reduced test case in bug reports.

Is there an option to send you a test case privately (that only member of bootscore can acceess that link)?

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

No, we do open source and public. Please set up a new WordPress, install bootScore, Woocommerce, supscription plugin and add a sample product. This testing site can you use then for further bug reports.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

Disable the ajax cart should solve this https://github.com/orgs/bootscore/discussions/569#discussioncomment-6968025

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Disable the ajax cart should solve this https://github.com/orgs/bootscore/discussions/569#discussioncomment-6968025

Results in

Uncaught ReferenceError: wc_add_to_cart_params is not defined
    <anonymous> /product/subscriptions/?switch-subscription=169&item=43&_wcsnonce=b57e1bcb1a&auto-switch=true:446
    jQuery 10
    <anonymous> /product/subscriptions/?switch-subscription=169&item=43&_wcsnonce=b57e1bcb1a&auto-switch=true:432
    jQuery 13
        e
        t
        setTimeout handler*Deferred/then/l/<
        c
        fireWith
        fire
        c
        fireWith
        ready
        P
        EventListener.handleEvent*
        <anonymous>
        <anonymous>
subscriptions:446:11
    <anonymous> /product/subscriptions/?switch-subscription=169&item=43&_wcsnonce=b57e1bcb1a&auto-switch=true:446
    jQuery 10
    <anonymous> /product/subscriptions/?switch-subscription=169&item=43&_wcsnonce=b57e1bcb1a&auto-switch=true:432
    jQuery 13

You can find the plugin files here.
Admin edit: removed link as links to paid plugins aren't allowed.

Also i might be able to send you an example website in a week, maybe earlier.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Website: https://temp.gretas-research.de
Username: test
Password: test
Shop: https://temp.gretas-research.de/shop/

You can "purchase" the basic subscription first, its free and then try to switch to premium, (you wont be able to checkout because no payment provider is enabled), but for testing purposes we do not need that anyway.

I installed bootscore and bootscore-child, the later is the activated one. The child theme has no changes.
Ajax cart is enabled.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

Now we get closer. Well, got a copy of subscription plugin v5.4.0 and did the same setup like you. Basic variation free and Premium paid. Both sold individually and seems to work fine? If once has been added to the cart, you can switch between variations.

Check https://dev.bootscore.me/product/subscription-2/

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Now we get closer. Well, got a copy of subscription plugin v5.4.0 and did the same setup like you. Basic variation free and Premium paid. Both sold individually and seems to work fine? If once has been added to the cart, you can switch between variations.

Check https://dev.bootscore.me/product/subscription-2/

It is not about switching while one is being added to the cart. It is about switching while you already had one purchased, so you switch your active subscription.

In the subscriptions settings you have to allow Allow Switching between subscriptions variations.

If you want you can import the products wc-product-export.csv. Then we should have the same product settings.

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

This is the subscription imported via your csv https://dev.bootscore.me/product/subscriptions/.

I cannot say what's wrong on your site.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Are you sure you enabled switching?
image

Iam not able to switch the subscriptions.
On "My Subscription" there should be a downgrade/upgrade button.
image

The product page will look like this
image

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

Now I have Allow Between Subscription Variations enabled.

Please empty cart and reload the page https://dev.bootscore.me/product/subscriptions/. It works?

You mentioned above that twenty twenty three theme works fine. Please install another Bootstrap theme https://wordpress.org/themes/understrap/ and let me know if your plugin is working with this one. I tested it and subscription switch works exactly as in bootScore.

If Understrap works well for you, roughly delete/comment following snippets in bootscore-main to make sure that all scripts which may have a conflict are disabled:

Ajax cart

/**
* Register Ajax Cart
* Allow users to edit/disable entire AJAX functionality in child theme
*/
if (!function_exists('register_ajax_cart')) :
function register_ajax_cart() {
require_once('inc/ajax-add-to-cart.php');
}
add_action('after_setup_theme', 'register_ajax_cart');
endif;

WooCommerce JS

wp_enqueue_script('bootscore-wc-script', get_template_directory_uri() . '/woocommerce/js/woocommerce.js', array(), $modificated_WooCommerceJS, true);

Theme JS

wp_enqueue_script('bootscore-script', get_template_directory_uri() . '/js/theme.js', array('jquery'), $modificated_themeJs, true);

If plugin still not work, you can try at least disable Bootstrap's JS to check if there is a conflict (think not).

wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/lib/bootstrap.bundle.min.js', array(), $modificated_bootstrapJs, true);

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Now I have Allow Between Subscription Variations enabled.

Please empty cart and reload the page https://dev.bootscore.me/product/subscriptions/. It works?

Yes, it is working now. Except the adding to cart part. EDIT: investigate.
image

You mentioned above that twenty twenty three theme works fine. Please install another Bootstrap theme https://wordpress.org/themes/understrap/ and let me know if your plugin is working with this one. I tested it and subscription switch works exactly as in bootScore.

Yes understrap is redirecting me to the checkout. You mean with your plugin the woocommerce plugins? I have no other plugins installed.

If Understrap works well for you, roughly delete/comment following snippets in bootscore-main to make sure that all scripts which may have a conflict are disabled:

Ajax cart

/**
* Register Ajax Cart
* Allow users to edit/disable entire AJAX functionality in child theme
*/
if (!function_exists('register_ajax_cart')) :
function register_ajax_cart() {
require_once('inc/ajax-add-to-cart.php');
}
add_action('after_setup_theme', 'register_ajax_cart');
endif;

WooCommerce JS

wp_enqueue_script('bootscore-wc-script', get_template_directory_uri() . '/woocommerce/js/woocommerce.js', array(), $modificated_WooCommerceJS, true);

Theme JS

wp_enqueue_script('bootscore-script', get_template_directory_uri() . '/js/theme.js', array('jquery'), $modificated_themeJs, true);

Disabling everything you mentioned until here, will then redirect me to the checkout.

If plugin still not work, you can try at least disable Bootstrap's JS to check if there is a conflict (think not).

wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/lib/bootstrap.bundle.min.js', array(), $modificated_bootstrapJs, true);

Did not try this.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Adding to cart, while switching, works with https://dev.bootscore.me/product/subscription-variable but not with https://dev.bootscore.me/product/subscriptions

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Having AJAX cart disabled and js/theme.js and woocommerce/js/woocomerce.js enabled, redirects.

I think the error might be here https://github.com/bootscore/bootscore/blob/main/woocommerce/inc/ajax-add-to-cart.php#L38-L91, but at this point iam out of ideas, i just can say that it do not work as described here

Adding to cart, while switching, works with https://dev.bootscore.me/product/subscription-variable but not with https://dev.bootscore.me/product/subscriptions

from bootscore.

crftwrk avatar crftwrk commented on June 20, 2024

Having AJAX cart disabled and js/theme.js and woocommerce/js/woocomerce.js enabled, redirects.

Yeah, this leads back to #564 (comment). Sure, AJAX script prevents redirection to checkout. If you want to redirect after added to cart, you must disable AJAX script.

I see, your site is working fine now. So, this isn't a bug and we will do no changes there.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

Hopefully it stays like that, if you want to investigate further, it is still broken on your own site https://dev.bootscore.me/product/subscriptions/.
Having "purchased" the basic subscription i cannot switch to premium.

from bootscore.

IceflowRE avatar IceflowRE commented on June 20, 2024

if you want to investigate further, it is still broken on your own site

Of course, because AJAX cart is enabled. Subscription plugin with this settings does not work together with AJAX cart. You have to disable it.

Why is it working here then? https://dev.bootscore.me/product/subscription-variable/ Did you allowed more than one subscription? So i can sign up to basic and premium?

from bootscore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.