Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Location
    Sweden
    Posts
    94
    Plugin Contributions
    4

    help question die in a foreach()

    One of our partners in Payment modules need to have a correct answer on why the die not work. Can someone help me to se the problem or give a good answer.

    foreach($GLOBALS['order_totals'] as $k_global => $v_global)
    {
    $name = strip_tags($v_global['title']);
    die($name);
    }

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: die in a foreach()

    Are you sure you're entering the foreach loop?

    if $GLOBALS['order_totals'] is empty or null, the foreach won't loop.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Sep 2008
    Location
    Sweden
    Posts
    94
    Plugin Contributions
    4

    Default Re: die in a foreach()

    Thanks Swguy. It's not my payment module but they have made lot of bugs so I tried to fix it. It is the most popular card payment module in Sweden so it has to work correct.

    The die part of the code I toke that away and the checkout confirmation was working so you are right about that. But do they need that part that is my own question. Why pick up subtotal, tax and shipping when it is in the checkout page. in the payment service all information is there when I take the die row away. It only print it out or have I wrong? (never use die)

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: die in a foreach()

    It looks like a debugging statement to me; it's certainly not intended for final release (why would you want to stop processing in the middle?).
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Sep 2008
    Location
    Sweden
    Posts
    94
    Plugin Contributions
    4

    Default Re: die in a foreach()

    Yes it look like that so I should look in the older version if it's different and se what to find out on that. Thanks again.

 

 

Similar Threads

  1. Foreach loop not working
    By zc_fan in forum General Questions
    Replies: 5
    Last Post: 10 Oct 2010, 06:46 AM
  2. Die Hard
    By dedrater in forum Installing on a Windows Server
    Replies: 9
    Last Post: 5 Jan 2010, 03:49 AM
  3. Barclays ePDQ Do or Die
    By StephanToth in forum Addon Payment Modules
    Replies: 0
    Last Post: 19 Aug 2006, 04:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR