X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Display random product (https://forum.x-cart.com/showthread.php?t=12799)

mpj 03-14-2005 10:50 AM

Display random product
 
Is something like this possible?

balinor 03-14-2005 11:11 AM

Depends on where you want it to show. The Recommended products shown on the product page are completely random.

mpj 03-14-2005 12:58 PM

Actually I want to display it on the homepage

skin1>customer>home.tpl

I've tried to random loop produts loop=$products but it doesn't seem to be looping it.


here's what I have added

Code:

{*RANDOM FEATURE ITEM*}

{capture name=menu}
{section name=product loop=$products max=1}
<A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">
[img]{$xcart_web_dir}/thumb/phpthumb.php?src=/product/thumb/t_{$products[product].productid}.jpg&w=70&h=70[/img]
</A>
{/section}
{/capture}
{ include file="menu.tpl" menu_title="Product of the day" menu_content=$smarty.capture.menu }

{*RANDOM FEATURE ITEM*}


mffowler 06-06-2005 03:48 PM

Random products for entire site?
 
I need to randomize all products in all categories. I've looked at the recommends for help, but it just isn't the same relation to the overall products.php.

Has anyone done this? If so, do you have the SQL statement that will give the option in General Settings/Appearance to display randomn products?

Funky has some 3.x code in the forum, but there just doesn't seem to be anything for 4.0.x. In recommends you see $rnd = rand(); and ORDER BY RAND(NOW()+$rnd). Ideas?

Thanks, Mike

Allan Martel 06-10-2005 03:29 PM

I have managed to replace the "Featured Products" with "Recommended Products" on home.php - now 6 products are displayed at random instead of the static "Featured Products"

My next goal would be to make this now display the pricing information and the "Buy Now" button, in 2 rows of 3 products....any help?

Heres what I did:

in skin1/customer/home.tpl, add
Code:

{include file="modules/Recommended_products/recommends.tpl"}
under

Code:

{include file="customer/home_main.tpl"}

In skin1/customer/main/welcome.tpl

remove

Code:

{include file="customer/main/featured.tpl" f_products=$f_products}

and finally, in home.php add:

Code:

if(!empty($active_modules["Recommended_Products"]))
        include "./recommends.php";


under
Code:

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


This was done in 4.0.11

Hope this helps someone!

Allan

mffowler 06-10-2005 03:52 PM

I think that is a good solution and may investigate, but there must be a way to just display all products at random?

Has anyone done this? The main reason we need this is that our providers are soiking their product names to get better display and it's very annoying.

TelaFirma, I know you know how to do this one... ;-)

Thanks, Mike


All times are GMT -8. The time now is 02:57 PM.

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