| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
What's new mod | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
What's new mod
I've created a pretty simple "what's new" modification that someone might be interested in. It displays all the products that were created within a configurable number of days.
First, create a PHP file called newest.php that contains the following code: Code:
Then change home.php to include the following: Code:
I put that right after the Bestsellers code. Next, you'll need a template called customer/main/newest.tpl Code:
Then edit customer/home_main.tpl to include the previous template: Code:
Then I added a config table setting called TFTACustom.wndays, you can call it anything you'd like. Assuming that you called it that, you can then add a link in the categories.tpl Code:
This mod works as written with 4.0.7 Walt
__________________
X-cart Gold 4.1.7 on Linux/Apache. |
|||||||
#2
|
|||||||
|
|||||||
I've seen something like this before and very handy it was BUT it's only downfall is if you create a new product and then set it to disabled (because you updating your store and want to enable it later) it will still show in your new product list.
Does yours suffer from that as well or does it obey the disabled rule??
__________________
x-cart 4.0.5 (live and heavily modded) Server: freebsd |
|||||||
#3
|
|||||||||
|
|||||||||
$search_data["products"]["forsale"] = "Y";
it will only show if its available for sale. |
|||||||||
#4
|
|||||||
|
|||||||
Quote:
Where do I configure the number of days? Thanks
__________________
x-cart 4.0.8 |
|||||||
#5
|
|||||||||
|
|||||||||
Quote:
at the top of the script Code:
|
|||||||||
#6
|
|||||||
|
|||||||
Hi,
thanks for this mod I've tested your mod in 4.0.12 with fashion moasic skin every thing was good except it appears in the main page which is not good for that skin SO, how can i configure it to work like if we see a category i.e. not in the main page thanks again
__________________
X-Cart Gold 4.0.17 (X-AOM, X-FancyCat, FasionMosaic skin) Operating System Linux Apache version 1.3.34 (Unix) PHP version 4.4.1 MySQL version 4.1.13 |
|||||||
#7
|
|||||||
|
|||||||
Quote:
if (!empty($wn)) { include "./newest.php"; $smarty->assign("wn","$wn"); } don't put above code in home.php instead put it in catagories.php
__________________
X-Cart Version 4.1.8 Hosted on Linux |
|||||||
#8
|
|||||||
|
|||||||
i did what you said
Quote:
but after calling, it returns to home page without any results any other idea?
__________________
X-Cart Gold 4.0.17 (X-AOM, X-FancyCat, FasionMosaic skin) Operating System Linux Apache version 1.3.34 (Unix) PHP version 4.4.1 MySQL version 4.1.13 |
|||||||
#9
|
|||||||
|
|||||||
Hi everybody ,
i tried to modify the this mod to work with my x-cart version and skin, inspite i'm not a php expert but i depend on comparing similar files and do needed changes then testing on the site. After 2 days i think that i solve it and this is the mod after modifications: First, create a PHP file called newest.php that contains the following code: Code:
Next, you'll need a template called customer/main/newest.tpl that contains the following code: Code:
Then edit customer/home_main.tpl to include this code: Code:
Then, add these lang variables to the database (SQL) Code:
Finally, you can call this mod through a link e.g: "wn" indicats the number of days , wn=10 i.e. 10 days I hope this will be good, and correct me if there is any mistake thanks for all of you.
__________________
X-Cart Gold 4.0.17 (X-AOM, X-FancyCat, FasionMosaic skin) Operating System Linux Apache version 1.3.34 (Unix) PHP version 4.4.1 MySQL version 4.1.13 |
|||||||
#10
|
|||||||
|
|||||||
If i try this link:
http://www.indyplaza.com/catalog/newest.php?wn=10 I got: Page not found! The requested page does not exist or you are not allowed to access it! If i try this link: http://www.indyplaza.com/catalog/newest.php I got: 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 ') <= from_unixtime(add_date) AND xcart_pricing.productid=xcart_ SQL QUERY FAILURE: SELECT COUNT(xcart_products.productid), MIN(xcart_pricing.price) as price , xcart_products_lng.product as product_lng, xcart_products_lng.descr as descr_lng, xcart_products_lng.full_descr as fulldescr_lng, IF(xcart_variants.variantid IS NOT NULL,'Y','') as is_variant, IF(xcart_classes.classid IS NOT NULL,'Y','') as is_product_options, v_pricing.price as v_price FROM xcart_products, xcart_pricing , xcart_featured_products, xcart_products_categories, xcart_categories LEFT JOIN xcart_products_lng ON xcart_products_lng.productid = xcart_products.productid AND xcart_products_lng.code = 'US' LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid LEFT JOIN xcart_pricing as v_pricing ON v_pricing.variantid = xcart_variants.variantid AND v_pricing.quantity = 1 AND v_pricing.membership IN ('','') WHERE DATE_SUB(CURDATE(),INTERVAL DAY) <= from_unixtime(add_date) AND xcart_pricing.productid=xcart_products.productid AND xcart_pricing.quantity=1 AND xcart_pricing.membership IN ('','') AND (xcart_pricing.variantid = 0 OR (xcart_variants.variantid = xcart_pricing.variantid)) AND xcart_products_categories.productid=xcart_products .productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.membership IN ('','') AND xcart_products.forsale='Y' GROUP BY xcart_products.productid Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/indypla/public_html/catalog/include/func.php on line 102
__________________
X-CART GOLD: 4.0.14 Operating system Linux Apache version 1.3.33 (Unix) PERL version 5.8.1 PHP version 4.3.10 MySQL version 4.0.22-standard |
|||||||
|
|||
X-Cart forums © 2001-2020
|