twgh Posted December 16, 2019 Share Posted December 16, 2019 Hi, I have a product group which has hidden products which are sold to clients on request. Although the product group is hidden, I will like anyone who stumbles on the link to the product group to get redirected to the default cart page, since they won't be able. Is this possible? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 16, 2019 Share Posted December 16, 2019 13 minutes ago, twgh said: I have a product group which has hidden products which are sold to clients on request. Although the product group is hidden, I will like anyone who stumbles on the link to the product group to get redirected to the default cart page, since they won't be able. you could use a redirection hook similar to the one I posted in the thread below, but change the if statement... if ($vars['gid'] == 1 || in_array($vars['pid'],array(2,5))) { which basically says that if they've entered the hidden group URL (change 1 to the group id of your hidden group), or they've tried to access the specified products (2 or 5) directly, they'll be redirected elsewhere.... for simplicity, i've added the products to be redirected in an array, but if you know capsule, you could get these products by querying the database - however, I assume you're not going to be updating these hidden products frequently, so coding their product ids in the hook should probably be enough. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.