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)
-   -   Manufacturer Name on Cart Page (https://forum.x-cart.com/showthread.php?t=41975)

jvolvovski 08-25-2008 12:50 PM

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

Piotr M. 08-25-2008 01:21 PM

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"); 


jvolvovski 08-25-2008 01:30 PM

Re: Manufacturer Name on Cart Page
 
Perfect!
Thanks so much.

Jenny

animart 03-03-2009 09:08 AM

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...

jvolvovski 11-19-2010 10:46 AM

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


All times are GMT -8. The time now is 12:52 PM.

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