Re: Export Shipping & Order Information
Quote:
Originally Posted by
misscotton
Hi - i am hoping you can help me here. I am modifying this add on to include a "Product Cost" column to the report. I have it working except I can't quite figure out how I take the value and place it into the new column I created. It is essentially making the same query to the db as what is used for filling the "Products Atrributes" column only I don't need to format the multiple attribute options, i.e. like below where the field I am pulling out of the db is "options_values_price_w":
Code:
$product_attributes_rows="SELECT Count(*) as num_rows
FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
WHERE orders_id = " . $order_details->fields['orders_id'] . "
AND orders_products_id = " . $order_details->fields['orders_products_id'] . "";
$attributes_query_rows = $db->Execute($product_attributes_rows);
$num_rows = $attributes_query_rows->fields['num_rows'];
If ( $num_rows > 0) {
$product_attributes_query="SELECT *
FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
WHERE orders_id = " . $order_details->fields['orders_id'] . "
AND orders_products_id = " . $order_details->fields['orders_products_id'] . "";
$attributes_query_results = $db->Execute($product_attributes_query);
$str_export = $str_export . "\"";
for ($i = 0, $n = $num_rows; $i < $n; $i++) {
$str_export = $str_export . $attributes_query_results->fields['options_values_price_w'] .
$attributes_query_results->MoveNext();
}
$str_export = $str_export . "\"";
}
If I replace this code with what is used to fill the "Product Attributes" column it shows the cost value properly. But I would like both columns displayed - "Products Attributes" and "Product Cost". I added the name of the column successfully like below, but don't know what would make the data go into that column:
Code:
if ($_POST['product_details'] == 1) { // add to header row
if ($_POST['filelayout'] == 2) { // 1 Product Per row RADIO
$str_header = $str_header . ",Product Qty,Products Price,Product Name,Product Model,Product Attributes,Product Cost";
} else { // File layout is 1 OPR
/**************the following exports 1 OPR attribs****************/
$oID = zen_db_prepare_input($order_details->fields['orders_id']);
$oIDME = $order_details->fields['orders_id'];
$order = new order($oID);
for ($i = 0, $n = $max_products; $i < $n; $i++) {
$str_header = $str_header . ",Product " . $i . " Qty";
$str_header = $str_header . ",Product " . $i . " Price";
$str_header = $str_header . ",Product " . $i . " Name";
$str_header = $str_header . ",Product " . $i . " Model";
$str_header = $str_header . ",Product " . $i . " Attributes";
$str_header = $str_header . ",Product " . $i . " Cost";
}
/*****************************************************************/
} // End if to determine which header to use
} // end Row header if product details selected
hope that makes sense - I feel like I am really close to figuring it out, but I am kinda crash coursing learning db and php coding to make this work..any help would be appreciated....thanks
In order to get that to work and keep your current setup correct you'll need to ad a few items.
1) add a new header row column for that new field and don't forget to only show that IF the user chose that option otherwise it will through off the export.
2) Add the exported data to two sections in the program. (a) the section that exports data "one order per row" and (b) to the section that exports data "one product per row".
3) You'll also need to update the query itself to pull that extra field in order to have the "data" to put into the export.
Make a backup file of your current working copy before you change anything so you have a working version.
So you're looking at a number of edit areas to get it to work.
Re: Export Shipping & Order Information
I am getting the same error as everyone else:
Catchable fatal error: Object of class queryFactoryResult could not be converted to string in /home/growligh/public_html/admin/includes/functions/html_output.php on line 262
But when I try to use the updated version of html_output.php I get only the green bar portion of the header in the admin side of the site and this error:
Fatal error: Call to undefined function zen_catalog_href_link() in /home/needgcom/public_html/elocin/includes/header.php on line 219
If I switch back to the core file from the 1.3.7 download then I can access my admin again but still have no export button for this mod.
Any suggestions?
Thanks,
Marc
Re: Export Shipping & Order Information
Hi,
A really interesting contribution.
Please could you show me how to get as default some of the options "on", 1 line for order, discount, etc,... All of them are desable as default.
I want the options we are used to "activate" before do the batch will be activated already when we are on this page in order to save time and human faults.
thanks for your help
Re: Export Shipping & Order Information
Quote:
Originally Posted by
tat2nu
I am getting the same error as everyone else:
Catchable fatal error: Object of class queryFactoryResult could not be converted to string in /home/growligh/public_html/admin/includes/functions/html_output.php on line 262
But when I try to use the updated version of html_output.php I get only the green bar portion of the header in the admin side of the site and this error:
Fatal error: Call to undefined function zen_catalog_href_link() in /home/needgcom/public_html/elocin/includes/header.php on line 219
If I switch back to the core file from the 1.3.7 download then I can access my admin again but still have no export button for this mod.
Any suggestions?
Thanks,
Marc
In shipping_export.php of the root admin folder, on line 543 change the word "orders" to order". You will see your export button after that...
Re: Export Shipping & Order Information
Wow, thanks a lot. The correction showed up on line # 550 in Notepad though not 543. I was able to find it by looking at the last items that did show up on the screen before the error.
Thanks again,
Marc
Re: Export Shipping & Order Information
Quote:
Originally Posted by
tat2nu
Wow, thanks a lot. The correction showed up on line # 550 in Notepad though not 543. I was able to find it by looking at the last items that did show up on the screen before the error.
Thanks again,
Marc
Weird, in DW, its 543...are you using version 1.2.3?
Re: Export Shipping & Order Information
Yeah, it is 1.2.3 not sure why it would be different.
Re: Export Shipping & Order Information
For some reason the "company" field is left blank in the excel output. In the database almost every single order has a company name. I saw one other post with the same problem, but can't find the solution.
I changed the "delivery_company" in admin/shipping_export.php to "customers_company" (on lines 151,441,452,459) just to test the result and the field is still left empty.
Anyone know what's wrong?
Great Contribution by the way.
Thanks.
Re: Export Shipping & Order Information
Quote:
Originally Posted by
AATECH
For some reason the "company" field is left blank in the excel output. In the database almost every single order has a company name. I saw one other post with the same problem, but can't find the solution.
I changed the "delivery_company" in admin/shipping_export.php to "customers_company" (on lines 151,441,452,459) just to test the result and the field is still left empty.
Anyone know what's wrong?
Great Contribution by the way.
Thanks.
Just Tried a different test. When you replace "delivery_suburb" with "delivery_company" in all 7 lines (34,53,152,232,441,452,461) The company name shows up in the "Delivery Suburb" section of the excel output.
So there are 4 instances of "delivery_company" and 7 instances of "delivery_suburb". Is there a reason for this?
Re: Export Shipping & Order Information
Quote:
Originally Posted by
tat2nu
I am getting the same error as everyone else:
Catchable fatal error: Object of class queryFactoryResult could not be converted to string in /home/growligh/public_html/admin/includes/functions/html_output.php on line 262
But when I try to use the updated version of html_output.php I get only the green bar portion of the header in the admin side of the site and this error:
Fatal error: Call to undefined function zen_catalog_href_link() in /home/needgcom/public_html/elocin/includes/header.php on line 219
If I switch back to the core file from the 1.3.7 download then I can access my admin again but still have no export button for this mod.
Any suggestions?
Thanks,
Marc
The "catchable fatal error" message is a zen cart / php compatability issue. Not actually a contribution issue.
The answer to the "catchable error" is found here:
http://www.zencartoptimization.com/2...r-html-output/