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

Manufacturer name in from of Product name

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-03-2009, 10:20 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

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

Question Manufacturer name in from of Product name

I need an expert advice on this. I would like to have in all pages {MANUFACTURER NAME} in front of {PRODUCT NAME}.

E.g. ASICS╝ GEL-Nimbus╝ 11 instead of GEL-Nimbus╝ 11.

I can do this editing all tpl files, but it is time consuming. I would like to know in what php file shall I edit to concatenate the product name with manufacturer name.

(product name) = (manufacturer name) . (product name)

X-Cart shows all places product name, and doing this it will be a fast way to put the manufacturer name in front of product name.

Thankx
__________________
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 08-03-2009, 11:20 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Manufacturer name in from of Product name

Don't do this on a live site as I have not tested it

include/func.product.php look for this
Code:
# # Put all product info into $product array #
and insert before the end of this function before
Code:
return $product; }

Code:
$product['product'] = $product['manufacturer'] . " " . $product['product'];
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
am2003 (08-03-2009)
  #3  
Old 08-03-2009, 11:47 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

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

Default Re: Manufacturer name in from of Product name

Quote:
Originally Posted by cflsystems
Don't do this on a live site as I have not tested it

include/func.product.php look for this
Code:
# # Put all product info into $product array #
and insert before the end of this function before
Code:
return $product; }

Code:
$product['product'] = $product['manufacturer'] . " " . $product['product'];

I will follow your advice. But, we have to do a query first to get the manufacturer name in this file. What do you think about?
__________________
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
  #4  
Old 08-03-2009, 12:16 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Manufacturer name in from of Product name

No. Manufacturer name and id are in there already and part of product array
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 08-03-2009, 10:34 PM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

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

Default Re: Manufacturer name in from of Product name

It's not working. Could you please check too?
__________________
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 08-04-2009, 01:35 AM
 
Mark Orbit Mark Orbit is offline
 

Newbie
  
Join Date: May 2009
Posts: 8
 

Default Re: Manufacturer name in from of Product name

I've been looking for a solution to this and tried the above with no success. Is there anything else that we need to do? It would be a really cool mod. Thanks in advance.
__________________
X-Cart Gold version: 4.2.2
Apache version: 2.2.11
PHP version: 5.2.9-2
phpMyAdmin: 3.1.1

MYSQL version: 5.0.51a
Operating system: Windows Vista Ultimate
Reply With Quote
  #7  
Old 08-04-2009, 05:32 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Manufacturer name in from of Product name

This is the code you put in include/func/func.product.php just before "return $product"

Code:
$product["product"] = $product['manufacturer'] . " " . $product['product'];

and it will show just like you want it. If you want to manually show it somewhere in skin1/customer/main/product.tpl you call it like this
Code:
{$product.product}
If you want the product title to be with manufacturer name change the first code like this
Code:
$product["producttitle"] = $product['manufacturer'] . " " . $product['product'];
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 08-04-2009, 05:34 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Manufacturer name in from of Product name

This is the code you put in include/func/func.product.php just before "return $product"

Code:
$product["product"] = $product['manufacturer'] . " " . $product['product'];

and it will show just like you want it. If you want to manually show it somewhere in skin1/customer/main/product.tpl you call it like this
Code:
{$product.product}
If you want the product title to be with manufacturer name change the first code like this
Code:
$product["producttitle"] = $product['manufacturer'] . " " . $product['product'];
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #9  
Old 08-04-2009, 06:08 AM
 
Mark Orbit Mark Orbit is offline
 

Newbie
  
Join Date: May 2009
Posts: 8
 

Default Re: Manufacturer name in from of Product name

Quote:
Originally Posted by cflsystems
This is the code you put in include/func/func.product.php just before "return $product"

Code:
$product["product"] = $product['manufacturer'] . " " . $product['product'];

and it will show just like you want it.

Thanks for your help Steve but isn't this exactly the same as the previous suggestion? (EDIT: I see we have doube quotes now) I have tried it again with no success. I'm on 4.2.2 if that's any help.

Ah... I see it has appeared in the Breadcrumbs. Just the page heading to do now.
__________________
X-Cart Gold version: 4.2.2
Apache version: 2.2.11
PHP version: 5.2.9-2
phpMyAdmin: 3.1.1

MYSQL version: 5.0.51a
Operating system: Windows Vista Ultimate
Reply With Quote
  #10  
Old 08-04-2009, 08:02 AM
 
Mark Orbit Mark Orbit is offline
 

Newbie
  
Join Date: May 2009
Posts: 8
 

Default Re: Manufacturer name in from of Product name

Quote:
Originally Posted by cflsystems
This is the code you put in include/func/func.product.php just before "return $product"

Code:
$product["product"] = $product['manufacturer'] . " " . $product['product'];

Assuming that I am following instructions correctly (and I think I am) then this method does appear to cause problems as it affects the admin area aswell...

What happens in my case is the manufacturer name is added into the 'product name' field in the admin EVERY time you make a saved edit in the admin, so I ultimately end up with 'Gibson Gibson Gibson Les Paul Guitar' after three product edits in the admin.

Ideally, I think a solution should not affect the admin or db and just be added at runtime wherever the product name is called on the front end. Any way to do this?

Thanks again for any help. I'm pretty new to XCart with a fairly big project ahead (customised) and I hope it's going to be a fairly logical process once I get the hang of these damn tpl files
__________________
X-Cart Gold version: 4.2.2
Apache version: 2.2.11
PHP version: 5.2.9-2
phpMyAdmin: 3.1.1

MYSQL version: 5.0.51a
Operating system: Windows Vista Ultimate
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 03:14 PM.

   

 
X-Cart forums © 2001-2020