Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Displaying All User's Wishlists in Admin

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-28-2003, 06:51 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default 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.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #2  
Old 12-28-2003, 07:19 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

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.
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #3  
Old 12-28-2003, 07:32 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #4  
Old 12-29-2003, 04:52 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default 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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #5  
Old 12-30-2003, 01:05 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Nice work Carrie

Once you get the hang of it, nothing is impossible.
__________________
ex x-cart guru
Reply With Quote
  #6  
Old 12-30-2003, 05:40 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

Thanks.

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #7  
Old 12-30-2003, 06:02 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

mods have a habit of doing that 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

ps - you wont be able to not do that now
__________________
ex x-cart guru
Reply With Quote
  #8  
Old 12-30-2003, 06:16 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #9  
Old 12-30-2003, 08:40 AM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

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.
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #10  
Old 12-30-2003, 09:30 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,063
 

Default

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:10 AM.

   

 
X-Cart forums © 2001-2020