Created
August 3, 2017 11:38
-
-
Save CB9TOIIIA/b3fb55d4acc0c1cc6a015aafa7db5ca2 to your computer and use it in GitHub Desktop.
Последние заказы и массив по условию JBZoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LastOrders = JBModelOrder::model()->getList(); | |
$allitem = array(); | |
foreach ($LastOrders as $Order) { | |
$order = JBModelOrder::model()->getById($Order->id); | |
$cartItems = $order->getItems(false); | |
foreach ($cartItems as $cartItem) { | |
if ($order->getPaymentStatus()->getName() == 'Оплачен') { | |
if ($cartItem->item_name == $item->name) { | |
$allitem[] = $cartItem->item_name; | |
} | |
} | |
} | |
} | |
if (NULL != $allitem) { | |
echo count($allitem) . ' шт. купонов уже купили'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment