Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi everyone,

 

I believe this should be an easy one to fix, but I guess I'm having one of those days.

 

I'm trying to look for the file that controls the text style of the "Price" column for the product listings on my site. The text under every column was the same size, but now, the price column is a bit bigger than the others, causing the rows to be distorted.

 

Below is an example of what I'm talking about:

 

help-priceformatting.jpg

 

Any suggestions?

 

Thank you all very much in advance!

Posted
Any suggestions?

A. Thanks for not cross-posting (see forum rules).

B. If you have a problem with a contribution it is good practice to use the support thread for that contribution. SPPC and QPBPP for SPPC have the same support thread and the thread is mentioned in the documentation.

C. We are not paid for support here so bumping and cross-posting after a couple of hours is very much frowned upon.

D. If you study the includes/modules/product_listing for the part of the price:

		  case 'PRODUCT_LIST_PRICE':
		$lc_align = 'right';
// BOF QPBPP for SPPC
		$price_breaks_from_listing = array();
		if (isset($price_breaks_array[$listing[$x]['products_id']])) {
		  $price_breaks_from_listing = $price_breaks_array[$listing[$x]['products_id']];
		}
		$pf->loadProduct($listing[$x]['products_id'], $languages_id, $listing[$x], $price_breaks_from_listing);
		$lc_text = $pf->getPriceStringShort();

you will note that the $lc_text is returned by the functin getPriceStringShort in the class price_formatter.php.

 

If you don't like the display (note the <br> and the <big>) you should change it there (I don't find it particularly appealing either to be honest):

  function getPriceStringShort() {
global $currencies;

if (true == $this->hasSpecialPrice) {
	$lc_text = ' <big><s>'
	. $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
	. '</s>  <br><span class="productSpecialPrice">' . TEXT_ON_SALE . ' '
	. $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass))
	. '</big></span> <br><br><br>';
} elseif (true == $this->hasQuantityPrice) {
  $lc_text = ' <big>' . TEXT_PRICE_BREAKS . ' '
  . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass))
  . ' </big><br><br><br>';
} else {
	$lc_text = ' <big>'
	. $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
	. ' </big><br><br><br>';
}
return $lc_text;
 }

Posted
A. Thanks for not cross-posting (see forum rules).

B. If you have a problem with a contribution it is good practice to use the support thread for that contribution. SPPC and QPBPP for SPPC have the same support thread and the thread is mentioned in the documentation.

C. We are not paid for support here so bumping and cross-posting after a couple of hours is very much frowned upon.

D. If you study the includes/modules/product_listing for the part of the price:

		  case 'PRODUCT_LIST_PRICE':
		$lc_align = 'right';
// BOF QPBPP for SPPC
		$price_breaks_from_listing = array();
		if (isset($price_breaks_array[$listing[$x]['products_id']])) {
		  $price_breaks_from_listing = $price_breaks_array[$listing[$x]['products_id']];
		}
		$pf->loadProduct($listing[$x]['products_id'], $languages_id, $listing[$x], $price_breaks_from_listing);
		$lc_text = $pf->getPriceStringShort();

you will note that the $lc_text is returned by the functin getPriceStringShort in the class price_formatter.php.

 

If you don't like the display (note the <br> and the <big>) you should change it there (I don't find it particularly appealing either to be honest):

  function getPriceStringShort() {
global $currencies;

if (true == $this->hasSpecialPrice) {
	$lc_text = ' <big><s>'
	. $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
	. '</s>  <br><span class="productSpecialPrice">' . TEXT_ON_SALE . ' '
	. $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass))
	. '</big></span> <br><br><br>';
} elseif (true == $this->hasQuantityPrice) {
  $lc_text = ' <big>' . TEXT_PRICE_BREAKS . ' '
  . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass))
  . ' </big><br><br><br>';
} else {
	$lc_text = ' <big>'
	. $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
	. ' </big><br><br><br>';
}
return $lc_text;
 }

 

Oh awesome! Found it!

 

Thank you very much for the help and I apologize for breaking some of the rules there.

 

I promise it wont happen again. Just had a bit of a time crunch (which is still no excuse, I understand).

 

Thanks again!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...