Jump to content

Where is the product name located in this code snippet, Please see example :)


edwardtilbury

Recommended Posts

I'm trying to customize the google base xml exporter for zen cart to automatically reduce my Product Name / Title to 70 characters or less..  I was able to accomplish this with my test variable $test_name , see the example code below of what I was able to do:

 

 //BOF Edward Custom formatting of product name and title
$badstuff = array('>', '(', ')', 'discount', 'sale', '/');
$test_name = str_ireplace('doctor', 'DR', $test_name);
$test_name = str_ireplace('bill gates', 'Bill', $test_name);
$test_name = str_ireplace($badstuff, "", $test_name);
trim ($test_name);
substr($test_name, 0, 70);
//EOF Edward Custom

 

Now my only problem is inserting the code into the google base xml exporter... I do not understand where the actual product name / title varible is.

 

Here's where I think it exists, but I'm not 100% sure..

$content["title"] = '<title>' . $google_base->google_base_xml_sanitizer($products->fields['products_name'], true) . '</title>';

 

How would I edit the title with my script? In other words, how could I combine the 2?

:)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.