Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

possible to get shopping cart to display product number?


Guest

Recommended Posts

is there a way to have the product number show in the shopping cart on the right column instead of the product description? (ie, the "1 x product description") most of our descriptions are fairly long and the column fills up pretty quickly. i think it would present better having the shorter model number in this box. is this possible? i've done a fair bit of searching and found a few others pose the question, but never an answer. thanks in advance.

Link to comment
Share on other sites

is there a way to have the product number show in the shopping cart on the right column instead of the product description? (ie, the "1 x product description") most of our descriptions are fairly long and the column fills up pretty quickly. i think it would present better having the shorter model number in this box. is this possible? i've done a fair bit of searching and found a few others pose the question, but never an answer. thanks in advance.

 

in includes/boxes/shopping_cart.php you have this statement :

 

$cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

 

 

change that to:

 

$cart_contents_string .= $products[$i]['model'] . '</span></a></td></tr>';

 

or

 

$cart_contents_string .= $products[$i]['id'] . '</span></a></td></tr>';

Treasurer MFC

Link to comment
Share on other sites

any chance there's a similar method to get notifications to do the same thing? would like the product notification message to say "Notify me of updates to [model number]" instead of product name.

 

tried playing around with product_notifications.php in includes/boxes, but this looks a bit more complicated than the shopping cart and i really don't want to muck anything up. :blink:

 

thanks in advance.

Link to comment
Share on other sites

any chance there's a similar method to get notifications to do the same thing? would like the product notification message to say "Notify me of updates to [model number]" instead of product name.

 

tried playing around with product_notifications.php in includes/boxes, but this looks a bit more complicated than the shopping cart and i really don't want to muck anything up. :blink:

 

thanks in advance.

 

 

the clue is in :

 

tep_get_products_name($HTTP_GET_VARS['products_id'])

 

which will return the product name based on the given id.

 

 

this function in general.php

 

// Return a product's name

// TABLES: products

function tep_get_products_name($product_id, $language = '') {

global $languages_id;

 

if (empty($language)) $language = $languages_id;

 

$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'");

$product = tep_db_fetch_array($product_query);

 

return $product['products_name'];

}

 

 

you could add a function to general.php to get the model:

 

// Return a product's model

// TABLES: products

function tep_get_products_model($product_id) {

$product_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

$product = tep_db_fetch_array($product_query);

return $product['products_model'];

}

 

 

and change the

 

tep_get_products_name($HTTP_GET_VARS['products_id'])

 

calls (2x) to

 

tep_get_products_model($HTTP_GET_VARS['products_id'])

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...