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)
-   -   Wishlist Quantity & No. of Orders on every page (https://forum.x-cart.com/showthread.php?t=40022)

hebs 05-25-2008 10:16 AM

Wishlist Quantity & No. of Orders on every page
 
1 Attachment(s)
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! :-)

hebs 05-25-2008 10:22 AM

Re: Wishlist Quantity & No. of Orders on every page
 
1 Attachment(s)
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! :-)

itsmeee 07-02-2008 09:41 AM

Re: Wishlist Quantity & No. of Orders on every page
 
nicely done, I may put this into my site!


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

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