Jump to content

how to place in first page the two blocks displayed in authentification.tpl


Recommended Posts

Hi
my site needs specific treatment for it's first page due to the fact the shop acces is conditionned by identification first.

in fact i need to place in the first page the two blocks ("create an account", "log yourself") displayed when you click on the existing first page link "connect".

As i do not master either "php" or smarty could someone help me to do that ?
Thank you very much

(this post is a translation of the one i posted in the french forum)

Link to comment
Share on other sites

hi that's me again,
it would really help me if someone could at least explain to me how every files works together.

In my situation i want :
first that the customers log in each time they enter the site (i change code so that if someone registered quit the site, the cookie session end)
so my first page (index i guess) is a page where there is a little text (to explain that the access is not wide open but correlated to
either the ask of creating a count
or the log in trough id and word pass)

and so, near the text the two blocks that by defaut in usual prestashop vesion are displayed after a clic on the link "log in".
If i have well understood, this link points toward the file my-account.php, and if the client is not loggued then to the authentification.php file, am i right ?
what should i change that for the authentification.php is launched inthe central zone of page without needing a clic on the "log in "link ? is there some lines of my-account to put directly in the index ?? (don't shout at me if i say something totally wrong i don't catch anything about php)
i hope i'm clear in my ask...
thank you

Link to comment
Share on other sites

i'm back (lol)

i take a look in different files and find out that the identification link ("hello,log in") was stored in block user info.
The blockuserinfo.tpl lines are :


what i understand is that in case there is not any cookie so the link : {l s='Log in' mod='blockuserinfo'}
is displayed.

I first wonder if it is possible to separate identification link with the other infos in blockuserinfo, such as the shopping cart and the account info ?

Secondly, i would like to know what {$base_dir_ssl} is for ?



       {l s='Welcome' mod='blockuserinfo'},
       {if $logged}
{$customerName}({l s='Log out' mod='blockuserinfo'})
       {else}
{l s='Log in' mod='blockuserinfo'}
       {/if}
Link to comment
Share on other sites

For your 1st question

are you refering to

{l s='Log in' mod='blockuserinfo'}



If so please let us know where you would like this moved to?

Your second question regarding {$base_dir_ssl}
this is a smarty assigned variable for your SSL directory

you will find these varaibles which may be used in any smarty template file located within init.php around line 95

$smarty->assign(array(
   'base_dir' => __PS_BASE_URI__,
   'base_dir_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__,
   /* If the current page need SSL encryption and the shop allow it, then active it */
   'protocol' => $protocol,
   'img_ps_dir' => _PS_IMG_,
   'img_cat_dir' => _THEME_CAT_DIR_,
   'img_lang_dir' => _THEME_LANG_DIR_,
   'img_prod_dir' => _THEME_PROD_DIR_,
   'img_manu_dir' => _THEME_MANU_DIR_,
   'img_sup_dir' => _THEME_SUP_DIR_,
   'img_ship_dir' => _THEME_SHIP_DIR_,
   'img_col_dir' => _THEME_COL_DIR_,
   'img_dir' => _THEME_IMG_DIR_,
   'css_dir' => _THEME_CSS_DIR_,
   'js_dir' => _THEME_JS_DIR_,
   'tpl_dir' => _PS_THEME_DIR_,
   'mail_dir' => _MAIL_DIR_,
   'lang_iso' => $ps_language->iso_code,
   'come_from' => 'http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').htmlentities($_SERVER['REQUEST_URI']),
   'shop_name' => Configuration::get('PS_SHOP_NAME'),
   'cart_qties' => intval($cart->nbProducts()),
   'cart' => $cart,
   'currencies' => Currency::getCurrencies(),
   'id_currency_cookie' => intval($currency->id),
   'currency' => $currency,
   'languages' => Language::getLanguages(),
   'logged' => $cookie->isLogged(),
   'page_name' => $page_name,
   'customerName' => ($cookie->logged ? $cookie->customer_firstname.' '.$cookie->customer_lastname : false)
   ));

Link to comment
Share on other sites

Hello Amwdesign and thank you
(i do feel less lonely now ;-)


yes indeed it was this code i was referring to.

In fact, i want to go further than to move in another place the link, in fact i would like to find a way to include directly in the central column, what authentiication.php/tpl display when you click on the link. thus my first home page would say, please log in or ask for an account, but i want to cut off the click that is an unsufull one.

But as i'm not "fluent" with presta, and as no response was registered to my post (i understand also why : my need is so specific) so i decided to have a look to the files managing the identification function...it's a way not to stay impotent and to learn...

So now i understand that the ssl function is activate if necessary and especially trough my-account file.

What is strange for me, is where and when the authentification.php file is called, i didn't notice it anywhere ?
To avoid the useless click, is an "include" function a solution ? and how to stick what authentificationphp/tpl display to the central colum, in a hook ? (excuse me if i say big mistakes i do not intent any programmation language at all)

i hope i'm clear...

Link to comment
Share on other sites

×
×
  • Create New...