I have had a pretty good look around the forum but can't find what I am looking for:
Is there a way (or indeed a mod) that will allow me to create CMS pages but only have them visable to customers when they are logged in"
Cheers
robster
Is there a way (or indeed a mod) that will allow me to create CMS pages but only have them visable to customers when they are logged in"
Cheers
robster
I know my place...!
I just try to help you out...
try this:
1. open catalog folder:
controller/common/home.php
find:
add after:
2. open catalog\view\theme\YOUR_LOVE_TEMPLATE\template\common\home.tpl
find:
Replace with:
3. then go to admin area: System-->Store then fill the welcome message with your news/announcement to your logged customers
try this:
1. open catalog folder:
controller/common/home.php
find:
Code: Select all
$this->data['text_latest'] = $this->language->get('text_latest');
Code: Select all
$this->data['logged'] = $this->customer->isLogged(); // New Addition
find:
Code: Select all
<div class="top">
<div class="left"></div>
<div class="right"></div>
<div class="center">
<h1><?php echo $heading_title; ?></h1>
</div>
</div>
<div class="middle">
<div><?php echo $welcome; ?></div>
</div>
<div class="bottom">
<div class="left"></div>
<div class="right"></div>
Code: Select all
<div class="top"><?php if ($logged) { ?>
<div class="left"></div>
<div class="right"></div>
<div class="center">
<h1><?php echo $heading_title; ?></h1>
</div>
</div>
<div class="middle">
<div><?php echo $welcome; ?></div>
</div>
<div class="bottom">
<div class="left"></div>
<div class="right"></div><?php } ?>
Hi jones and thanks for taking the time to help.
Does your solution just work on home page? I really need it to work on specific pages that I create in admin. Like page id5 or page id8, etc if you understand me.....
robster
Does your solution just work on home page? I really need it to work on specific pages that I create in admin. Like page id5 or page id8, etc if you understand me.....

robster
I know my place...!
It's not the most elegant solution, but you can use the following to change the content of an information page based on its SEO keyword URL:
IN:
BEFORE THE CONDITIONAL CONTENT ADD:
AND AFTER THE CONDITIONAL CONTENT ADD:
The REQUEST_URI is the part of the URL that comes after the domain name (e.g. http://www.mysite.com). In the example, I used the SEO keyword of "myinfopage". If you combined this with the "if logged in" part it would be:
I have tried this code, but it should work for you.
IN:
Code: Select all
/catalog/view/theme/YOURTHEME/template/information/information.tpl
Code: Select all
<?php if($_SERVER['REQUEST_URI'] == '/myinfopage') { ?>
Code: Select all
<?php } ?>
Code: Select all
<?php if ($this->customer->isLogged()) { ?>
<?php if($_SERVER['REQUEST_URI'] == '/myinfopage') { ?>
HTML content here
<?php } elseif($_SERVER['REQUEST_URI'] == '/anotherpage') { ?>
Different HTML content here
<?php } ?>
<?php } else { ?>
Content to show if customer isn't logged in
<?php } ?>
hi robster,robster wrote:Hi jones and thanks for taking the time to help.
Does your solution just work on home page? I really need it to work on specific pages that I create in admin. Like page id5 or page id8, etc if you understand me.....
robster
i just noted your 1st message
but now it more clear to me."but only have them visable to customers when they are logged in"
then if you want
as similar to Jonathan suggestedwork on specific pages that I create in admin. Like page id5 or page id8
you also can create in /catalog/view/theme/YOURTHEME/template/information/information.tpl your conditional content by detected the URL id e.g. index.php?route=information/information&information_id=5
if not someone can create this module for you maybe just $12 USD
Hi there everyone, hope we are all doing well.
I know its been awhile since someone has posted to this thread, so hopefully folks are still reading it.
I read the solution from Johnathan, by the way, i have purchased a few of your modules, and they all work great. Thank you.
I would like to do the same thing as mentioned in this thread title, I would like to hide a certain page. If customer is logged in, then they can view it, if they are not logged in, they get redirected to the login/register page
Kicker is, i would like to do this on a CMS module that I purchased, however, the developer seems to have fallen off the face of the earth.
I have attached a txt file of the code that is in the file that i think I need to edit.
On the server the path to this tpl file is catalog/view/theme/THEMENAME/template/news/article.tpl
Would the same idea as mentioned earlier in this post work with this file? if so, where abouts would I put the code?
thanks in advance for your help, much appreciated
T
I know its been awhile since someone has posted to this thread, so hopefully folks are still reading it.
I read the solution from Johnathan, by the way, i have purchased a few of your modules, and they all work great. Thank you.
I would like to do the same thing as mentioned in this thread title, I would like to hide a certain page. If customer is logged in, then they can view it, if they are not logged in, they get redirected to the login/register page
Kicker is, i would like to do this on a CMS module that I purchased, however, the developer seems to have fallen off the face of the earth.
I have attached a txt file of the code that is in the file that i think I need to edit.
On the server the path to this tpl file is catalog/view/theme/THEMENAME/template/news/article.tpl
Would the same idea as mentioned earlier in this post work with this file? if so, where abouts would I put the code?
thanks in advance for your help, much appreciated
T
Attachments
I used your suggestion above to hide the category description if the user is not logged in and it worked perfectly - thankyou so much!jones wrote:I just try to help you out...
try this:
1. open catalog folder:
controller/common/home.php
find:add after:Code: Select all
$this->data['text_latest'] = $this->language->get('text_latest');
2. open catalog\view\theme\YOUR_LOVE_TEMPLATE\template\common\home.tplCode: Select all
$this->data['logged'] = $this->customer->isLogged(); // New Addition
find:
Replace with:Code: Select all
<div class="top"> <div class="left"></div> <div class="right"></div> <div class="center"> <h1><?php echo $heading_title; ?></h1> </div> </div> <div class="middle"> <div><?php echo $welcome; ?></div> </div> <div class="bottom"> <div class="left"></div> <div class="right"></div>
3. then go to admin area: System-->Store then fill the welcome message with your news/announcement to your logged customersCode: Select all
<div class="top"><?php if ($logged) { ?> <div class="left"></div> <div class="right"></div> <div class="center"> <h1><?php echo $heading_title; ?></h1> </div> </div> <div class="middle"> <div><?php echo $welcome; ?></div> </div> <div class="bottom"> <div class="left"></div> <div class="right"></div><?php } ?>
Andy
Who is online
Users browsing this forum: Majestic-12 [Bot] and 42 guests