Exemplo n.º 1
0
 function overrideReset($products_articles_id, $products_use_elements_id)
 {
     tep_db_query("DELETE FROM `products_articles_use_elements` WHERE products_articles_id = {$products_articles_id} AND products_use_elements_id = {$products_use_elements_id}");
     use_class('products_family');
     $class_pf = new products_family();
     $class_pf->refreshFamilyMatchKey(null, $products_articles_id);
 }
Exemplo n.º 2
0
 function finalizeProduct($products_id, $username)
 {
     use_class('products_family');
     $obj_family = new products_family(null, $products_id);
     $obj_family->refreshFamilyMatchKey($products_id);
     $sda = array();
     $sda['finalized_time'] = time();
     $sda['finalized_by'] = $username;
     tep_db_perform('designs_products', $sda, 'update', "products_id={$products_id}");
 }
       $success++;
   }
}
echo "<h3>TOTAL FAMILY RECALC FOR TOTAL MEMBERS = $success</h3>";
* 
*/
///*
//UPDATE FAMILY SEARCH KEY
use_class('products_articles');
use_class('products_family');
$class_pf = new products_family();
$class_pa = new products_articles();
$dbq = tep_db_query("SELECT products_id FROM products WHERE active_status = 1 AND products_id < 55072 ORDER BY products_id DESC");
$success = 0;
while ($r = tep_db_fetch_array($dbq)) {
    $pid = $r['products_id'];
    $key = $class_pf->refreshFamilyMatchKey($pid);
    echo "Key {$key} added to {$pid}\n";
    $success++;
    $articles = $class_pa->retrieveList($pid);
    foreach ($articles as $article) {
        $aid = $article['products_articles_id'];
        $key = $class_pf->refreshFamilyMatchKey($pid, $aid);
        echo "Key {$key} added to {$pid}-{$aid}\n";
        $success++;
    }
    unset($articles);
}
echo "<h3>TOTAL FAMILY KEY ADDED TO PRODUCTS = {$success}</h3>";
// *
// */
Exemplo n.º 4
0
 function refreshProductDataSupport($data)
 {
     //MUST UPDATES AFTER ADD-UPDATE-DELETE ELEMENTS
     $pid = $data['pid'];
     use_class('jng_sp_catalog_params');
     $class_jcp = new jng_sp_catalog_params();
     $class_jcp->setParams($pid, 'M');
     $this->calculateMaterialExpenses($pid);
     if ($data['contain_stones']) {
         $this->calculateStoneTotal($pid);
     }
     $this->updateComplexity($pid);
     $this->setSellingPointToProducts($pid);
     use_class('products_family');
     $family = new products_family();
     $family->refreshFamilyMatchKey($pid);
 }