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)

finestshops 11-17-2004 02:05 PM

Try this:

add in customer/home_main.tpl

Code:

{elseif $main eq "newest"}
{include file="customer/main/newest.tpl"}


in newest.php

at the beginning add

Code:

require "./auth.php";

and at the end:

Code:

$smarty->assign("main","newest");
$smarty->display("customer/home.tpl");


do not forget to remove

Code:

require "./newest.php";

from home.php

now try to run http://www.domain.com/store/newest.php
Should work if I did not miss something :wink:

Or just order this mod here:
http://www.shopping-carts-upgrades.com/Newest-Products-Added-p-91.html

and we'll set it up this way.

josu 11-22-2004 05:29 AM

Not working newest.php
 
I have created the newest.php and do the modifications indicated, but I can not see the new products...

earion 11-28-2004 10:40 AM

i've tried to lok for a solution to this problem on my own but i'm not a sql guy... i need in my first page a newest products modules except it has to be on 3 columns and each column is a different category.
I think i know how it would work : each column is displayed like in the store and using the add_date we can narrow it down to say 5 or 10 products ordered by add_date. Can you guys help me out ?
Thanks in advance !

rapsearch 12-20-2004 11:24 AM

I would be very interested in the ^ as well... Can anyone help out with this for the x-cart generation 4?

(wonderes why this is not default in x-cart....)

pcdoktorn 12-24-2004 02:11 PM

Seems this mod is not working in 4.0.8
I get an error saying
Parse error: parse error, unexpected T_USE in /home/www/www/pcdoktorn/newest.php on line 27

eaglemobiles 01-10-2005 07:31 PM

is it working in 4.0.9

Thanks

shishapipe 01-12-2005 06:53 AM

Cant get it to work on x-cart 4.09 :(

This works ok http://www.shisha.co.uk/shopcart/newest.php
but when i use http://www.shisha.co.uk/shopcart/home.php

I get the NEW blue bar at the bottom but no products :(

Any ideas, i have followed the postings, but cant find the problem.

I Know that the code for x-cart 4.09 in shopcart/skin1/customer/main/welcome.tpl is working fine

Code:

{* $Id: welcome.tpl,v 1.23 2004/05/28 12:21:00 max Exp $ *}
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD height="19" class="WelcomeTitle" background="{$ImagesDir}/custom/welcome_title_bottom_bg.gif" valign="top">
{if ($active_modules.Greet_Visitor ne "") AND ($smarty.cookies.GreetingCookie ne "")}
{$lng.lbl_welcome_back}, {$smarty.cookies.GreetingCookie|replace:"\'":"'"}
{else}
{$lng.lbl_welcome_to} { $config.Company.company_name }
{/if}
</TD>
</TR>
<TR>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR><TD class="WelcomeBox" background="{$ImagesDir}/custom/welcome_bg.gif"><TABLE border="0" cellpadding="5" cellspacing="10">
<TR>
<TD valign="top">[img]{$ImagesDir}/custom/welcome_image.gif[/img]</TD>
<TD class="WelcomeBox">{$lng.txt_welcome}
</TD></TR>
</TABLE></TD></TR>
</TABLE>

{*capture name=dialog}
{$lng.txt_welcome}
{/capture}
{if ($active_modules.Greet_Visitor ne "") AND ($smarty.cookies.GreetingCookie ne "")}
{include file="dialog.tpl" title="`$lng.lbl_welcome_back`, `$smarty.cookies.GreetingCookie`" content=$smarty.capture.dialog extra="width=100%" dialog_box_color="_orange"}
{else}
{include file="dialog.tpl" title="`$lng.lbl_welcome_to` `$config.Company.company_name`" content=$smarty.capture.dialog extra="width=100%" dialog_box_color="_orange"}
{/if*}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
{include file="customer/main/featured.tpl" f_products=$f_products dialog_title_color="_orange"}


 
{include file="customer/main/newest.tpl" newproducts=$newproducts dialog_title_color="_orange"}


I know that the shopcart/newest.php works fine.

So all i need to check now is the:
shopcart/home.php modification
shopcart/skin1/customer/home_main.tpl modification
shopcart/skin1/customer/main/newest.tpl modification

shishapipe 01-12-2005 08:05 AM

Also checked the shopcart/skin1/customer/home_main.tpl (x-cart 4.09)

And that is OK

Code:

{if $smarty.get.mode eq "subscribed"}
{include file="main/subscribe_confirmation.tpl"}

{elseif $smarty.get.mode eq "unsubscribed"}
{include file="main/unsubscribe_confirmation.tpl"}

{elseif $main eq "returns"}
{include file="modules/RMA/returns.tpl"}

{elseif $main eq "register"}
{include file="customer/main/register.tpl"}

{elseif $main eq "download"}
{include file="modules/Egoods/main.tpl"}

{elseif $main eq "send_to_friend"}
{include file="customer/main/send_to_friend.tpl"}

{elseif $main eq "pages"}
{include file="customer/main/pages.tpl"}

{elseif $main eq "manufacturers_list"}
{include file="modules/Manufacturers/customer_manufacturers_list.tpl"}

{elseif $main eq "manufacturer_products"}
{include file="modules/Manufacturers/customer_manufacturer_products.tpl"}

{elseif $main eq "search"}
{include file="customer/main/search_result.tpl"}

{elseif $main eq "advanced_search"}
{include file="customer/main/search_result.tpl"}

{elseif $main eq "cart"}
{include file="customer/main/cart.tpl"}

{elseif $main eq "comparison" && $active_modules.Feature_Comparison ne ''}
{include file="modules/Feature_Comparison/comparison.tpl"}

{elseif $main eq "choosing" && $active_modules.Feature_Comparison ne ''}
{include file="modules/Feature_Comparison/choosing.tpl"}

{elseif $main eq "wishlist"}
{if $active_modules.Wishlist ne ""}
{include file="modules/Wishlist/wishlist.tpl"}
{/if}

{elseif $main eq "anonymous_checkout"}
{include file="customer/main/anonymous_checkout.tpl"}

{elseif $main eq "order_message"}
{include file="customer/main/order_message.tpl"}

{elseif $main eq "checkout"}
{include file="customer/main/checkout.tpl"}

{elseif $main eq "product"}
{include file="customer/main/product.tpl" product=$product}

{elseif $main eq "giftcert"}
{include file="modules/Gift_Certificates/giftcert.tpl"}

{elseif $main eq "subscriptions"}
{include file="modules/Subscriptions/subscriptions.tpl"}

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

{elseif $main eq "catalog"}
{include file="customer/main/subcategories.tpl" cat=$cat}

{elseif $active_modules.Gift_Registry ne "" and $main eq "giftreg"}
{include file="modules/Gift_Registry/giftreg_common.tpl"}

{elseif $main eq "product_configurator"}
{include file="modules/Product_Configurator/pconf_common.tpl"}

{elseif $main eq "secure_login_form"}
{include file="customer/main/secure_login_form.tpl"}

{elseif $main eq "news_archive"}
{include file="modules/News_Management/news_archive.tpl"}

{elseif $main eq "change_password"}
{include file="customer/main/change_password.tpl"}

{elseif $main eq "customer_offers"}
{include file="modules/Special_Offers/customer/offers.tpl"}

{elseif $main eq "customer_bonuses"}
{include file="modules/Special_Offers/customer/bonuses.tpl"}

{elseif $main eq "newest"}
{include file="customer/main/newest.tpl"}

{else}
{include file="common_templates.tpl"}
{include file="customer/main/welcome.tpl" f_products=$f_products newproducts=$newproducts}

{/if}


shishapipe 01-12-2005 08:10 AM

Also checked shopcart/skin1/customer/main/newest.tpl (x-cart 4.09)

And this is ok, so its got to be something in the shopcart/home.php file

Code:

{* $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 featured="Y"}
{else}
{$lng.txt_no_new}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_new_products content=$smarty.capture.dialog extra="width=100%"}


roccons 01-14-2005 01:17 PM

First of all
thanks for the great mod!
I installed it yesterday and runs pretty well both as a welcome page and as a newest.php linkeable page.
I'm interested in being able to show the result of newest products in several pages.
I know I need to do something related with the products_per_page variable but don't know how or where.
Here is my newest.tpl code:
Code:

{* $Id: newest.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *}
{*sцЁlo si el template es llamado desde newest_display.php muestra la barra location*}
{if $main eq "newest"}
{include file="location.tpl" last_location=$lng.lbl_new_products}
{/if}
{capture name=dialog}
{if $newproducts ne ""}
{include file="customer/main/products.tpl" products=$newproducts}
{else}
{$lng.txt_no_new}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_new_products content=$smarty.capture.dialog extra="width=100%"}

And here is my newest_display.php code:
Code:

<?
//para que pueda presentarse sola
require "./auth.php";
require $xcart_dir."/include/categories.php";
if (!empty($cat))
        require "./products.php";
// set variables
$daterange = 9000000; // (60*60*24=86400)*(nц╨mero de dц╜as) ej. 7 dц╜as = 86400*7 = 604800 unix time
$nowtime = time();
$oldtime = $nowtime - $daterange ;

// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid AND add_date > " . $oldtime . " AND add_date < " . $nowtime . " ORDER BY xcart_products.productID DESC LIMIT 0,12 ";
// change the LIMIT 0,x above to indicate max number of items

// give the product array to smarty to make it available sitewide.
$newproducts = func_query($query);
$smarty->assign("newproducts",$newproducts);
//para que pueda presentarse sola
$smarty->assign("main","newest");
$smarty->display("customer/home.tpl");
?>

Any ideas?
Thanks in advance.


All times are GMT -8. The time now is 11:13 PM.

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