Example #1
0
require_once '../../com_virtuemart/ajax/acl.php';
require_once "../../com_importer/ajax/lib.php";
ajaxACL(__FILE__, array('administrator', 'super administrator'));
$pdo = STN::getPDO();
$results = $pdo->query("\n\tSELECT *\n\t\tFROM `stn_matchup_results`\n\t\tWHERE `import_status` = 'Y' AND `dup_field` != 'no'\n\t;\n");
$rowCount = $results->rowCount();
include_once "{$mosConfig_absolute_path}/administrator/components/com_virtuemart/virtuemart.cfg.php";
$error = array();
$errorSkus = array();
$alreadyImported = array();
$markImported = $pdo->prepare("\n\tUPDATE `stn_matchup_results`\n\t\tSET `import_status`='AI'\n\t\tWHERE `ID`=:id\n\t;\n");
STN::depend('ProductDataProvider');
$processedSkus = array();
try {
    belongsToGroup($_SESSION, 'super administrator');
    $provider = getProvider('STN');
    $categories = $provider->getCategories();
    $unImportable = array();
    $importedCount = 0;
    foreach ($results->fetchAll(PDO::FETCH_ASSOC) as $importable) {
        $sku = $importable['stn_sku_match'];
        if (empty($sku)) {
            $error[] = 'No import candidate for item number: ' . $importable['POSItemNumber'] . ' missing SKU.';
            continue;
        }
        if (productExistsLocally($sku, STN::getPDO())) {
            $alreadyImported[] = $sku;
            $importCount += 1;
            continue;
        }
        try {
Example #2
0
<?php

// Get list of all users or one in particualr if the id is given
include_once '../include/headers.php';
include_once '../include/dbutils.php';
include_once '../include/main.php';
include_once 'domain/providers.php';
db_connect();
$expand = isset($_GET['expand']) ? $_GET['expand'] : null;
$clothId = isset($_GET['clothId']) ? $_GET['clothId'] : null;
$country = isset($_GET['country']) ? $_GET['country'] : 'ARG';
if (isset($_GET['id'])) {
    $value = getProvider($_GET['id']);
} else {
    $value = getProviders($clothId, $expand);
}
//return JSON array
exit(json_encode($value));