maleli VIP
Total posts: 87
02 Апр 2014 19:14

I'd like to create subscriptions for individual cobalt records that have the same structure (same type and fields). I need to set up a Subscription per record, so that when a user purchases it, he'll have access to all the restricted fields in that record. For example, the intro text could be public, and the complete text of a specific article should display only if the user buys access to that specific article. I see that I can restrict a field that should only be visible to subscribed users, but this allows a user to purchase a Subscription and see that field for all records.
Is there any way to restrict each record individually? Or would I have to create a different type por each record and replicate the fields a thousand times to restrict each record field with a different plan?

Последние изменения: 08 Апр 2014


Sergey
Total posts: 13,748
03 Апр 2014 06:44

I think you can use Paytoaccess field. This field restrict access to full article view unless you have purchased either this article individualy or seleted subscription plan.


maleli VIP
Total posts: 87
03 Апр 2014 14:12

Thank you, is there documentation on this? I'd like to understand how it works without taking much of your time, but I have a few questions: - Does pay to access restrict the full view with all its contents? Or can I select to show for example a description text and one download in full view for the public but show the contents of the article and more downloads to subscribers of that single article? - If I chose a subscription plan for the field, then the subscriber will have access to all the articles that use that field, insead of purchasing each item separately? - I see how to set the price for each article but how can I set the duration of subscription?


maleli VIP
Total posts: 87
03 Апр 2014 15:44

Maybe this helps understand what I'd need to do. In a PaytoAccess field I'd like to be able to set: - Same details as an Emerald Subscription (payment gateways, period, descriptions, coupons, etc) - Select which fields I'd be granting access to when buying that specific article, no matter if they are in intro or full view.

Is there a way to do this?


pepperstreet VIP
Total posts: 3,837
04 Апр 2014 00:55

maleli Does pay to access restrict the full view with all its contents?

Yes. Use intro part and fields for teaser... and put restricted fields into full view.

maleli If I chose a subscription plan for the field, then the subscriber will have access to all the articles that use that field, insead of purchasing each item separately?

Yes.
(You can see a similar mixed usage on the MintJoomla downloads section. There is PayToDownload for a single item. And there is subscription for all items.)


maleli VIP
Total posts: 87
04 Апр 2014 04:32

Thanks for your reply! :( I actually need to be able to set the opposite. I almost have it set up

For example, fields show as intro, then clicking on the title, the record should show only the public fields (same as what happens with emerald).
Then in place of the other fields (or somewhere in the article) there should be a button to buy a time-limited subscription to that specific item´s restricted fields.

What I have tried is I created a new field that would restrict individual records only through emerald plans and not through direct purchase (like the original PaytoAccess field does) Now, what I need to work out is how NOT to block the entire full view of the record, but instead the restrictions should only block the categories I define as restricted. After buying the subscription, the user will see all restricted and non restricted fields.

Do you think this can be done through templates?

I´ve been trying to see where in the programming, the restriction is applied in the record but haven´t found that. :/


Sergey
Total posts: 13,748
04 Апр 2014 05:56

maleli I see how to set the price for each article but how can I set the duration of subscription?

You set duration of subscription in plan parameters.

2014-04-04_11-51-06

Please tell me again. You what user pay to see fields in this particual article they what to see or purchase subscription that opens access to same fields in all articles?


maleli VIP
Total posts: 87
04 Апр 2014 14:11

user pay to see fields in this particual article they what to see

A user pays for access to see restricted fields in a particular record for a year. I was able to set the duration of Paytoaccess by hiding the buy now button and only leaving available the subscription for that record.

My problem is: - I can't use Pay to access because restricts the full record view itself with whatever fields are inside, so users without a subscription can't see the non restricted fields. I need to be able to show those fields to them in full article view without showing the restricted fields (like the way emeral subscriptions work).
- I can't use subscriptions because if a user buys a certain subscription, they are buying the restricted fields for all the records that are inside that section, and I want them to be able to buy a subscription for one article.

Thanks for your help!


Sergey
Total posts: 13,748
04 Апр 2014 15:16

When you add fields there is Emerald tab and there you can restrict individual field.


maleli VIP
Total posts: 87
04 Апр 2014 15:50

Yes, that's what I did at first. In the Emerald tab I restricted the field that can be purchased through an Emerald plan, but that doesn't work for me because, for example I have this in Cobalt Article A - Price: $10 to see all restricted fields for 1 year Public field: intro (shown in intro) Public field: photo (shown in intro and article view) Public field: description (shown in article view) Restricted field: presentation (shown in article view to users with a subscription) Restricted field: downloads (shown in article view to users with a subscription) Article B - Price $20 to see all restricted fields for 1 year Public field: intro (shown in intro) Public field: photo (shown in intro and article view) Public field: description (shown in article view) Restricted field: presentation (shown in article view to users with a subscription) Restricted field: downloads (shown in article view to users with a subscription)

In Emerald I'd have to create two different subscriptions: Subscription A subscription - $10 Subscription B subscription - $15

But in Cobalt, I CAN'T assign - Subscription A to presentation A and downloads A and - Subscription B to presentation B and downloads B

I can assign both subscriptions to fields presentation and downloads, but then if a user buys Subscription A he will also have access to presentation A, presentation B, downloads A and downloads B and any other presentation and download content I add to that section in the future.

I think I'd like to try and make a field like this: Restricted field

Where a restricted field can be assigned a subscription plan for that specific record, not for the entire section.


maleli VIP
Total posts: 87
04 Апр 2014 17:26

I think I figured out what I need to do. Is it possible to create new fields with these parameters? I see that downloaded videos have them and downloads have them but I'd like to be able to set in this exact same way other fields like video (linked from protected video that's hosted elsewhere), texts, etc.

Who can add subscription

Can I do this by making new fields by duplicating and editing existing fields?


Sergey
Total posts: 13,748
07 Апр 2014 07:32

May be you can use uploads field. It can upload any file and also have Emearld protection parameters.

But agin it will grant doewnload in all articles of this type. If you want to sell doesnload you may use paytodownload field to pay for current article download only.

But in that case it will not manage access to fields.

What I can sugegst is still use paytoaccess field. Simply put all fields you want user to be able to acess into list view.


maleli VIP
Total posts: 87
07 Апр 2014 14:26

Mmm, no, that's not what I need. I'd have to display very large text and info in list view and that's not the layout I want. Maybe this can be done in Cobalt 8 and Emerald 9? I'll post in the other forum exactly what I need to be able to set up.


pepperstreet VIP
Total posts: 3,837
07 Апр 2014 16:26

Just some thoughts...

A.) What about the code of "PayToAccess" field? I mean the part that is reponsible for the access restriction and check... can't it be used directly in custom template? For conditional display of all your fields? That might require to turn-off the standard behavior and check on list view. Otherwise the user can't reach the full-view.

(BTW, there seems to be an API to check for subscription, isn't there something similar to check for PayToAccess?! Would be nice to have a similar article in the docs.)

B.) What about using another field and value for conditional display? Maybe an extra field could be set/toggled through "PayToAccess" field... comparable to customSQL in Status field.


maleli VIP
Total posts: 87
07 Апр 2014 16:59

Thanks for your thoughts,

I think if I could figuire that out, it would definitely solve my issue, but I'm not sure if it can be done? A) I have tried to look into PayToAccess, I tried to find the code where PayToAccess changes the item link (which is redirected to a subscriptions page) and where it restricts the full view but I couldn't find it, so, like you say, I could check if it's set up, disable the full content restriction and manually set the restriction through the template in each field that I need to protect. But couldn't figure out where the PaytoAccess restriction takes over :(

B) I'm not sure I understand this idea... something like disabling the PayToAccess part that restricts the entire full view and add a parameter to the field that checks if there is PayToAccess set up for the record, and if so, the field should display according to the PayToAccess configuration? That would definitely be great if I could figure out how to change where the PayToAccess restrictions take effect.

I've tried to follow the code but I can't find where PayToAccess comes into play when displaying a record. :/


maleli VIP
Total posts: 87
07 Апр 2014 17:03

I just thought of another idea...

I haven't looked into this, but I read somewhere that Cobalt records can be embedded one in another. Maybe if I create a Main record with all visible fields, and embed other records that are restricted with PaytoAccess I could achieve what I need. I'll look for embedding in the forum to see if I can do this and if this would solve my issue.


Sergey
Total posts: 13,748
08 Апр 2014 07:28

I am not sure what is embed one field into another.

Работает на Cobalt