User account panel

  • Posts: 55
  • Thank you received: 0
13 years 3 months ago #22695

Hi! :)

My specs: joomla 1.7, hikashop 1.5.3

How to?
When I log in in my account, I see the panel with:

    User account - edit your account
    Address - Edit your address
    Orders - see your orders

If I click on Address, in the Address page I can clik New or Cancel
If I click on Cancel I get redirected to my user panel.
And I find it is the right behaviour.

If I click on User account instead, and then Cancel I get redirected to my homepage...
Why? I think it should redirect you to the User panel. It makes more sense.
How can I do that?

In addition, in the User account page, Cancel is a simple link. In the Address page and in the Orders page Cancel is a simple Link with an image.
Why not making them all the same?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #22696

Hi,

The reason is simple. The User acount page is NOT a HikaShop page but a Joomla page.
So we can't change the cancel link to add an image and we can't change it to direct to the user control panel. However, if you want, you can do it yourself by editing that joomla view in the file components/com_user/views/user/tmpl/form.php

Alternatively, you can unpbulish the Hikashop User account Plugin so that the User account link is not displayed on the user control panel.

Please Log in or Create an account to join the conversation.

  • Posts: 55
  • Thank you received: 0
13 years 3 months ago #22697

:)
Now everything is clear!
Thank you!
;)

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #23847

There is no "components/com_user/views/user/tmpl/form.php" in 1.6.6

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #23862

It's the file components/com_users/views/profile/tmpl/edit.php on joomla 1.6

Last edit: 13 years 3 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #24072

Actually it's templates/{yourtemplate}/com_users/views/profile/tmpl/edit.php

But I can't edit how the form is displayed. I don't want to display certain fields.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24090

That's because your template is overriding that view file so indeed the file is templates/{yourtemplate}/com_users/views/profile/tmpl/edit.php in that case.

Why can't you edit that file ?

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #24245

After yesterdays update to Joomla 1.7 and the latest version of the YOOtheme phoenix style the edit.php looks like this:

// include config and layout
$base = dirname(dirname(dirname(__FILE__)));
include($base.'/config.php');
include($warp->path->path('layouts:'.preg_replace('/'.preg_quote($base, '/').'/', '', __FILE__, 1)));

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #24246

Now I found the correct file in /templates/yoo_phoenix/warp/systems/joomla.1.7/layouts/com_users/profile

The problem is, the fields are loaded like this:

PHP foreach ($this->form->getFieldsets() as $fieldset): /PHP

So I can't remove e.g. the fields for username and name. Also hiding it with CSS is not possible.

Last edit: 13 years 3 months ago by emergentec. Reason: php code

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24256

Why wouldn't you be able to remove it ?

You could do something like that probably:
if($fieldset->field_name =='my_field') continue;

Note that I don't know what is in $fieldset, I'm just giving an example. If $fieldset is HTML code, you could do a strpos or a regex on it or even remove the element from the $this->form object before the foreach...

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
13 years 3 months ago #24446

That's my solution:

if(strpos($field->label,"jform_username")!==false) continue

But then the user is not able to submit the form, because the form expects a name and username!

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24447

Then, you should add it with a hidden input.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum