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

Adding Manufacturer name in front of Product name

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-29-2010, 03:37 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #2  
Old 12-29-2010, 04:04 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

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

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 12-30-2010, 05:44 AM
  rogue's Avatar 
rogue rogue is offline
 

X-Adept
  
Join Date: Apr 2007
Location: Loveland, Ohio
Posts: 770
 

Default 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.
__________________
Richard Williams
Rogue Wave Limited

Initial Inventory Imports
Daily Inventory Updates
Daily Inventory Reports
Drop Ship Support
Order Export to Shipper/Supplier
Shopping Feeds That Work
Programming for X-Cart

richard@roguewavelimited.com
http://www.roguewavelimited.com
Reply With Quote

The following user thanks rogue for this useful post:
gb2world (12-30-2010)
  #4  
Old 12-30-2010, 06:46 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #5  
Old 12-30-2010, 10:09 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #6  
Old 12-30-2010, 10:58 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #7  
Old 01-25-2011, 10:05 AM
 
ScrapOrchard ScrapOrchard is offline
 

eXpert
  
Join Date: Mar 2008
Posts: 243
 

Default 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?
__________________
www.scraporchard.com
X-Cart Pro Version 4.5.5

Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters
Gahela: Gahela Support System
The xCart Store: xBanners, xAccess, xMenus
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:56 AM.

   

 
X-Cart forums © 2001-2020