Results 1 to 3 of 3
  1. #1

    Default Product Type Redirect Info Page to Category Page

    Hi Guys,

    I currently have a product type that the products are only ever added to the card from the product listing page and never the product info page for this certain product type. I have deleted all main links to the product info page so this cannot normally be accessed but I am wondering if there would be a way, so If the customer manages to click a link to the product info page that this is then redirected to the category page.

    For example on the shopping cart if this link is clicked it would bring you back to the category page. I hope this makes sense.

    I was thinking the way that it might be handled is changing something in the includes/modules/pages/product_units_info/header_php.php to redirect to the products cateogry?

    Thanks!

  2. #2
    Join Date
    Jul 2012
    Posts
    16,742
    Plugin Contributions
    17

    Default Re: Product Type Redirect Info Page to Category Page

    That file or using an observer off of one of the notifiers that may have been used/incorporated would be a place where you could put a zen_redirect call to go to the category desired for the associated product. Would need to lookup what category the product is in and then determine the cPath desired for the redirect's parameters.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3

    Default Re: Product Type Redirect Info Page to Category Page

    Thanks for the point in the right direction! I'm not used to many of the functions so I've been digging and the solution I have come up with encase anyone comes across this thread:

    In my includes/modules/pages/NEWPAGE/header_php.php I have added the following line:

    PHP Code:
    zen_redirect(zen_href_link(FILENAME_DEFAULT'cPath=' zen_get_generated_category_path_rev(zen_get_products_category_id((int)$_GET['products_id'])))); 
    From what I can tell this does the following

    zen_redirect is a function to redirect to another link
    zen_href_link is the function to generate zencart links
    zen_get_generated_category_path is the function with generates the full cPath when you give it the category id
    zen_get_caterogy_id gets the category id from the product id

    This seems to work exactly how I need!

 

 

Similar Threads

  1. How to remove the redirect of product info page?
    By billpalm in forum General Questions
    Replies: 2
    Last Post: 17 Dec 2010, 10:16 AM
  2. Adding a new Product Type Info Page Layout options :: Product - General
    By bn17311 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Aug 2010, 06:42 PM
  3. Redirect Product Info Page
    By IncrediBody.com in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 26 Mar 2010, 08:36 PM
  4. Back Button on product info page returning to previous category page ex. page 5
    By dharma in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 19 Mar 2008, 10:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR