nbs_212
Total posts: 94
10 Апр 2013 21:51

Sergey,

I've made two Plan:

Plan A with language setting to UK

Plan B with language setting to ID

User will be directed to each plan accordingly base on their language setting in Joomla.

This approach working well when we direct user to open subscription form via menu created.

UK menu set to show only Plan A

ID menu set to show only Plan B

There for, Plan A will only be shown by User with UK set, as well as Plan B.

Now, the problem is:

When User directly click the link of restricted field inside the content, this approach didn't work.

Subscriptions from both Plans shown for each User, url language variable has no effect or the form that being opened by this link is not using it to split the Plan to show.

While I saw this language variable is being use in the link, and act properly if we set the language switcher.

your advice please.

Последние изменения: 02 Март 2014


Sergey
Total posts: 13,748
11 Апр 2013 04:18

Unfortunately there is no Language feature in Emerald. I mean the language parameter is not saved with plan and we cannot for example select only plans on UK.

I think the best way is to create subscription plans override template and there hide plans depending on current language.


Sergey
Total posts: 13,748
11 Апр 2013 06:14

The template is in views/plans/tmpl/form.php or form_plans.php


nbs_212
Total posts: 94
11 Апр 2013 11:53

Sergey,

I've tried to modify default_record_default.php,

and changing the line 181:

echo $field->result;

to

//echo $field->result; (remark)

$result2="

*** Subscription Field ***

";

echo $result2;

and it work, any restricted field now is only show one link "*** Subscription Field ***" that will be linked to Subscription form,

Question is, eventhough it is working, why the url shown became

http://localhost/stdi01/ index.php/en/component/cobalt/user-item/982-data01/22-presidential-and-coordinating-ministers/index.php/en/?option=com_emerald&view=plans&layout=form

and not shown

http://localhost/stdi01/ index.php/en/?option=com_emerald&view=plans&layout=form ? (target link)

The link it self working good and I can go to subscription form

My next goal is to change the target link directly to menu that I've created before. but since there were additional link

behind the target link, it produce error 404 page not found

my menu link is : http://localhost/stdi01/index.php/en/subscriptions-package so I change the target link above to "href=index.php/en/subscriptions-package"

and it shown

http://localhost/stdi01/ index.php/en/component/cobalt/user-item/982-data01/22-presidential-and-coordinating-ministers/index.php/en/subscriptions-package

and not

http://localhost/stdi01/ index.php/en/subscriptions-package

and if I click the link it produce error 404 page not found

where is that additional link came from?, and how can I get only the target link to echo?


nbs_212
Total posts: 94
11 Апр 2013 21:32

Solved...

Already found a way for this, using JRoute:.

Now, I can direct User to go to each of subscription plan form directly from restricted field link, base on current language setup.

Thanks :)


Sergey
Total posts: 13,748
11 Апр 2013 22:50

Also your code looks like it does not check for user subscription and will continue to show link even to subscribed users. May be I do not see whole picture but that is how it looks from what I see.


nbs_212
Total posts: 94
12 Апр 2013 10:22

Sergey,

I found another issue,.

I have some subscriptions plan with different Currency Sign, but why all subscription show the same currency sign?, then I found out the currency sign applies in subscription form was taken from option setting here,

I have tried to leave it blank, and it is also show a blank currency sign in subscription form.

That's mean the currency sign parameter on each of subscription setup was not applied here.

Работает на Cobalt