Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. $quote=Mage::getSingleton('checkout/session')->getQuote();
  2.  
  3. $billingAddress=$quote->getBillingAddress()->addData($this->addressData);
  4. $shippingAddress=$quote->getShippingAddress()->addData($this->addressData);
  5. $shippingAddress->setCollectShippingRates(true)->collectShippingRates()
  6. ->setShippingMethod('flatrate_flatrate')
  7. ->setPaymentMethod('checkmo');
  8.  
  9. $quote->getPayment()->importData(array('method' => 'cc','cc_type'=>'visa','cc_number_enc'=>'4111111111111111','cc_owner'=>'Bob Men','cc_last4'=>'5687','cc_exp_month'=>7,'cc_exp_year'=>2020));
  10. $quote->setCustomerIsGuest(true)
  11. ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
  12. $quote->getPayment()->setMethod('ccsaved');
  13. $quote->getPayment()->setCcType('Visa');
  14. $quote->getPayment()->setCcNumber('4111222244445555');
  15. $quote->getPayment()->setCcOwner('Danniel N J klkj');
  16. $quote->getPayment()->setLast4(4242);
  17. $quote->getPayment()->setCcExpMonth(6);
  18. $quote->getPayment()->setCcExpYear(2023);
  19.  
  20.  
  21. $quote->collectTotals()->save();
  22. $quote->save();
  23.  
  24. $service = Mage::getModel('sales/service_quote', $quote);
  25. $service->submitAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement