Displaying All Users Wish Lists in Admin 4.0.16
Here is the same solution for X-Cart 4.0.16
Change to module ../skin1/admin/menu.tpl
New module ../skin1/admin/main/adminwish.tpl
Code:
This page allows you to view all user's wishlists.
{capture name=dialog}
{ include file="customer/main/navigation.tpl" }
<table border="0" cellpadding="2" cellspacing="1" width="100%">
<tr class="TableHead">
<td valign=top>
Name</td>
<td valign=top>
Products Desired</td>
<td valign=top>
Quantity</td>
<td valign=top>
Price Each</td>
<td valign=top>
Purchased</td>
</tr>
{section name=cust_num loop=$wl_data}
<tr {cycle values=", class='TableSubHead'"}>
<td valign=top align=left>{$wl_data[cust_num].firstname} {$wl_data[cust_num].lastname}</td>
<td valign=top align=left>
{$wl_data[cust_num].product}</td>
<td valign=top align=center>{$wl_data[cust_num].amount}</td>
<td valign=top align=right>${$wl_data[cust_num].price}</td>
<td valign=top align=center>{$wl_data[cust_num].amount_purchased}</td>
</tr>
{/section}
</table>
{ include file="customer/main/navigation.tpl" }
{/capture}
{include file="dialog.tpl" title="Wish Lists" content=$smarty.capture.dialog extra="width=100%"}
New module ../admin/adminwish.php
Code:
<?
require "./auth.php";
require $xcart_dir."/include/security.php";
$objects_per_page = $config["Appearance"]["users_per_page_admin"];
#
# Obtain wishlist from database
#
$wl_data = func_query("select $sql_tbl[customers].firstname, $sql_tbl[customers].lastname, $sql_tbl[products].productid, $sql_tbl[products].product,$sql_tbl[wishlist].amount, $sql_tbl[pricing].price, $sql_tbl[wishlist].amount_purchased from $sql_tbl[customers], $sql_tbl[wishlist], $sql_tbl[products], $sql_tbl[pricing] where $sql_tbl[wishlist].login=$sql_tbl[customers].login and $sql_tbl[wishlist].productid=$sql_tbl[products].productid and $sql_tbl[wishlist].productid=$sql_tbl[pricing].productid");
$total_items = count($wl_data);
$total_nav_pages = ceil($total_items/$objects_per_page)+1;
require $xcart_dir."/include/navigation.php";
if (is_array($wl_data))
$wl_data = array_slice($wl_data, $first_page, $objects_per_page);;
$smarty->assign("navigation_script","adminwish.php?");
$location[] = array("All Wish-list");
$smarty->assign("location", $location);
$smarty->assign("wl_data",$wl_data);
$smarty->assign("main","adminwish");
@include $xcart_dir."/modules/gold_display.php";
func_display("admin/home.tpl",$smarty);
?>
Change to module ../skin1/single/home.tpl
Code:
{elseif $main eq "adminwish"}
{include file="admin/main/adminwish.tpl"}
salutes and good job