Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to incorporate these two pieces of code


mark27uk3

Recommended Posts

Hi Guys,

 

Will someone please show me to join the two pieces of code below so that the price is directly below the product name in the product listings.

 

Everytime I try to do it I either lose the description of the product or the product name.

 

Add this:

 

case 'PRODUCT_LIST_PRICE':
           $lc_align = 'center';
           if (tep_not_null($listing['specials_new_products_price'])) {
             $lc_text = ' <br><br><font color="#ff0000"><b><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> </b></font><p><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></p> ';
           } else {
             $lc_text = ' <br><br><font color="#ff0000"><b>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' </b></font> ';
           }
           break;

 

to this:

 

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> ';
           }
 if (PRODUCT_LIST_DESCRIPTION && $listing['products_description'] && PRODUCT_LIST_DESCRIPTION_MAX_LENGTH)
           $lc_text .= '<br><table border="0" cellpadding="0" cellspacing="0" width="85%"><tr><td class="productDesc">' . tep_flatten_product_description($listing['products_description'],  '<p><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a>  <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></p>') . '</td></tr></table>';
           break;

 

Thanks

 

Mark :thumbsup:

Lifes a bitch, then you marry one, then you die!

Link to comment
Share on other sites

whos calling the cases code? I am guessing there is an infobox or something that puts everything together at the end. You could remove the cases and place everything in one $lc_text variable. Use the $lc_text .= ..... for the second part

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...