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)
-   -   Replacing "Featured Products" with "Recommend (https://forum.x-cart.com/showthread.php?t=14503)

NightFire 06-15-2006 06:30 AM

Quote:

Originally Posted by xcarter
Hi guys,

I was trying out his mod. Had no luck, then immediately reverted back to my backed up files.

Now I've lost my featured products on my home page!!! Even though I've gone back to my original site with featured products on my home page.


I'm having some trouble here trying to rectify this.

Someone please help.


The featured products are shown from the welcome.tpl file
Check if this line is included into your customer/main/welcome.tpl file:

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

xcarter 06-15-2006 06:35 AM

Thanks for replying.
Yes of course it is there. I just check.

Since I reverted back to the original files as were before I attempted the mod, I can't understand why this is happening.

Any other ideas??
Thanks.

fhiremark 06-16-2006 07:40 AM

looks like a nice mod, i'll have to try it. Thanks for the work.

aflores3 06-18-2006 03:50 PM

excellent mod. thank you for sharing your work. i do have one quick question.
any chance of getting this to only show recommended products when the featured products query returns no results?

chamberinternet 07-31-2006 09:42 AM

great mod ... works well in 4.1.2

only one thing that doesnt show is the price. instead it displays "Enter Your Price" ...

After looking into this it's because the 'taxed_price' field isnt passed to the $randoms smarty variable ..

Any ideas on how i can get this field passed ?

Thanks & Regards

Shafiq :sK

geckoday 07-31-2006 12:45 PM

Quote:

Originally Posted by chamberinternet
great mod ... works well in 4.1.2

only one thing that doesnt show is the price. instead it displays "Enter Your Price" ...

After looking into this it's because the 'taxed_price' field isnt passed to the $randoms smarty variable ..

Any ideas on how i can get this field passed ?

Thanks & Regards

Shafiq :sK


See my post earlier in this thread on how to do this.

http://forum.x-cart.com/viewtopic.php?t=20135&postdays=0&postorder=asc&sta rt=13

chamberinternet 07-31-2006 03:06 PM

Opps ... Missed that ..

Thanks for that :)

Regards

Shafiq :sK

chamberinternet 08-01-2006 02:33 AM

Ok ...

i've tried putting the addtional code in just before the smarty assign ..

but now i get a blank page.. :?

the code i have in random.php is as follows:

// the database query
$query = "SELECT $sql_tbl[products].*, (SELECT MIN($sql_tbl[pricing].price) FROM $sql_tbl[pricing] WHERE $sql_tbl[pricing].productid=$sql_tbl[products].productid AND $sql_tbl[pricing].quantity=1 AND $sql_tbl[pricing].variantid = 0) AS price FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 ORDER BY RAND() LIMIT 6 ";

// give the product array to smarty to make it available sitewide.
$randoms = func_query($query);

if (is_array($randoms) && count($randoms) > 0) {
foreach ($randoms as $k=>$v) {
$randoms[$k]["tmbn_url"] = func_get_thumbnail_url($v["productid"]);
$randoms[$k]["taxes"] = func_get_product_taxes($randoms[$k], $login);
}
}
$smarty->assign("randoms",$randoms);

Can you help ?

Regards

Shafiq :sK

chamberinternet 08-01-2006 03:57 AM

I think i've sorted the issue..

I had to comment the following line:

Quote:

$randoms[$k]["tmbn_url"] = func_get_thumbnail_url($v["productid"]);

The function 'func_get_thumbnail_url' doesnt exist in v4.1.2
(By looking at the /log/x-errors_php-xxxxxx.php file)

The thumbmail still displays and the link to more product details work fine too.

Regards

Shafiq :sK

mffowler 08-01-2006 06:10 PM

This is a beauty in 4.1.2, thanks.

Can anyone get it to be category specific to the current cat. vs. random? The nice thing about this is you can use it for multiple instances. Like a "You Might Also Like..." and a sorta auto-generated cross-selling mod IF it was category specific.

Anyone?

Thanks!

- Mike


All times are GMT -8. The time now is 12:11 AM.

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