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
  #221  
Old 05-27-2008, 12:26 PM
 
toolexperts toolexperts is offline
 

eXpert
  
Join Date: Feb 2008
Location: Knoxville, TN
Posts: 290
 

Default Re: Newest Products

thanks Jwait
__________________
Tool Experts
X-Cart DB Version: 5.4.1.49
Windows
Reply With Quote
  #222  
Old 05-27-2008, 05:16 PM
 
Lingerieblowout Lingerieblowout is offline
 

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

Default Re: Newest Products

Anyone get to work on the home page instead of a link/speed bar/etc ....

/skin1/customer/main/welcome.tpl
{include file="customer/main/newproducts.tpl"}

Show the new products mod but no products show up but in speed bar link they do
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #223  
Old 06-02-2008, 12:57 PM
 
Otis Otis is offline
 

Newbie
  
Join Date: Feb 2007
Posts: 8
 

Default Re: Newest Products

Hey Lingerieblowout,

I noticed you got the "newest Products" to show on the main page...can i ask how you made that work...i still get the " No new products have been listed within timeframe you specified " resultant....

can you help out?

or anyone for that matter....

Thanks
__________________
4.5.2
Reply With Quote
  #224  
Old 06-02-2008, 03:58 PM
 
Lingerieblowout Lingerieblowout is offline
 

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

Default Re: Newest Products

Otis .. I PMed you.
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #225  
Old 06-03-2008, 07:27 AM
 
fireflight fireflight is offline
 

Member
  
Join Date: Jun 2008
Posts: 10
 

Default Re: Newest Products

Quote:
Originally Posted by cliffo4
Well in the spirit of sharing here is the basis of thing. Do take into account that I have taken out some of the more specific requirements of my development to give a basis to be working on. Code based on Xcart Gold 4.0.18

/modules/Bestsellers/bestsellers.php.

Code:
<?php /*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2005 Ruslan R. Fazliev <rrf@rrf.ru> | | All rights reserved. | +-----------------------------------------------------------------------------+ | PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" | | FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE | | AT THE FOLLOWING URL: http://www.x-cart.com/license.php | | | | THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE | | THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. | | FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING | | AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). | | PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT | | CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, | | COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY | | (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS | | LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS | | AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND | | OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS | | AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE | | THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.| | THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2005 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: bestsellers.php,v 1.24.2.4 2006/01/16 14:58:31 mclap Exp $ # # Bestsellers and now newitems at same time to save some processing # if (!defined('XCART_SESSION_START')) { header("Location: ../../"); die("Access denied"); } if ($active_modules['Bestsellers'] || $active_modules['Newitems']){ if (!is_numeric($config["Modules"]["number_of_bestsellers"])) $config["Modules"]["number_of_bestsellers"] = 0; # # Get products data for current category and store it into $products array # $avail_condition = ""; if ($config["General"]["unlimited_products"] == "N" && $config["General"]["disable_outofstock_products"] == "Y") $avail_condition = " AND $sql_tbl[products].avail>0 "; $cat = intval($cat); if ($cat) { $category_data = func_query_first("SELECT categoryid_path, threshold_bestsellers FROM $sql_tbl[categories] USE INDEX (PRIMARY) WHERE categoryid='$cat'"); $result = func_query("SELECT categoryid, threshold_bestsellers FROM $sql_tbl[categories] USE INDEX (pam) WHERE categoryid_path LIKE '$category_data[categoryid_path]/%' AND avail='Y'"); $threshold = (int)$category_data["threshold_bestsellers"]; $cat_ids = array(); if (is_array($result)) { foreach($result as $k=>$v) { $cat_ids[] = $v["categoryid"]; if ($v["threshold_bestsellers"]>0 && $threshold > $v["threshold_bestsellers"]) $threshold = $v["threshold_bestsellers"]; } } else $cat_ids[] = $cat; $str = " AND $sql_tbl[products_categories].categoryid IN (".implode(",", $cat_ids).")"; if ($threshold) $threshold -=1; $search_query1 = $str." AND $sql_tbl[products].views_stats>0 AND $sql_tbl[products].sales_stats > $threshold"; } else { $threshold = 0; $search_query1 = " AND $sql_tbl[products].sales_stats>$threshold"; } $search_query2 = " AND $sql_tbl[products].add_date>UNIX_TIMESTAMP()-(14*86400) and $sql_tbl[products].add_date >0 and $sql_tbl[products].forsale='Y'"; $order_by1 = "$sql_tbl[products].sales_stats DESC, $sql_tbl[products].views_stats DESC"; $order_by2 = "rand()"; #$order_by2 = "$sql_tbl[products].views_stats, $sql_tbl[products].newdate_until desc"; \\least viewed by youngest item # # Search the bestsellers and newitems # if ($active_modules['Bestsellers']) { $bestsellers = func_search_products($search_query1, @$user_account["membership"], $order_by1, $config["Modules"]["number_of_bestsellers"]); $smarty->assign("bestsellers",$bestsellers); } if ($active_modules['Newitems']) { $tmp_str = $str.$search_query2; $bestsellers = func_search_products($str.$search_query2, @$user_account["membership"], $order_by2, $config["Modules"]["number_of_bestsellers"]); if (empty($bestsellers) and $cat) $bestsellers = func_search_products($search_query2, @$user_account["membership"], $order_by2, $config["Modules"]["number_of_bestsellers"]); $smarty->assign("newitems",$bestsellers); } } ?>

You may want to pay attention to the query2 string above in relation to column "add_date" as my system uses a different column due to other mods I have made on cart.

skin1/modules/Newitems/newitems.tpl
Code:
{* $Id: newitems.tpl,v 1.3.2.1 2006/03/12 11:15:01 max Exp $ *} {if $newitems and $active_modules.Newitems} {capture name=newitem} <TABLE cellpadding="2" cellspacing="2" border="0"><tr valign="top"> {section name=num loop=$newitems max=5} <TD align="center" width="20%"> <A href="product.php?productid={$newitems[num].productid}">{if $config.Modules.bestsellers_thumbnails eq "Y"} {include file="product_thumbnail.tpl" productid=$newitems[num].productid image_x=90 product=$newitems[num].product} {/if} {$newitems[num].product} <FONT class="ProductPrice">{$lng.lbl_price}:</FONT> {if $newitems[num].price eq 0 and $product.avail lt 1}<FONT class="ProductDetailsTitle"><SPAN id="product_price">{$lng.lbl_TBC}</SPAN></FONT>{else} {if $newitems[num].price ne 0 || $variants ne ''} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$newitems[num].price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$newitems[num].price}</SPAN></FONT> {if $newitems[num].taxes} {include file="customer/main/taxed_price.tpl" taxes=$newitems[num].taxes}{/if} {else}{$lng.lbl_enter_your_price}{/if}{/if}</A> {/section}</tr><tr><td align="center" colspan="{$smarty.section.num.total}">more new items</td></tr></TABLE> {/capture} {include file="dialog.tpl" title=$lng.lbl_newproducts content=$smarty.capture.newitem extra="width=100%"} {/if}
This template may need some alteration as I test for Zero price and do some other bits - feel free to alter to fit your needs.

Edit skin1/customer/home.tpl
Code:
{include file="location.tpl"} {include file="dialog_message.tpl"} {if $active_modules.Special_Offers ne ""} {include file="modules/Special_Offers/customer/new_offers_message.tpl"} {/if} {include file="customer/home_main.tpl"} {include file="modules/NewItems/newitems.tpl"}

Upto you how and where you place the block - it should come out as a horizontol block with 5 items listed. It can be added elsewhere and will be category sensitive (like bestsellers is). Meaning it will show newest 5 items in currently selected category or if there are none, will do a global search.

Add some sql to xcart:
Code:
INSERT INTO `xcart_modules` VALUES (64, 'Newitems', 'Show Newest items added to site', 'Y');
This will result in you seeing in admin/modules a new module - obviously do activate it to enable the block on front page.

Think thats about it. Can't promise it will work as it is as I've had to pull it all out from my mods - Good luck - and the fun is when you do get it to happen

Cliff. This worked really well for me. However, I'm trying to get it to display the description. I've tried adding:

Code:
{$newitems[num].descr|truncate:300:"...":true}

But this doesn't work. How would I go about adding the description?
__________________
Version 4.1.9
Reply With Quote
  #226  
Old 06-08-2008, 06:49 AM
 
sparker2 sparker2 is offline
 

eXpert
  
Join Date: Feb 2007
Posts: 290
 

Default Re: Newest Products

I purchased this Newest Product mod from FiretankSoftware.com and I do not like the way it displays on my home page. I would rather create it as a separate page and add a link to my speed bar or one of the vertical menu areas, How can I do this? I do not like that little box because it does not look nice displaying on my home page. Maybe it would look better if it was centered but I am not sure how to do that.
__________________
Shareen
sparker2@cox.net
http://www.stitches4u.com
X-Cart Version 4.5.0 with Smart Template vs 4.4.x
Reply With Quote
  #227  
Old 06-08-2008, 06:59 AM
 
Lingerieblowout Lingerieblowout is offline
 

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

Default Re: Newest Products

I fixed up my firetank newest to display like this ..

http://www.lingerieblowout.com/
__________________
http://www.lingerieblowout.com
Version 4.1.10

http://www.topnichewebsites.com
Version 4.4.5

Michael
Reply With Quote
  #228  
Old 06-08-2008, 07:06 AM
 
sparker2 sparker2 is offline
 

eXpert
  
Join Date: Feb 2007
Posts: 290
 

Default Re: Newest Products

That looks very nice but I have no idea on how to do that. I just do not like that little box that shows up originally. Is there an easier way to make this a separate page to look like to other product pages that display the new designs only?
__________________
Shareen
sparker2@cox.net
http://www.stitches4u.com
X-Cart Version 4.5.0 with Smart Template vs 4.4.x
Reply With Quote
  #229  
Old 06-08-2008, 09:07 AM
  JWait's Avatar 
JWait JWait is offline
 

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

Default Re: Newest Products

Shareen, see post 185 in this thread. It does exactly what you want.

There is a mistake in the notes.. you need to edit {xcart_dir}/skin1/customer/home_main.tpl, not home_main.php (there is no such thing).

Also, see the additional info below....

Also, as many people have noticed, 4.1.x sorts products by the title by default. X-cart has no provisions for sorting by Add Date. The thread at http://forum.x-cart.com/showthread.php?t=38263 deals with this issue, but if you read the last post I am personally having a conflict with Add_Date and recommended products.
__________________
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
  #230  
Old 06-08-2008, 09:40 AM
 
sparker2 sparker2 is offline
 

eXpert
  
Join Date: Feb 2007
Posts: 290
 

Default Re: Newest Products

Thanks for the reply but I do not see no post 185 in this tread.
__________________
Shareen
sparker2@cox.net
http://www.stitches4u.com
X-Cart Version 4.5.0 with Smart Template vs 4.4.x
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 12:35 PM.

   

 
X-Cart forums © 2001-2020