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
  #201  
Old 11-12-2007, 05:39 PM
 
Lingerieblowout Lingerieblowout is offline
 

X-Adept
  
Join Date: Sep 2003
Location: Annapolis, MD
Posts: 415
 

Default Re: Newest Products

The Newest Items is a custom mod and the shop by price features already exist under Advance Search. Im sure you can enhance the search by price. Can you send me a PM of your URL.
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #202  
Old 11-17-2007, 08:57 PM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default Re: Newest Products

Hi,

This post seems so simple but I just can't get it right. I don't want the new products to be called from a link in the lhs (i.e. VertMenuLeftColumn). I would like the new products to display in the main content area.

I thought if I add the following include to my home.php that everything would be sweet:-
include "./newproducts.php";

This is a small chunk of my home.php file:-
// WCM - CDSEO Links
include $xcart_dir."/modules/cdseolinks/cdseo_cat.php";

require $xcart_dir."/include/categories.php";

if ($active_modules["Manufacturers"])
include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";

if (!empty($cat))
include "./products.php";

if (empty($products))
include "./featured_products.php";

include "./newproducts.php";


if ($active_modules["Bestsellers"])
include $xcart_dir."/modules/Bestsellers/bestsellers.php";



My home_main.tpl looks like this at the bottom:-
{elseif $main eq "newproducts"}
{include file="customer/main/newproducts.tpl"}
{else}
{include file="common_templates.tpl"}
{/if}


What I get is a blank white page. I haven't changed any of the new files, so I must be doing something wrong. Can someone put me on the right path?
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox)
PHP 4.4.4
SQL 4.1.21
Linux O/S
Reply With Quote
  #203  
Old 12-12-2007, 02:20 PM
  pig@pp's Avatar 
pig@pp pig@pp is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Luis Obispo, CA
Posts: 38
 

Default Re: Newest Products

I've installed this mod on v4.1.9 and it works fine except I can't get the Price: $XXX to display. Mod originally displayed "Enter Your Price" but I was able to find and remove the code for that. Any suggestions?

Thanks!

UPDATE: Fixed it. Borrowed some code from products_t.tpl
__________________
http://www.polyperformance.com/
4.1.9 Gold (x7)
Hosting by EWDHosting.com
Reply With Quote
  #204  
Old 01-19-2008, 06:24 PM
 
poil11 poil11 is offline
 

Newbie
  
Join Date: Jan 2008
Posts: 4
 

Default Re: Newest Products

Great Mod, just getting into x-cart. Anyway can make a Buy Now button next to each item?
__________________
4.1.9
Reply With Quote
  #205  
Old 01-28-2008, 06:47 AM
 
babydollcosmetics babydollcosmetics is offline
 

Member
  
Join Date: Jan 2008
Posts: 15
 

Default Re: Newest Products

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

thanx so much.
however, when i add this on my website,
everything seems to work fine.
the new products do show on the newproducts.php page...
but they do not show on my home page.
it just keeps showing:

"Products added since:

No new products have been listed within timeframe you specified "

what did i do wrong?
__________________
Clement
X-Cart 4.1.10
Reply With Quote
  #206  
Old 02-28-2008, 08:21 AM
 
erickim erickim is offline
 

Newbie
  
Join Date: Jan 2008
Posts: 6
 

Default Re: Newest Products

Quote:
Originally Posted by pavant
I love this mod but it wasn't set up for 4.1.x versions of xcart so I tried to make it work with my 4.1.8. I have it set to show new products added within the last 90 days on the home page only. Here is what I have so far:

1. Create file newest.php in the xcat home directory.
PHP Code:
<?php
#
# $Id: newest.php 2007/07/22 $
#
// set variables
$daterange 7776000// 60 * 60 * 24 * 90 days in unix time
$nowtime time();
$oldtime $nowtime $daterange ;
 
# Get new products data and store it into $newproducts array
#
if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); }
#
# Select from products table
#
$user_account['membershipid'] = !empty($user_account['membershipid'])?$user_account['membershipid']:0;
$old_search_data $search_data["products"];
$old_mode $mode;
$old_page $page;
$search_data["products"] = array();
$search_data["products"]["forsale"] = "Y";
$search_data["products"]["avail"] = "> 0";
$search_data["products"]["add_date"] = "> " $oldtime "";
$search_data["products"]["add_date"] = "< " $nowtime "";
$search_data["products"]["sort_condition"] = "$sql_tbl[products].add_date DESC";
$REQUEST_METHOD "GET";
$mode "search";
include 
$xcart_dir."/include/search.php";
$search_data["products"] = $old_search_data;
x_session_save("search_data");
$mode $old_mode;
$page $old_page;
unset(
$old_search_data$old_mode$old_page);
$smarty->clear_assign("newproducts");
$smarty->assign("newproducts",$products);
$search_data '';
$products = array();
unset(
$search_data$products);
?>
2. Modify file home.php in the xcart home directory to add code for newest.php

PHP Code:
if (empty($products)) {
include 
"./featured_products.php";
}
if (empty(
$products) and empty($current_category)) {
include 
"./newest.php";



3. Modify statement in the home_main.tpl template in the skin1/customer directory to read as follows:

{elseif $main eq "catalog" && $current_category.category eq ""}
{include file="customer/main/welcome.tpl" f_products=$f_products newproducts=$newproducts}


4. Create newest.tpl template in the /skin1/customer/main directory.

{* $Id: newest.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *}
{capture name=dialog}
{if $newproducts ne ""}
{include file="customer/main/products.tpl" products=$newproducts}
{/if}
{/capture}
{include file="dialog.tpl" title="New Products" content=$smarty.capture.dialog extra="width=100%"}



5. Modify the welcome.tpl template in the /skin1/customer/main directory.

{if $f_products ne ""}
{include file="customer/main/featured.tpl" f_products=$f_products}
{/if}
{if $newproducts ne ""}
{include file="customer/main/newest.tpl" newproducts=$newproducts}
{/if}
{if $f_products eq "" && $newproducts eq ""}
<img src="{$ImagesDir}/customer_images/welcome.jpg" alt="" />
{/if}


I hope this helps some of the xcart 4.1 sites. I make no promises that this code will work with your site; each environment is different and your code may function differently especially if it has already been moded. I can't provide any support for this mod. Install only if you have the resources to fix any problems that may occur.

I followed your(Pavant's) codes posted #186, it works fine except one thing.
It shows the products alphabetical order, not by newest.
I have 4.1.9 xcart. Could you help me what is wrong with this?
Or anybody help me?


Thank you.
__________________
x-cart gold 4.1.9
Reply With Quote
  #207  
Old 03-20-2008, 04:32 PM
  ScrapProfessor's Avatar 
ScrapProfessor ScrapProfessor is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 90
 

Question Re: Newest Products

I would love help on this also. I'm running x-cart pro 4.1.9.

Can someone help?

Thank you!
__________________
Joli Kirk,
"Life is not measured by the number of breaths we take, but by the number of moments that take our breath away"

X-Cart PRO 4.3.1 | Linux | PHP 5 | MySQL 5


AlteredCart.com - Download Expander; Product Page Downloads
BCSEngineering.com - On Sale Products; Newest Added Products
Reply With Quote
  #208  
Old 04-16-2008, 12:09 PM
  yamiya's Avatar 
yamiya yamiya is offline
 

Member
  
Join Date: Aug 2007
Posts: 24
 

Default Re: Newest Products

I like to modify the code such that I can display entire category in front page.

Anyone knows how to do it?

Quote:
Originally Posted by vulcan-works
PHP Code:
#
# $Id: newest.php 2007/07/22 $
#
// set variables
$daterange 7776000// 60 * 60 * 24 * 90 days in unix time
$nowtime time();
$oldtime $nowtime $daterange ;
 
# Get new products data and store it into $newproducts array
#
if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); }
#
# Select from products table
#
$user_account['membershipid'] = !empty($user_account['membershipid'])?$user_account['membershipid']:0;
$old_search_data $search_data["products"];
$old_mode $mode;
$old_page $page;
$search_data["products"] = array();
$search_data["products"]["forsale"] = "Y";
$search_data["products"]["avail"] = "> 0";
$search_data["products"]["add_date"] = "> " $oldtime "";
$search_data["products"]["add_date"] = "< " $nowtime "";
$search_data["products"]["sort_condition"] = "$sql_tbl[products].add_date DESC";
$REQUEST_METHOD "GET";
$mode "search";
include 
$xcart_dir."/include/search.php";
$search_data["products"] = $old_search_data;
x_session_save("search_data");
$mode $old_mode;
$page $old_page;
unset(
$old_search_data$old_mode$old_page);
$smarty->clear_assign("newproducts");
$smarty->assign("newproducts",$products);
$search_data '';
$products = array();
unset(
$search_data$products); 


You must add:
Code:
<?php
at the very top of the file
and
Code:
?>
to the end of it for it to work
but other than that great job!
__________________
Yamiya Yam
http://www.yamiya.com.my
---------------------------------------
X-Cart Gold v4.1.8 (UNIX)
Reply With Quote
  #209  
Old 04-22-2008, 10:08 AM
 
flawfulfibers flawfulfibers is offline
 

Member
  
Join Date: Mar 2008
Posts: 10
 

Default Re: Newest Products

I have John C's version running, but now I'm getting SQL errors 1064, where it looks like there may be a security issue through newproducts.php? Anyone know what I can add to fix it? I tried what was suggested for the other new products mods, but that didn't work.
__________________
xcart Gold Ver. 4.1.9
Reply With Quote
  #210  
Old 04-22-2008, 11:00 AM
  ScrapProfessor's Avatar 
ScrapProfessor ScrapProfessor is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 90
 

Default Re: Newest Products

I am getting the same MySQL error message. Can anyone help? It would be appreciated!
__________________
Joli Kirk,
"Life is not measured by the number of breaths we take, but by the number of moments that take our breath away"

X-Cart PRO 4.3.1 | Linux | PHP 5 | MySQL 5


AlteredCart.com - Download Expander; Product Page Downloads
BCSEngineering.com - On Sale Products; Newest Added Products
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:04 PM.

   

 
X-Cart forums © 2001-2020