Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing product display listing


janice171

Recommended Posts

Hi

 

i want to change the product listing display so instead of displaying across in columns like this:

 

'product image'..............'product name'..............'price'.................'buy now'

 

i would like the image to be displayed on the left with the price, name and buy now displayed at the side of the image in rows.

 

i've trawled the forums and the contributions but have not found anything.

could anyone point me to a tutorial, contribution or offer any other help please??

my php knowledge is small so fairly easy solutions are required.

 

thanks in advance

 

janice

Link to comment
Share on other sites

includes/modules/product_listing.php, starting around line 90. You'll see that each feature is applied within its own segment of code, which can be re-arranged in relation to others to change the order in which it is displayed on the page.

 

switch ($column_list[$col]) {
? ? ? ? ?case 'PRODUCT_LIST_MODEL':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?$lc_text = ' ' . $listing['products_model'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_NAME':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?if (isset($HTTP_GET_VARS['manufacturers_id'])) {
? ? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
? ? ? ? ? ?}
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_MANUFACTURER':
? ? ? ? ? ?$lc_align = '';
? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_PRICE':
? ? ? ? ? ?$lc_align = 'right';
? ? ? ? ? ?if (tep_not_null($listing['specials_new_products_price'])) {
? ? ? ? ? ? ?$lc_text = ' <s>' . ?$currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
? ? ? ? ? ?}
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_QUANTITY':
? ? ? ? ? ?$lc_align = 'right';
? ? ? ? ? ?$lc_text = ' ' . $listing['products_quantity'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_WEIGHT':
? ? ? ? ? ?$lc_align = 'right';
? ? ? ? ? ?$lc_text = ' ' . $listing['products_weight'] . ' ';
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_IMAGE':
? ? ? ? ? ?$lc_align = 'center';
? ? ? ? ? ?if (isset($HTTP_GET_VARS['manufacturers_id'])) {
? ? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
? ? ? ? ? ?}
? ? ? ? ? ?break;
? ? ? ? ?case 'PRODUCT_LIST_BUY_NOW':
? ? ? ? ? ?$lc_align = 'center';
? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
? ? ? ? ? ?break;
? ? ? ?}

 

select code from one 'case' as far as, but not including, the next 'case'

 

Vger

Link to comment
Share on other sites

Hi

 

thank you for your quick reply.

i think maybe i didn't explain myself very well.

it is not the order i want to change, it's the actual layout.

here's a link to the kind of layout that i want

 

the image is still displayed to the left but the associated information is aligned to the right of the image and displayed in rows.

 

do you know how i could do this please?

 

thanks

Link to comment
Share on other sites

switch ($column_list[$col]) {

 

Try changing it to (can't guarantee this, haven't tested it):

 

switch ($column_list[$row]) {

 

Which changes columns to rows, and then you can re-order the items as you wish.

 

Vger

Link to comment
Share on other sites

Hi,

 

i tried that but all it did was to tile the image from left to right and the headings remained along the top.

i'm sure this must have been done before as it's quite a common way to display products.

 

can you suggest anything else?

 

thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...