Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About ZackTim

  • Rank
  1. ZackTim

    issue with array_unique

    What I'm trying to say is: If a Refunded Transfer is Repaid back, then it should be hidden because there will be a new one generated with same Order Id
  2. ZackTim

    issue with array_unique

    @maxxd Forgive me for the confusion, I will explain, take a look at Screenshot1 and Screenshot2. Screenshot1 will show a transfer, Let's do the Refund. ScreenShot2, now we did the refund, do you see how it looks? Imagine this, If you clicked on Refund then the entry is hidden, how would I Repay back? Once I "Repay" it should then Change from "Refunded - Repay" To "Refund", now, this situation works fine if you have only 1 transfer, if you have more than 1, then it will display the previous ones. Is it possible to use array_diff and filter the entries by Order Id
  3. ZackTim

    issue with array_unique

    Thanks @maxxd for your input, however, if you pulled transfers which are not refunded or [ $isRefunded = 0 ] once you hit Refund, it won't show you the refunded transfer to do the repay functionality, that in case if I only want to list transfers that are not refunded but in the other hand, I still need to see the refunded entry so I can do "Repay" and once done, that will disappear and another entry will be generated for the same transfer I originally refunded, you might read this and take a look at the screenshot I attached in my first post.
  4. ZackTim

    issue with array_unique

    Hello, @ginerjm I can't modify any table because each table has a connection with another one, modifying will make things worse. When you click Refund, it will take the transfer out of the seller's wallet back to admin's wallet, now you decided to repay the seller, you click, and you submit. Since a new transfer created, a new entry will be visible in case "again" you wanted to refund it "for some reasons". But I still need to "Hide" those unwanted transfers, If you tried to Repay a "Refunded" transfer, it will just work fine. Anyway to filter the duplication by using Order Id ?
  5. ZackTim

    issue with array_unique

    Hello guys, thanks for your response. Remember we have no idea what $all_transfers_details is. => It's an array that will list all transfers made by admin back to sellers' wallets. array_unique() won't work on multidimensional arrays. Is that what you're working with? => So which function will hide those duplicated entries? wouldn't the best solution be to make it not add those lines? Or maybe it's to add the new line but also remove the old one? => Correct, but how, it works with only 1 transfer, once you refund it, it will only show 1 entry but if there is multiple transfers, it won't work, my code did this perfectly but as I said only for the first transfer, here is the code: $all_transfers_details = array(0=>array_pop($all_transfers_details)); Anyway to influence this code to be applied on all transfers? I assume the data's coming from a database and includes a transaction ID and transaction type, yes? Correct, it's pulled from the DB for sure.
  6. ZackTim

    issue with array_unique

    Hello, I have an array that display transfers, each transfer can be refunded, once done, it will allow you to re-send it back with the help of "Repay" Button, check screenshot. You will notice that at the top,there are 2 refunded transfers, each time a transfer is refunded, a repay button will appear then it will generate a new line with same transfer, in this case transfers from seller1@domain are generated 3 times, (2 times refunded and repaid back) I'm trying to find a way to list only unique transfers instead of these duplicated enteries, I tried array_unique but it will throw an error : Notice: Array to String conversion... Here is my code: if ($all_transfers_details) { if (count($all_transfers_details)>1) { $all_transfers_details = array_unique($all_transfers_details); } If I change the count like >20 or even >100 the error is not thrown, but it won't hide those previously refunded entries.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.