Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Admin invoice and packing slip


22 replies to this topic

#1 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 08 October 2003, 12:01

I really need some help fast! My store admin 'invoice' and 'packing slip' are not showing the address's on either.
Only the phonenumber and email....

I think this line is what brings it up..

<?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?>

Any ideas?????

#2 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 08 October 2003, 15:03

not even the oscommerce admins / creators can help me??
please, I need this feature back up again.

what does it rely on to work, could I have removed something??

#3 gabi

  • Community Member
  • 44 posts
  • Real Name:Gabriela Serban

Posted 08 October 2003, 19:10

In packingslip under admin you have to have soldto and shipto:

<tr>
            <td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
          </tr>
          <tr>
            <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo $order->customer['telephone']; ?></td>
          </tr>
          <tr>
            <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
          </tr>
        </table></td>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
          </tr>
          <tr>
            <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
          </tr>

The same for order or invoice.Try this. :)

#4 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 25 October 2003, 01:39

I tried the above code but it seems its the same as whats allready there, I replaced it anyway and still nothing there!
Tried ctrl+f5 for a fresh refresh, still nothing.

The customers have deffinetly put their details into the database.
It is ok at calling the phone number, email and payment method....just the
SOLD TO
and
SHIPPING ADDRESS


Please help! Im stalling orders untill I can start printing my invoices again, not fun!!

#5 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 25 October 2003, 01:41

hmm I tried removing the
tep_address_format(
and the ending )

but now it just shows:

SOLD TO:
0Array1

This isnt good at all.

#6 Daemonj

  • Community Member
  • 2,707 posts
  • Real Name:Jim Ekleberry
  • Gender:Male
  • Location:Tennessee USA

Posted 25 October 2003, 01:59

What release (MS1, MS2, CVS [date]) of osCommerce are you using?
"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

#7 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 25 October 2003, 10:42

MS2
not sure about the cvs or anything.

#8 Daemonj

  • Community Member
  • 2,707 posts
  • Real Name:Jim Ekleberry
  • Gender:Male
  • Location:Tennessee USA

Posted 25 October 2003, 14:59

Before the line that looks like:
                <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
add the following:
<?php
  function akoza_debug_var($cText, $xVar) {
    $cText = $SCRIPT_NAME . $cText;
    if (is_array($xVar) || is_object($xVar)) {
      echo "<p>$cText:</p>\n<pre>\n";
      print_r($xVar);
      reset($xVar);
      echo "</pre>\n";
    } else {
      echo "<p>$cText: $xVar</p>\n";
    }
  }
  akoza_debug_var('$order', $order);
?>
to make the whole thing look like:
<?php
  function akoza_debug_var($cText, $xVar) {
    $cText = $SCRIPT_NAME . $cText;
    if (is_array($xVar) || is_object($xVar)) {
      echo "<p>$cText:</p>\n<pre>\n";
      print_r($xVar);
      reset($xVar);
      echo "</pre>\n";
    } else {
      echo "<p>$cText: $xVar</p>\n";
    }
  }
  akoza_debug_var('$order', $order);
?>
                <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
When you view the orders page it will display the contents of the order class. Copy the customer and delivery sections and paste it here.

Edited by Daemonj, 25 October 2003, 15:00.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

#9 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 25 October 2003, 17:23

This is what it came out with...

$order:

order Object
(
    [info] => Array
        (
            [currency] => GBP
            [currency_value] => 1.000000
            [payment_method] => PayPal IPN
            [cc_type] => 
            [cc_owner] => 
            [cc_number] => 
            [cc_expires] => 
            [date_purchased] => 2003-10-24 16:41:47
            [orders_status] => 99999
            [last_modified] => 
        )

    [totals] => Array
        (
            [0] => Array
                (
                    [title] => Sub-Total:
                    [text] => £29.71
                )

            [1] => Array
                (
                    [title] => Table Rate (Best Way):
                    [text] => £0.00
                )

            [2] => Array
                (
                    [title] => Total:
                    [text] => £29.71
                )

        )

    [products] => Array
        (
            [0] => Array
                (
                    [qty] => 1
                    [name] => Motley crue - girls girls girls
                    [model] => 
                    [tax] => 75.0000
                    [price] => 8.9900
                    [final_price] => 8.9900
                    [attributes] => Array
                        (
                            [0] => Array
                                (
                                    [option] => Size
                                    [value] => Xtra Large
                                    [prefix] => 
                                    [price] => 0.0000
                                )

                        )

                )

            [1] => Array
                (
                    [qty] => 1
                    [name] => Aerosmith - Redwing
                    [model] => 
                    [tax] => 75.0000
                    [price] => 7.9900
                    [final_price] => 7.9900
                    [attributes] => Array
                        (
                            [0] => Array
                                (
                                    [option] => Size
                                    [value] => Xtra Large
                                    [prefix] => 
                                    [price] => 0.0000
                                )

                        )

                )

        )

    [customer] => Array
        (
            [name] => xxxxxxxx
            [company] => 
            [street_address] => xxxxxx
            [suburb] => 
            [city] => xxxxxxx
            [postcode] => CA28 6FR
            [state] => 
            [country] => Lincolnshire
            [format_id] => 0
            [telephone] => 01946 592496
            [email_address] => xxxxxxxxxxx
        )

    [delivery] => Array
        (
            [name] => xxxxxxxx
            [company] => 
            [street_address] => xxxxxxxx
            [suburb] => 
            [city] => xxxxxxx
            [postcode] => CA28 6FR
            [state] => 
            [country] => Lincolnshire
            [format_id] => 0
        )

    [billing] => Array
        (
            [name] => xxxxxxxx
            [company] => 
            [street_address] => xxxxxxx
            [suburb] => 
            [city] => xxxxxxxxxx
            [postcode] => CA28 6FR
            [state] => 
            [country] => Lincolnshire
            [format_id] => 0
        )

)

THANKYOU for the help! and I hope this helps you help me!

Edited by DaemonJ to remove customer specific information.

Edited by Daemonj, 26 October 2003, 00:40.


#10 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 25 October 2003, 17:40

While you are waiting for someone with a better understanding of the process to comment, it might help if you replaced $order->customer['format_id'] with '1'. If that produces more but incorrect output, try other numbers from 2-5. Backup first. This is not a fix so much as a debugging tool. Might allow you to print invoices until you can figure out what's really wrong. Please post back with results.

I don't think 0 is a good value for the format_id. Perhaps someone else will have an idea as to why it is not putting the correct value there. Also worth checking the orders table to see if that's what's showing there too.

Good luck,
Matt

#11 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 25 October 2003, 23:55

hmm, I tried from 1- 5 in here

<?php echo tep_address_format($order->customer['[B]HERE[/B]'], 
and also in here
$order->customer, [B]HERE[/B], '', '<br>'); ?>

but still nothing shows up, I know it can get the address's because of the code I put here earlier, its just not diaplsying them....please help, you would not believe how much of a ballbreaker it is keeping swapping from customers -> customer to order _>customer order and then back again if I forgot something....

#12 Daemonj

  • Community Member
  • 2,707 posts
  • Real Name:Jim Ekleberry
  • Gender:Male
  • Location:Tennessee USA

Posted 26 October 2003, 00:37

The problem is indeed because of the format_id being 0. The question now is why do you have a format_id of 0.

That is most likely because Lincolnshire is not a country - more a suburb I would imagine. Now, how did that get to be in the country field?

Edited by Daemonj, 26 October 2003, 00:41.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

#13 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 26 October 2003, 01:35

What I was suggesting was something like tep_address_format(1, blah blah

Replacing the whole $order->customer['format_id'] with the 1. Obviously, it would be better to figure out what is actually wrong. In the DB, do you Lincolnshire as the country as well? Or only here? If it's in the DB, maybe there is a problem in checkout_process.php?

Hth,
Matt

#14 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 26 October 2003, 02:34

the counties are just direct replacements for the countries. Nothing perticularly strange there.

I will try the replacement of the whole thing for 1 - 5

Daemonj, what does the format_id do??

#15 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 26 October 2003, 02:36

problem checkout process;

If you look about 6 posts up I posted something from my page, after inserting some code...this shows the address so it must 'know' its there.

#16 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 26 October 2003, 02:40

ok, I tried the replacing of $order->customer['format_id'] with the 1 so it looked like this:

 <tr>
               <td class="main"><?php echo 1, $order->customer, 1, '', '<br>'); ?></td>

         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo $order->customer['telephone']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
         </tr>
       </table></td>
       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
         </tr>
         <tr>
           <td class="main"><?php echo 1, $order->delivery, 1, '', '<br>'); ?></td>
         </tr>

but it just turns up a blank page...
I also tried it with 2, and still a blank page.

Had 5 more orders today too, this is costing me :'(

Please help me.

PS - Thx admins for aditing the post, but I had made the customer details up anyway ;) But thx ;)

Edited by interbikes, 26 October 2003, 02:42.


#17 Daemonj

  • Community Member
  • 2,707 posts
  • Real Name:Jim Ekleberry
  • Gender:Male
  • Location:Tennessee USA

Posted 26 October 2003, 02:48

Replacing the counties for the countries is what is causing you your problem.

The address_format is determined by the country the address belongs to. Obviously, if the system is not able to find the country (since the country of Lincolnshire does not exist) it will not know how to properly format the address.

In PHPMyAdmin, edit the record for the order in the orders table and set the country to the appropriate value, place Lincolnshire either in the suburb field or add it to the city field, set the address_format_id to the appropriate value (determined by viewing the countries table) and return the orders.php file to its original format and your problem should be resolved.

Each group of countries have a particular layout for the address. The address_format_id determines the layout to use to properly format the address information for display.

Edited by Daemonj, 26 October 2003, 02:51.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

#18 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 26 October 2003, 14:47

If you go here:

http://www.alternateclothing.com/create_account.php

I have only changed the country tables to england counties. So I cannot see why this would make a difference. I still have state in there, and just renamed country to county in the language file, not in the database.
So surely everything is the same??

I have removed the state/suburb tho, would this make a difference??
If needs be I can use this part for the 'how did you find us columb. Regards, peter.

#19 Daemonj

  • Community Member
  • 2,707 posts
  • Real Name:Jim Ekleberry
  • Gender:Male
  • Location:Tennessee USA

Posted 26 October 2003, 16:05

If the county is in the actual country field in the orders table and address_book table, then it will be a problem because the tep_address_format and several other functions are performing country lookups based upon the information contained in the country field.

You would have been better off leaving the suburb field and enabling it and setting the country field to default to your country.

That way the information is in the appropriate fields and your customers do not have to select the country.
"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

#20 interbikes

  • Community Member
  • 352 posts
  • Real Name:interbikes

Posted 26 October 2003, 18:27

Daemonj, on Oct 26 2003, 12:05 PM, said:

If the county is in the actual country field in the orders table and address_book table, then it will be a problem because the tep_address_format and several other functions are performing country lookups based upon the information contained in the country field.

You would have been better off leaving the suburb field and enabling it and setting the country field to default to your country.

That way the information is in the appropriate fields and your customers do not have to select the country.
the counries are still in the countries table tho, I cant see how they make a difference. Its like renaming america to lincolshire.. Its just a name change.

States I deleted from the account registration as they arent needed, could that have done anything??