Jump to content

Bloc My Account ( Custom )


Nommam
 Share

Recommended Posts

I suggest:
Because there is already a module called blockmyaccount, you should rename your module, it's very easy. Example: blockmyaccountcustom.


Suggestion: comme ce module est different du module original, tu pourrais lui donner un nom different, c'est tres facile à faire et cela permet de faire des tests sans avoir a écraser ou renommer l'original et cela evite les confusion de fichiers. ;-)
blockmyaccountcustom par exemple

Share this post


Link to post
Share on other sites

Bonjour à tous,


Pour ceux chez qui ca ne fonctionne pas (ex: un clique sur déconnexion ne bascule pas):
If this module don't work. Its one of the solution

Fonctionne avec la ver 1.2.4.0 / Works with ver 1.2.4.0

Replace BLOCKMYACCOUNT.TPL by this one:


your code missed the "No account yet?" and needed organizing for positioning & fixed the no-change of the block title when changing the language..
Here is it modified:
<!-- Block My Account -->
 {if $logged}

{l s='My Account' mod='blockmyaccount'}


{l s='My orders' mod='blockmyaccount'}
           {if $returnAllowed}
{l s='Merchandise return' mod='blockmyaccount'}
           {/if}
{l s='Credit slips' mod='blockmyaccount'}
{l s='My addresses' mod='blockmyaccount'}
{l s='My personal info' mod='blockmyaccount'}
           {if $voucherAllowed}
{l s='My vouchers' mod='blockmyaccount'}
           {/if}
           {$HOOK_CUSTOMER_ACCOUNT}



{l s='Sign out' mod='blockmyaccount'}




 {else}

   {if $displayconnexionbox}


{l s='My Account' mod='blockmyaccount'}


           <form action="authentication.php" method="post">

                      {l s='E-mail address' mod='blockmyaccount'}

                      <input type="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall'|stripslashes}{/if}"/><br />
                      {l s='Password' mod='blockmyaccount'}

                      <input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|escape:'htmlall'|stripslashes}{/if}"/><br />

                      <input type="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />
<input type="submit" id="SubmitLogin" name="SubmitLogin" value="{l s='Log in' mod='blockmyaccount'}" class="button" /></div>

              </form>
              {if $displaypassword}

{l s='Forgot your password?' mod='blockmyaccount'}

           {/if}
           {if $displayregister}

{l s='No account yet?' mod='blockmyaccount'}

           {/if}




   {/if}
 {/if}
<!-- /Block My Account --> 

Share this post


Link to post
Share on other sites

  • 5 weeks later...

Thanks guys. This got me going in the right direction. I don't know how to make a module yet (i'm too lazy to learn right now... actually not enough time!) so what I did was change the current module "blockuserinfo" included in prestashop. I didn't want a block in the nav area anyway - I wanted it right at the top of the page:

www.seriesperformance.com

here's the code in /opt/prestashop/modules/blockuserinfo/blockuserinfo.tpl

<!-- Block user information module HEADER -->

   {if $logged}

{$customerName} ({l s='Log out' mod='blockuserinfo'})


{l s='Cart:' mod='blockuserinfo'}
{if $cart_qties > 0}{$cart_qties}{/if}{l s='product' mod='blockuserinfo'}{l s='products' mod='blockuserinfo'}
{if $cart_qties > 0}{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, 4)}{else}{convertPrice price=$cart->getOrderTotal(true, 4)}{/if}{/if}
{l s='(empty)' mod='blockuserinfo'}

{l s='Your Account' mod='blockuserinfo'}


   {else}

     <form action="{$base_dir_ssl}authentication.php" method="post">
{l s='Login:' mod='blockmyaccount'}
       <input type="text" id="email" name="email" value="Email Address{if isset($smarty.post.email)}{$smarty.post.email|escape:'htmlall'|stripslashes}{/if}">

{l s='Password:' mod='blockmyaccount'}
       <input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|escape:'htmlall'|stripslashes}{/if}" style="width:79px;"/>
       <input type="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />
       <input type="submit" id="SubmitLogin" name="SubmitLogin" value="{l s='Go' mod='blockmyaccount'}" />



{l s='Register' mod='blockuserinfo'}  |  
{l s='Forgot password?'}
     </form>

   {/if}



<!-- /Block user information module HEADER -->




That is all I had to change!

Any updates could end up wiping this out, though... be sure to save a copy!

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Well, I'm pretty much gobsmacked by this: Presta does NOT have a login module so that customers can login without having to add items to their cart????
I hadn't realised this until a friend ( who I made a shop for), asked me if I could put a login module on the home page. So off I went, searching these forums.
I found a couple of threads ( including this one), and tried all the offered solutions. I DID get one login module to work, but ONLY on Presta 1.2.4
I'm still trying to understand why a shopping cart would NOT have a login module built in.
I've sung Presta's praises to all and sundry since I first started using it for my site a few years ago. It has its ( at times) annoying, illogical quirks, but I've stayed with it. I've spent literally hundreds of hours on this forum, searching for answers...some found, some not.
Now though, I'm unsure what to do. To date, the positives have outweighed the negatives ( mostly), and the bottom line is, I KNOW Prestashop, and to change shopping carts would mean another long painful learning curve.
I'm not sure why I never noticed this lack of login module on my main site that has used Presta for years, so maybe that's why it's NOT a core module, but it does bring home yet another annoying quirk.
I hope someone can prove me wrong, that there IS a login module that works on 1.2.5....searching on this forum is a huge PITA, so I could have missed finding the appropriate thread/post.

Share this post


Link to post
Share on other sites

Something odd here...

I have everything regarding this mod working fine except when I log in I can see all added modules in the center screen but in the "my account box", I don't see the same amount of listed modules. All I see are the .php links only

Please see attached image for better explanation.

Regards

18203_ciBItWHJ9xSTVn0CzOcr_t

Share this post


Link to post
Share on other sites

I can confirm this problem. The install function of this module does not create the "My account" hook like the original module does. If you haven't previously installed the original my account module, this hook will be missing. You should add the following to the bottom of blockmyaccount.php:

private function addMyAccountBlockHook()
{
   return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'hook` (`name`, `title`, `description`, `position`) VALUES (\'myAccountBlock\', \'My account block\', \'Display extra informations inside the "my account" block\', 1)');
}

private function removeMyAccountBlockHook()
{
   return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'myAccountBlock\'');
}



and then change the first line of the install() function to:

if (!$this->addMyAccountBlockHook() OR !parent::install() OR !$this->registerHook('leftColumn'))



Then uninstall, then install the module again so that the "My account" hook is added to the database.

Share this post


Link to post
Share on other sites

Thanks for the code Rocky.

Ye, I also found it was because of hooks. Issues was this was on a store that was installed with no modules. My solution was to re-install the account module that comes with PS1.2.5 and then just overwrite with the new module. It worked fine then.

What I will now do is add your code updates to the package for future installs.

Regards,

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 5 weeks later...
  • 4 weeks later...

My exiprens with these kind of box is that they tend to spooke off costumers that has no account. Im guessing that they are thinking "ohh i need an account to shop here, how do i get one, can i even get one, hmmm... im out of here" :)

Share this post


Link to post
Share on other sites

Great stuff, thanks alot :) and @Timpet, i think just about everyone who considers buying something online is accustomed to a login form ;) the few customers you might loose is worth it, compared to the gain you get through letting returning customers and visitors log in more efficiently. actually i think it could be a very positive way of subliminaly leading visitors to getting an account, especially if you have some kind of carrot. like refferer-bonuses and that kind of thingy goin :)

Share this post


Link to post
Share on other sites

  • 3 weeks later...

This module works on version 1.3.1.1 and with URL rewriting ON, you need to change some lines in the blockmyaccount.tpl. Put a "../" on the end of each .php file which is being called ... such like below. if not .. your customers won't be able to login or click any of the links if they are on a different page other than your HOME page. e.g. if you are in www.yoursite.com/content/terms-and-conditions the links on the my account block would be www.yoursite.com/content/password.php

<form action="../authentication.php" method="post">



 {if $displaypassword}

{l s='Forgot your password?' mod='blockmyaccount'}

              {/if}
              {if $displayregister}

{l s='No account yet?' mod='blockmyaccount'}

              {/if}

Share this post


Link to post
Share on other sites

This module works on version 1.3.1.1 and with URL rewriting ON, you need to change some lines in the blockmyaccount.tpl. Put a "../" on the end of each .php file which is being called ... such like below. if not .. your customers won't be able to login or click any of the links if they are on a different page other than your HOME page. e.g. if you are in www.yoursite.com/content/terms-and-conditions the links on the my account block would be www.yoursite.com/content/password.php

<form action="../authentication.php" method="post">



 {if $displaypassword}

{l s='Forgot your password?' mod='blockmyaccount'}

              {/if}
              {if $displayregister}

{l s='No account yet?' mod='blockmyaccount'}

              {/if}



Bonjour
Merci fonctionne très bien de cette manière.

Share this post


Link to post
Share on other sites

Hi

I'm new to prestashop and I'm trying to install this module, but I don't know how to get it to show on my website?
Where do I upload the tpl file?

Thanks.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Hi there,

I put in the

<form action=”{$base_dir}authentication.php” method=“post”>

but I still get the "We're sorry, but the Web address you entered is no longer available " error.

This happens when I am not logged in but I am viewing a product or viewing a CMS page and then either click the "login", "Forgot your password?" or "Create an Account" links...

Any help would be mega appreciated as this is a brilliant module!

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Nevermind. Found the problem myself.

It looks like PrestaShop isn't compatible with Google Chrome, that's why it didn't work! Although you can see the website, yet you can't login with the browser.

Make it possible and then you got another customer here!

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 1 month later...
  • 1 month later...
  • 2 months later...
  • 1 month later...

module crashs my shop

internal error 505 after installation

my ps version
PrestaShop™ 1.4.3

edit:

just tested again
when I enable

Display the connexion box if logout

then it crashs!

and the login box is missing :(

Share this post


Link to post
Share on other sites

  • 3 months later...
  • 3 months later...
  • 4 months later...
  • 4 months later...
  • 5 months later...
  • 7 months later...

Hi, I was using this excellent module since version 1.3 of prestashop.

Since I updated my shop from 1.4.9 to 1.5.6 it doesn't work anymore.

When I click on connect after having put in my email and password it says that the requested page doesn't exist.

I'm ready to donate 10€ to whoever helps me on finding a solution.

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More