Jump to content

'strlen' question for zen cart


joshuabaer23

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) {

    $rows++;

 

    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'];

        break;

        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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.