coralliao Posted November 28, 2006 Share Posted November 28, 2006 Dear all, I want to creat my store by STS 4.1, and use $cat_# & $urlcat_# variables inside my templates! I have already uncommentted their codes in catalog/includes/modules/sts_inc/sts_user_code.php. It can successfully work in "iindex.php.html" template and "sts_template.html", but can't work only in "product_info.php.html" template. In product_info.php pages, it only directly works $cat_# & $urlcat_#! :'( Is there anyone can provide some advice, please? I can't find where the problem is for all day! Thanks a lot! Coral Quote Link to comment Share on other sites More sharing options...
bkellum Posted November 28, 2006 Share Posted November 28, 2006 Dear all, I want to creat my store by STS 4.1, and use $cat_# & $urlcat_# variables inside my templates! I have already uncommentted their codes in catalog/includes/modules/sts_inc/sts_user_code.php. It can successfully work in "iindex.php.html" template and "sts_template.html", but can't work only in "product_info.php.html" template. In product_info.php pages, it only directly works $cat_# & $urlcat_#! :'( Is there anyone can provide some advice, please? I can't find where the problem is for all day! Thanks a lot! Coral Hi Coral, I think if you update to STSv4.3 your problem would be solved. There was an issue with the product_info.php script in the older version. Also, make sure that if you are using a char set of "#" at the end of your tags that you have the endchar code in the beginning of your templates. Quote Bill Kellum Sounds Good Productions STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE Link to comment Share on other sites More sharing options...
coralliao Posted November 29, 2006 Author Share Posted November 29, 2006 Hi Coral, I think if you update to STSv4.3 your problem would be solved. There was an issue with the product_info.php script in the older version. Also, make sure that if you are using a char set of "#" at the end of your tags that you have the endchar code in the beginning of your templates. Hi Bill, Thanks for your suggestion! I have read all the documentaries about STSv4.3 and started to update today. However, after I finished, i can't login my admin! It keepes showes: Fatal error: Call to undefined function: tep_admin_check_login() in c:\appserv\www\store\admin\includes\application_top.php on line 214 the codes of line 214 are: if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } Could you or anyone please give me some advice about my problems? Thanks to ALL! Coral Quote Link to comment Share on other sites More sharing options...
bkellum Posted November 29, 2006 Share Posted November 29, 2006 Hi Bill, Thanks for your suggestion! I have read all the documentaries about STSv4.3 and started to update today. However, after I finished, i can't login my admin! It keepes showes: Fatal error: Call to undefined function: tep_admin_check_login() in c:\appserv\www\store\admin\includes\application_top.php on line 214 the codes of line 214 are: if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } Could you or anyone please give me some advice about my problems? Thanks to ALL! Coral Coral, STS does not make any modifications to admin/includes/application_top.php. Make sure that you did not edit the wrong application_top.php file. STS does make modifications to includes/application_top.php. At the end of the file, before the last ?>, you need to add the following code: // START STS 4.3.2 require (DIR_WS_CLASSES.'sts.php'); $sts= new sts(); $sts->start_capture(); // END STS 4.3.2 Check your other files against those in the contribution (all_files) or (modified_files) folders using a compare program to be sure you have everything correct. Quote Bill Kellum Sounds Good Productions STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE Link to comment Share on other sites More sharing options...
coralliao Posted November 30, 2006 Author Share Posted November 30, 2006 Dear Bill, Thanks for your reply! I have found where my problems are. That's because I have another admin account contribution in my admin. So, I checked all the code I have modified yesterday, corrected the all the wrong files, and successfully updated to 4.3 today. But, unfortunately, the same error occured! The "$cat_CategoryID" works in everypages, except product_info.php page! Please see the forrowing images. *A of my images is the image I want to give a link. *B of my images is the current url (name file) of my IE. *C of my images id the link of my image A. $cat_CategoryID" works in index.php But, it can't work in product_info.php I deleted other templates in my STS, and left only sts_template.php.html, but it works the same. It is so queer! I am really not able to find where the problem is! By the way, thanks for your contribution STS4.3. It helps my to solve my another problem now of that I can't put different images in different languages! Thanks a.... lot!!! Coral Quote Link to comment Share on other sites More sharing options...
coralliao Posted December 3, 2006 Author Share Posted December 3, 2006 Is there anyone can give me some ideas to find where my problem is? Thanks a lot! Coral Quote Link to comment Share on other sites More sharing options...
coralliao Posted December 7, 2006 Author Share Posted December 7, 2006 Dear All, I keep to find where my problem is all this week, and finally found where the BUG was. $cat_# & $urlcat_# can can work perfectly in all the PHP pages, however, the BUG occurs when it meets product_info.php. If the product_info.php page reads the product in the SECOND level category(ex.http://****product_info.php?cPath=3_11 ), $cat_# & $urlcat_# variables can't work! It will show directly what the variable is. (Please see the following image 1) But, if the product_info.php page reads the product in the first level category(ex.http://****product_info.php?cPath=37 ), the variables can work perfectly. (Please see the following image 2) Is there any anyone coould please kindly help my to modify the sts_user_code.php? PLEASE.........!! and THANK......all of your help SO MUCH! image 1 image 2 Quote Link to comment Share on other sites More sharing options...
bkellum Posted January 6, 2007 Share Posted January 6, 2007 Dear All, I keep to find where my problem is all this week, and finally found where the BUG was. $cat_# & $urlcat_# can can work perfectly in all the PHP pages, however, the BUG occurs when it meets product_info.php. If the product_info.php page reads the product in the SECOND level category(ex.http://****product_info.php?cPath=3_11 ), $cat_# & $urlcat_# variables can't work! It will show directly what the variable is. (Please see the following image 1) But, if the product_info.php page reads the product in the first level category(ex.http://****product_info.php?cPath=37 ), the variables can work perfectly. (Please see the following image 2) Is there any anyone coould please kindly help my to modify the sts_user_code.php? PLEASE.........!! and THANK......all of your help SO MUCH! image 1 image 2 Coral, Find the following code in your sts_user_code.php: /* // START COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_ // See if there are any $url_ or $urlcat_ variables in the template file, if so, flag to read them if (strpos($sts->template['template_html'], "\$cat_") or strpos($sts->template['template_html'], "\$urlcat_") ) { print "<!-- STS: Reading $cat_ and $urlcat_ tags, recommend not using them -->"; $get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION); // Loop through each category (in each language) and create template variables for each name and path while ($categories_description = tep_db_fetch_array($get_categories_description_query)) { $cPath_new = tep_get_path($categories_description['categories_id']); $path = substr($cPath_new, 6); // Strip off the "cPath=" from string $catname = $categories_description['categories_name']; $catname = str_replace(" ", "_", $catname); // Replace Spaces in Category Name with Underscores $sts->template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new); } } */ // END COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_ Try Change it to the following: // START COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_ // See if there are any $url_ or $urlcat_ variables in the template file, if so, flag to read them if (strpos($sts->template['template_html'], "\$cat_") or strpos($sts->template['template_html'], "\$urlcat_") ) { print "<!-- STS: Reading $cat_ and $urlcat_ tags, recommend not using them -->"; $get_categories_description_query = tep_db_query("SELECT categories_id, categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION); // Loop through each category (in each language) and create template variables for each name and path while ($categories_description = tep_db_fetch_array($get_categories_description_query)) { $cPath_new = tep_get_path($categories_description['categories_id']); $path = substr($cPath_new, 6); // Strip off the "cPath=" from string $catname = $categories_description['categories_name']; $catname = str_replace(" ", "_", $catname); // Replace Spaces in Category Name with Underscores $sts->template["cat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["urlcat_" . $catname] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["cat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $sts->template["urlcat_" . $path] = tep_href_link(FILENAME_DEFAULT, $cPath_new); } } // END COMPATIBILITY WITH STS 2 AND 3: $cat_ and $urlcat_ This would make the $cat tags useable in your templates. Keep in mind, the following code insert is for STS v4.3.3, the most current release as of today. Quote Bill Kellum Sounds Good Productions STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE Link to comment Share on other sites More sharing options...
coralliao Posted January 7, 2007 Author Share Posted January 7, 2007 Dear Bill, Thanks! But, I have already uncommentted those codes in catalog/includes/modules/sts_inc/sts_user_code.php. It can successfully work in "index.php.html" template and "sts_template.html", but can't work only in "product_info.php.html" template when this page reads the product in the second level catagory! But, if it reads the product in the first catagory, it does work! Please see the photo above. I guess there is a BUG here, though I have no idea to fix it! Please help me & thank you so much! Coral Quote Link to comment Share on other sites More sharing options...
bkellum Posted January 7, 2007 Share Posted January 7, 2007 Dear Bill, Thanks! But, I have already uncommentted those codes in catalog/includes/modules/sts_inc/sts_user_code.php. It can successfully work in "index.php.html" template and "sts_template.html", but can't work only in "product_info.php.html" template when this page reads the product in the second level catagory! But, if it reads the product in the first catagory, it does work! Please see the photo above. I guess there is a BUG here, though I have no idea to fix it! Please help me & thank you so much! Coral Coral, before we go any further...did you upgrade to STS version 4.3.3? This version consists of each of the three service packs. Also, How are you creating your link? Quote Bill Kellum Sounds Good Productions STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.