ich habe folgendes Code in checkout_success.php hinzugefügt , mit dem Code werden eingenschaften die 0 sind ausgeblendet , falls alle Eigenschaften eines Artikels ausvekauft sind , wird der Artikel inaktiv gesetzt, im checkout_success.php nach dem
PHP-Code:
$GLOBALS['breadcrumb']->add(NAVBAR_TITLE_2_CHECKOUT_SUCCESS);
folgendes hinzufügen
PHP-Code:
///////////////// following Code will delete Sizes which their quantities are 0 //////
$getemptysizes="SELECT products_properties_combis_id, products_id FROM `products_properties_combis` WHERE combi_quantity='0.0000'";
$doemptysizes = xtc_db_query($getemptysizes);
if(!$doemptysizes )
{
die('Could not Select Size: ' . mysql_error());
}
while($zerorows = mysql_fetch_array($doemptysizes, MYSQL_ASSOC)){
$theppcombiid=$zerorows['products_properties_combis_id'];
$theproductid=$zerorows['products_id'];
$deletesize="DELETE FROM `products_properties_combis` WHERE products_properties_combis_id=$theppcombiid";
$dodeletesize = xtc_db_query($deletesize);
$pidexist="SELECT * FROM `products_properties_combis` WHERE products_id=$theproductid";
$dopidexist = xtc_db_query($pidexist);
$counttheproduct=mysql_affected_rows();
if ($counttheproduct==0){
$updatepstatus="UPDATE `products` SET products_status=0 WHERE products_id=$theproductid";
$dotheupdate = xtc_db_query($updatepstatus);
}
}
////////////// FINISH ////////////////