Prevent users from reaching item with direct link

Ulrika
Tera Expert

Hi all,

I have some old items that I've now included in an order guide instead of those separate items.

 

However, users have saved the url:s to the specific items so when they use the url:s they will not end up in the order guide. Is there a way I can force the users to go to the order guide instead of using direct links to the items? I've already checked the "No search" box but that doesn't prevent the direct links to the forms but at least they cannot search for the items.

 

Thank you in advance,

Ulrika

2 ACCEPTED SOLUTIONS

Jaspal Singh
Mega Patron
Mega Patron

Hi Ulrika,

 

An onLoad Catalog Client script on the Catalog item that you do not wish users to directly access will help.

 

In there you can redirect the user, using the following code:

Replace google.com with your own URL.

function onLoad() {
	top.window.location ='http://google.com';
}

 

View solution in original post

You could also create a variable set that would contain the onLoad Catalog Client Script and add that to the relevant Catalog Items.

But you need one more thing for this to work properly - a test whether the current context is a stand-alone Catalog Item, or an Order Guide:

if (g_service_catalog && !g_service_catalog.isOrderGuide()) {
	// redirect code;
}

If you don't do the check, the onLoad Catalog Client Script will execute on the Order Guide too and will redirect on the Order Guide too.

View solution in original post

7 REPLIES 7

Jaspal Singh
Mega Patron
Mega Patron

Hi Ulrika,

 

An onLoad Catalog Client script on the Catalog item that you do not wish users to directly access will help.

 

In there you can redirect the user, using the following code:

Replace google.com with your own URL.

function onLoad() {
	top.window.location ='http://google.com';
}

 

Aha OK, then I'll need to add this onLoad to all my items. Thank you so much for your suggestion, I'll try it out!

You could also create a variable set that would contain the onLoad Catalog Client Script and add that to the relevant Catalog Items.

But you need one more thing for this to work properly - a test whether the current context is a stand-alone Catalog Item, or an Order Guide:

if (g_service_catalog && !g_service_catalog.isOrderGuide()) {
	// redirect code;
}

If you don't do the check, the onLoad Catalog Client Script will execute on the Order Guide too and will redirect on the Order Guide too.

Very good, I'll try this. Thank you!!