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
  #51  
Old 04-03-2009, 02:29 AM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Hi,

in next_prev.tpl you made corrected changes:

Code:
{* Previous *} {if $prev.productid} <div style="float:left;"><a href="product.php?productid={$prev.productid}&cat={$cat}" title="{$prev.product}"><img src="{$ImagesDir}/larrow.gif" width=9 height=9 border=0 alt="{$lng.lbl_prev_page}"> {$prev.product}</a></div> {/if} {* Next *} {if $next.productid} <div style="float:right;"><a href="product.php?productid={$next.productid}&cat={$cat}" title="{$next.product}">{$next.product} <img src="{$ImagesDir}/rarrow.gif" width=9 height=9 border=0 alt="{$lng.lbl_next_page}"></a></div> {/if} <br><br>

in product.php it must be:

Code:
// === Next - Previous products from xCartMod.com === if ($cat != "") $xcat = $cat; else $xcat = $product_info["categoryid"]; $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 = '$xcat' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product"); $list = array(); ......

Alex
Reply With Quote

The following user thanks jones for this useful post:
clik (04-03-2009)
  #52  
Old 04-03-2009, 05:52 AM
  clik's Avatar 
clik clik is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: Canada
Posts: 30
 

Smile Re: free <PREV | NEXT> mod help

Thanks Alex!

It works like magic

The code looks like this right now (there is no membership):

Code:
if ($cat != "") $xcat = $cat; else $xcat = $product_info["categoryid"]; $mem_list = func_query("SELECT pr.productid, pr.product FROM $sql_tbl[products_categories] AS cat, $sql_tbl[products] AS pr WHERE cat.categoryid = '$xcat' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product"); $list = array();

Thanks!
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
Reply With Quote
  #53  
Old 04-03-2009, 07:39 AM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Yes...for membership code must be:

Code:
if ($cat != "") $xcat = $cat; else $xcat = $product_info["categoryid"]; $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 = '$xcat' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product"); $list = array();


Alex
Reply With Quote
  #54  
Old 06-25-2009, 10:43 AM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: free <PREV | NEXT> mod help

I am lost, can someone please tell me the location of the files need to be change.
Ex. Customer>xxx.html
And is that possilble to add "view all" too?

Thanks!
X-Cart version 4.1.11
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
  #55  
Old 07-09-2009, 10:34 AM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: free <PREV | NEXT> mod help

I guess No one know the view all option.
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
  #56  
Old 08-21-2009, 02:07 AM
 
info@sjidesign.com info@sjidesign.com is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 46
 

Default Re: free <PREV | NEXT> mod help

Hi

Great mod,

Can this be done so that instead of going to the next product (alphabetically) as the code does at the moment then it goes through to the next product by the number they are listed in the category position order?

e.g. I have 3 products

Football
Tennis Racket
Golf Club

They are set to be listed in this order: Football 1 (product number 20) Tennis Racket 2 (product number 3) Golf Club 3 (product number 9)

So I need to go throguh from football, tennis racket, golf club.

Thanks in advance

Dan
__________________
X Cart Version 4.2
Reply With Quote
  #57  
Old 08-31-2009, 06:21 AM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Hi Dan,

You can change it easy:

in product.php add "cat.orderby," in this query:

Code:
// === Next - Previous products from xCartMod.com === $mem_list = func_.... ORDER BY cat.orderby, pr.product"); $list = array(); ......

Alex
Reply With Quote
  #58  
Old 08-31-2009, 09:35 AM
 
info@sjidesign.com info@sjidesign.com is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 46
 

Default Re: free <PREV | NEXT> mod help

Hi Alex,

Thank you very much for the reply but when I put that code in my product.php I get the error.

INVALID SQL: 1054 : Unknown column 'pr.orderby' in 'order clause'
SQL QUERY FAILURE:SELECT pr.productid, pr.product, mem.membershipid FROM xcart_products_categories AS cat, xcart_products AS pr LEFT JOIN xcart_product_memberships AS mem ON mem.productid = pr.productid WHERE cat.categoryid = '71' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.orderby, pr.product


Any ideas what's wrong?

Thanks again for your help.

Regards

Dan
__________________
X Cart Version 4.2
Reply With Quote
  #59  
Old 09-02-2009, 06:18 AM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Hi Dan,

Sorry, I slipped. Need to add "cat.orderby,".

Alex

Quote:
Originally Posted by info@sjidesign.com
Hi Alex,

Thank you very much for the reply but when I put that code in my product.php I get the error.

INVALID SQL: 1054 : Unknown column 'pr.orderby' in 'order clause'
SQL QUERY FAILURE:SELECT pr.productid, pr.product, mem.membershipid FROM xcart_products_categories AS cat, xcart_products AS pr LEFT JOIN xcart_product_memberships AS mem ON mem.productid = pr.productid WHERE cat.categoryid = '71' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.orderby, pr.product


Any ideas what's wrong?

Thanks again for your help.

Regards

Dan
Reply With Quote
  #60  
Old 09-02-2009, 06:52 AM
 
info@sjidesign.com info@sjidesign.com is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 46
 

Default Re: free <PREV | NEXT> mod help

Hi Alex,

Thank you very much, it worked perfectly

I really appreciate your help.

Thank you again.

Regards

Dan
__________________
X Cart Version 4.2
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 12:00 PM.

   

 
X-Cart forums © 2001-2020