Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. function getDesignerCollection()
  2. {
  3. $user_home = new USER();
  4. require_once '../../app/Mage.php';
  5.  
  6. Mage::app();
  7. $i = 0;
  8.  
  9. foreach($order as $orderData)
  10. {
  11. $orderitems = $orderData['dproduct_id'];
  12. $orderitemsarray = explode(",", $orderitems);
  13. $k = 0;
  14.  
  15. while ($k < count($orderitemsarray))
  16. {
  17.  
  18. if ($orderitemsarray[$k] != '0')
  19. {
  20. $stmtorders = $user_home->runQuery("SELECT * FROM order_details");
  21. $stmtorders->execute(array(
  22. ":dorder_id" => $orderData['entity_id']
  23. ));
  24. $roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);
  25.  
  26. if ($roworders['dproduct_id'] == '')
  27. {
  28. $dorderStatus = "Unpaid";
  29. }
  30. else
  31. {
  32. $dorderStatus = $roworders['dpaid_status'];
  33. }
  34.  
  35. $responce[] = array(
  36. $orderData->getIncrementId() ,
  37. $orderData->getIncrementId() ,
  38. $orderitemsarray[$k],
  39. $dorderStatus
  40. );
  41. }
  42.  
  43. $k++;
  44. $i++;
  45. }
  46. }
  47.  
  48. echo json_encode($responce);
  49. }
  50.  
  51. while ($roworders = $stmtorders->fetch(PDO::FETCH_ASSOC))
  52. {
  53. if ($roworders['dproduct_id'] == '')
  54. {
  55. $dorderStatus = "Unpaid";
  56. }
  57. else
  58. {
  59. $dorderStatus = $roworders['dpaid_status'];
  60. }
  61. }
  62.  
  63. while ($roworders = $stmtorders->fetch(PDO::FETCH_ASSOC))
  64. {
  65. if ($roworders['dproduct_id'] == '')
  66. {
  67. $dorderStatus = "Unpaid"; }
  68. else
  69. {
  70. $dorderStatus = $roworders['dpaid_status'];
  71. }
  72. $responce[] = array( $dorderStatus );
  73. }
  74. $k++;
  75. $i++;
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement