Esempio n. 1
0
                        } else {
                            return '';
                        }
                    }
                }
            }
        }
    }
}
function kids($category, $subCategory, $title)
{
    global $leggings, $active, $palazzo, $pants, $printed, $missy, $leather, $fitness, $sublimation, $jeggings, $capri, $skirts, $jogger, $jeans, $harem, $seamless, $shorts, $basic;
    $subCategory = getSubCategory($subCategory, $title);
    $removableChars = array(" ", "_", ":", ";");
    $lstr = trim(strtolower(str_replace($removableChars, "-", $title)));
    if ($subCategory == 'skirt' || $subCategory == 'skirts' || preg_match_all($skirts, $lstr, $matches)) {
        return '/skirt';
    } else {
        if ($subCategory == 'palazzo' || preg_match_all($palazzo, $lstr, $matches)) {
            return '/palazzo';
        } else {
            if ($subCategory == 'leggings' || $subCategory == 'legging' || preg_match_all($leggings, $lstr, $matches)) {
                return '/leggings';
            } else {
                return '';
            }
        }
    }
}
echo getCategoryString('activewear', '', 'Wholesale Womens Activewear leggings');
Esempio n. 2
0
}
$fp = fopen("no1.csv", "a+");
foreach ($data as $value) {
    $imgStr = '';
    $sizeArray = array();
    $packArray = array();
    $category = $value['category'];
    if ($category == 'active-wear') {
        $category = 'activewear';
    }
    $subcategory = $value['subcategory'];
    $tempData = json_decode($value['data'], TRUE);
    /*Get Category String*/
    $category = getCategory($value['category'], $value['subcategory'], $tempData['title'][0]);
    $subCategory = getSubCategory($value['category'], $value['subcategory'], $tempData['title'][0]);
    $categoryStr = getCategoryString($category, $subCategory);
    /*Get dimension*/
    $dimension = getDimensions($category, $subcategory);
    $csvData[$count]['category'] = $category;
    $csvData[$count]['subCategory'] = $subCategory;
    $csvData[$count]['category_str'] = $categoryStr;
    $csvData[$count]['price'] = getSalePrice(str_replace('$', '', trim($tempData['price'])));
    $csvData[$count]['weight'] = $dimension['weight'];
    $csvData[$count]['auctioninc_product_length'] = $dimension['length'];
    $csvData[$count]['auctioninc_product_width'] = $dimension['width'];
    $csvData[$count]['auctioninc_product_height'] = $dimension['height'];
    $csvData[$count++]['prod_url'] = $value['url'];
}
// Writing Header
fputcsv($fp, array_keys($csvData[0]));
foreach ($csvData as $data) {
Esempio n. 3
0
if (file_exists('sng.csv')) {
    unlink('sng.csv');
}
$fp = fopen("sng.csv", "a+");
foreach ($data as $value) {
    $imgStr = '';
    $sizeArray = array();
    $packArray = array();
    $category = $value['category'];
    if ($category == 'active-wear') {
        $category = 'activewear';
    }
    $subcategory = $value['subcategory'];
    $tempData = json_decode($value['data'], TRUE);
    /*Get Category String*/
    $categoryStr = getCategoryString($value['category'], $value['subcategory'], $tempData['title']);
    $temp = explode('/', $categoryStr);
    $category = $temp[0];
    $subcategory = isset($temp[1]) ? $temp[1] : '';
    /*Get dimension*/
    $dimension = getDimensions($category, $subcategory);
    /*Get Sizes*/
    foreach ($tempData['color_size'] as $cdata) {
        $keys = array_keys($cdata['size']);
        foreach ($keys as $k) {
            if ($k == 'sm') {
                array_push($sizeArray, 's/m');
                $packArray['s/m'] = $cdata['size'][$k];
            } else {
                if ($k == 'ml') {
                    array_push($sizeArray, 'm/l');