Passing parameters into another template

Post

Posted
Rating:
#5294 (In Topic #1206)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
I'm adding a subscription-based product to the products catalogue, but apart from usergroup subscriptions, the system doesn't support adding subscription durations or units of duration.

I was able to add a CPF for it in the catalogue, but now I just need to figure out how to pass {FIELD_10} (contains either monthly, quarterly, or annually) into the below templates:

RESULTS_cart_TABLE (to show the user before clicking 'checkout')
ECOM_CART_BUTTON_VIA_PAYPAL to let PayPal know the duration

I've noticed the price of an item is stored as {FIELD_2} and somewhere along the line it gets passed into {PRICE} for use on the above listed templates.

If it's not possible, I could sell the item as a usergroup subscription to accomplish the recurring payment, but it just complicates things more because I have to create faux secondary usergroups for each product I choose to sell (which in return would get messy if I have 10+ items selling)
Online now: No Back to the top

Post

Posted
Rating:
#5299
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Why don't you just embed your own PayPal button code directly in whatever catalogue template you are working with? There may be no need to use the Composr eCommerce system at all.

The eCommerce system is fully extendible to programmers with new subscription projects, and that is documented, but it's definitely not something you should try and achieve at the template level. There is a lot of plumbing behind the eCommerce templates to make it work. If those templates are to be used in any meaningful way, the product being purchased would need to be compatible also with all the assumptions in that plumbing. For example, any IPN coming through for a purchased shopping cart project would not be expected to have a subscription term defined for it, and thus that purchase would fail with a hack-attack alert, unless a new eCommerce product hook was custom coded up for it.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#5301
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’

Chris Graham said

Why don't you just embed your own PayPal button code directly in whatever catalogue template you are working with? There may be no need to use the Composr eCommerce system at all.

Since I'm a moron when it comes to PHP, I'll stick to doing this then!
Online now: No Back to the top
1 guest and 0 members have just viewed this.
Back to Top