Changing checkout type depending on product type

AdeelAdeel Member
Hi there,

My client have two just products , one is subscription and other is physical product.

Is it possible to checkout as guest if product in the cart is physical product (non subscription prod) and Create account only if the product in the cart is subscription?

Thanks.
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @Adeel,

    Good question. You could add a small bit of Twig logic to the top of your checkout template to conditionally change the checkout type for the customer like this:
    {% if has_subscriptions %}
    {% set checkout_type = "account_only" %}
    {% else %}
    {% set checkout_type = "guest_only" %}
    {% endif %}
    That should then dynamically change the setting based on whether subscriptions are present or not. For what it's worth - when subscriptions are present in the cart, the checkout will default to being account only as well, but if you wanted to force it to be guest only for non-subscription products, you'll need something like the above.
  • AdeelAdeel Member
    Awsome... Thanks Bro.
Sign In or Register to comment.