Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product info pages custom text


cruisecontrol2010

Recommended Posts

I want to add text to my product info page.. i want to remove the "this product was added on" and replace it with text saying ..

 

This book is called PRODUCT_NAME_HERE an is apart of our CATEGORY_NAME_HERE series in this MAINPAGE_URL_IN_ANCHOR_TEXT (fictional books shop) . Enjoy shopping here!

 

im trying to do some ncie internal linking here

Can anyone tell me exactly what i need to put in that space to get this working right

 

thanks!

Link to comment
Share on other sites

Add to /catalog/includes/languages/[iNSERT EACH LANGUAGE YOU SUPPORT HERE]/product_info.php

 

define( 'TEXT_INTRA_LINK', 'This book is called %s and is a part of our %s series in this %s (fictional books shop) . Enjoy shopping here!');

 

Add to /catalog/product_info.php in place of the "date added" code:

 

<?php
// Return categories name
// TABLES: categories_description
// Note: I didn't author this function I found it here on the forum
 function tep_get_categories_name($who_am_i) {
global $languages_id;
$the_categories_name_query= tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $who_am_i . "' and language_id= '" . $languages_id . "'");
$the_categories_name = tep_db_fetch_array($the_categories_name_query);
return $the_categories_name['categories_name'];
 }
?>
<p style="text-align: center;"><?php echo sprintf(TEXT_INTRA_LINK, $product_info['products_name'], tep_get_categories_name( $_GET['cPath'] ) , '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath']) . '">' . STORE_NAME . '</a>' ); ?></p>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I don't see where you specified you wanted that.

 

I'll post an update later today.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

<?php
//// Return categories name
// TABLES: categories_description
 function tep_get_categories_name($who_am_i) {
global $languages_id;
$the_categories_name_query= tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $who_am_i . "' and language_id= '" . $languages_id . "'");
$the_categories_name = tep_db_fetch_array($the_categories_name_query);
return $the_categories_name['categories_name'];
 }
if ( $_GET['cPath'] == '' ) {
 $link1 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . tep_get_product_path( $product_info['products_id'] )) . '">' . $product_info['products_name'] . '</a>';
 $link2 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . tep_get_product_path( $product_info['products_id'] )) . '">' . STORE_NAME . '</a>';
 $text1 = tep_get_categories_name( tep_get_product_path( $product_info['products_id'] ) );
 $pieces = explode("_", tep_get_product_path( $product_info['products_id'] ));
 $link3 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $pieces[0] ) . '">' . $text1 . '</a>';
} else {
 $link1 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath']) . '">' . $product_info['products_name'] . '</a>';
 $link2 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath']) . '">' . STORE_NAME . '</a>';
 $text1 = tep_get_categories_name( $_GET['cPath'] );
 $pieces = explode("_", $_GET['cPath']);
 $link3 = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $pieces[0] ) . '">' . $text1 . '</a>';
}
?>
<p style="text-align: center;"><?php echo sprintf(TEXT_INTRA_LINK,  $link1 , $link3 , $link2 ); ?></p>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 2 weeks later...

You don't understand how the SEO URL's work.

 

The links the code makes are the same as they always were.

 

The .htaccess rewrites them.

 

The code I posted works for me on my server.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...