function otdeAutoKeywords($name, $brand, $category) { $properName = strlen($name) <= 50 ? $name : ''; $maxkeywords = 94 - (strlen($brand) + strlen($properName)); if ($maxkeywords > 64) { $maxkeywords = 64; } //don't send manual keywords to otto.de $keywords = ''; $keywords_name = $properName == '' ? $name : ''; $keywords = addAutoKeywords($keywords, $maxkeywords, $keywords_name, '', ', '); if ($keywords == '') { $keywords = $category; } return $keywords; }
} } } //1) Try to send Propername if Name is short enough //2) Auto generate keywords from Name if it's too long to be sent as Propername //3) Use Category if we have no keywords at all (manually / auto generated) $properName = strlen($p['name']) <= 50 ? $p['name'] : ''; $maxkeywords = 94 - (strlen($brand_id) + strlen($properName)); if ($maxkeywords > 64) { $maxkeywords = 64; } //don't send manual keywords to otto.de //$keywords = $p['keywords']; $keywords = ''; $keywords_name = $properName == '' ? $p['name'] : ''; $keywords = addAutoKeywords($keywords, $maxkeywords, $keywords_name, '', ', '); if ($keywords == '') { $keywords = $product_categories_name[$p['categories_id']]; } $xml_content .= writeXMLline('KeyWord', $keywords, 2); //Product description $p['description'] .= str_replace("\n", '<br>', categoryExtraDescription($p['categories_id'], $sp_detail['languages_id'])); $pd2data = $class_pm->retrieveDetail($p['products_id'], 'pd2'); $desc2_label = $class_pm->description2_label($pd2data['pd2']); $proddesc2 = array(); foreach ($desc2_label as $label => $value) { $proddesc2[] = $label . ': ' . $value; } $p['description'] .= '<br><br>Produktdetails:<br><ul><li>' . implode('</li><li>', $proddesc2) . '</li></ul>'; $html_long_desc = $p['description']; $long_desc = strip_tags(str_replace('<li>', ' ', $html_long_desc));
$content .= '<td>Short Name</td>'; $content .= '<td><input type="text" class="input2" id="shortname-' . $lid . '" name="shortname" value="' . htmlspecialchars($description[$lid]['products_short_name']) . '" maxlength="12" /><br /><span class="smallText notice">* Max 12 chars, will be printed in Amazon Germany EAN Label</span></td>'; $content .= '</tr>'; $content .= '<tr>'; $content .= '<td>Full Name</td>'; $content .= '<td><input type="hidden" name="labelname_split" value="' . $label_name_for_js . '" /><input type="text" name="labelname" value="' . htmlspecialchars($label_name) . '" class="input2 disabled" readonly="readonly" /><br /><span class="smallText notice">* Automatically generated, real time preview</span></td>'; $content .= '</tr>'; $content .= '<tr>'; $content .= '<td>Topic</td>'; $content .= '<td><select id="topicname-' . $lid . '" class="input2">' . loadComboListFromArray($topic, null, $description[$lid]['topic_name']) . '</select></td>'; $content .= '</tr>'; $content .= '<tr>'; $content .= '<td>Collection</td>'; $content .= '<td><input type="text" class="input2" id="colname-' . $lid . '" name="colname" value="' . htmlspecialchars($description[$lid]['collection_name']) . '" /></td>'; $content .= '</tr>'; $auto_keywords_amvd = addAutoKeywords($textarea_keyw_text, 188, $description[$lid]['products_name'], $products_colors[$lid]); $content .= '<tr>'; $content .= '<td>Keywords</td>'; $content .= '<td><input type="text" id="autokw-amvd-' . $lid . '" value="' . htmlspecialchars($auto_keywords_amvd) . '" class="input2 disabled" readonly="readonly" />'; $content .= '<br /><span class="smallText notice">* Might be added with auto keywords or reduced until max limit</span>'; $content .= '</tr>'; $products_selling_points_amde = explode(';', $description[$lid]['products_selling_points_amde']); for ($spt = 0; $spt < 3; $spt++) { $spt_nr = $spt + 1; $content .= '<tr>'; $content .= '<td valign="top">Selling Point ' . $spt_nr . '</td>'; $content .= '<td><input type="text" id="sellingpointamde' . $spt_nr . '-' . $lid . '" class="sellingpoints5 input2" value="' . $products_selling_points_amde[$spt] . '" maxlength="150" /></td>'; $content .= '</tr>'; } $content .= '<tr><td colspan="2"> </td></tr>'; $content .= '<tr><td colspan="2" class="bold">OT.DE Special Description</td></tr>';