Results 1 to 10 of 11

Threaded View

  1. #1
    Join Date
    May 2008
    Location
    United States
    Posts
    490
    Plugin Contributions
    1

    Default How to use MoveNext();

    The below statement works for tracking orders that only have a single tracking number:

    PHP Code:
            $order_number=$_POST['order_number'];
          
    $track_rs $db->Execute("SELECT tracking_number FROM fulfill_tracking WHERE order_number = '" . (int)$order_number "' LIMIT 1");
          if (
    $track_rs ->RecordCount() > 0) {
            
    $track_num $track_rs ->fields['tracking_number'];
            
    header('Location: http://example dot com/' $track_num);
          } else {
          
    $messageStack->add('tracking'ENTRY_ORDER_NUMBER_ERROR3);
          } 
    So basically above code works as follows:

    Customer enters an order number on our tracking page and if that order number exist then the following is executed:
    header('Location: http://example dot com/' . $track_num);

    This is fine for 99% of orders which only ship in one package however I do ship single order sometimes in multiple packages so I will have to account for this in the above statement somehow.

    So if only one result then do what it is doing now, execute the below :
    header('Location: http://example dot com/' . $track_num);

    if more then 1 entry is in the results then show on a separate page or on the tracking page as results something like:

    This order shipped in xx box's:

    Package 1: Click to Track

    Package 2: Click to Track

    Package 3: Click to Track

    Package 4: Click to Track

    Package 5: Click to Track

    Each "Click to Track" needs to be one of the results so for example the five above would be:


    http://customurl.com/[/url]' . $track_num[Result 1]
    http://customurl.com/[/url]' . $track_num[Result 2]
    http://customurl.com/[/url]' . $track_num[Result 3]
    http://customurl.com/[/url]' . $track_num[Result 4]
    http://customurl.com/[/url]' . $track_num[Result 5]

    I have no clue how to properly write this in code, any help would be most appreciated.
    Last edited by marcopolo; 4 Nov 2015 at 02:41 AM.

 

 

Similar Threads

  1. Replies: 14
    Last Post: 12 Apr 2016, 02:47 PM
  2. v139h How to reset an object after using MoveNext()?
    By Cyberkiller in forum General Questions
    Replies: 6
    Last Post: 30 Mar 2012, 05:27 PM
  3. Basic query question with MoveNext
    By delia in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 12 Jan 2010, 05:20 PM
  4. How can I use Multiple mods that use same files?
    By sfklaas in forum General Questions
    Replies: 1
    Last Post: 8 May 2009, 10:27 PM

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