예제 #1
0
if (!is_array($ref_cats) || !count($ref_cats)) {
    return;
}
foreach ($ref_cats as $cat) {
    $ref_categories[$cat['id_category_ref']] = $cat['id_ebay_category'];
}
$i = 0;
$sql = 'REPLACE INTO `' . _DB_PREFIX_ . 'ebay_category_configuration` (`id_country`, `id_ebay_category`, `id_category`, `percent`, `date_add`, `date_upd`) VALUES ';
if (is_array($category_list) && count($category_list)) {
    /* while categoryList */
    foreach ($category_list as $category) {
        if (!isset($category_config_list[$category['id_category']]) || !$category_config_list[$category['id_category']]['id_ebay_category']) {
            if (isset($product_test[$category['id_category']]) && !empty($product_test[$category['id_category']])) {
                echo $category['id_category'] . '$';
                $id_category_ref_suggested = $ebay_request->getSuggestedCategory($category['name'] . ' ' . $product_test[$category['id_category']]['name']);
                $id_ebay_category_suggested = isset($ref_categories[$id_category_ref_suggested]) ? $ref_categories[$id_category_ref_suggested] : 1;
                if ((int) $id_ebay_category_suggested > 0) {
                    if ($i) {
                        $sql .= ', ';
                    }
                    $sql .= '(8, ' . (int) $id_ebay_category_suggested . ', ' . (int) $category['id_category'] . ', 0, NOW(), NOW()) ';
                    $i++;
                }
            }
        }
    }
    if ($i) {
        Db::getInstance()->execute($sql);
    }
    echo $ebay->l('Settings updated');
}
예제 #2
0
 private static function _getPriceDescriptionStr($price, $price_percent, $id_currency)
 {
     $ebay = new Ebay();
     $price_str = $ebay->l('instead of', 'ebay') . ' <del> %price_original% </del> (' . $ebay->l('promotion of', 'ebay') . ' %percent%%)';
     return str_replace(array('%price_original%', '%percent%'), array(Tools::displayPrice($price, $id_currency), round($price_percent)), $price_str);
 }
예제 #3
0
 public static function getTemplateTabConfiguration($id_ebay_profile)
 {
     $ebay_profile = new EbayProfile($id_ebay_profile);
     $ebay = new Ebay();
     if ($ebay_profile->getConfiguration('EBAY_PRODUCT_TEMPLATE_TITLE') == '') {
         return array('indicator' => 'wrong', 'indicatorBig' => 'wrong', 'message' => $ebay->l('You need to add something in your template title. Use the tags available to personnalize your product title on eBay', 'ebayvalidatortab'));
     }
     if ($ebay_profile->getConfiguration('EBAY_PRODUCT_TEMPLATE_TITLE') == '{TITLE}') {
         return array('indicator' => 'success', 'indicatorBig' => 'mind', 'message' => $ebay->l('You could improve your title template by adding informations about the items', 'ebayvalidatortab'));
     }
     return array('indicator' => 'success');
 }