X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Proper way for query functionality (https://forum.x-cart.com/showthread.php?t=75179)

PhilJ 04-19-2017 01:17 PM

Re: Proper way for query functionality
 
If all you are looking to do is display manufacturer icons on the manufacturer list page...

In modules/Manufacturers/customer_manufacturers_list.php

Before...
Code:

$smarty->assign('manufacturers', $manufacturers);
Insert...
Code:

        if ($manufacturers) {
            foreach($manufacturers as $key=> $manufacturer)
            $manufacturers[$key]["image_path"] = func_query_first_cell("SELECT image_path FROM $sql_tbl[images_M] WHERE id=".$manufacturer["manufacturerid"]);
            foreach($manufacturers as $key=> $manufacturer)
            $manufacturers[$key]["image_x"] = func_query_first_cell("SELECT image_x FROM $sql_tbl[images_M] WHERE id=".$manufacturer["manufacturerid"]);
            foreach($manufacturers as $key=> $manufacturer)
            $manufacturers[$key]["image_y"] = func_query_first_cell("SELECT image_y FROM $sql_tbl[images_M] WHERE id=".$manufacturer["manufacturerid"]);
        }

Then in skin/common_files/modules/Manufacturers/customer_manufacturers_list.tpl

In the foreach loop...
Code:

<img src="{$m.image_path|amp}" width="{$m.image_x}" height="{$m.image_y}" alt="{$m.manufacturer|escape}>


All times are GMT -8. The time now is 07:05 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.