I want to hide url link from not registered customers, is this possible?
So $products_url is only shown where user is loged in.
Thank you
I want to hide url link from not registered customers, is this possible?
So $products_url is only shown where user is loged in.
Thank you
I'm not a php programer, so i could be way off.
Looking at index.php in language dir, i notice that greeting is formated in that way.
So i tried the same thing for URL, but it does not work.
Later on, i found that something is also defined in functions_customers.php and that is really complicated for me. Any idea how to proced?Code:if (STORE_STATUS == '0') { define('TEXT_MORE_INFORMATION', 'Url is not shown'); } else { define('TEXT_MORE_INFORMATION', 'Url is showing'); }
Tnx
In your admin go to:
Configuration > Customer Details > Customer Approval Status - Authorization Pending > and set to "1"
Zen-Venom Get Bitten
Get Your Business Found
Tnx kobra, but wouldn't this also hide all other info about product?
I only want URL link to hide from not registered users. I'm linking this url to PDF document, that has some info, only registered customers cas see.
I'm using showcase only
Well, i looked into function_customers.php and added this
In tpl_products_info_display.php i replacedCode:// Hide url function show_url() { if ($_SESSION['customer_first_name'] && $_SESSION['customer_id']) { $url_string = sprintf(TEXT_MORE_INFORMATION, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW)); } else { $url_string = sprintf(TEXT_MORE_INFORMATION_URL, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); } return $url_string; }
<?php // echo sprintf(TEXT_MORE_INFORMATION, $products_url); ?>
with
<?php echo show_url(); ?>
in languages products_info.php i added
define('TEXT_MORE_INFORMATION_URL', 'You have to be loged in to see this');
below
define('TEXT_MORE_INFORMATION', 'Please click <a href="%s" target="_blank">here, for PDF</a>.');
This works fine, but the problem now is, that %s is not showing url to PDF, but username of loged customer.
I'm aware that this must be very funy for someone who is experienced in php, but i'm graphic designer and programing is really not my thing.
Anyway if someone can check this and give me a little help, i would be wery grateful.
tnx
Sorry, I read this as the URL to the product pages...& not to a PDF.I want to hide url link from not registered customers, is this possible?
So $products_url is only shown where user is loged in.
I am also not a php coder by any definition.
Maybe by keeping this at the top, one of the php Zenners will chime in.
Zen-Venom Get Bitten
Get Your Business Found
Hey!
Sorry for bumping this, but does anybody have any idea how to solve my problem?
Tnx
Try this:In tpl_products_info_display.php replacePHP Code:// Hide url
function show_url($products_url='') {
if ($_SESSION['customer_id'] && $products_url !='') {
$url_string = sprintf(TEXT_MORE_INFORMATION, $products_url);
} else {
$url_string = sprintf(TEXT_MORE_INFORMATION_URL, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}
return $url_string;
}
withPHP Code:<?php // echo sprintf(TEXT_MORE_INFORMATION, $products_url); ?>PHP Code:<?php echo show_url($products_url); ?>
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donations always welcome: www.zen-cart.com/donate
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Yes! Thank you Sensei, this works great.
Bookmarks