chrometweaks.org

What all do I need to purchase from iPage to build a simple website?

Click Here To View All Answers...


Question I have... What all do I need to purchase from iPage to build a simple website? Looking forward for any answer. My other question... Hello,.

I just want to be able to click a button in the orders section and export all of the orders to a CSV or Excel file or any kind of comma delimmeted file. It should have the payment info, and the item numbers that were ordered..

Does this exist as a contribution? I'm desperately looking for it since it seems like something alot of people would use, but I can't find anything. Anyone know where I can find this?..

Comments (108)

Good question... I dunno what is the answer to that question. I'll do some investigation and get back to you if I find an good answer. You should email the people at iPage as they probably could help you..

Comment #1

I could not find a contribution for this so I got some help and had this put together. This code is in a file called extract_orders.php in the admin folder. The only other thing I did was make a folder called data for the info and put a link to the file in the catalog box. The link to the file is the only change you need to make to the existing code. It only takes orders once and all you do when the csv file comes up is save it to your local drive..

<?php.

/**.

* extract_orders.php.

*.

* This script extracts the orders into a .csv file for download..

*/.

$out_file = 'data/'.time().'.csv';.

Include_once( "includes/application_top.php" );.

?>.

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">.

<html <?php echo HTML_PARAMS; ?>>.

<head>.

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">.

<script language="javascript" src="includes/general.js"></script>.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">.

<? require( DIR_WS_INCLUDES'header.php' ); ?>.

<table border="0" width="100%" cellspacing="2" cellpadding="2">.

<tr>.

<td width="<?php echo BOX_WIDTH; ?>" valign="top">.

<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">.

<? require( DIR_WS_INCLUDES'column_left.php' ); ?>.

</table>.

</td>.

<td width="100%" valign="top">.

<?.

$fp = fopen( $out_file, 'w' );.

$sth = tep_db_query( "SELECT orders.orders_id as id, products.products_model as pid, orders_products.products_name as pname,.

Customers.customers_firstname, customers.customers_lastname,.

Orders.customers_street_address as street_addr, orders.customers_city as city, orders.customers_state as state, orders.customers_postcode as zip, orders_products.products_quantity as qty,.

'new' as idunno, products.products_cost as pprice,.

(orders_products.products_quantity*products.products_cost) as tcost.

FROM orders, customers,.

Orders_products, products WHERE.

Orders_products.orders_id = orders.orders_id AND products.products_id = orders_products.products_id.

AND customers.customers_id = orders.customers_id.

AND orders.exported = 0 ORDER BY orders.orders_id, orders_products.products_name");.

While( $r = tep_db_fetch_array($sth) ) {.

Tep_db_query("UPDATE orders SET exported=1 WHERE orders_id=".$r['id']);.

Unset($r['id']);.

$r['tcost'] = number_format( $r['tcost'], 2, '.', '' );.

$r['pprice'] = number_format( $r['pprice'], 2, '.', '' );.

$string = implode(",",$r)"\n";.

Fputs( $fp, $string );.

}.

Fclose($fp);.

?>.

Export Complete. You can download the file <a href="<?=$out_file?>">here</a>..

</td>.

</tr>.

</table>.

<?php require(DIR_WS_INCLUDES'footer.php'); ?>.

<br>.

</body>.

</html>.

<?php require(DIR_WS_INCLUDES'application_bottom.php'); ?>.

The only thing is I have the margin report contribution so that my cost is included in the report. If you do not have that one you will either need to modify the code, add the contribution or put a field in the data base for your cost..

Hope this helps. I will package it up with directions and add it to the contributions..

Richard..

Comment #2

I had to change the word "cost" to "price".

I am having an error with the orders.exported though. That field does not exist anywhere in my database..

These lines.

Are giving me this error:.

If I # the first and third line, it generates the report, but leaves out the orders_id.

I've tried what I thought would work, but it didn't. This is EXCATLY what I need as I am running a repair program and this will help me track things much more efficiently. Any assistance would be greatly appreciated!..

Comment #3

Does anyone have any suggestions on what I can alter to get the order numbers to show up?.

This function sorts the orders via order number, and I'd like to keep that in there as well. I just have no clue as to what to put in place of.

Orders.exported..

Comment #4

Just change:.

AND orders.exported = 0 ORDER BY orders.orders_id, orders_products.products_name");.

While( $r = tep_db_fetch_array($sth) ) {.

Tep_db_query("UPDATE orders SET exported=1 WHERE orders_id=".$r['id']);.

Tp:.

AND orders.status = 1 ORDER BY orders.orders_id, orders_products.products_name");.

While( $r = tep_db_fetch_array($sth) ) {.

Tep_db_query("UPDATE orders SET status=2 WHERE orders_id=".$r['id']);.

That should fix the problem for you..

-Chris..

Comment #5

Well I thought I posted a response to this yesterday but I noticed this morning that I do not see my post..

I am using cost because I am collecting the info I need to send to my supplier but if you want price instead that would work also..

As far as the order exorted field I forgot to mention that step in my orginal post. This is the field that the script uses to decide whether or not it has already uploaded the info to you so you do not keep getting the same orders over and over. You can add the field by adding the field manually or running this sql command.

ALTER TABLE `orders` ADD `exported` TINYINT( 1 ) DEFAULT '0' NOT NULL;.

Hope this helps.

Richard..

Comment #6

I'm using this as a repair ordering iPage site and having the same orders showing up would be that bad of an idea at all..

What do I need to change to keep it fromnot displaying the orders it's read before?..

Comment #7

You can just follow my advice as listed above. That will take care of it...

Comment #8

Blue,.

Your suggestion still does not display orders.id.

The reason I need to see the order.id, even if I have already exported it to a CSV file before, is that order.id is the RGA number for repairs. The customers will not recive RGA credit until I receive their return item..

Any suggestions on what to delete, add, or change to get it to display all of the information.

Without.

Hiding orders that have been exported?.

Again, I previously exported orders to be written to the CSV file. I'm not new to PHP, but this one, as simple as it looks, has kicked my butt lol. Thanks for the assistance so far, if I can get past this one little hump lol...

Comment #9

To display everything: *untested*.

<?php.

/**.

* extract_orders.php.

*.

* This script extracts the orders into a .csv file for download..

*/.

$out_file = 'data/'.time().'.csv';.

Include_once( "includes/application_top.php" );.

?>.

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">.

<html <?php echo HTML_PARAMS; ?>>.

<head>.

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">.

<title><?php echo TITLE; ?></title>.

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">.

<script language="javascript" src="includes/general.js"></script>.

</head>.

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">.

<? require( DIR_WS_INCLUDES'header.php' ); ?>.

<table border="0" width="100%" cellspacing="2" cellpadding="2">.

<tr>.

<td width="<?php echo BOX_WIDTH; ?>" valign="top">.

<table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">.

<? require( DIR_WS_INCLUDES'column_left.php' ); ?>.

</table>.

</td>.

<td width="100%" valign="top">.

<?.

$fp = fopen( $out_file, 'w' );.

$sth = tep_db_query( "SELECT orders.orders_id as id, products.products_model as pid, orders_products.products_name as pname,.

Customers.customers_firstname, customers.customers_lastname,.

Orders.customers_street_address as street_addr, orders.customers_city as city, orders.customers_state as state, orders.customers_postcode as zip, orders_products.products_quantity as qty,.

'new' as idunno, products.products_cost as pprice,.

(orders_products.products_quantity*products.products_cost) as tcost.

FROM orders, customers,.

Orders_products, products WHERE.

Orders_products.orders_id = orders.orders_id AND products.products_id = orders_products.products_id.

AND customers.customers_id = orders.customers_id.

ORDER BY orders.orders_id, orders_products.products_name");.

While( $r = tep_db_fetch_array($sth) ) {.

$r['tcost'] = number_format( $r['tcost'], 2, '.', '' );.

$r['pprice'] = number_format( $r['pprice'], 2, '.', '' );.

$string = implode(",",$r)"\n";.

Fputs( $fp, $string );.

}.

Fclose($fp);.

?>.

Export Complete. You can download the file <a href="<?=$out_file?>">here</a>..

</td>.

</tr>.

</table>.

<?php require(DIR_WS_INCLUDES'footer.php'); ?>.

<br>.

</body>.

</html>.

<?php require(DIR_WS_INCLUDES'application_bottom.php'); ?>.

HTH,.

-Chris..

Comment #10

Hello,.

I just want to be able to click a button in the orders section and export all of the orders to a CSV or Excel file or any kind of comma delimmeted file. It should have the payment info, and the item numbers that were ordered..

Does this exist as a contribution? I'm desperately looking for it since it seems like something alot of people would use, but I can't find anything. Anyone know where I can find this?..

Comment #11

I just had a customer request this same thing. I'd also be interested...

Comment #12


This question was taken from a support group/message board and re-posted here so others can learn from it.