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
  #11  
Old 08-04-2009, 08:32 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Manufacturer name in from of Product name

In my opinion (take that for what it's worth) I would be VERY careful here... and I would edit the templates. There aren't THAT many templates involved... maybe half a dozen?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #12  
Old 08-04-2009, 08:50 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

Quote:
Originally Posted by Mark Orbit
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

Ok I didn't check to see what is affected but that's not the way to go then. So you can either change the php to export to smarty new variable with this value (that way product array won't be affected, but you still have to change the templates to reflect the new variable) or as carpeperdiem posted - change the templates only, which I think you shoud do. Sorry to mislead you like this
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #13  
Old 08-04-2009, 09:27 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

Steve, if you checked it and it's working please upload your file (include/func.product.php ). I will make a backup and replace with yours. My X-Cart version is 4.2.2.

Hope an expert will see this and solve the mistery
__________________
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
  #14  
Old 08-04-2009, 10:15 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

I didn't keep the changes and my version is 4.2.1
If you insist on changing php files... open xcart_root/product.php find
Code:
$smarty->assign("location", $location);
and add before
Code:
$new_product_title = $product_info['manufacturer'] . " " . $product_info['product']; $smarty->assign("new_product_title", $new_product_title);
This will create a new variable and won't mess up with the product array. Then use it in product templates where you want the new title to appear
Code:
{$new_product_title}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
am2003 (08-04-2009)
  #15  
Old 08-04-2009, 12:30 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

Steve, the last solution is ok to me. Thanks for your support.
__________________
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
  #16  
Old 08-04-2009, 03:04 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 problem
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #17  
Old 08-04-2009, 03:21 PM
 
Mark Orbit Mark Orbit is offline
 

Newbie
  
Join Date: May 2009
Posts: 8
 

Default Re: Manufacturer name in from of Product name

OK thanks for the tips. That seems an option. If you both recommend to edit the templates then I would rather do that option.

In products_list.tpl we currently have:

HTML Code:
{$product.product|escape}

How would I change this to insert the manufacturer name beforehand. I can of course display the manufacturer ID itself by doing this:

HTML Code:
{$product.manufacturerid} {$product.product|escape}

And the following wouldn't work!
HTML Code:
{$product.manufacturer} {$product.product|escape}

I guess that I'm not far away? Thanks.
__________________
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
  #18  
Old 08-04-2009, 03:22 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Manufacturer name in from of Product name

try,

Code:
{$product.manufacturerid|escape}, {$product.product|escape}
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #19  
Old 08-04-2009, 05:09 PM
 
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 carpeperdiem
try,

Code:
{$product.manufacturerid|escape}, {$product.product|escape}

Thanks. That's ok if I want to display the manufacturer ID (1, 2 and so on). How do I modify it to get the actual manufacturer?
__________________
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
  #20  
Old 08-04-2009, 05:18 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Manufacturer name in from of Product name

$product.manufacturer
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
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 11:26 AM.

   

 
X-Cart forums © 2001-2020