I have a column in product_options_inventory table named s_gstok.(which I addded as a new column) Each product has option combinations and a variable in s_gstok table. I need to show these values in products manage page. I want them to seem in each product line.
I made an example that I try to show product_code like this: ProductCode1, ProductCode2, ProductCode3. All of these product code belong to only one product which has combinations.
Here is the code I made for example:
product.post.php
<br />
if ($mode == 'manage') {<br />
<br />
$products = Registry::get('view')->getTemplateVars('products');<br />
<br />
foreach ($products as $k => $d) {<br />
$data = db_get_array("SELECT ?:product_options_inventory.product_code FROM ?:products ".<br />
"LEFT JOIN ?:product_options_inventory ON ?:product_options_inventory.product_id = ?:products.product_id ".<br />
"WHERE ?:products.product_id = ?i", $d['product_id'] );<br />
<br />
foreach ($data as $v){<br />
$products[$k]['product_code'] = $v['product_code'];<br />
}<br />
<br />
}<br />
<br />
Registry::get('view')->assign('products', $products);<br />
}<br />
```<br />
<br />
[b]manage_body.post.tpl[/b]<br />
```php
<br />
{if $products}<br />
{foreach from=$products item="product"}<br />
{$product.product_code}<br />
{/foreach}<br />
{/if}<br />
```<br />
<br />
But it is not correct. Where am I making mistake? <img src="upload://n4syhXZrRhsStKvmS4jT3Mp2S3k.png" class="bbc_emoticon" alt=":("><br />
<br />
Note: I am going to change product_code variable according to my database.