I want to add a small snippet of code in createUser(), so I have extended oxcmp_user to myclass say dxcmp_user. Now my code works as it should but right panel login section is not working because in cmp_login_right.tpl there is a checking [{if !$oxcmp_user->oxuser__oxpassword->value}] . Because now I have $dxcmp_user instead of $oxcmp_user. $oxcmp_user is used in several templates , so I dont want to change this with my object. Is there any other way to do it? Thanks in advance.
Hello mousumi,
are you sure you understood how module writing shall work?
IMO dxcmp_user shall extend cmp_user, not replace it. Maybe one of these tutorials are helpful:
Regards
Yes , dxcmp_user is exended oxcmp_user class. But in some tpl files $oxcmp_user variable used, so those are not working now. That’s the problem. PHP code is working as it should be but all the $oxcmp_user variables in tpl is not working. I have tried to get the value by a loop
[{foreach from=$oxcmp_user item=user}]
<p class=“err”>[{ $user->value}]</p>
[{/foreach}]
when only oxcmp_user class is used value is displayed but when I am extending it then values are not set and isn’t displayed.
I have extended it like oxcmp_user => mymodule/views/dxcmp_user from admin.
On user registration I have added some code so re-written create_user() in my dxcmp_user class.
Another thing I have noticed is initially it is not working when url is http://hostname/index.php?cl=register&success=1&
After that if I click on any link then its working and in right panel logout option is shown. But in case of oxcmp_user in http://hostname/index.php?cl=register&success=1& - this link itself right panel showing logout option.
I believe, “[B]dxcmp_user[/B]” should [B]not [/B]extend “[B]oxcmp_user[/B]” but “[B]dxcmp_user_parent[/B]”
Include it via [B]oxcmp_user[/B]=>[B]dxcmp_user/[/B][B]dxcmp_user[/B].
(If “[B]dxcmp_user.php[/B]” is located in directory “[B]modules/dxcmp_user/[/B]”)
There is no problem in extend syntax. Problem was in render function i.e. I have wrote parent::render(); instead of return parent::render(); Now my module works fine.