Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( !$http->hasPostVariable( 'Products' ) && !$http->postVariable( 'Products' ) )
- {
- //affecte la règle à l'ensemble des produits d'une catégorie
- //récupère stock minmum de la famille de produit sélectionné
- $selectedClasse = ( !is_array( $discountRuleSelectedClasses ) )?$discountRuleSelectedClasses:$discountRuleSelectedClasses[0];
- if( $selectedClasse == -1 )$selectedClasse = 19 ;//use cas indifférent
- $contentObjectList = eZContentObject::fetchSameClassList( $selectedClasse );
- foreach( $contentObjectList as $contentObject )
- {
- if( $contentObject->className() == 'Product' )
- {
- if( is_object( $contentObject ) )
- {
- $dataMap = $contentObject->dataMap();
- if( array_key_exists('quantity', $dataMap) && array_key_exists('quantite_en_commande_client', $dataMap) )
- {
- $quantity = (int)$dataMap['quantity']->toString() - (int)$dataMap['quantite_en_commande_client']->toString() ;
- if( (int)$stockMini <= $quantity )
- {
- $newProductArray[]= $contentObject ;
- }
- else
- {
- $resetProductArray[] = $contentObject ;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement