trupti Posted October 5, 2006 Posted October 5, 2006 Hello All. I need to add a product hyperlink on the main page , so the place where it says "Check whats new " just above the "Welcome Guest! Woudl you like to ..." should instead say " Check our new Packaged Solutions " where Pakcaged Solutions is a hyperlink to one of the categories. How do I do this ?? the right way so that the link has the session id of the customer as well. I know I need to edit "HEADING_TITLE" in index.php via the admin interface to just reflect text changes. However I need to add a link out here. What is the best way to do this. Do I need to edit index.php source or is there some way to do it via the tools/define lanugages/..php interface. Awaiting replies
trupti Posted October 5, 2006 Author Posted October 5, 2006 Hello All. I need to add a product hyperlink on the main page , so the place where it says "Check whats new " just above the "Welcome Guest! Woudl you like to ..." should instead say " Check our new Packaged Solutions " where Pakcaged Solutions is a hyperlink to one of the categories. How do I do this ?? the right way so that the link has the session id of the customer as well. I know I need to edit "HEADING_TITLE" in index.php via the admin interface to just reflect text changes. However I need to add a link out here. What is the best way to do this. Do I need to edit index.php source or is there some way to do it via the tools/define lanugages/..php interface. Awaiting replies Well all still awaiting replies....?? This is shouldnt be hard to setup, only I want to be sure of what I am doing
bill110 Posted October 5, 2006 Posted October 5, 2006 Well all still awaiting replies....?? This is shouldnt be hard to setup, only I want to be sure of what I am doing If not answered when I get home I will answer. I can hack but cant go from scratch. couple of hours. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
bill110 Posted October 6, 2006 Posted October 6, 2006 If not answered when I get home I will answer. I can hack but cant go from scratch. couple of hours. OK sorry this took so long. The problem with making the heading title a link is it is defined within an "if /else statement. you could change the text and make it a link but the page that says"Let's see what we have here" and "Catagories would be the same link. If you want to do it that way look for this on catalog/index.php line 287 on default setup <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> where it says: <?php echo HEADING_TITLE; ?> replace with: <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_2&products_id=18') . '">'; ?><?php echo HEADING_TITLE . '</a>'; ?> You can get this info 'cPath=1_2&products_id=18' by selecting the product you want to link to and find it in the address bar. (note the _2 is a sub catagory) another way would be to define a new text in the english/index.php file like define('TEXT_WHATEVER', 'Your Text'); then just below where it calls for the heading title add another table row and table data and insert the code. Replace HEADING_TITLE with TEXT_WHATEVER Hope this helps. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
bill110 Posted October 6, 2006 Posted October 6, 2006 OK sorry this took so long. The problem with making the heading title a link is it is defined within an "if /elsestatement. you could change the text and make it a link but the page that says"Let's see what we have here" and "Catagories would be the same link. If you want to do it that way look for this on catalog/index.php line 287 on default setup <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> where it says: <?php echo HEADING_TITLE; ?> replace with: <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1_2&products_id=18') . '">'; ?><?php echo HEADING_TITLE . '</a>'; ?> You can get this info 'cPath=1_2&products_id=18' by selecting the product you want to link to and find it in the address bar. (note the _2 is a sub catagory) another way would be to define a new text in the english/index.php file like define('TEXT_WHATEVER', 'Your Text'); then just below where it calls for the heading title add another table row and table data and insert the code. Replace HEADING_TITLE with TEXT_WHATEVER Hope this helps. Sorry here is a correction. If you put the code where I said before it will only link from that page. The catagories will not link and neither will the Let's see what we have here. The index.php file has 3 places where it calls for HEADING_TITLE. Replacing the last one will show the link only on the main page. Sorry for any confusion. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
trupti Posted October 6, 2006 Author Posted October 6, 2006 Sorry here is a correction. If you put the code where I said before it will only link from that page. The catagories will not link and neither will the Let's see what we have here.The index.php file has 3 places where it calls for HEADING_TITLE. Replacing the last one will show the link only on the main page. Sorry for any confusion. Okay thanks for the response first of all. I am not sure I got you right. What you are saying is I need to change the HEADING_TITLE at 3 places in index.php ?? to get this to work ?? This is what I did, in index.php, where it was <td class="pageHeading"><?php echo HEADING_TITLE; ?></td I replaced it with the following code <td class="pageHeading"> <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=46', 'SSL'); ?>" class="links"><?php echo HEADING_TITLE; ?></a> </td> I want it to link to a category not a product , so there is no info about the productid in the URL. I replaced HEADING_TITLE in the english/index.php file with empty quotes so it looks like define('HEADING_TITLE', ''); But well this doesnt work. I dont get anything on the main page, cos the HEADING_TITLE does not contain anything. Even if I put text in it, it just displays the text, looks like its ignoring whatever I have in the index.php for it. :( . Also hardcoding the cpath in the code this way, is that a right thing to do?? I even did the other way which I actually prefer , defining a new field in the english/index.php file like : define('PRODUCT_HIGHLIGHT', ''); and then usign the same code above this way : <td class="pageHeading"> <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=46', 'SSL'); ?>" class="links"><?php echo PRODUCT_HIGHLIGHT; ?></a> </td> Even this doesnt work?? Please tell me where I am going wrong , I need to get this done urgently :) Thank You!!
bill110 Posted October 6, 2006 Posted October 6, 2006 Okay thanks for the response first of all. I am not sure I got you right. What you are saying is I need to change the HEADING_TITLE at 3 places in index.php ?? to get this to work ?? This is what I did, in index.php, where it was <td class="pageHeading"><?php echo HEADING_TITLE; ?></td I replaced it with the following code <td class="pageHeading"> <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=46', 'SSL'); ?>" class="links"><?php echo HEADING_TITLE; ?></a> </td> I want it to link to a category not a product , so there is no info about the productid in the URL. I replaced HEADING_TITLE in the english/index.php file with empty quotes so it looks like define('HEADING_TITLE', ''); But well this doesnt work. I dont get anything on the main page, cos the HEADING_TITLE does not contain anything. Even if I put text in it, it just displays the text, looks like its ignoring whatever I have in the index.php for it. :( . Also hardcoding the cpath in the code this way, is that a right thing to do?? I even did the other way which I actually prefer , defining a new field in the english/index.php file like : define('PRODUCT_HIGHLIGHT', ''); and then usign the same code above this way : <td class="pageHeading"> <a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=46', 'SSL'); ?>" class="links"><?php echo PRODUCT_HIGHLIGHT; ?></a> </td> Even this doesnt work?? Please tell me where I am going wrong , I need to get this done urgently :) Thank You!! When you define('PRODUCT_HIGHLIGHT', '') then you have to put some kind of text between the next two single quotes. that is the text that will display when you say echo PRODUCT_HIGHLIGHT. Also you only need to insert the code on the index.php file in one location. The last one down the page in the code is for the first page. The other two are for the catagories page and manufacturers page.(i think) My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
bill110 Posted October 6, 2006 Posted October 6, 2006 When you define('PRODUCT_HIGHLIGHT', '') then you have to put some kind of text between the next two single quotes. that is the text that will display when you say echo PRODUCT_HIGHLIGHT.Also you only need to insert the code on the index.php file in one location. The last one down the page in the code is for the first page. The other two are for the catagories page and manufacturers page.(i think) Ok for clarity: in the catalog/includes/languages/english/index.php file there are three HEADING_TITLE defines. Find the one that matches the text on the page you want to change and change it to what you want. then on catalog/index.php there are three places where echo HEADING_TITLE is called. The last one near the bottom is for the main page. It will be a little above where it says echo TEXT_MAIN. replace the code like i showed in the first example and that will have it link to the product.(or catagory) Also, on my local machine hard coding in this manner kept the session id. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
trupti Posted October 6, 2006 Author Posted October 6, 2006 When you define('PRODUCT_HIGHLIGHT', '') then you have to put some kind of text between the next two single quotes. that is the text that will display when you say echo PRODUCT_HIGHLIGHT.Also you only need to insert the code on the index.php file in one location. The last one down the page in the code is for the first page. The other two are for the catagories page and manufacturers page.(i think) Thanks a lot , that fixed it , I was adding it in the first location in index.php, instead of in the bottom. Works good now. Thanks once again. :)
trupti Posted October 6, 2006 Author Posted October 6, 2006 Thanks a lot , that fixed it , I was adding it in the first location in index.php, instead of in the bottom. Works good now. Thanks once again. :) However one more question yet...How about the hard coding part?? I still feel there should be some workaround for this?? I agree as you said , it preseves the session id , but I think if somehwere down the line I add more categories/products , its goign to mess it up .. Let me know if you know of a better way to link it instead of hardcoding it. Thanks again for all your help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.