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

Wishlist Quantity & No. of Orders on every page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-25-2008, 10:16 AM
 
hebs hebs is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: UK
Posts: 47
 

Default Wishlist Quantity & No. of Orders on every page

I am learning as I go and this is the first mod that I feel would be useful to others so here it is:

This mod should allow the customer to see how many items they have in their wishlist in the side menu:

Display No. of items in wishlist
4.1.9 - not tested in other versions
1. Create a php file and call it wishlist_qty.php
Place it in (XCART DIR)/modules/wishlist

PHP Code:
<?php

$hebs_res 
db_query("SELECT $sql_tbl[wishlist].wishlistid FROM $sql_tbl[wishlist] WHERE $sql_tbl[wishlist].login='$login'");
    
$wishlist_qty db_num_rows($hebs_res);
    
db_free_result($hebs_res);

$smarty->assign("wishlist_qty",$wishlist_qty);
?>


2. Add the following code to (XCART DIR)auth.php at the end before ?>

PHP Code:
if($active_modules["Wishlist"]) {
include 
$xcart_dir."/modules/Wishlist/wishlist_qty.php";



3. Add the following code to (XCART DIR)/skin1/authbox.tpl

HTML Code:
{if $active_modules.Wishlist eq "Y"} <a href="cart.php?mode=wishlist" class="VertMenuItems">{$lng.lbl_wish_list}&nbsp;&nbsp;{if $wishlist_qty eq ""}(empty){/if}{if $wishlist_qty eq "1"}(1 item){/if}{if $wishlist_qty ne "" && $wishlist_qty ne "1"}({$wishlist_qty} items){/if}</a><br /><br /> {/if}

after this (standard x-cart):

HTML Code:
{if $usertype eq "C"} <tr> <td class="VertMenuItems" colspan="2" align="right"> <br />


Done!
Attached Thumbnails
Click image for larger version

Name:	wishlist.GIF
Views:	161
Size:	5.5 KB
ID:	958  
__________________
Hebs

xcart GOLD v4.1.9 [unix]
Loads of Mods!

www.sub-laser.co.uk


3D Photography
Reply With Quote
  #2  
Old 05-25-2008, 10:22 AM
 
hebs hebs is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: UK
Posts: 47
 

Default Re: Wishlist Quantity & No. of Orders on every page

Display No. of orders in order history
4.1.9 - not tested in other versions
1. Create a php file and call it orders_qty.php
Place it in (XCART DIR)/include/

PHP Code:
<?php
if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

    
$hebs_res db_query("SELECT $sql_tbl[orders].orderid FROM $sql_tbl[orders] WHERE $sql_tbl[orders].login='$login'");
    
$order_qty db_num_rows($hebs_res);
    
db_free_result($hebs_res);

    
$smarty->assign("order_qty"$order_qty);

?>


2. Add the following code to (XCART DIR)/include/check_useraccount.php

PHP Code:
include $xcart_dir."/include/orders_qty.php"


After this (standard x-cart):

PHP Code:
} else {
            
$is_merchant_password 'Y';
        }
    }

    if (!empty(
$login) && $current_area == 'C' && func_is_anonymous($login)) {
        
$smarty->assign("anonymous_login", ($anonymous_login 1));
    } 


3. Add the following code to (XCART DIR)/skin1/authbox.tpl

HTML Code:
{if $order_qty gt 0} <a href="orders.php?mode=search" class="VertMenuItems">{$lng.lbl_orders_history}&nbsp;&nbsp;({$order_qty}&nbsp;orders)</a><br /> {/if}


after this (standard x-cart):

HTML Code:
{if $usertype eq "C"} <tr> <td class="VertMenuItems" colspan="2" align="right"> <br />


Done!
Attached Thumbnails
Click image for larger version

Name:	order history.GIF
Views:	148
Size:	3.7 KB
ID:	959  
__________________
Hebs

xcart GOLD v4.1.9 [unix]
Loads of Mods!

www.sub-laser.co.uk


3D Photography
Reply With Quote

The following user thanks hebs for this useful post:
TheWrongGrape (05-14-2010)
  #3  
Old 07-02-2008, 09:41 AM
 
itsmeee itsmeee is offline
 

Advanced Member
  
Join Date: Sep 2007
Posts: 56
 

Default Re: Wishlist Quantity & No. of Orders on every page

nicely done, I may put this into my site!
__________________
Version 4.1.8
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 07:04 AM.

   

 
X-Cart forums © 2001-2020