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

Newest Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #141  
Old 04-10-2006, 01:15 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

Just one more question: how to NOT show new products in other pages than home.php? I mean, I don't want to display products in categories..or if i display something should be new products from that category, if are not any new products in category, just show "no products" message..hope you understand me...

Thank you
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #142  
Old 04-10-2006, 08:34 AM
  cliffo4's Avatar 
cliffo4 cliffo4 is offline
 

Member
  
Join Date: Jul 2005
Location: Leicester, UK
Posts: 19
 

Default

Quote:
Originally Posted by MallRomania
Just one more question: how to NOT show new products in other pages than home.php? I mean, I don't want to display products in categories..or if i display something should be new products from that category, if are not any new products in category, just show "no products" message..hope you understand me...
Well as I said before it is engineered so if in a specific category and there are no items it then does a global search. However, if both these methods return empty then you will notice in skin1\modules\Newitems\newitems.tp at the top you get
Code:
{if $newitems and $active_modules.Newitems}
If you really want to show the block even when no items you need to chage this to:
Code:
{if $active_modules.Newitems} {if $newitems}
and the last
Code:
{if} ***At the bottom Replace with*** {elseif}Sorry No new items :( {/if} {/if}
I prefer no block when no items otherwise can draw attention to little or no new stock!

To not show the block on all pages simply remove if from the skin1/customer/home.tpl and place it where required. On interstellar its in skin1/customer/main/welcome.tpl. Other places like skin1/customer/main/subcategories.tpl is also a useable place.

Thats all I can tell you - I'm sure you can follow the tpl logic of where you want things - so happy modding
__________________
X-Cart Gold 4.0.19
http://interstellarsounds.com
Reply With Quote
  #143  
Old 05-05-2006, 08:06 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Hi,

Can somebody help me out, my server has Mysql version 4.0.25 so when I follow the instructions listed by lapidarist:

http://forum.x-cart.com/viewtopic.php?p=107474#107474


I get this error when calling newproducts.php:

INVALID SQL: 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'xcart_products.avail > 0 AND add_date > 1146282522 AND add_date
SQL QUERY FAILURE:SELECT COUNT(xcart_products.productid) FROM xcart_products, xcart_categories, xcart_products_categories, xcart_pricing WHERE xcart_products.productid=xcart_products_categories .productid AND xcart_products_categories.categoryid=xcart_categor ies.categoryid AND xcart_products.productid=xcart_pricing.productid AND xcart_pricing.quantity=1 AND (xcart_pricing.membership='' OR xcart_pricing.membership='') AND (xcart_categories.membership='' OR xcart_categories.membership='') AND xcart_products.forsale='Y' AND xcart_pricing.variantid = 0AND xcart_products.avail > 0 AND add_date > 1146282522 AND add_date < 1146887322 GROUP BY xcart_products.productid

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /include/func/func.db.php on line 125


I'm assuming that

Code:
$query = "AND $sql_tbl[products].avail > 0 AND add_date > $from_time AND add_date < $now_time ";

is not liking my msql version. Can someone tell me the correct query for mysql 4.0.25?

THANKS!
Reply With Quote
  #144  
Old 05-05-2006, 10:51 PM
  cliffo4's Avatar 
cliffo4 cliffo4 is offline
 

Member
  
Join Date: Jul 2005
Location: Leicester, UK
Posts: 19
 

Default

Quote:
Originally Posted by xcell67
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /include/func/func.db.php on line 125


I'm assuming that

Code:
$query = "AND $sql_tbl[products].avail > 0 AND add_date > $from_time AND add_date < $now_time ";

Looks more like it doesnt know which table "add_date" is from, so prefix it with xcart_products. to read xcart_product.add_date However in the code you probably need to make it:
Code:
$query = "AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].add_date > $from_time AND $sql_tbl[products].add_date < $now_time "

But if thats not right, maybe run the query in phpMyAdmin and see if it works, iff not you can try building the query up or strip it down.
__________________
X-Cart Gold 4.0.19
http://interstellarsounds.com
Reply With Quote
  #145  
Old 05-09-2006, 10:02 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Hey cliff,
thanks for the help but its giving the same error. I think its just a matter of different syntax between mysql 4.0.25 and 4.1.0. But I have no idea what the syntax differences are.
Reply With Quote
  #146  
Old 05-25-2006, 11:08 AM
 
flamers flamers is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 51
 

Default Internal Server Error

Hi,

I followed the step by step instructions, for this mod, didn't change a thing that I wasn't supposed to, but when I typed the URL in my browser address to get to the page for testing before inserting the live link on the site I got an Internal Server Error message...

"The server encountered an internal error or misconfiguration and was unable to complete your request."

Has anyone else had this problem? We've just been upgraded to V 4.0.18. Our site still works fine, no problems anywhere else.

Any ideas would be welcome, before we start tinkering.
__________________
X-Cart V 4.0.18
Reply With Quote
  #147  
Old 05-25-2006, 11:50 PM
 
syddos syddos is offline
 

eXpert
  
Join Date: Sep 2002
Location: London, England, UK
Posts: 259
 

Default

Quote:
Originally Posted by xcell67
Hi,

Can somebody help me out, my server has Mysql version 4.0.25 so when I follow the instructions listed by lapidarist:


See page 9, (post 4 from bottom of page)
__________________
Syddos

Nothing is impossible, We just don't know how to do it ........Yet!

Xcart 4.1.X PRO (Testing Platform: winXP Pro)
Perl 5.8.7 (win32)
WINAMP 1.6.3 (win32 server package. Includes the following)
- phpMyAdmin v2.8.03
- MySql 5.0.21
- Apache 2.0.55 (win32)
- php 5.1.4
- SQLitemanager 1.2.0
Reply With Quote
  #148  
Old 06-07-2006, 07:07 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default

Does anyone have this working with 4.1.x yet? I've installed a test version and would really like this included but don't know where to begin.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #149  
Old 06-29-2006, 07:46 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default

Hi,

I've got this working great, but I'd like to be able to put these on my frontpage too. Anyone know how I can do that?

I tried adding
Code:
require "./newproducts.php";
to home.php but all I get is a white screen.

Anyone know?

tia
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #150  
Old 06-30-2006, 08:17 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default

Quote:
Originally Posted by amy2203
Hi,

I've got this working great, but I'd like to be able to put these on my frontpage too. Anyone know how I can do that?

I tried adding
Code:
require "./newproducts.php";
to home.php but all I get is a white screen.

Anyone know?

tia

Do you mean instead of Featured Products, or in additon to? In any case I think you need to include 'newproducts.tpl' (or whatever you named the new products template).

This is a great mod, and I sure would like to get it working with version 4.1. Has anyone had any luck?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:44 AM.

   

 
X-Cart forums © 2001-2020