Jump to content

Forward Cart.php to another Page


Craft

Recommended Posts

Hi guys,

I would like to forward any access to cart.php page to another page (clientarea.php for example)

I can do it using Hook or Redirect URLs from cPanel, but my issue that I don't want to redirect it's parameters too like (cart.php?a=view), (cart.php?a=add&domain=register), etc..

How can I do that?

Link to comment
Share on other sites

4 minutes ago, Craft said:

I can do it using Hook or Redirect URLs from cPanel, but my issue that I don't want to redirect it's parameters too like (cart.php?a=view), (cart.php?a=add&domain=register), etc..

just to double check - you want viewcart, domainregister etc to work, but redirect other pages... or you want to totally prevent access to all cart.php pages for everyone ??

Link to comment
Share on other sites

9 minutes ago, brian! said:

just to double check - you want viewcart, domainregister etc to work, but redirect other pages

How?

 

9 minutes ago, brian! said:

you want to totally prevent access to all cart.php pages for everyone ??

Yes, because I hide all the products to appear at cart.php, so this page is useless.

1797643862_Currentcart.thumb.png.953b6f9e7efc70aaf215f9d6fca81bb2.png

Link to comment
Share on other sites

let me give you two answers, and then you figure out which suits your situation best...

1. redirect everyone away from cart.php...

<?php

# Redirect Cart Visitors Hook
# Written by brian!

function redirect_cart_vistors($vars)
{
	header("Location: clientarea.php");
	exit;
}
add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors");

2. redirect everyone away from the products page, but leave the other cart pages working...

my suspicion is that you'll need the second option - as looking at your site, I think you still need the other pages of the cart to work.

Edited by brian!
Link to comment
Share on other sites

25 minutes ago, brian! said:

2. redirect everyone away from the products page, but leave the other cart pages working...

my suspicion is that you'll need the second option - as looking at your site, I think you still need the other pages of the cart to work.

Yes, that's what I need exactly.

<?php

# Redirect Cart Visitors Hook for SteelSignature
# Written by brian!

function redirect_cart_vistors($vars)
{
	if ($vars['templatefile'] === 'products'){
		header("Location: clientarea.php");
		exit;
	}
}
add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors");
?>

Thank you 🙂

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