TRiNi-STaRR Posted February 14, 2008 Posted February 14, 2008 I would like to change a cpath example: the cpath in one of my categories menu is http://www.mysite.com/index.php?cPath=25 I would like to change it to: http://www.mysite.com/index2.php how can i do this?
ELnew Posted February 14, 2008 Posted February 14, 2008 I would like to change a cpath example: the cpath in one of my categories menu is http://www.mysite.com/index.php?cPath=25 I would like to change it to: http://www.mysite.com/index2.php how can i do this? being the novice I am, I'm pretty firmilar with the system and honestly I don't think this is possible, unless somehow you install a SEO contrib and change the name that way, but then again I'm not in that stage on my site yet, but I think that's how it's done. I just thought I'd give you an idea, seeing that noone has yet tp reply to you yet. ~Parker
johnnytli Posted February 15, 2008 Posted February 15, 2008 I would like to change a cpath example: the cpath in one of my categories menu is http://www.mysite.com/index.php?cPath=25 I would like to change it to: http://www.mysite.com/index2.php how can i do this? Well you can do it by finding the file that serves the link and check for the value that you want to change and change it. The problem with user modification is that everytime osCommerce updates you need to redo the code. If you have a reason for doing what you ask, maybe a better solution can be devised. Remember to document your changes so that you can find them later, if they are causing problems. If you want to change the link in the categories box you need to (1) Find and open it for editing this file "includes\boxes\categories.php" (2) Find the following code - around line 27 $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; (3) Replace it with the following code //modified to change index.php to index2.php for $counter =25 - By Johnny Li if ($counter != '25') { $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; } else { $fileName_user='index2.php'; $categories_string .= tep_href_link($fileName_user, $cPath_new) . '">'; } // end modified to change index.php to index2.php - By Johnny Li If you want to change the link in the categories list you need to (1) Find and open it for editing this file "index.php" - in the catalog folder (2) Find the following code - around line 104 echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; (3) Replace it with the following code // Change link for categoris_id=25 - Modified by Johnny Li if ($categories['categories_id'] != '25') { echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; } else { $fileName_cPath_3='index2.php'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link($fileName_cPath_3, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; } // end Change link for categoris_id=3 - Modified by Johnny Li
♥FWR Media Posted February 15, 2008 Posted February 15, 2008 I would like to change a cpath example: the cpath in one of my categories menu is http://www.mysite.com/index.php?cPath=25 I would like to change it to: http://www.mysite.com/index2.php how can i do this? Why not install the excellent ULTIMATE SEO URLs and turn http://www.mysite.com/index.php?cPath=25 Into http://www.mysite.com/my-great-product-c-25.html Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.