Zen Cart Logo
Forums / General Questions / Redirecting a subcategory to an external site

Redirecting a subcategory to an external site

Views: 4,188

Results 1 to 20 of 43
28 Apr 2011, 5:44 PM
#1
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Redirecting a subcategory to an external site

I have set up zencart v1.3.8 on my domain https://www.dscgunstore.com with a Gloss Black template. I have setup 3 main categories on my main page. The main page will have images for the Categories and some minimal text. The category named Firearms has numerous subcategories and further subcategories without any products because I wish to have an external link to my (another) webstore that was setup by one of my distributors for the product inventory counts and final purchase.
I have seen the option in the EZ Pages for an external URL redirect and would like to be able to modify my Category and Subcategories to be able to do individual redirects off site to different URLs at my distributor without doing a site wide php change. The other two main page categories of products will not be needing to be redirected off site. Please feel free to request any additional info. Any ideas will be deeply appreciated!!
Am new to forum and zencart so please bear with me. Thanks!!

28 Apr 2011, 7:17 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirecting a subcategory to an external site

If what you want is even possible, it would require significant custom coding. You can probably set up the custom code for the links easily enough, but actually getting it to function with the remote site being the real store is probably not practical, if you want the customer to be able to buy more than one item at a time.

THink about how you would feel, while shopping for a gun, if you clicked on a category or product and suddenly found yourself on another website completely... sounds pretty offputting to me.

28 Apr 2011, 7:34 PM
#3
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Redirecting a subcategory to an external site

I have set up zencart v1.3.8
NOT a good idea....Latest version of zencart is
Zencart 139h

29 Apr 2011, 4:53 PM
#4
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

To Black Belt - There is a redirect link going off site to my store at my distributor that already exists on my website under the EZpages Important Links sidebox called "Online Firearms Catalog". This redirects current customers to my store at my distributor and they can purchase as many or as much as they wish to purchase because they can surf around once they are at that site. It is the suggestions of my customers from my other site https://www.dscarmsinc.com to make the new site https://www.dscgunstore.com more manufacturer product category specific. So I don't think or feel it will be offputting to my customers since they made the suggestions. The question remains - exactly how can it be accomplished if it can be accomplished? Thanks for the help, reply and suggestion.

To Misty - Thanks for the reply - will upgrading to the latest version 1.3.9 - accomplish what I would like to do?

If there is another way to accomplish it - I am open to all suggestions!!
Thanks for the help!!

29 Apr 2011, 5:50 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Redirecting a subcategory to an external site

Not within Zencart, I don't think. I'm not sure I understand exactly what you're trying to do, but I still would wonder what would happen if I, as a customer, wanted to buy something from a 'local' category, and something from a 'remote' category - two separate checkouts ?

One possible kludge would be to create an EZpage for each remote category, using an external link to the remote site, and place the EZ page sidebox right under the Categories sidebox, remove the header and play with margins and padding so the two looked like the same sidebox.

2 May 2011, 12:03 AM
#6
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Thanks for the reply Stevesh.
The three main categories on my main page https://www.dscgunstore.com have different legal and shipping requirements if purchased. Multiple purchase checkout within the same category can be done without any problem and in the same shopping cart. The multiple checkout issue between different categories and/or subcategories is basically moot because of the different legal and shipping requirements within each category. Basically the "Black powder" category and the "NFA" category products are done in-house and the products in the "Firearms" are to redirected to other webstore of mine that is at one of my distributors. The products purchased in the "Firearms" category are shipped to my physical store for the customer to pickup.

Basically I want to have the categories out of the sideboxes and on the center of the main page - but to be able to automatically redirect to my other offsite webstore. The option in the EZpages (in the sidebox) to automatically redirect to an internal or an external url is present when setting up the EZpage in the admin area. I would like to get the main categories and/or subcategories in the admin area to be able to allow a redirect to another url.

Thanks for the input and will attempt it to see if it will work - customers requests to simplify and streamline the categories to go directly to the products they are interested in purchasing are the reason why I am trying to do this. Again I am open to any suggestions on how to accomplish it. Thanks to all.

2 May 2011, 12:27 AM
#7
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Anybody know or have any idea what I would have to change in the php code to accomplish a redirect in the categories and subcategories admin area for the main page and not be in the sideboxes? Thanks to all for any suggestions.

2 May 2011, 8:00 PM
#8
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Basically I want to have the categories out of the sideboxes and on the center of the main page - but to be able to automatically redirect to my other offsite webstore similar to the option in the EZPages admin area. The option in the EZpages (in the sidebox) will automatically redirect to an internal or an external url that is present when setting up the EZpage in the admin area. I would like to get the main categories and/or subcategories in the admin area to be able to allow a redirect to another url.

History is as follows:
I have set up zencart v1.3.8 on my domain https://www.dscgunstore.com with a Gloss Black template. I have setup 3 main categories on my main page. The main page will have images for the Categories and some minimal text. The category named Firearms has numerous subcategories and further subcategories without any products because I wish to have an external link to my (another) webstore that was setup by one of my distributors for the product inventory counts and final purchase.

The three main categories on my main page https://www.dscgunstore.com have different legal and shipping requirements if purchased. Multiple purchase checkout within the same category can be done without any problem and in the same shopping cart. The multiple checkout issue between different categories and/or subcategories is basically moot because of the different legal and shipping requirements within each category. Basically the "Black powder" category and the "NFA" category products are done in-house and the products in the "Firearms" are to redirected to other webstore of mine that is at one of my distributors. The products purchased in the "Firearms" category are shipped to my physical store for the customer to pickup.

I have seen the option in the admin for EZ Pages for an external URL redirect. I would like to be able to modify my Category and Subcategories to be able to do individual automatic same page redirects off site to different URLs from at my distributor. The other two main page categories of products will not be needing to be redirected off site. It is the suggestions of my customers from my other site https://www.dscarmsinc.com to make my new website https://www.dscgunstore.com more manufacturer product category specific by way of a redirect.

Anybody know or have any idea what I would have to change in the program php code to accomplish a redirect in the categories and subcategories admin area for the main page and not be in the sideboxes? Will upgrading to the latest version 1.3.9 - accomplish what I would like to do?

My expertise is limited to installing and making only minor modifications to the current php program code.

Please feel free to request any additional info. Any ideas will be deeply appreciated!!

Thanks for the help!!

3 May 2011, 9:14 AM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Redirecting a subcategory to an external site

I think you're looking at enough custom coding that you may have to pay someone to do it, but I'm not a programmer, so I could be wrong.

Did you consider my 'kludge' in post #5 ?

3 May 2011, 2:20 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirecting a subcategory to an external site

Thinking out loud... If you use the ez-page external link function to hold the desired links, you could tweak the category listing to check for one of your special category ids, and if one of them (or the Firearms top category) is being handled, go to an alternate output where you have a zen_ez_pages_link(##) with the ## set according to the current subcategory. You would need a method of storing the correspondences between subcategories and ez-page ids. A database table would work, but it would probably be easier to define a constant with array content that could be evaluated at runtime.

3 May 2011, 7:46 PM
#11
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Thanks Stevesh - I did try the Kludge previously and then after you suggested it. It does redirect but it is not the desired webpage my customers requested but it may have to do for now while I figure out something better.

Thanks Blackbelt - I will look into trying that with the ezpages link #'s and see if it will work out.

Thanks for the help and suggestions. I may end up at a programmer to accomplish this, reconsider the main page layout, or going with another cart all together (but I really do not want to do that). I am sure there is someone at some point in the past that has wanted the same redirect and solved it - especially with all the redirection that goes on - on the web.
Once again thanks for the suggestions and ideas. Please feel free to post more suggestions if you think of any.

4 May 2011, 2:46 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Redirecting a subcategory to an external site

There's a caveat to all this, which the others have touched on indirectly: What if I'm shopping on your site, add some things to my cart, and then click a link that takes me to some other site, buy some things there, and completely forget about completing checkout back on your main site? Instant loss of sales, and confusion for the customer.

4 May 2011, 2:47 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Redirecting a subcategory to an external site

I think using EZ-Pages for this is the wrong way to go.

Glenn is more correct in the idea of creating a mapping of categories and corresponding destination links, and then doing routing where appropriate.

Do you have a list of which category cPaths should be redirected to what URLs?

4 May 2011, 3:02 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirecting a subcategory to an external site

In regard to the question of orphaned cart items on your main site - if you can track the referrer on the other site, store the info in the session, and after checkout suggest returning to your main site where relevant, that might alleviate the potential confusion. Will all visitors to the other site come from your main site, or are there other routes of access?

4 May 2011, 3:11 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirecting a subcategory to an external site

Just thinking about a simplified way of making the corresponding links...
you could define a constant for each subcat like

define('FIREARMS_LINK_32_57', 'http://www.yourothersite.com/whatever_page'); //for cPath=32_57

then in the category listing, see if there is a constant that matches the cPath and use its defined value instead of the regular link.

4 May 2011, 3:20 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Redirecting a subcategory to an external site

Right.
Then use an observer class to hook the NOTIFY_HEADER_START_INDEX notifier point, and simply do a zen_redirect() to the corresponding URL whenever the specified cPath is clicked.

Could use constants to do the defining, or just an array of values, or even just a bank of case statements in a switch() loop.

10 May 2011, 4:00 PM
#17
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Sorry for the delay in getting back to you all for the suggestions.
To Dr Byte - Regarding your caveat - The three main categories on my main page https://www.dscgunstore.com have different legal and shipping requirements if purchased. Multiple purchase checkout within the same category can be done without any problem and in the same shopping cart. The multiple checkout issue between different categories and/or subcategories is basically moot because of the different legal and shipping requirements within each category. Basically the "Black powder" category and the "NFA" category products are done in-house and the products in the "Firearms" are to redirected to other webstore of mine that is at one of my distributors. The products purchased in the "Firearms" category are shipped to my physical store for the customer to pickup. So the purchase would have to completed and then instructed to go back for other category purchases. Most purchases are done singlely anyway with very few multiple purchases of these items.
I agree using EZpages is not what I wish to use - other than the fact that it contains in the ezpages part of the zencart program an option to redirect offsite to a specified url and/or ccurl or cpath. I just wanted it to be part of the category/subcategories area. As far as other routes of access to my other webstore at my distributor - yes there is access to it but there are links provided to go to my main (or originating) site. Purchases there can only be made there - however multiple purchases from the same site using that shopping cart.
I do like the simplification idea of Black belts - just do not know where i would put the code or program instructions to accomplish what you both have so graciously and intelligently suggested to solve my boggle.

Blackbelt, Dr Byte and everyone else has been super - problem is I am extremely new to the programming thing with zencart and I am learning as i go along. My daughter had set up the sites and dumped them in my lap because she no longer wanted anything to do with it anymore and walked out entirely.
So Any help is greatly appreciated. Thanks to all!!!!!!

12 May 2011, 5:32 AM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Redirecting a subcategory to an external site

So, are you wanting to redirect category links, or wanting to redirect products?
ie: when a visitor clicks on the "Benelli" category, are you wanting them to see a list of related products on your site? Or be immediately redirected to the other site?
And do you have a list which maps those "source click" and "destination URL" pairs someplace?

Thus far you're only talking in theory, and not exact specifics. So all we can really do is give you ideas of what to do, which we've done.

13 May 2011, 3:52 PM
#19
dscarms avatar

dscarms

New Zenner

Join Date:
May 2010
Posts:
29
Plugin Contributions:
0

Re: Redirecting a subcategory to an external site

Thanks again - DrByte for the all the assistance.

The specifics are as follows - if a customer goes to the "firearms" category (on www.dscgunstore .com site) and then to a subcategory (for example S&W) and then further subcategories of "Handguns" , then to a futher subcategory of either "Pistols" or "Revolvers" and when the customer would choose either one of either "Pistols" or "Revolvers" subcategory it would be re-directed to my other webstore at Davidsons (my distributor) inventory (urls) to purchase the products. The customer can surf within my webstore at the Davidsons site and make multiple product purchases if they wish. The products will be shipped to my physical store for that customer.

The other main categories (Black powder and NFA) products listed on www.dscgunstore .com site would be handled within the DSC gunstore website shopping cart and within my physical store only - largely due to legal and shipping restrictions.
In answer to your question, the "source click" would be the Subcategories on the dsc gunstore site and the "destination url" would go to the urls at my webstore at the Davidsons in the specific manufacturer and model/type area (ie. revolver or pistol). At this point in time I have not compiled an actual list but could easily copy and paste them if I could get the zencart categories or subcategories to have the option to re-direct it - whether it would be on a categories/subcategories template or in the program php code itself.

Basically I want to re-direct the subcategories from my dscgunstore site TO the actual instock, realtime, inventory of products at my Davidsons webstore - for purchase.
I hope that eplains in detail what I am trying to accomplish.

Thanks for all the suggestions, assistance and help. If you have any more specific solutions, please feel free to suggest. Thanks Again.

15 May 2011, 1:13 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Redirecting a subcategory to an external site

The suggestion I made in posts 10 & 15 will do exactly what you want. A more specific solution would be writing the actual code for you.
Using the observer/notifier system instead of modifying the listing file, while more elegant, would require up-to-date programming skills and a knowledge of Zen Cart's structure. How much experience do you have with PHP?