- Posts: 8
- Thank you received: 0
Pass coupon code from pricing table view to subscription form
- Pete
- Topic Author
- Offline
- New Member
Less
More
10 months 1 week ago #164200
by Pete
Pass coupon code from pricing table view to subscription form was created by Pete
Hi,
When a user comes to the pricing table view with a coupon code in the URL, I would like this to get passed on to the subscription form page. For example I give the user a link like: index.php?option=com_osmembership&view=plans&layout=pricingtableflat&id=0&coupon_code=MYCODE
The coupon_code should be appended to all buttons on the page that take you to the subscription form. I know the subscription form already supports the coupon_code parameter so there is no change required there.
I'm currently doing this with a template override but it would be a nice feature to have natively. Here is the code I added:
/components/com_osmembership/view/common/tmpl/pricingtable_flat_plans.php
When a user comes to the pricing table view with a coupon code in the URL, I would like this to get passed on to the subscription form page. For example I give the user a link like: index.php?option=com_osmembership&view=plans&layout=pricingtableflat&id=0&coupon_code=MYCODE
The coupon_code should be appended to all buttons on the page that take you to the subscription form. I know the subscription form already supports the coupon_code parameter so there is no change required there.
I'm currently doing this with a template override but it would be a nice feature to have natively. Here is the code I added:
/components/com_osmembership/view/common/tmpl/pricingtable_flat_plans.php
Code:
// at the beginning, like line 27
$coupon = JFactory::getApplication()->input->getString('coupon_code', '');
$appendCoupon = $coupon ? '?coupon_code=' . $coupon : '';
// add in line 102 after signupUrl is created
$signUpUrl .= $appendCoupon;
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
10 months 1 week ago #164213
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Pass coupon code from pricing table view to subscription form
Hi Pete
This is a special use-case, so override like you did is needed. This is something we won't add to the core package
Just one minor thing, on that code, JFactory should be replaced with it's namespaced class Factory to make sure it works well with future releases of Joomla
Regards,
Tuan
This is a special use-case, so override like you did is needed. This is something we won't add to the core package
Just one minor thing, on that code, JFactory should be replaced with it's namespaced class Factory to make sure it works well with future releases of Joomla
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.