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)
-   -   Displaying All User's Wishlists in Admin (https://forum.x-cart.com/showthread.php?t=5762)

BCSE 12-28-2003 06:51 PM

Displaying All User's Wishlists in Admin
 
This is my first custom modification that I have made by myself. So feel free to give suggestions on anything that I did "wrong" or "unconventionally." Or any way to improve the "look" of the output. :)

This mod is for displaying all the user's wishlists in the admin section of x-cart. I wrote this for 3.3.5 but should be fairly easy to implement in most other versions I would think.

First create a new file admin/adminwish.php

Quote:

<?
require "../smarty.php";
require "../config.php";
require "./auth.php";
require "../include/security.php";
#
# Obtain wishlist from database
#

$wl_data = func_query("select xcart_customers.firstname, xcart_customers.lastname, xcart_products.product, xcart_wishlist.amount, xcart_pricing.price from xcart_customers, xcart_wishlist, xcart_products, xcart_pricing where xcart_wishlist.login=xcart_customers.login and xcart_wishlist.productid=xcart_products.productid and xcart_wishlist.productid=xcart_pricing.productid") ;

$smarty->assign("wl_data",$wl_data);
$smarty->assign("main","adminwish");

@include "../modules/gold_display.php";
$smarty->display("admin/home.tpl");
?>


Next create another new file skin1/admin/main/adminwish.tpl
Quote:

This page allows you to view all user's wishlists.



{capture name=dialog}
<table border=0 cellspacing=5>
<tr>
<td valign=top>Name</td>
<td valign=top>Products Desired</td>
<td valign=top>Quantity</td>
<td valign=top>Price Each</td>
</tr>
{section name=cust_num loop=$wl_data}
<tr>
<td valign=top>{$wl_data[cust_num].firstname} {$wl_data[cust_num].lastname}</td>
<td valign=top> {$wl_data[cust_num].product}</td>
<td valign=top> {$wl_data[cust_num].amount}</td>
<td valign=top> ${$wl_data[cust_num].price}</td>
</tr>
{/section}
</table>
{/capture}
{include file="dialog.tpl" title="Wish Lists" content=$smarty.capture.dialog extra="width=100%"}


Finally add these two lines after the first if statement in skin1/single/home.tpl
Quote:

{elseif $main eq "adminwish"}
{include file="admin/main/adminwish.tpl"}


Hopefully this will help others as I've not seen a way to do this on the forums yet. Feel free to contact me if you need different/more information returned to display. For a small price, I may be able to make customizations to this for different outputs. Donations are always welcome. :wink:

Carrie

leon 12-28-2003 07:19 PM

Nice mod, I see that you can have mastered the engine now, could be usefull to add other things to it as well in the future, for example a side link to send that specific user or users a mail to give them an idea (eg. "Hey, just a suggestion, you could always send your wishlist to friends, they might like to cooperate, good look... your wish list: xx, xx, xx, etc.")

Just a slight drawback I see is that you are controlling ALL users wishlist, but what if you have thousands of users with thousands of wishlist (neverending story) ---> Control output by PAGES.

Just a suggestion. :wink:

BCSE 12-28-2003 07:32 PM

Hum. Good point. Didn't even think of those lucky ones with large stores and lots of wish lists. I'll probably look into how to make "pages" of wish lists. If I figure out how to do it, I'll post the mod here. :)

I wouldn't say that I have "mastered the engine now" but I'm working on understanding php and smarty. And trying to remember what I learned a few years ago about mysql. :)

Thanks for the input! I'll work on the "pages" mod to this when I have time. I remember seeing an example on it and it didn't even pop into my head to implement it with this mod.

Carrie

BCSE 12-29-2003 04:52 PM

Admin Wishlist view with pages
 
I got it I believe. Again this was written for 3.3.5. This displays all the wish list items for every person. It will display X number of items per page where X depends on the variable "Users per page (admin)" in general settings. It could easily depend on another variable if you so desire to change it. One thing I don't like about it is I haven't figured out yet how to list just unique names instead of repeating the user's name multiple times depending on how many items in their wish list. (hope that made sense!) Right now I don't have time to figure that out part out though.

Here's the new admin/adminwish.php
Quote:

<?
require "../smarty.php";
require "../config.php";
require "./auth.php";
require "../include/security.php";

$objects_per_page = $config["General"]["users_per_page_admin"];

#
# Obtain wishlist from database
#

$wl_data = func_query("select xcart_customers.firstname, xcart_customers.lastname, xcart_products.product, xcart_wishlist.amount, xcart_pricing.price from xcart_customers, xcart_wishlist, xcart_products, xcart_pricing where xcart_wishlist.login=xcart_customers.login and xcart_wishlist.productid=xcart_products.productid and xcart_wishlist.productid=xcart_pricing.productid") ;

$total_items = count($wl_data);
$total_nav_pages = ceil($total_items/$objects_per_page)+1;

require "../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?");

$smarty->assign("wl_data",$wl_data);
$smarty->assign("main","adminwish");

@include "../modules/gold_display.php";
$smarty->display("admin/home.tpl");
?>


The new skin1/admin/main/adminwish.tpl
Quote:

This page allows you to view all user's wishlists.



{capture name=dialog}
{ include file="customer/main/navigation.tpl" }
<table border=0 cellspacing=5>
<tr>
<td valign=top>Name</td>
<td valign=top>Products Desired</td>
<td valign=top>Quantity</td>
<td valign=top>Price Each</td>
</tr>
{section name=cust_num loop=$wl_data}
<tr>
<td valign=top>{$wl_data[cust_num].firstname} {$wl_data[cust_num].lastname}</td>
<td valign=top> {$wl_data[cust_num].product}</td>
<td valign=top> {$wl_data[cust_num].amount}</td>
<td valign=top> ${$wl_data[cust_num].price}</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%"}


and don't forget to add this after the first if statement in the
Quote:

{elseif $main eq "adminwish"}
{include file="admin/main/adminwish.tpl"}


Hope this helps someone! :)

Carrie

funkydunk 12-30-2003 01:05 AM

Nice work Carrie 8)

Once you get the hang of it, nothing is impossible. :)

BCSE 12-30-2003 05:40 AM

Thanks. :D

Now to make it so you can view just one user's wish lists when viewing their profile so you don't have to skim through them all (or even do a search on a user's wishlist)......but that's another time and this will do for now for one of my customers. :)

Actually, now that I think about it, the search part (like in user.php) might not be too hard to implement. But I have other priorities now, although I'm sure this idea will suck me in and get me working on it instead of something more important. LOL

Carrie

funkydunk 12-30-2003 06:02 AM

mods have a habit of doing that :lol: just to see if you can do it....

what would be really good is a summary page showing the top ten products added to wishlists and maybe a mail the users who have added them to the wishlist with 'something' to make them actually buy it then...

just thought I would add that into your to do list :wink:

ps - you wont be able to not do that now :)

BCSE 12-30-2003 06:16 AM

Sounds like a good idea. Isn't that more like what Groovico has in his upcoming MM2.0? I can't wait to demo that out. Wish they'd hurry up and get it rolling! :) Last I checked they still weren't back up yet. :(

These mods are eating at me! LOL I have a new customer though that I need to concentrate on. The product they are selling is a hoot. Can't wait to get it done and get everyone's opinion on it. It's due to be done in Feb-March.

Carrie

groovico 12-30-2003 08:40 AM

Patience ;) As many people have noticed, we skipped the Marketing manager 1.4 release and have been developing marketing manager 2.0 which is actually now finished.

However! What isn't is our new site which are key to the new release as we're moving everything to a new domain.

Our new x-cart add ons are coming, they'll all be worth the wait, we don't make major releases until we're happy that the code is rock solid, marketing manager 2.0 isn't one add on, it's a global name for our range of add on products for x-cart.

MM 2.0 totals about 30 x-cart add ons which will all be available as stand alone packs but will also work together and will also be available in one huge Pro pack.

For those who are curious about the marketing manager wishlist add on it does the following:

- Search for customers wishlists via date ranges, i.e capable of scanning and filtering out

- View individual wishlists on a per customer basis

- View actual products they've bookmarked

- Send a multipart email to the customer

- Printable output option

The wishlist add on will be released as part of a "Viewer Pack" which will contain other useful x-cart add ons.

BCSE 12-30-2003 09:30 AM

Sounds great Groovico! Hopefully I can convince one (or more) of my customers to purchase MM 2.0 as I'd love to play with it and think it will really help them increase their sales.

Carrie

B00MER 12-30-2003 10:36 AM

First product bought in admin->orders:

Code:

{$orders_full[cat_num].product}

in orders.tpl ;)

Kinda off subject but thought I'd throw that in :D

adpboss 12-31-2003 03:14 PM

Looks like this is turning into a MM2.0 thread.

Groovico, can I see how many times a product appears in the wishlist table?

That is essential. I want to know if 1 or 100 customers have it in their wishlist.

leon 01-02-2004 12:18 PM

Back to the real subject here:

Quote:

Originally Posted by funkydunk
what would be really good is a summary page showing the top ten products added to wishlists and maybe a mail the users who have added them to the wishlist with 'something' to make them actually buy it then...

just thought I would add that into your to do list :wink:

ps - you wont be able to not do that now :)


Great idea to add this in. You can actually convert a SIMPLE mod into a GREAT MULTIPURPOSE one here with these ideas.

BCSE 01-22-2004 01:59 PM

Hum. I look at this code and wonder why I did some things that I did as far as the sql query. It could be written much better. If I ever get back to this and "clean up" the code I'll post the mod here. It does work though.

Carrie

groovico 01-22-2004 04:54 PM

Quote:

Originally Posted by adpboss
Looks like this is turning into a MM2.0 thread.

Groovico, can I see how many times a product appears in the wishlist table?

That is essential. I want to know if 1 or 100 customers have it in their wishlist.


You'll be able to see whats in the wishlists via a straight forward lists, wishlists generally don't have huge amounts of the same product in them as customers remove items from their wishlist once purchased of if they change their mind.

We've ran the wishlist viewer on some of the busiest x-cart sites around, depending on the type of site you have the use of the wishlist by customers will vary drastically.

adpboss 01-22-2004 05:08 PM

Groovico,

My personal experience with Wishlists has been different.

My customers tend to "clump" around core products.

Anyway,

I am getting really tired of waiting for MM 2.0.

I kicked off some development today that I think is in your product but I simply cannot keep waiting for.

Please tell me it is coming soon.

groovico 01-22-2004 05:26 PM

Quote:

Originally Posted by adpboss

I am getting really tired of waiting for MM 2.0.

I kicked off some development today that I think is in your product but I simply cannot keep waiting for.

Please tell me it is coming soon.


Public release date 26th Jan.

However, you may check your email instead :wink:

B00MER 01-22-2004 05:26 PM

From the demo I've seen 2.0 is worth the wait! =P~

groovico 01-22-2004 06:16 PM

Quote:

Originally Posted by B00MER
From the demo I've seen 2.0 is worth the wait! =P~


That'll have been Marketing Manager 2.0 Pro bundle you've been peaking at :D

garryhs 02-01-2004 02:15 AM

Displaying All Users Wish Lists in Admin 3.4.11
 
Displaying All Users Wish Lists in Admin 3.4.11

Here is the same solution for X-Cart 3.4.11

Change to module ../skin1/admin/menu.tpl
Note: Add this line under the link to users.php (after line 3)

Wish lists


New module ../skin1/admin/main/adminwish.tpl

This page allows you to view all user's wishlists.



{capture name=dialog}
{ include file="customer/main/navigation.tpl" }
<table border=0 cellspacing=5>
<tr>
<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>
<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].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

<?
require "../smarty.php";
require "../config.php";
require "./auth.php";
require "../include/security.php";

$objects_per_page = $config["Appearance"]["users_per_page_admin"];

#
# Obtain wishlist from database
#

$wl_data = func_query("select xcart_customers.firstname, xcart_customers.lastname, xcart_products.product, xcart_wishlist.amount, xcart_pricing.price, xcart_wishlist.purchased from xcart_customers, xcart_wishlist, xcart_products, xcart_pricing where xcart_wishlist.login=xcart_customers.login and xcart_wishlist.productid=xcart_products.productid and xcart_wishlist.productid=xcart_pricing.productid") ;

$total_items = count($wl_data);
$total_nav_pages = ceil($total_items/$objects_per_page)+1;

require "../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?");

$smarty->assign("wl_data",$wl_data);
$smarty->assign("main","adminwish");

@include "../modules/gold_display.php";
$smarty->display("admin/home.tpl");
?>




Change to module ../skin1/single/home.tpl
Note: Add these 2 lines after the line {include file="main/subscribe_confirmation.tpl"}

{elseif $main eq "adminwish"}
{include file="admin/main/adminwish.tpl"}


Thats it...

Simple.

Regards

Garry

xcell67 05-09-2004 01:47 AM

I use the above code that was designed for 3.4.14 but can't seem to get it to work for 3.5.6, has anyone successfully implemented this for 3.5.x?

xcart@spiritdiscovery.com 11-25-2004 03:32 AM

I implemented this code on my 3.5.11 install, and the query works for me when I run it directly against my DB. I can see the entries for my customers.

But when I click on the new "Wish List" link in my Admin control panel, I'm simply returned back to admin/home.php with no results.

Any ideas? Thanks!

alpine 11-26-2004 04:42 AM

Does this work for 4.0.7
 
Does this work for v4.0.7?

Thanks,

Randy

BCSE 11-28-2004 04:57 PM

Give me a few days guys and I'll see if I can whip this up for a free mod on my site. I'm pretty swamped right now from the holidays but hope to be able to squeeze this in soon.

Carrie

adpboss 11-28-2004 05:12 PM

Quote:

Originally Posted by BCSE
Give me a few days guys and I'll see if I can whip this up for a free mod on my site. I'm pretty swamped right now from the holidays but hope to be able to squeeze this in soon.

Carrie

Carrie,

You work too damn hard. I hope you get some shutdown time after Xmas so you can hang out with your rug rats.

BCSE 12-09-2004 12:39 PM

Thanks Adpboss. :)

I haven't gotten to this yet. Sorry guys. Am backed up right now. Hopefully next week.

Carrie

andreas04031 02-18-2005 12:16 AM

Is there a way to get this for the version 4.0.11, Andy

KCAutosound 02-22-2005 10:01 PM

Quote:

Originally Posted by andreas04031
Is there a way to get this for the version 4.0.11, Andy


same here :)

IndieDepot 05-20-2005 02:19 AM

Can we get this for 4.0.13?

- Shannon

BCSE 05-20-2005 08:23 AM

Let me see what I can do. I'm swamped right now but have an assistant programmer that should be able to convert this to 4.0.x possibly next week.

Thanks,

Carrie

Jerrad 05-20-2005 09:17 AM

I'm really looking forward to it!
Thanks in advance, Carrie :D :D :D

BCSE 05-30-2005 05:43 PM

Available on my site now for free for 3.5.x and 4.0.x! :)

http://www.bcsengineering.com/store/customer/product.php?productid=116&MMCF_xf_wish

Carrie

Bella Forma 06-15-2005 05:16 PM

I have one minor issue with this but I am not sure if it's just my customised site that's causing the problem, not complaining too much though as it's free :) :)

All my products have variants of size/colour. In the Wishlist Viewer it will show the item for every single size/colour combination rather than just for the size/colour combination that has been selected.

Just thought you might want to know.

BCSE 06-15-2005 05:44 PM

Thanks for the note. This was originally created for 3.3.5!! 8O which seems so long ago. ;)

I'll put it on our list to do some time.

Thanks for letting me know!

Carrie

fablot 10-31-2005 02:07 PM

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
Code:

Wish lists


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

anandat 11-03-2005 09:06 PM

Hi fablot,
Thanks for posting the code :)
This code is perfectly working with version 4.0.12 also \:D/

Thanks.

mrkenzie 07-21-2006 12:56 PM

Has anyone got this to work in 4.1.x? I keep getting the following output for adminwish.php:

Quote:

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); ?>

Never mind, I fixed it:

Needed to be:
Code:

<?php
in the beginning (just in case anyone else has the same problem).

Thanks.

jeanne 07-25-2006 04:13 PM

variants
 
Has anyone gotten this to work properly with variants?
I like the way that it works in 4.1.2, but I can't seem to wrap my head around how to get it to work with variants in 4.0.17

Jeanne
4.0.17 Gold


All times are GMT -8. The time now is 11:48 PM.

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