| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Newest Products | ||||
|
|
Thread Tools | Search this Thread |
#171
|
|||||||
|
|||||||
Re: Newest Products
Any one please share the complete working code for version 4.1.7 ?
I was using it with version 4.0.12 but as now I have upgraed to latest version the original code doesn't work.
__________________
X-Cart: 4.7.7 LIVE Skin:Ultra by xcartmods.co.uk X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9) --------------- Server: Linux php: 5.3 mysql: 5.0.89 ---------------- |
|||||||
#172
|
|||||||||
|
|||||||||
Re: Newest Products
Quote:
That would be nice but I don't think there is a working code for the 4.1.x version. It is the major reason we have not upgraded.
__________________
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 |
|||||||||
#173
|
|||||||||
|
|||||||||
Re: Newest Products
Maybe Phil from http://www.xcartmods.co.uk/ can help...
__________________
"The point is, to make so much money, that money isn't the point anymore." Pro Version 4.0.19 Gold Version 4.1.3 Linux |
|||||||||
#174
|
|||||||
|
|||||||
Re: Newest Products
Quote:
I rewrote the newproducts module for 4.1.x I am attaching a zip file for the code I use. It may have some bugs.. so we can work them out together - james -
__________________
X-Cart Gold Plus 4.5.4 X-PDF 4.5.3 X-Payments 1.05 CDSEO Pro 1.8.7 WebsiteCM Product Map 2.0.1 WebsiteCM Next-Prev 1.3 disabled because of SQL errors and bugs. |
|||||||
#175
|
|||||||||
|
|||||||||
Re: Newest Products
Hello ...
Works great in 4.1.8 Just a few things to mention for the installation: 1) Comment out line 15 in newproducts.php if you're not using WebsiteCM's CDSEO Mod. Quote:
Replace line with this: Quote:
Quote:
Regards Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!) Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x Multiple Instances of X-Cart MySQL 5.6.37 CentOS 7.4 Chamber Internet - Lancashire, United Kingdom http://www.chamberelancs.co.uk |
|||||||||
#176
|
|||||||
|
|||||||
Re: Newest Products
How do I get this to show in Categories. I add this to the categories.tpl
I am using this code Only the word New Products show with no link {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $main eq "newproducts"}New Products<HR size="1" noshade class="CateMenuHr"> {else} New Products<HR size="1" noshade class="CateMenuHr"> {/if} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories}
__________________
yages x-cart version 4.5.5 |
|||||||
#177
|
|||||||
|
|||||||
Re: Newest Products
Hi! Had a problem with this mod for version 4.1.x as listed above by lapidarist. I used the zip file and made the modifications recommended by chamberinternet.
When you arrive at the link, the following error occurs when a time frame is chosen with no new products, Warning: array_slice() [function.array-slice]: The first argument should be an array in /home/wwwjust/public_html/shop/newproducts.php on line 153 Line 153 reads: $newproducts = array_slice($temp_products, $lowerLimit, ($upperLimit - $lowerLimit));
__________________
XCart Version 4.1.6 PHP 4.4.4 MySQL 4.1.21-standard |
|||||||
#178
|
|||||||||
|
|||||||||
Re: Newest Products
Quote:
It could be because you have not specified a link to newproducts.php. Since it is "newproducts" is not a category it will not be there on its own, you need to add a link to it. Try.... {if $main eq "newproducts"}<a href="newproducts.php">New Products<HR size="1" noshade class="CateMenuHr"></a> {else} <a href="newproducts.php">New Products<HR size="1" noshade class="CateMenuHr"></a> {/if}
__________________
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 |
|||||||||
#179
|
|||||||||
|
|||||||||
Re: Newest Products
Quote:
Yes, this seems to be a problem when there is no new products in the specified time period. The rest seems to be working ok. From the error message, it appears that there should be an array and none is created if the array is empty (no new products). I tried changing the area around line 147 so it says... # if we have items to show.. go get them.. if not it will default to empty string "". if ($total_items > 0) { # get the product list that is limited to the page we need to display. print_debug("temp_products count: " . count($temp_products) . "<br />"); print_debug("lowerLimit: $lowerLimit upperLimit: $upperLimit <br>"); } if ($temp_products > 0) { $newproducts = array_slice($temp_products, $lowerLimit, ($upperLimit - $lowerLimit)); print_debug("newproducts count: " . count($newproducts) . "<br />"); } I added a check that $temp_products > 0. and it seems to work. Try it and see what you get.
__________________
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 |
|||||||||
#180
|
|||||||
|
|||||||
Re: Newest Products
Quote:
I modified the code to: 1. Conditionally load WebsiteCM CDSEO if it exists (thanks chamberinternet) . 2. Updated the bad SQL statement in the language file (thanks chamberinternet). 3. Added a $default_days variable to set default instead of 7 days (thanks chamberinternet) 4. Fixed the bug to check if an array is returned from the search.. if not it will create an empty array (thanks LisaB) 5. Updated the install file 6. Changed code to not show new products that are not available (sold). This was confusing my customers. Hopefully this will fix some problems.
__________________
X-Cart Gold Plus 4.5.4 X-PDF 4.5.3 X-Payments 1.05 CDSEO Pro 1.8.7 WebsiteCM Product Map 2.0.1 WebsiteCM Next-Prev 1.3 disabled because of SQL errors and bugs. |
|||||||
|
|||
X-Cart forums © 2001-2020
|