Zen Cart Logo
Forums / Contribution-Writing Guidelines / Need help customizing the Sage contrib

Need help customizing the Sage contrib

Locked

Views: 1,991

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
29 Jan 2009, 11:21 AM
#1
kylef avatar

kylef

New Zenner

Join Date:
Jan 2009
Posts:
2
Plugin Contributions:
0

Need help customizing the Sage contrib

Hi

I've already customized Sage Line 50 Integration contribution,
but I need to do some more work on it.

What I'm trying to do is to get the shipping information / cost out when I export and I got that working, but when there is more than one product in an order the shipping cost is added for every product. I know why it does it, but I don't have any solution for it.

You will see the problem in the code I'll list.
And don't mind that the code is very untidy :P

$shipping_q = "SELECT * 
 FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL ." ot
 WHERE o.orders_status <= $statustosages AND date_purchased >= $datestart AND date_purchased <= $dateend
 AND ot.class = 'ot_shipping'
 AND ot.orders_id = $orderid ";

$shipping_query = $db->Execute($shipping_q);

$saleprice = $Orderedproduct->fields["final_price"];


		$output_prod["Sales_Price"]=number_format ($saleprice, 2, '.', '') . ";";
		$output_prod["quantity"]= $Orderedproduct->fields['products_quantity'] . "\r\n";

$prodprice=$prodprice*$Orderedproduct->fields['products_quantity'];
$totprice = $prodprice+$totprice;
	
	
		

$Orderedproduct->MoveNext();

		$output_ship["ShippingID"] = $shipping_query->fields['orders_id'] . ";";
		$output_ship["ShippingModell"] =  "Frakt;";
		$output_ship["ShippingDesc"] =  "Frakt;";
		$output_ship["ShippingCost"] = $shipping_query->fields['value'] . ";";
		$output_ship["Shippingquantity"]= "1 \r\n";

		$output = array_merge($output_prod, $output_ship);
		zen_sages_fwrite($output);
}															//6