-
Hi,
I was wondering if it is possible to add a new shortcode or modify a new shortcode.
I am using the WP UserPro plugin for the registration of students. I am using WooCommerce for paying a membership.
So, when the user fills in the registration form, when I press on register, at the end it should add that specific products to the cart. I’ve configured WooCommerce so that when you add a single product, it will redirect to the checkout page immediately.Now, there are 2 options:
1. using the redirect option from WP UserPro to the add-to-cart url. For example: http://website.com/become-member/?add-to-cart=62, as this will add the product and then redirect again to the checkout page.
2. Put the product id as parameter in a shortcode, and a boolean for telling that it is a membership registration. In the code i can put the appropriate conditions and then programmatically add the product to the cart. And then use the redirect parameter to redirect to the checkout page. For example: http://website.com/checkoutI’ve tried option 1. But the redirect does not always goes well. This is not WP User Pro’s fault, as it redirects good to the page http://website.com/become-member/?add-to-cart=62. But then it not redirects to the checkout page.
So I want to try option 2. However, I couldn’t find a good way to extend the shortcode and put the appropriate checks. Can you help me out?
I hope to hear from you soon.
You must be logged in to reply to this topic.