Jump to content

Redirecting a product group


twgh

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated