Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Name & Price:


peterpil19

Recommended Posts

Hi everyone, just a quick question:

 

The Product Name & Price fields for products, they don't seem to take html tags very well because apparently they strip out any html to erase any difficulties.

 

Does anyone know how I can insert html tags successfully without it spurting out a long line of rubbish in the product_listing page?

 

I'd like to be able to make my product prices appear bold as well as certain parts of the product title.

 

Please don't suggest WYSIWYG Html area type editors, because they work in every field BUT the short ones like Price and quantity etc.T

 

Thanks for any help!

 

 

 

--Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

Hi everyone, just a quick question:

 

The Product Name & Price fields for products, they don't seem to take html tags very well because apparently they strip out any html to erase any difficulties.

 

Does anyone know how I can insert html tags successfully without it spurting out a long line of rubbish in the product_listing page?

 

I'd like to be able to make my product prices appear bold as well as certain parts of the product title.

 

Please don't suggest WYSIWYG Html area type editors, because they work in every field BUT the short ones like Price and quantity etc.T

 

Thanks for any help!

 

 

 

--Peter

 

 

Hi Peter

 

The model name shouldnt be a problem , just enter the html in the field and you should get the bits bold that you want (i tested this and it works) but the price is different. you will need to make a new css class for it and apply that to the prices.

 

F5

Link to comment
Share on other sites

The product listings (on the category page that lists all products) are handled by the catalog/includes/modules/product_listing.php

 

You can add html code to that page to alter text either directly adding what you want or using classes defined in your stylesheet.

 

If you look at the code on that page you should be able to figure out where and how to add what you need to change the look of your text.

 

For an example to make your product name bold look for

		  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;

and change it to

		  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']) . '"><b>' . $listing['products_name'] . '</b></a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</b></a> ';
		}
		break;

 

 

Otherwise the products name and price on your product page should already be bold and it is handled by CSS

pageHeading

 

 

Hope that helps. :)

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Hi Peter

 

The model name shouldnt be a problem , just enter the html in the field and you should get the bits bold that you want (i tested this and it works) but the price is different. you will need to make a new css class for it and apply that to the prices.

 

F5

 

Hi Flyer5, thanks for that, you are right it does work! Only problem I found out is that there is a limit to how many characters can be entered into the title. Would you happen by chance to know how to change the maximum no of characters?

 

Thanks Wendy, I will look into what you said so I can Bold the price.

 

I appreciate your help guys, thanks!

 

 

 

--Peter

 

 

 

Don't worry, just figured it out: the field length is defined in the database, so it should just be a matter of using php admin to change the value...

 

--Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

Hi Flyer5, thanks for that, you are right it does work! Only problem I found out is that there is a limit to how many characters can be entered into the title. Would you happen by chance to know how to change the maximum no of characters?

 

Thanks Wendy, I will look into what you said so I can Bold the price.

 

I appreciate your help guys, thanks!

 

 

 

--Peter

Don't worry, just figured it out: the field length is defined in the database, so it should just be a matter of using php admin to change the value...

 

--Peter

 

 

correct!

Link to comment
Share on other sites

  • 10 months later...

Hi Wendy,

Do you know how to make: Available Options in the product display just above the drop-down options be BOLD or DIFF COLOR?

 

:)

Thanks!

MV

 

The product listings (on the category page that lists all products) are handled by the catalog/includes/modules/product_listing.php

 

You can add html code to that page to alter text either directly adding what you want or using classes defined in your stylesheet.

 

If you look at the code on that page you should be able to figure out where and how to add what you need to change the look of your text.

 

For an example to make your product name bold look for

		  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;

and change it to

		  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']) . '"><b>' . $listing['products_name'] . '</b></a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</b></a> ';
		}
		break;

Otherwise the products name and price on your product page should already be bold and it is handled by CSS

pageHeading

Hope that helps. :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...