Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. <modules>
  2. <Pricebinc_Shipping>
  3. <version>0.1.0</version>
  4. </Pricebinc_Shipping>
  5. </modules>
  6. <global>
  7. <models>
  8. <shipping>
  9. <class>Pricebinc_Shipping_Model</class>
  10. <resourceModel>shipping_resource</resourceModel>
  11. </shipping>
  12. <shipping_resource>
  13. <class>Pricebinc_Shipping_Model_Resource</class>
  14. <entities>
  15. <shipmentlist>
  16. <table>shipping_shipmentlist</table>
  17. </shipmentlist>
  18. </entities>
  19. </shipping_resource>
  20. </models>
  21. <resources>
  22. <shipping_setup>
  23. <setup>
  24. <module>Pricebinc_Shipping</module>
  25. </setup>
  26. <connection>
  27. <use>core_setup</use>
  28. </connection>
  29. </shipping_setup>
  30. <shipping_write>
  31. <connection>
  32. <use>core_write</use>
  33. </connection>
  34. </shipping_write>
  35. <shipping_read>
  36. <connection>
  37. <use>core_read</use>
  38. </connection>
  39. </shipping_read>
  40. </resources>
  41.  
  42. class Pricebinc_Shipping_Model_Shipmentlist extends Mage_Core_Model_Abstract {
  43.  
  44. public function _construct()
  45. {
  46. parent::_construct();
  47. $this->_init('shipping/shipmentlist');
  48. }
  49. }
  50.  
  51. class Pricebinc_Shipping_Model_Resource_Shipmentlist extends Mage_Core_Model_Resource_Db_Abstract
  52. {
  53. protected function _construct()
  54. {
  55. parent::_construct();
  56. $this->_init('shipping/shipmentlist', 'autoid');
  57. }
  58. }
  59.  
  60. class Pricebinc_Shipping_Model_Resource_Shipmentlist_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
  61. {
  62. protected function _construct()
  63. {
  64. parent::_construct();
  65. $this->_init('shipping/shipmentlist');
  66. }
  67. }
  68.  
  69. public function newAwbAction()
  70. {
  71. $shipcontact = ''.$this->getRequest()->getPost('shipContact');
  72. $shipper = ''.$this->getRequest()->getPost('shipper');
  73. $shipaddr1 = ''.$this->getRequest()->getPost('shipAddr1');
  74. $shipaddr2 = ''.$this->getRequest()->getPost('shipAddr2');
  75.  
  76. $magentoShippingModel = Mage::getModel('shipping/shipmentlist');
  77. $magentoShippingModel->setData('shipContact', $shipcontact);
  78. $magentoShippingModel->setData('shipper', $shipper);
  79. $magentoShippingModel->setData('shipAddr1', $shipaddr1);
  80. $magentoShippingModel->setData('shipAddr2', $shipaddr2);
  81. $magentoShippingModel->save();
  82.  
  83. }
  84.  
  85. class Pricebinc_Shipping_Model_Resource_Shipmentlist extends Mage_Core_Model_Resource_Db_Abstract
  86. {
  87. protected function _construct()
  88. {
  89. $mainTable = 'shipping_shipmentlist'; // check the node in the config.xml
  90. $idFieldName = 'autoid'; // whatever the column is named.
  91. $this->_init($mainTable, $idFieldName);
  92. }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement