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

free <PREV | NEXT> mod help

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #11  
Old 09-17-2008, 12:53 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

If you have one product in category then the next/prev will not be displayed.

Alex
Reply With Quote
  #12  
Old 09-17-2008, 12:56 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

I know that

But i have more then one.

http://www.4-legged.com
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #13  
Old 09-17-2008, 01:03 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Hmm. I will need to rebuild this mod :O)

If you don't use memberships options in your store you can use this variant:

$mem_list = func_query("SELECT pr.productid, pr.product FROM $sql_tbl[products_categories] AS cat, $sql_tbl[products] AS pr WHERE cat.categoryid = '$product_info[categoryid]' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product");

Alex
Reply With Quote
  #14  
Old 09-17-2008, 01:08 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

I've been looking for that kind of mod forever..
Now that i found it
it's not working on my site...

I'll be waiting.......

Thanks anyway
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #15  
Old 09-17-2008, 01:17 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

It was easy.
In product.php change old code to this:


// === Next - Previous products from xCartMod.com ===

$mem_list = func_query("SELECT pr.productid, pr.product, mem.membershipid FROM $sql_tbl[products_categories] AS cat, $sql_tbl[products] AS pr LEFT JOIN $sql_tbl[product_memberships] AS mem ON mem.productid = pr.productid WHERE cat.categoryid = '$product_info[categoryid]' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product");

$list = array();
if (is_array($mem_list))
foreach($mem_list as $li) {
if ($li["membershipid"] == $user_account["membershipid"] || $li["membershipid"] == 0 || $li["membershipid"] == "")
$list[] = $li;
}

if (is_array($list))
foreach($list as $x=>$li)
if ($li["productid"] == $productid) {
// previous
if ($list[$x-1]["productid"] != "")
$prev = $list[$x-1];
else
$prev = end($list);

// next
if ($list[$x+1]["productid"] != "")
$next = $list[$x+1];
else
$next = $list[0];
}

$smarty->assign("next", $next);
$smarty->assign("prev", $prev);

// === Next - Previous products from xCartMod.com ====

Alex
Reply With Quote
  #16  
Old 09-17-2008, 01:23 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

Don't know why
but it's not working.

Tammy
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #17  
Old 09-17-2008, 01:28 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Did you add this text in skin1/customer/main/product.tpl ?

{* === Next - Previous products from xCartMod.com === *}
{include file="customer/next_prev.tpl"}
{* === Next - Previous products from xCartMod.com === *}

I don't see "<br><br>" it on your site.

Alex
Reply With Quote
  #18  
Old 09-17-2008, 01:31 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

I did add it



{* $Id: product.tpl,v 1.147.2.15 2007/05/11 08:00:26 max Exp $ *}

{* === Next - Previous products from xCartMod.com === *}

{include file="customer/next_prev.tpl"}

{* === Next - Previous products from xCartMod.com === *}


What you refer to <br><br/>?
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #19  
Old 09-17-2008, 01:40 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Now I have no installed MySQL 5, so I cannot test it :O(
It's last version. Please, try.

// === Next - Previous products from xCartMod.com ===
$mem_list = func_query("SELECT pr.productid, pr.product FROM $sql_tbl[products_categories] AS cat, $sql_tbl[products] AS pr WHERE cat.categoryid = '$product_info[categoryid]' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product");

$list = array();
if (is_array($mem_list))
foreach($mem_list as $li) {
$mem = func_query_first_cell("SELECT membershipid FROM $sql_tbl[product_memberships] WHERE productid = '$li[productid]'");
if ($mem == $user_account["membershipid"] || $mem == 0 || $mem == "")
$list[] = $li;
}

if (is_array($list))
foreach($list as $x=>$li)
if ($li["productid"] == $productid) {
// previous
if ($list[$x-1]["productid"] != "")
$prev = $list[$x-1];
else
$prev = end($list);

// next
if ($list[$x+1]["productid"] != "")
$next = $list[$x+1];
else
$next = $list[0];
}

$smarty->assign("next", $next);
$smarty->assign("prev", $prev);
// === Next - Previous products from xCartMod.com ====

Alex
Reply With Quote
  #20  
Old 09-17-2008, 01:44 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

No luck.

I'm trying to think maybe i did some mistake.
checked it all again, and no.


Tammy
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



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 01:00 PM.

   

 
X-Cart forums © 2001-2020