Jump to content

Disable cart.php?


Dhush

Recommended Posts

Hi,

 

How can i disable cart.php page? I want to completely disable it and make a redirect to login/registration page, even if someone visited directly it must be redirected.

 

Looking for help from brain, sentq.

 

Instead i want people to place orders directly from client area, similar to Digitalocean, vultr.

More over it should be like virtkick.

 

Thank you.

Link to comment
Share on other sites

How can i disable cart.php page? I want to completely disable it and make a redirect to login/registration page, even if someone visited directly it must be redirected.

Looking for help from brain, sentq.

one option might be to use an action hook...

 

<?php

add_hook("ClientAreaPageCart",1,function($vars){

   $client = Menu::context("client");
   $clientid = (int) $client->id;

   if ($clientid===0){
   header("Location: register.php");
       exit;
   }    
});

the way it would work is to check, on any cart page, if the user is logged in - if they are not logged in, then they are redirected to the register.php page; if they are logged in, then they can use the cart as normal. :idea:

 

Instead i want people to place orders directly from client area, similar to Digitalocean, vultr.

More over it should be like virtkick.

with the above hook, only logged in clients can access the cart - either directly or via the links (navbar and sidebar) in the clientarea.

 

Can any one give an idea about how to integrate ordering system in to clients dashboard? like above i mentioned!

it already is - links to the cart are in the client area.

 

I think it would take some effort to add cart functionality directly to the client area pages (you'd likely need to write an API solution) - what I suspect you should really aim to do is theme your client area and cart templates with a similar theme, so that the join between them is seamless.

 

off the top of my head, I can't think of any available custom orderform template that behaves like the virtkick demo. :?:

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