You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
So far as I can tell, the query that runs the Related Items on a product page uses 'ccp0_prod.xprod'. I'd like to be able to change the behaviour of the query, rather than manually typing in id's I just want to use a keyword, or keyword phrase. This saves having to initially insert,edit and delete ids when required. Something that resembles;
where xprod=$string
SELECT * FROM ccp0_prod WHERE name LIKE '%$string%' OR keywords LIKE '%$string%' OR desclong LIKE '%$string%' ...;
Where would I find the query to do this? Thanks.
Offline
All the queries of that sort will be in the file.
Offline
Pretty sure this is it but I'm a little bit in the dark as to what to do with it. I used to working with actual queries "SELECT ..."
// +-- // | NAMESPACE: prodshow (Related Product) // +-- } elseif ($ns == 'prodshow') { $prod = $this->globals('ecom.prod_proddetail'); $xprod = $prod['xprod']; $xprod = $this->make_list($xprod); if (empty($xprod)) {return 1;} $xwhere = '('; foreach ($xprod as $num => $xid) { $xwhere .= 'id=' . $this->KHXC_DB->quote($xid) . ' OR '; } // End of foreach statement. if (preg_match('/ OR $/',$xwhere)) {$xwhere = rtrim($xwhere,' OR ');} $xwhere .= ') '; if (!(empty($where))) {$where .= 'AND ';} $where .= $xwhere; $prodnum = $prod['reldispnum']; $prodtype = $prod['reldisptype']; if (empty($prodnum)) {$prodnum = $this->globals('khxc_settings.' . $this->app . '.splashprodnum');} if (empty($prodtype)) {$prodtype = $this->globals('khxc_settings.' . $this->app . '.splashprodtype');} // +--
Offline
Everything in the file is built in stages. - Earlier on in the file there is the following section (which is deliberately constructed the way it is so it does not have to be re-declared for each and every required instance):
// +-- // | Build out our SQL. // +-- $table = $this->app . '_prod'; $colstring = $this->KHXC_DB->table_column_string($table); if (($this->IsError($colstring)) || (empty($colstring))) {return 1;} $sql = "SELECT {$colstring} FROM {$table} WHERE "; $where = '';
Offline
The "where" statement (for product display) is being built from a quite a few code lines before it gets to this point, your not going to be able to tell what its looking for from the lines you have displayed.
John
Offline
Which is why I've submitted a quote request. Not sure how long it will take. I'm still waiting to hear from them on a quote we spoke about on Nov 7th last year.
Offline
Pages: 1