JoeWoodworker Posted February 7, 2003 Posted February 7, 2003 I looked through the code in boxes/bestsellers.php but I can't seem to find the line the would remove the number in front of each item displayed. Any ideas? Thank you to all who have helped me so much today! Evil will always triumph over good... Because good is dumb. - D.H.
toolcrazy Posted February 7, 2003 Posted February 7, 2003 Go into catalog/includes/boxes/best_sellers.php And comment out part of line 37: (at least it is in my file) Change this: 'text' => tep_row_number_format($rows) . '. <a href="' . To this. 'text' => /*tep_row_number_format($rows) . */ ' <a href="' . You will notice that /* */ is my comment tags. Be sure to leave the single quote before and you will need delete a period between the two. You can just delete the code between the comment tags if you want, but I don't like to delete. Steve -------------------------
mugitty Posted February 7, 2003 Posted February 7, 2003 Joe; Look at line 37 in catalog/includes/boxes/best_sellers.php 'text' => tep_row_number_format($rows) . '. Changing that first section to (for example): 'text' => '> Would give you a > in front of the name of the item ... if you want to REALLY see something that doesn't set up right out of the box without some tweaking, try being a Foster Parent!
mugitty Posted February 7, 2003 Posted February 7, 2003 Ya beat me to it, Steve... Must be time for bed :shock: ... if you want to REALLY see something that doesn't set up right out of the box without some tweaking, try being a Foster Parent!
JenRed Posted April 20, 2003 Posted April 20, 2003 I know it's an old thread, but it nearly contains the answer to my question: How do I change the numbers from 01, 02 etc to 1 and 2 ie. remove the 0 before the number. I presume it is there for sorting reasons (when you get to 10) but I only plan to show 5 Bestsellers in my listing. thanks Jen I haven't lost my mind - I have it backed up on disk somewhere.
toolcrazy Posted April 20, 2003 Posted April 20, 2003 I would try and find this function that fomats the variable and see if you can modify it. But, it may be a built in PHP function that does the 01,02 thing. In that case you would have to write a strip function to strip the zero. tep_row_number_format($rows) Just an Idea. Steve -------------------------
Ajeh Posted April 20, 2003 Posted April 20, 2003 In /includes/functions/general.php is the function Steve referred to: function tep_row_number_format($number) { if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number; return $number; } Remove the function from the bestsellers box and just use the number.
toolcrazy Posted April 20, 2003 Posted April 20, 2003 I just thought of a problem with my above logic, if you modify the tep_row_number_format function, it is going to effect other files too. But here is the solution you asked for. Go to /includes/function/general.php and find this section of code. function tep_row_number_format($number) { if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number; return $number; } And just delete the 0, (the zero and the comma after it). And make sure there is only one space between the first comma and the one. And that's it. I.E. (substr($number, 1) != '0') Steve -------------------------
toolcrazy Posted April 20, 2003 Posted April 20, 2003 In /includes/functions/general.php is the function Steve referred to: function tep_row_number_format($number) { if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number; return $number; } Remove the function from the bestsellers box and just use the number. OK, Linda!!!! Quit typing so fast. :D :D My solution is better!!!! :wink: Steve -------------------------
Ajeh Posted April 20, 2003 Posted April 20, 2003 Unless of course you ever want that function for the 0 padding ... 8)
toolcrazy Posted April 20, 2003 Posted April 20, 2003 I just thought of a problem with my above logic, if you modify the tep_row_number_format function, it is going to effect other files too. But here is the solution you asked for. Go to /includes/function/general.php and find this section of code. function tep_row_number_format($number) { if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number; return $number; } And just delete the 0, (the zero and the comma after it). And make sure there is only one space between the first comma and the one. And that's it. I.E. (substr($number, 1) != '0') The only other file this edit going to effect is the Address Book and I has a 5 entry limit anyway so it isn't going to matter. Steve -------------------------
Ajeh Posted April 20, 2003 Posted April 20, 2003 Now ... I modify the box a bit more to align the numbers right and trim the length of the products_description or wrap it pretty. Example: http://www.8thoctave.com/osc_freecall/defa...ult.php?cPath=3
JenRed Posted April 21, 2003 Posted April 21, 2003 Thanks both of you. I have to admit I found it already - and it was Linda again! :) http://www.oscommerce.com/forums/viewtopic.php...ght=bestsellers The link above tells you how to remove the zeros and how to indent the product name if it goes onto two lines. thanks! Jen I haven't lost my mind - I have it backed up on disk somewhere.
Ajeh Posted April 21, 2003 Posted April 21, 2003 Thought I had posted that modification before ... glad it worked for you. Steve's method was a good quick fix also ... I just cannot think off hand where else that function is used, but I hate to lose the purpose of a function for one fix only to need it back for another.
toolcrazy Posted April 22, 2003 Posted April 22, 2003 Thought I had posted that modification before ... glad it worked for you. Steve's method was a good quick fix also ... I just cannot think off hand where else that function is used, but I hate to lose the purpose of a function for one fix only to need it back for another. Linda, The only other place the function shown, in my search, is Address Book. Unless the team has added it somewhere else. Steve -------------------------
Ajeh Posted April 22, 2003 Posted April 22, 2003 That was all I have found too. But ... do we want to lose this function's purpose? Or, modify the Bestsellers box? That was my main concern. Being that the only reason there are the padded 0s in the box is because Bestsellers box uses the function so toss the function out of the box and the 0s are gone but the function can live another day ... :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.