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)
-   -   Newest Products (https://forum.x-cart.com/showthread.php?t=1084)

MallRomania 04-10-2006 01:15 AM

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

cliffo4 04-10-2006 08:34 AM

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! :oops:

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

xcell67 05-05-2006 08:06 PM

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!

cliffo4 05-05-2006 10:51 PM

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.

xcell67 05-09-2006 10:02 PM

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. :(

flamers 05-25-2006 11:08 AM

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.

syddos 05-25-2006 11:50 PM

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)

JWait 06-07-2006 07:07 PM

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.

amy2203 06-29-2006 07:46 AM

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

JWait 06-30-2006 08:17 AM

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?


All times are GMT -8. The time now is 03:34 PM.

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