products_matrix table referenced

13 views
Skip to first unread message

Ap.Muthu

unread,
Nov 5, 2013, 1:57:19 PM11/5/13
to Justin James Kelly, SI Group
In the file modules/invoices/invoice.php reference the products_matrix table - what does this code fragment in it do?
 
$sql_prod = "select product_id as PID, (select count(product_id) from ".TB_PREFIX."products_matrix where product_id = PID ) as count from ".TB_PREFIX."products_matrix ORDER BY count desc LIMIT 1;";
$sth_prod =  dbQuery($sql_prod);
$number_of_products = $sth_prod->fetchAll();
 
$smarty -> assign("number_of_attributes", $number_of_products['0']['count']);

-
Ap.Muthu
 

Justin Kelly

unread,
Nov 6, 2013, 6:15:07 AM11/6/13
to Ap. Muthu, SI Group

Good question - is $numbet_of_attributes used in any template files? If not just delete this

Ap.Muthu

unread,
Nov 8, 2013, 11:01:24 PM11/8/13
to Justin Kelly, SI Group
----- Original Message -----
From: Justin Kelly
To: Ap. Muthu
Sent: Wednesday, November 06, 2013 4:45 PM
Subject: Re: products_matrix table referenced

Good question - is $numbet_of_attributes used in any template files? If not just delete this

Ap.Muthu wrote:

The variable $number_of_attributes is used in the following files but presently it is empty and hence the {if} constructs that check if it's value is 3 does not get executed at all.
 
extensions/text_ui/templates/default/invoices/itemised.tpl
extensions/text_ui/templates/default/invoices/details.tpl
extensions/text_ui/templates/default/invoices/add_invoice_item.tpl
extensions/mini/templates/default/invoices/itemised.tpl
 
Also note that these files are all in the extensions only.
Wonder if these smarty template files are being used at all or if the said variable is being displayed with any meaningful content - it appears to be a flag of some sort only.
 
- Ap.Muthu

Justin Kelly

unread,
Nov 10, 2013, 11:32:48 PM11/10/13
to Ap.Muthu, SI Group
thanks
Reply all
Reply to author
Forward
0 new messages