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)
-   -   Adding Manufacturer name in front of Product name (https://forum.x-cart.com/showthread.php?t=57275)

ADDISON 12-29-2010 03:37 AM

Adding Manufacturer name in front of Product name
 
Hi Guys,

I would like to show in Frontend Manufacturer name in front of Product name. In my store Manufacturer name is actually Brand name. One option is to insert [Brand Name + Product Name] when adding a product in Backend. But is not what I would like to do.

Other option is to edit all templates, but this is taking too much time and too many changes. What I would like to do is changing the php file responsible to process the product name all over the script. Is there anyone who knows what php file shall I change?

The idea is to do an sql query before for manufacturer name, then to concatenate with product name and result being product name. Product name is used all over the script, and saving lot of time with changes.

gb2world 12-29-2010 04:04 PM

Re: Adding Manufacturer name in front of Product name
 
I don't think you will find that x-cart is put together that way - being that there is only one query of the products that controls the information on every page in every situation.

I think in 4.4, manufacturerid is already in the query for all the product arrays. I also think there is an array available to every page that is used in the menu that contains all the manufacturers names. If so - you can use smarty to print the name. But that does not help with what you were trying to do - only have to edit one query somewhere to meet your requirement.

Unless - you are willing to run a query on your database after every time you update that would actually change the product name field to add the manufacturer's name.

---

rogue 12-30-2010 05:44 AM

Re: Adding Manufacturer name in front of Product name
 
I think I see what you are trying to do. The code you are looking for is in .../include/func/func.product.php. You should be able to add a couple of lines at the bottom before the product array is returned to modify the product name by adding the manufacturer name as prefix.

The manufacturer name is in $product[manufacturer] I think.

The product name is in $product[product] I think.

ADDISON 12-30-2010 06:46 AM

Re: Adding Manufacturer name in front of Product name
 
I will make a try. If I get the solution I will post it here. Any help before is much appreciated.

If everything goes fine in the first step, we can go further with another step, adding an option in Admin (Store configuration) placing or not manufacturer's name in front of product name.

This feature was requested many years ago. I don't understand why is not implemented by QT.

Quote:

Originally Posted by rogue
I think I see what you are trying to do. The code you are looking for is in .../include/func/func.product.php. You should be able to add a couple of lines at the bottom before the product array is returned to modify the product name by adding the manufacturer name as prefix.

The manufacturer name is in $product[manufacturer] I think.

The product name is in $product[product] I think.


ADDISON 12-30-2010 10:09 AM

Re: Adding Manufacturer name in front of Product name
 
OK here is what I did for product page (v4.4.1) - ../include/func/func.product.php.

Line 1263

Original: $product['producttitle'] = $product['product'];

Replace with this: $product['producttitle'] = $product['manufacturer'] . " ". $product['product'];

New challenges coming, this is available only in product page. If you add the product in cart, the name is without manufacturer name.

I don't understand QT idea to change more php files when we talk important variable like manufacturer name, product name. How simple it was to change the product name only in one file.

ADDISON 12-30-2010 10:58 AM

Re: Adding Manufacturer name in front of Product name
 
Let's go further just for product page with this feature. Execute this SQL query:

INSERT INTO `xcart_config` VALUES ('show_manufacturer_name', 'Show manufacturer name in front of product name', 'N', 'Appearance', 114, 'checkbox', 'N', '', '');

This will add a check box in General Settings -> Appearance -> Show manufacturer name in front ...

In func.product.php line 1263 change to this:

if($config['Appearance']['show_manufacturer_name'] == 'Y')

$product['producttitle'] = $product['manufacturer'] . " ". $product['product'];

else

$product['producttitle'] = $product['product'];

Right now finding solutions to make this available in all places. Once is done everyone can use this feature.

ScrapOrchard 01-25-2011 10:05 AM

Re: Adding Manufacturer name in front of Product name
 
I am working on 4.3.2 and would like to know if it is possible to put the Provider's Company Name next to the product title? If so, what changes need to be made where?


All times are GMT -8. The time now is 09:19 PM.

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