Results 1 to 10 of 524

Threaded View

  1. #11
    Join Date
    Dec 2005
    Posts
    1,509
    Plugin Contributions
    6

    Default Re: Export Shipping & Order Information

    Quote Originally Posted by misscotton View Post
    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.
    Last edited by econcepts; 16 May 2009 at 02:01 PM. Reason: clarification
    Eric
    20 Ways to Increase Sales Using Zen Cart
    Zen Cart contribs: Simple Google Analytics, Export Shipping Information

 

 

Similar Threads

  1. Export Shipping+Order Information plugin not exporting some orders
    By woemlavy in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Mar 2013, 02:01 PM
  2. v138a Trouble Installing Export Shipping+Order Information
    By scripto in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 16 Jan 2013, 11:36 PM
  3. Export Shipping/Order Information - dump down to 2 sheets or XML
    By sbbemn in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 4 Oct 2012, 05:37 PM
  4. Export Shipping / Order Information
    By digruk in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 28 Oct 2011, 08:25 PM
  5. Export Shipping Order Information doesn't include downloadable products?
    By rcaroe in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 31 Jul 2010, 05:14 PM

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