Jump to content
#StayAtHome ×


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


'strlen' question for zen cart

Recommended Posts

Looking for a tip here, since I am not much of a php guy.

Im working on a zen cart site, and Im having issues with the model numbers of my parts. Im trying to change the display of the model numbers that the users see.


Most of my model numbers are around 6 to 10 digits, and I want to add an additional 5 digits for store use, that the user can not see. I figure strlen and substr are probably the answer to this, but I am having trouble figuring how to implement it.

For those that know it, this is part of my includes/modules/product_listing.php file:


if ($listing_split->number_of_rows > 0) {

  $rows = 0;

  $listing = $db->Execute($listing_split->sql_query);

  $extra_row = 0;

  while (!$listing->EOF) {



    if ((($rows-$extra_row)/2) == floor(($rows-$extra_row)/2)) {

      $list_box_contents[$rows] = array('params' => 'class="productListing-even"');

    } else {

      $list_box_contents[$rows] = array('params' => 'class="productListing-odd"');



    $cur_row = sizeof($list_box_contents) - 1;


    for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

      $lc_align = '';

      switch ($column_list[$col]) {

        case 'PRODUCT_LIST_MODEL':

        $lc_align = '';

        $lc_text = $listing->fields ['products_model'];


        case 'PRODUCT_LIST_NAME':

        $lc_align = '';


I have highlighted what I "think" is the correct area that I need to adjust, to chop off 5 characters.

Can anyone help with this?

Share this post

Link to post
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.