binibi Posted February 29, 2008 Share Posted February 29, 2008 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. ?> 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.