本文整理汇总了PHP中SoapClient::CreateSaleOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::CreateSaleOrder方法的具体用法?PHP SoapClient::CreateSaleOrder怎么用?PHP SoapClient::CreateSaleOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::CreateSaleOrder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: approvedOrderPush
public function approvedOrderPush()
{
$wsdlUrl = "https://zoffio.unicommerce.com/services/soap/uniware16.wsdl";
$wsdllUrl = "http://zoffio.unicommerce.com/services/soap/?version=1.6&facility=01";
$username = "zoff@uni";
$password = "00583d86-b3f9-11e2-9827-1231400462bd";
$soapClient = new SoapClient($wsdlUrl, array('trace' => 1, 'exception' => 0));
$soapClient->__setLocation($wsdllUrl);
$strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$objSoapVarUser = new SoapVar($username, XSD_STRING, NULL, $strWSSENS, "UserName", $strWSSENS);
$objSoapVarPass = new SoapVar($password, XSD_STRING, NULL, $strWSSENS, "Password", $strWSSENS);
$objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass);
$objSoapVarWSSEAuth = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS);
$objWSSEToken = new clsWSSEToken($objSoapVarWSSEAuth);
$objSoapVarWSSEToken = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS);
$objSoapVarHeaderVal = new SoapVar($objSoapVarWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS);
$objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal, true);
$soapClient->__setSoapHeaders(array($objSoapVarWSSEHeader));
$aorders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status', 'approved')->addAttributeToSelect('increment_id');
foreach ($aorders as $aorder) {
$address = array();
$saleorder = array();
$items = array();
$order = Mage::getModel('sales/order')->loadByIncrementId($aorder->getIncrementId());
$incrementId = $order->getIncrementId();
$customer_id = $order->getCustomerId();
$collection = Mage::getModel("customer/customer")->load($customer_id);
$allitems = $order->getAllItems();
$totalqtyordered = $order->getTotalQtyOrdered();
$shippingAmount = $order->getShippingAmount();
$itemshipamt = $shippingAmount / $totalqtyordered;
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
$payment_title = "Payment Method: " . $order->getPayment()->getMethodInstance()->getTitle();
$payment_method_title = $order->getPayment()->getMethodInstance()->getTitle();
if ($payment_method_code == 'checkmo') {
$shipmethodcode = "CHQ";
} else {
$shipmethodcode = "STD";
}
foreach ($allitems as $item) {
$itemQty = (int) $item->getQtyOrdered();
if ($item->getPriceInclTax() > 0) {
for ($i = 0; $i < $itemQty; $i++) {
$icode = $item->getItemId() . $i;
$icode = (int) $icode;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getPriceInclTax() + $itemshipamt - $discountAmt;
$itemSPrice = $item->getPriceInclTax() - $discountAmt;
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => $shipmethodcode, 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $itemshipamt, 'Discount' => $discountAmt, 'PacketNumber' => '1');
}
}
}
$verifypayment = 0;
if ($payment_method_code == 'cashondelivery' || $payment_method_code == 'checkmo') {
$chpmcode = 1;
} else {
$chpmcode = 0;
}
$email = $order->getCustomerEmail();
$billing_address = $order->getBillingAddress();
$billing_name = $billing_address->getName();
$billing_street = $billing_address->getStreet();
$billing_company = $billing_address->getCompany() . ".";
$billing_str = $billing_street[0] . " " . $billing_street[1];
$billing_city = $billing_address->getCity();
$billingregion = Mage::getModel('directory/region')->load($billing_address->getRegionId());
$billing_state = explode("-", $billingregion->getCode());
$billing_Country = $billing_address->getCountryId();
$billing_postcode = $billing_address->getPostcode();
$billing_phone = $billing_address->getTelephone();
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_company, 'AddressLine2' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
$shipping_address = $order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_company = $shipping_address->getCompany() . ".";
$shipping_str = $shipping_street[0] . " " . $shipping_street[1];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_company, 'AddressLine2' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'NotificationEmail' => $email, 'NotificationMobile' => $shipping_phone, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array(array('name' => 'customerId', 'value' => $customer_id), array('name' => 'zoffioPaymentMethod', 'value' => $payment_method_code)))));
$soapClient->CreateSaleOrder($saleorder);
}
}
示例2: explode
}
$shipping_address = $order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_company = $shipping_address->getCompany();
$shipping_str = $shipping_street[0] . " " . $shipping_street[1];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
if ($shipping_address->getCompany() != '') {
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_company, 'AddressLine2' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
} else {
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
}
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'NotificationEmail' => $email, 'NotificationMobile' => $shipping_phone, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array(array('name' => 'customerId', 'value' => $customer_id), array('name' => 'zoffioPaymentMethod', 'value' => $payment_method_code)))));
echo "<pre />";
print_r($saleorder);
echo "<pre>";
$result = $soapClient->CreateSaleOrder($saleorder);
echo "<pre>";
print_r($result);
//print_r($result);
//echo "<td>"; print_r($result);
//echo "</td>";
//echo "</tr>";
//}
//echo "</table>";
//}
示例3: array
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_company, 'AddressLine2' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
$shipping_address = $order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_company = $shipping_address->getCompany() . ".";
$shipping_str = $shipping_street[0] . " " . $shipping_street[1];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
if ($shipping_phone == '') {
$shipping_phone = $shipping_address->getStd() . $shipping_address->getNewTelephoneno();
}
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_company, 'AddressLine2' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
if ($shipping_address->getTelephone() != '') {
$notify_mobile = $shipping_address->getTelephone();
} elseif ($billing_address->getTelephone() != '') {
$notify_mobile = $billing_address->getTelephone();
} else {
$notify_mobile = "";
}
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'NotificationEmail' => $email, 'NotificationMobile' => $notify_mobile, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array(array('name' => 'customerId', 'value' => $customer_id), array('name' => 'zoffioPaymentMethod', 'value' => $payment_method_code)))));
echo "<pre>";
print_r($saleorder);
exit;
$pushdetails = $soapClient->CreateSaleOrder($saleorder);
echo "<pre>";
print_r($pushdetails);
}
示例4: instantAdminOrder
//.........这里部分代码省略.........
$ActQty = $cntbundlefixqty / $parentItemQty;
//$remainQty = $cntbundlefixqty - $remainQty;
if ($item->getPriceInclTax() > 0) {
$itembunInceId = $cntbundlefixqty - $bundlefixqty;
$j = 1;
//for($j=1; $j<=$itemQty; $j++){
for ($i = 1; $i <= $itemQty; $i++) {
//$icode = $item->getItemId().$i;
//$icode = (int)$icode;
//$bundlefixqty = $itembunInceId - $i;
//$icode = $parentItemSku."@".$parentItemId.$remainQty;
$icode = $parentItemId . $j . "-" . $remainQty . "@" . $parentItemSku;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getPriceInclTax() + $myitemshipamt - $discountAmt;
$itemSPrice = $item->getPriceInclTax() - $discountAmt;
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => $shipmethodcode, 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $myitemshipamt, 'Discount' => $discountAmt, 'PacketNumber' => '1');
//$remainQty++;
if ($j == $parentItemQty) {
if ($item->getParentItemId() == $parentItemId) {
if ($remainQty != $cntbundlefixqty) {
$remainQty++;
} else {
$remainQty = 1;
}
}
$j = 1;
} else {
$j++;
}
}
//}
//$remainQty = $j;
}
} else {
$itemQty = (int) $item->getQtyOrdered();
if ($item->getPriceInclTax() > 0) {
for ($i = 1; $i <= $itemQty; $i++) {
$icode = $item->getItemId() . $i;
$icode = (int) $icode;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getPriceInclTax() + $itemshipamt - $discountAmt;
$itemSPrice = $item->getPriceInclTax() - $discountAmt;
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => $shipmethodcode, 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $itemshipamt, 'Discount' => $discountAmt, 'PacketNumber' => '1');
}
}
}
}
$verifypayment = 0;
if ($payment_method_code == 'cashondelivery' || $payment_method_code == 'checkmo') {
$chpmcode = 1;
} else {
$chpmcode = 0;
}
$email = $order->getCustomerEmail();
$billing_address = $order->getBillingAddress();
$billing_name = $billing_address->getName();
$billing_street = $billing_address->getStreet();
$billing_company = $billing_address->getCompany();
$billing_str = $billing_street[0] . " " . $billing_street[1];
$billing_city = $billing_address->getCity();
$billingregion = Mage::getModel('directory/region')->load($billing_address->getRegionId());
$billing_state = explode("-", $billingregion->getCode());
$billing_Country = $billing_address->getCountryId();
$billing_postcode = $billing_address->getPostcode();
$billing_phone = $billing_address->getTelephone();
if ($billing_address->getCompany() != '') {
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_company, 'AddressLine2' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
} else {
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
}
$shipping_address = $order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_company = $shipping_address->getCompany();
$shipping_str = $shipping_street[0] . " " . $shipping_street[1];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
if ($shipping_address->getCompany() != '') {
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_company, 'AddressLine2' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
} else {
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
}
$cFormProvided = '0';
if ($order->getCForm() == 1) {
$cFormProvided = '1';
}
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'NotificationEmail' => $email, 'NotificationMobile' => $shipping_phone, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'CFormProvided' => $cFormProvided, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array(array('name' => 'customerId', 'value' => $customer_id), array('name' => 'zoffioPaymentMethod', 'value' => $payment_method_code)))));
// echo "<pre>";
//print_r($saleorder);
//exit;
$soapClient->CreateSaleOrder($saleorder);
} catch (Exception $e) {
}
}
示例5: instantAdminOrder
public function instantAdminOrder(Varien_Event_Observer $observer)
{
//unicom api details
$wsdlUrl = Mage::getStoreConfig('unicom_options/unigroup/uniurl');
$wsdllUrl = Mage::getStoreConfig('unicom_options/unigroup/unilurl');
$uniUname = Mage::getStoreConfig('unicom_options/unigroup/uniusername');
$uniPass = Mage::getStoreConfig('unicom_options/unigroup/unipass');
echo "qaws";
exit;
$soapClient = new SoapClient($wsdlUrl, array('trace' => 1, 'exception' => 0));
$soapClient->__setLocation($wsdllUrl);
$strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
$objSoapVarUser = new SoapVar($username, XSD_STRING, NULL, $strWSSENS, "UserName", $strWSSENS);
$objSoapVarPass = new SoapVar($password, XSD_STRING, NULL, $strWSSENS, "Password", $strWSSENS);
$objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass);
$objSoapVarWSSEAuth = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS);
$objWSSEToken = new clsWSSEToken($objSoapVarWSSEAuth);
$objSoapVarWSSEToken = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS);
$objSoapVarHeaderVal = new SoapVar($objSoapVarWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS);
$objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal, true);
$soapClient->__setSoapHeaders(array($objSoapVarWSSEHeader));
//$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$lastOrderId = $observer->getOrder()->getId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$incrementId = $order->getIncrementId();
$customer_id = $order->getCustomerId();
$collection = Mage::getModel("customer/customer")->load($customer_id);
$allitems = $order->getAllItems();
$totalqtyordered = $order->getTotalQtyOrdered();
$shippingAmount = $order->getShippingAmount();
$itemshipamt = $shippingAmount / $totalqtyordered;
foreach ($allitems as $item) {
$itemQty = (int) $item->getQtyOrdered();
for ($i = 0; $i < $itemQty; $i++) {
$icode = $item->getItemId() . $i;
$icode = (int) $icode;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getOriginalPrice() + $itemshipamt - $discountAmt;
$itemSPrice = $item->getOriginalPrice();
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => 'STD', 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $itemshipamt, 'Discount' => $discountAmt);
}
}
$payment_method_code = $order->getPayment()->getMethodInstance()->getCode();
$payment_title = "Payment Method: " . $order->getPayment()->getMethodInstance()->getTitle();
$payment_method_title = $order->getPayment()->getMethodInstance()->getTitle();
if ($payment_method_code == 'cashondelivery' || $payment_method_code == 'checkmo') {
$chpmcode = 1;
$verifypayment = 1;
} else {
$chpmcode = 0;
$verifypayment = 0;
}
$verify = $collection->getIsVerified();
if ($verify == 335) {
$paycodes = array("cashondelivery");
$orderCode = $order->getPayment()->getMethodInstance()->getCode();
if (in_array($orderCode, $paycodes)) {
$verifypayment = 0;
}
}
$billing_address = $order->getBillingAddress();
$billing_name = $billing_address->getName();
$billing_street = $billing_address->getStreet();
$billing_str = $billing_street[0];
$billing_city = $billing_address->getCity();
$billingregion = Mage::getModel('directory/region')->load($billing_address->getRegionId());
$billing_state = explode("-", $billingregion->getCode());
$billing_Country = $billing_address->getCountryId();
$billing_postcode = $billing_address->getPostcode();
$billing_phone = $billing_address->getTelephone();
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
$shipping_address = $order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_str = $shipping_street[0];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array('name' => 'customerId', 'value' => $customer_id))));
$soapClient->CreateSaleOrder($saleorder);
}
示例6: _approve
//.........这里部分代码省略.........
}
}
$j = 1;
} else {
$j++;
}
}
}
//exit;
} elseif ($item->getProductType() == "simple" && $item->getParentItemId() != NULL) {
$itemQty = (int) $item->getQtyOrdered();
$ActQty = $cntbundlefixqty / $parentItemQty;
//$remainQty = $cntbundlefixqty - $remainQty;
if ($item->getPriceInclTax() > 0) {
$itembunInceId = $cntbundlefixqty - $bundlefixqty;
$j = 1;
//for($j=1; $j<=$itemQty; $j++){
for ($i = 1; $i <= $itemQty; $i++) {
//$icode = $item->getItemId().$i;
//$icode = (int)$icode;
//$bundlefixqty = $itembunInceId - $i;
//$icode = $parentItemSku."@".$parentItemId.$remainQty;
$icode = $parentItemId . $j . "-" . $remainQty . "@" . $parentItemSku;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getPriceInclTax() + $myitemshipamt - $discountAmt;
$itemSPrice = $item->getPriceInclTax() - $discountAmt;
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => $shipmethodcode, 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $myitemshipamt, 'Discount' => $discountAmt, 'PacketNumber' => '1');
//$remainQty++;
if ($j == $parentItemQty) {
if ($item->getParentItemId() == $parentItemId) {
if ($remainQty != $cntbundlefixqty) {
$remainQty++;
} else {
$remainQty = 1;
}
}
$j = 1;
} else {
$j++;
}
}
//}
//$remainQty = $j;
}
} else {
$itemQty = (int) $item->getQtyOrdered();
if ($item->getPriceInclTax() > 0) {
for ($i = 1; $i <= $itemQty; $i++) {
$icode = $item->getItemId() . $i;
$icode = (int) $icode;
$itemSku = $item->getSku();
$discountAmt = $item->getDiscountAmount() / $itemQty;
$itemTPrice = $item->getPriceInclTax() + $itemshipamt - $discountAmt;
$itemSPrice = $item->getPriceInclTax() - $discountAmt;
$items[] = array('Code' => $icode, 'ItemSKU' => $itemSku, 'ShippingMethodCode' => $shipmethodcode, 'TotalPrice' => $itemTPrice, 'SellingPrice' => $itemSPrice, 'ShippingCharges' => $itemshipamt, 'Discount' => $discountAmt, 'PacketNumber' => '1');
}
}
}
}
$verifypayment = 0;
$verify2 = 1;
$chpmcode = 0;
$email = $_order->getCustomerEmail();
$billing_address = $_order->getBillingAddress();
$billing_name = $billing_address->getName();
$billing_street = $billing_address->getStreet();
$billing_company = $billing_address->getCompany() . ".";
$billing_str = $billing_street[0] . " " . $billing_street[1];
$billing_city = $billing_address->getCity();
$billingregion = Mage::getModel('directory/region')->load($billing_address->getRegionId());
$billing_state = explode("-", $billingregion->getCode());
$billing_Country = $billing_address->getCountryId();
$billing_postcode = $billing_address->getPostcode();
$billing_phone = $billing_address->getTelephone();
$address[] = array('Name' => $billing_name, 'AddressLine1' => $billing_company, 'AddressLine2' => $billing_str, 'City' => $billing_city, 'State' => $billing_state[1], 'Country' => $billing_Country, 'Pincode' => $billing_postcode, 'Phone' => $billing_phone, 'id' => '1');
$shipping_address = $_order->getShippingAddress();
$shipping_name = $shipping_address->getName();
$shipping_street = $shipping_address->getStreet();
$shipping_company = $shipping_address->getCompany() . ".";
$shipping_str = $shipping_street[0] . " " . $shipping_street[1];
$shipping_city = $shipping_address->getCity();
$shippingregion = Mage::getModel('directory/region')->load($shipping_address->getRegionId());
$shipping_state = explode("-", $shippingregion->getCode());
$shipping_Country = $shipping_address->getCountryId();
$shipping_postcode = $shipping_address->getPostcode();
$shipping_phone = $shipping_address->getTelephone();
$address[] = array('Name' => $shipping_name, 'AddressLine1' => $shipping_company, 'AddressLine2' => $shipping_str, 'City' => $shipping_city, 'State' => $shipping_state[1], 'Country' => $shipping_Country, 'Pincode' => $shipping_postcode, 'Phone' => $shipping_phone, 'id' => '2');
$saleorder = array('SaleOrder' => array('Code' => $incrementId, 'DisplayOrderCode' => $incrementId, 'CashOnDelivery' => $chpmcode, 'NotificationEmail' => $email, 'NotificationMobile' => $shipping_phone, 'AdditionalInfo' => $payment_title, 'Addresses' => array('Address' => $address), 'VerificationRequired' => $verifypayment, 'BillingAddress' => array('ref' => '1'), 'ShippingAddress' => array('ref' => '2'), 'SaleOrderItems' => array('SaleOrderItem' => $items), 'CustomFields' => array('CustomField' => array(array('name' => 'customerId', 'value' => $customer_id), array('name' => 'zoffioPaymentMethod', 'value' => $payment_method_code)))));
$soapClient->CreateSaleOrder($saleorder);
}
}
Mage::getSingleton("core/session")->setApproveOrderID($quote->getId());
$this->_redirect('*/order/success', array('orderid' => $incrementId));
//$one_page->getCustomerSession()->setCustomer($me);
Mage::Log('Firstname: ' . $quote_customer_data['firstname'] . 'LastName: ' . $quote_customer_data['lastname'] . 'Email: ' . $quote_customer_data['email']);
//Mage::app()->getResponse()->setRedirect($redirectUrl1);
//$this->_redirect('*/*/approve');
Mage::Log("LEAVE : makeapproveAction");
}