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
  #41  
Old 09-17-2008, 04:47 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

Sorry

on customer not main
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #42  
Old 09-17-2008, 04:48 PM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

I have no more ideas. I need to see full code for fixing this problem.

If you want to install this mod you need to give me FTP access and buy installation service on our site (http://www.xcartmod.com/cart/product/installation.html).

Or you can ask man who made design for your store: what template (TPL-file) is used for product page.

Good night.
Alex
Reply With Quote
  #43  
Old 09-17-2008, 04:51 PM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: free <PREV | NEXT> mod help

Thank you Alex for all your trouble
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #44  
Old 09-17-2008, 11:01 PM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default Re: free <PREV | NEXT> mod help

Quote:
Originally Posted by robertswww
If you do not have products assigned to different memberships, then you can remove that part from the SQL Query.

To get this mod to work with X-Cart 4.1.x on mySQL 5, I made the following change:

File: product.php (root-level)

Change the SQL Query to read:
Code:
$mem_list = func_query("SELECT pr.productid, pr.product FROM $sql_tbl[products] AS pr LEFT JOIN $sql_tbl[products_categories] AS cat ON cat.productid = pr.productid WHERE cat.categoryid = '$product_info[categoryid]' AND pr.productid = cat.productid AND pr.forsale='Y' ORDER BY pr.product");

That's it... working fine on my live site now.

Robert

I've got it also working with the above change of the product.php.

Many thanks, Robert!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #45  
Old 09-19-2008, 11:24 AM
 
jones jones is offline
Banned
 

Advanced Member
  
Join Date: Aug 2008
Posts: 36
 

Default Re: free <PREV | NEXT> mod help

Hello Jerrad,

Note that Robert's code is not working with memberships.

If you use to memberships in your store you need to use this code:

$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");

Alex
Reply With Quote
  #46  
Old 09-21-2008, 02:10 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default Re: free <PREV | NEXT> mod help

Quote:
Originally Posted by jones
If you use to memberships in your store you need to use this code:

$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");

Alex

I'm not using memberships in our store, but thanks for informing me and also a BIG thanks for this great free mod, Alex!!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #47  
Old 09-24-2008, 06:09 AM
 
chickykoala chickykoala is offline
 

Member
  
Join Date: Jul 2008
Posts: 16
 

Default Re: free <PREV | NEXT> mod help

Would it be possible to use this in LC? My client is desperate for something to make her site more functional on an iPhone...page results are VERY difficult to use with fat fingers.
__________________
Thanks,
liteCommerce 2.2.35
Reply With Quote
  #48  
Old 09-24-2008, 10:44 PM
  flyclothing's Avatar 
flyclothing flyclothing is offline
 

eXpert
  
Join Date: Aug 2004
Location: Gilbert, AZ
Posts: 357
 

Default Re: free <PREV | NEXT> mod help

Awesome mod! Thank you.
__________________
Jonathan
Flyclothing, LLC
PO Box 1490
Gilbert, AZ 85299-1571
P 480.422.7350
F 888.359.2568
www.flysportsgear.com?MMCF_xcartforum (X-Cart 4.5.2) FOR SALE
Reply With Quote
  #49  
Old 09-29-2008, 11:38 AM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: free <PREV | NEXT> mod help

Quote:
Originally Posted by chickykoala
Would it be possible to use this in LC?
We don't use LC, but it is very doubtful this X-Cart Mod would work, because most likely the database table names and fields are probably different.

If you are good at writing SQL queries you can probably make your own LC-specific query. Convert the Template to work with LC, add an include on your product pages (if LC uses include statements), and add the SQL query to your product.php or equivalent page.

Otherwise look for a LC programmer or site that sells custom LC mods.

Good Luck!

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #50  
Old 04-02-2009, 09:11 AM
  clik's Avatar 
clik clik is offline
 

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

Question Re: free <PREV | NEXT> mod help

Quote:
Originally Posted by jones
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

Hi Alex,

thank you for the PREV|NEXT Mod. It's very handy. I don't even understand why it's not a standart mod in x-cart

Everything is working when it's a product's main category. And when it's an additional category, the next and previous link to the products from the main category while it should keep the id # of additional category.

That's how it looks: http://www.clikinternational.com/home.php?cat=24

For ex., click on "Glossy Buttons", there should be:
<- Previous (Oval Label) | (Photoshop Style - Light Grey) Next->
but it's not.

I've tried to modify the code but without luck.
Here is what I tried to do:

next_prev.tpl

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>

product.php (I didn't change anything here)

Code:
// === 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) { 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 ====

Thank you again for this Mod.
I would appreciate if you can help me.
__________________
__________________
XC5: 5.3.4.4
PHP: 7.0.26
MySQL server: 5.5.56-MariaDB
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:54 PM.

   

 
X-Cart forums © 2001-2020