I have made some progress since my last post.
(BACKUP, BACKUP, BACKUP before you do any of this....)
- Redirecting a customer to the login page when they click on a specific manufacturer:
modify the file /includes/index_filters/default_filter.php as follows:
after the first
if (!isset($select_column_list)) $select_column_list = "";
insert this code
//if the customer calls for a specific manufacturer a n d the customer is not logged in
//then redirect them to the login page
if (!$_SESSION['customer_id'] && (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] = '1' )) {
$_SESSION['navigation']->set_snapshot();
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
this works perfectly.
If you want to use this code then just replace the '1' with the manufacturers id you want to block. Pre-condition: the products to block must have a manufacturer assigned to them.
- Redirecting a customer to the login page when they click on a specific category:
have tried anything and everything known to me in the file /includes/index_filters/default_filter.php with no avail.
then stumbled over the file /includes/functions/functions_categories.php
and inserted before
> return 'cPath=' . $cPath_new;
this code
if (!$_SESSION['customer_id'] && ($cPath_new = '36')) {
$_SESSION['navigation']->set_snapshot();
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
Clicking on the category with id=36 (Practitioner Only) produces the desired result: the customer is redirected to the login page. Upon testing the other categories all work fine (without redirection) except for the categories "Gift Certificates" and "Supplements (all)" - clicking on these 2 cats ALSO produces a redirection. That's not what I want, these 2 cats are "Free For All" - no hiding or redirecting required.
What the :censored: am I doing wrong? :frusty:
To refresh your memories:
I am using v Zen Cart 1.3.7.1
the URL of my site is https://www.frnt.org/zencart/
Can anyone help please??
Once it's all done (with your kind help) I am planning to produce a mod and post it in the "Downloads" section for all to use at their pleasure (and risk).
Thanks heaps,
Frank