Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Replacing "Featured Products" with "Recommend

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 06-15-2006, 06:30 AM
  NightFire's Avatar 
NightFire NightFire is offline
 

X-Adept
  
Join Date: Jul 2004
Location: The Netherlands
Posts: 561
 

Default

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}
__________________
Best regards,
Niki Buitenrust Hettema

X-Cart Gold 4.1.8 (Live & Loaded)
Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more...
Reply With Quote
  #22  
Old 06-15-2006, 06:35 AM
 
xcarter xcarter is offline
 

Senior Member
  
Join Date: Sep 2005
Posts: 146
 

Default

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.
__________________
Version 4.1.9
Reply With Quote
  #23  
Old 06-16-2006, 07:40 AM
 
fhiremark fhiremark is offline
 

Advanced Member
  
Join Date: Apr 2006
Location: New York
Posts: 66
 

Default

looks like a nice mod, i'll have to try it. Thanks for the work.
__________________
X-cart GOLD v 4.0.18
Reply With Quote
  #24  
Old 06-18-2006, 03:50 PM
 
aflores3 aflores3 is offline
 

Member
  
Join Date: Dec 2003
Posts: 11
 

Default

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?
Reply With Quote
  #25  
Old 07-31-2006, 09:42 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #26  
Old 07-31-2006, 12:45 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default

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
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #27  
Old 07-31-2006, 03:06 PM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

Opps ... Missed that ..

Thanks for that

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #28  
Old 08-01-2006, 02:33 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #29  
Old 08-01-2006, 03:57 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #30  
Old 08-01-2006, 06:10 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

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
__________________
4.1.9
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 10:13 PM.

   

 
X-Cart forums © 2001-2020