aguzman Posted August 17, 2006 Share Posted August 17, 2006 I recently installed Quantity Price Breaks per Customer and got it working fine. The only thing I would love is to remove the quantity price break table that appears on the store web pages. I'm not very good at reading code so I would need to know specifically what pages and what bit of code I need to comment out, if it is possible. thanks, Al :( Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 17, 2006 Share Posted August 17, 2006 The only thing I would love is to remove the quantity price break table that appears on the store web pages. I think the simplest way to accomplish this is to copy the function getPriceStringShort (this is the last function in the class catalog/includes/classes/PriceFormatter.php) and past it right after that (the last } is not part of that function so leave that one alone!).Then rename it to for example getPriceStringRegular and comment out the middle else block: // was: function getPriceStringShort() { function getPriceStringRegular() { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = '?<s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s>??<span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span>?'; } // comment out, it wil print $ low price-high price /* else { if($this->hasQuantityPrice == true) { $lc_text = '?' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . '?'; } */ else { // removed the nobreakspace before and after the price $lc_text = $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)); } } return $lc_text; } Then on the product_info.php page where it says (around line 79): $products_price=$pf->getPriceString(); you change it to: $products_price=$pf->getPriceStringRegular(); Haven't tried it, but I think it should work. Quote Link to comment Share on other sites More sharing options...
aguzman Posted August 18, 2006 Author Share Posted August 18, 2006 Thanks JanZ, I will give it a try today and let you know how it goes. Al :thumbsup: Quote Link to comment Share on other sites More sharing options...
aguzman Posted August 21, 2006 Author Share Posted August 21, 2006 Jan Z, I gave your suggestin a try but I'm getting errors Parse error: parse error, unexpected '}' in /home/nespapoo/public_html/osCommerce/catalog/includes/classes/PriceFormatter.php on line 436 Here is the PriceFormatter.php file starting at line 373 function getPriceStringShort() { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { if($this->hasQuantityPrice == true) { $lc_text = ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . ' '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } } //function getPriceStringShort() { function getPriceStringRegular() { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } /* else { if($this->hasQuantityPrice == true) { $lc_text = ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . ' '; } */ else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } ?> What could be the problem. I think it might have someting to do with the closing } but not sure. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 21, 2006 Share Posted August 21, 2006 I'm getting errors Parse error: parse error, unexpected '}' in /home/nespapoo/public_html/osCommerce/catalog/includes/classes/PriceFormatter.php on line 436 What could be the problem. I think it might have someting to do with the closing } but not sure. Yes, getting the }'s on the right spot is crucial. I think the bottom part should look like this: /*?? else { ??????if($this->hasQuantityPrice == true) { ????$lc_text = '?' ??????. $currencies->display_price($this->lowPrice, ?????????????????????? tep_get_tax_rate($this->taxClass)) ??????. ' - ' ??????. $currencies->display_price($this->hiPrice, ?????????????????????? tep_get_tax_rate($this->taxClass)) ??????. '?'; ??????} */ ??????else { ????$lc_text = '?' ??????. $currencies->display_price($this->thePrice, ?????????????????????? tep_get_tax_rate($this->taxClass)) ??????. '?'; ??????}? ????return $lc_text; ??} // end function } ?> Quote Link to comment Share on other sites More sharing options...
aguzman Posted August 22, 2006 Author Share Posted August 22, 2006 (edited) Jan, that is not working either. Here is the file PriceFormatter.php file the way it was before the changes suggested whree I think the table is coded in. The contribution is working but I just do not want the price break table showing on the products page. thanks for all your help, if you can please take another look for me and see how I can hide the price break table on the products page. /function getPriceString($style='productPriceInBox') { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">'; $lc_text .= ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> ' .'</td></tr>'; } else { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</td></tr>'; } // If you want to change the format of the price/quantity table // displayed on the product information page, here is where you do it. if($this->hasQuantityPrice == true) { for($i=1; $i<=8; $i++) { if($this->quantity[$i] > 0) { $lc_text .= '<tr><td class='.$style.'>' . $this->quantity[$i] .'+ </td><td class='.$style.'>' . $currencies->display_price($this->price[$i], tep_get_tax_rate($this->taxClass)) .'</td></tr>'; } } $lc_text .= '</table>'; } else { if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } function getPriceStringShort() { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { if($this->hasQuantityPrice == true) { $lc_text = ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . ' '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } } ?> Edited August 22, 2006 by aguzman Quote Link to comment Share on other sites More sharing options...
aguzman Posted August 22, 2006 Author Share Posted August 22, 2006 Jan, with a little trial and error I figured out how to hide the price break table. Here is what I did starting out at the function getPriceString in file PriceFormatter.php. I commented out a chunck of code and now the table is GONE! and it still computes correctly for my price breaks. function getPriceString($style='productPriceInBox') { global $currencies; /* if ($this->hasSpecialPrice == true) { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">'; $lc_text .= ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> ' .'</td></tr>'; } else { $lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">'; $lc_text .= '<tr><td align="center" class=' . $style. ' colspan="2">' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</td></tr>'; } // If you want to change the format of the price/quantity table // displayed on the product information page, here is where you do it. if($this->hasQuantityPrice == true) { for($i=1; $i<=8; $i++) { if($this->quantity[$i] > 0) { $lc_text .= '<tr><td class='.$style.'>' . $this->quantity[$i] .'+ </td><td class='.$style.'>' . $currencies->display_price($this->price[$i], tep_get_tax_rate($this->taxClass)) .'</td></tr>'; } } $lc_text .= '</table>'; } */ //else { if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } //} return $lc_text; } function getPriceStringShort() { global $currencies; if ($this->hasSpecialPrice == true) { $lc_text = ' <s>' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)) . '</span> '; } else { if($this->hasQuantityPrice == true) { $lc_text = ' ' . $currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)) . ' - ' . $currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)) . ' '; } else { $lc_text = ' ' . $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)) . ' '; } } return $lc_text; } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.