Gift Subscription Question

2 years 2 months ago #328614 by liaskas
Replied by liaskas on topic Gift Subscription Question
Thank you for your reply Krileon.

On step 4 you mention " turn off direct access". How do i do it?

Please Log in to join the conversation.

2 years 2 months ago #328616 by krileon
Replied by krileon on topic Gift Subscription Question
After saving the auto action there should be parameter below the auto action URL on the global tab to disable direct access. Be sure you've no triggers selected when doing this as should be the case for actions 1 and 2 in my explanation. This allows those actions to only be called via APIs and not via URL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 2 months ago - 2 years 2 months ago #328617 by liaskas
Replied by liaskas on topic Gift Subscription Question
A few more questions.

Step 4 / third auto action
You mention "it MUST have the same conditions as the cb_gifts field" but cb_gifts field does not have any conditions!
You also say "for Output use a redirect to redirect back to the displayed users profile". How is this done. There is just a text field in redirect output.

Step 5
"In the Custom HTML field you'd just create a button that links to Action 3." How to create this button and what the link will be?

Thank you

Please Log in to join the conversation.

2 years 2 months ago #328625 by liaskas
Replied by liaskas on topic Gift Subscription Question
Ok... seems that we are getting close to complete the tutorial!

User A buys the gift plan. The cb_gifts field is updated and he can view the link to auto action 3 that will trigger auto actions 1 and 2. He clicks on it, the procedure works, but the gift subscription is added to himself.... not to User B.

Also i do not know what url i have to enter to redirect back to User B profile.

Can you please advise?

Thank you.

Please Log in to join the conversation.

2 years 2 months ago #328630 by krileon
Replied by krileon on topic Gift Subscription Question

You mention "it MUST have the same conditions as the cb_gifts field" but cb_gifts field does not have any conditions!

Sorry, it should have the same conditions as your Custom HTML field.

You also say "for Output use a redirect to redirect back to the displayed users profile". How is this done. There is just a text field in redirect output.

Set the redirect URL to the following and it'll send them back to their profile.

[cb:url location="profile_view" /]

"In the Custom HTML field you'd just create a button that links to Action 3." How to create this button and what the link will be?

Just using plain old HTML. Example as follows.

<a href="ACTION_URL_HERE" class="btn btn-primary">Gift Subscription!</a>

User A buys the gift plan. The cb_gifts field is updated and he can view the link to auto action 3 that will trigger auto actions 1 and 2. He clicks on it, the procedure works, but the gift subscription is added to himself.... not to User B.

You need to add &users=[user_id] to your action URL so the auto action knows what profile to gift to.

Probably also worth adding a condition to the field and your action to make sure the viewing user and action user are not the same user to prevent that from happening as well. Below should work.

Field: Custom > Value
Custom Value: [cb:userdata field="user_id" user="#me" /]
Operator: Not Equal To
Value: [user_id]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 2 months ago #328636 by liaskas
Replied by liaskas on topic Gift Subscription Question
Thank you Krileon.

We got even closer. The issue we have now is that when we add &users=[user_id] to the action URL, the cb_gifts is not reduced.

I remind that cb_gifts is an integer field that contains the number of gifts that can be given away. Each time user A buys a gift subscription, cb_gifts is increased by one.

When &users=[user_id] is absent from the action URL, the subtraction by 1 is successful on gift subscription activation.

When &users=[user_id] is present in the action URL, there is no subtraction on gift subscription activation.

Please advise...

Thank you

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.256 seconds

Facebook Twitter LinkedIn