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

Manufacturer Name on Cart Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-25-2008, 12:50 PM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Manufacturer Name on Cart Page

Hi,
I am trying to add the Manufacturer name to the cart.
I am able to add the manufacturer id, but not the name.

Here's the code I am using to add the id number:
{$products[product].manufacturerid}

if I change it to:
{$products[product].manufacturer}
it comes up blank.

This code is within the products loop on the cart page - {section name=product loop=$products}

Any ideas?

Thanks very much for your help,
Jenny
__________________
Version 4.3.2
Reply With Quote
  #2  
Old 08-25-2008, 01:21 PM
  Piotr M.'s Avatar 
Piotr M. Piotr M. is offline
 

Senior Member
  
Join Date: Aug 2008
Posts: 134
 

Default Re: Manufacturer Name on Cart Page

To add manufacturer name do the following. Edit /include/func/func.cart.php

Find function func_products_from_scratch()

there is a line with SQL query beginning with
PHP Code:
$products_array func_query_first("SELECT $sql_tbl[products].* 

Replace it with
PHP Code:
$products_array func_query_first("SELECT $sql_tbl[products].*,$sql_tbl[manufacturers].manufacturer as manufacturer, MIN($sql_tbl[pricing].price) as price, IF($sql_tbl[images_T].id IS NULL, '', 'Y') as is_thumbnail, $sql_tbl[images_T].image_path, $sql_tbl[images_T].image_x, $sql_tbl[images_T].image_y, IF($sql_tbl[images_P].id IS NULL, '', 'P') as is_pimage, $sql_tbl[images_P].image_path as pimage_path, $sql_tbl[images_P].image_x as pimage_x, $sql_tbl[images_P].image_y as pimage_y FROM $sql_tbl[pricing],$sql_tbl[products] LEFT JOIN $sql_tbl[images_T] ON $sql_tbl[images_T].id = $sql_tbl[products].productid LEFT JOIN $sql_tbl[images_P] ON $sql_tbl[images_P].id = $sql_tbl[products].productid LEFT JOIN $sql_tbl[manufacturers] ON $sql_tbl[products].manufacturerid=$sql_tbl[manufacturers].manufacturerid WHERE $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products].forsale != 'N' AND $sql_tbl[products].productid='$productid' AND $avail_condition ".(empty($active_modules['Wholesale_Trading']) ? "$sql_tbl[pricing].quantity = 1" "$sql_tbl[pricing].quantity<='$amount'")." AND $sql_tbl[pricing].membershipid IN('$membershipid', '0') AND $sql_tbl[pricing].variantid = '$variantid' GROUP BY $sql_tbl[products].productid ORDER BY $sql_tbl[pricing].quantity DESC"); 
__________________
Regards,
Piotr Markushin

X-Cart PDF Catalog Generator NEW
Professional X-Cart Skins Store (7 new skins added in August 2008!)

ahedOffice.com - Web 2.0 Online Groupware
Reply With Quote
  #3  
Old 08-25-2008, 01:30 PM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Re: Manufacturer Name on Cart Page

Perfect!
Thanks so much.

Jenny
__________________
Version 4.3.2
Reply With Quote
  #4  
Old 03-03-2009, 09:08 AM
 
animart animart is offline
 

Newbie
  
Join Date: Apr 2008
Posts: 4
 

Default Re: Manufacturer Name on Cart Page

There are 2 lines in 4.1.11 under that function where that code starts. Line 1655 & 1669. Which one or does both need to be modified? The two seem a bit different...

Line 1655:
Code:
$products_array = func_query_first("SELECT $sql_tbl[products].*, MIN($sql_tbl[pricing].price) as price FROM $sql_tbl[pricing],$sql_tbl[products] WHERE $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products].forsale != 'N' AND $sql_tbl[products].productid='$productid' AND $avail_condition ".(empty($active_modules['Wholesale_Trading']) ? "$sql_tbl[pricing].quantity = 1" : "$sql_tbl[pricing].quantity<='$amount'")." AND $sql_tbl[pricing].membershipid IN('$membershipid', '0') AND $sql_tbl[pricing].variantid = '$variantid' GROUP BY $sql_tbl[products].productid ORDER BY $sql_tbl[pricing].quantity DESC");

Line 1669:
Code:
$products_array = func_query_first("SELECT $sql_tbl[products].*, MIN($sql_tbl[pricing].price) as price, $sql_tbl[images_T].image_path, $sql_tbl[images_T].image_x, $sql_tbl[images_T].image_y, IF($sql_tbl[images_P].id IS NULL, '', 'P') as is_pimage, $sql_tbl[images_P].image_path as pimage_path, $sql_tbl[images_P].image_x as pimage_x, $sql_tbl[images_P].image_y as pimage_y FROM $sql_tbl[pricing],$sql_tbl[products] LEFT JOIN $sql_tbl[images_T] ON $sql_tbl[images_T].id = $sql_tbl[products].productid LEFT JOIN $sql_tbl[images_P] ON $sql_tbl[images_P].id = $sql_tbl[products].productid WHERE $sql_tbl[products].productid=$sql_tbl[pricing].productid AND $sql_tbl[products].forsale != 'N' AND $sql_tbl[products].productid='$productid' AND $avail_condition ".(empty($active_modules['Wholesale_Trading']) ? "$sql_tbl[pricing].quantity = 1" : "$sql_tbl[pricing].quantity<='$amount'")." AND $sql_tbl[pricing].membershipid IN('$membershipid', '0') AND $sql_tbl[pricing].variantid = '$variantid' GROUP BY $sql_tbl[products].productid ORDER BY $sql_tbl[pricing].quantity DESC");

Thanks for any help...
__________________
X-Cart Pro 4.1.11
Reply With Quote
  #5  
Old 11-19-2010, 10:46 AM
 
jvolvovski jvolvovski is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 46
 

Default Re: Manufacturer Name on Cart Page

Any idea how to do this in version 4.4.1 for the order page? i'm assuming you would need to change func.order.php

Thanks,
Jenny
__________________
Version 4.3.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 09:55 PM.

   

 
X-Cart forums © 2001-2020