Jump to content

code returning first letter only


binibi

Recommended Posts

the following code is used as part of a online shop to filter the product into a alphebatised index eg a, b, c... i'm trying to replace the alphabets into colour reference so in essence this will become a colour index selector and instead of a, b, c... it will be red, blue, green...

 

please can anyone look at this code and tell me what the obvious mistake is thanks in advance

 

<?php

 

$eol      = $this->globals('khxc.eol');

$prodidx  = $this->globals('ecom.prod_prodidx');

$dispapp  = $this->globals('khxc_display.app');

$ref      = $this->globals('khxc.ref');

 

// +--

// | Display navigation links if there are any.

// +--

 

if (!(empty($prodidx))) {

 

    print '<div class="khxc_storelink">' . $eol . $eol;

    print '<p><strong>Index</strong>: ' . $eol . $eol;

 

    $plinks = '';

 

    foreach ($prodidx as $num => $data) {

 

          $idx  = $data['prodidx'];

          $eidx = $this->xhtml_encode($idx);

 

          if ($ref == $idx) {

 

              $plinks .= $eidx . ' | ';

 

          } else {

 

              $href = $this->link_namespace($dispapp,'prodidx',array('ref'    => $idx));

 

              $plinks .= '<a href="' . $href . '" title="Product Index ';

              $plinks .= $eidx . '">' . $eidx . '</a> | ';

 

          } // End of if statement.

 

    } // End of foreach statement.

 

    if (preg_match('/ \| $/',$plinks)) {$plinks = rtrim($plinks,' | ');}

 

    print $plinks;

 

    print '</p>' . $eol . $eol;

    print '</div>' . $eol . $eol;

 

} // End of if statement.

 

?>

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.