Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <modules>
- <Pricebinc_Shipping>
- <version>0.1.0</version>
- </Pricebinc_Shipping>
- </modules>
- <global>
- <models>
- <shipping>
- <class>Pricebinc_Shipping_Model</class>
- <resourceModel>shipping_resource</resourceModel>
- </shipping>
- <shipping_resource>
- <class>Pricebinc_Shipping_Model_Resource</class>
- <entities>
- <shipmentlist>
- <table>shipping_shipmentlist</table>
- </shipmentlist>
- </entities>
- </shipping_resource>
- </models>
- <resources>
- <shipping_setup>
- <setup>
- <module>Pricebinc_Shipping</module>
- </setup>
- <connection>
- <use>core_setup</use>
- </connection>
- </shipping_setup>
- <shipping_write>
- <connection>
- <use>core_write</use>
- </connection>
- </shipping_write>
- <shipping_read>
- <connection>
- <use>core_read</use>
- </connection>
- </shipping_read>
- </resources>
- class Pricebinc_Shipping_Model_Shipmentlist extends Mage_Core_Model_Abstract {
- public function _construct()
- {
- parent::_construct();
- $this->_init('shipping/shipmentlist');
- }
- }
- class Pricebinc_Shipping_Model_Resource_Shipmentlist extends Mage_Core_Model_Resource_Db_Abstract
- {
- protected function _construct()
- {
- parent::_construct();
- $this->_init('shipping/shipmentlist', 'autoid');
- }
- }
- class Pricebinc_Shipping_Model_Resource_Shipmentlist_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
- {
- protected function _construct()
- {
- parent::_construct();
- $this->_init('shipping/shipmentlist');
- }
- }
- public function newAwbAction()
- {
- $shipcontact = ''.$this->getRequest()->getPost('shipContact');
- $shipper = ''.$this->getRequest()->getPost('shipper');
- $shipaddr1 = ''.$this->getRequest()->getPost('shipAddr1');
- $shipaddr2 = ''.$this->getRequest()->getPost('shipAddr2');
- $magentoShippingModel = Mage::getModel('shipping/shipmentlist');
- $magentoShippingModel->setData('shipContact', $shipcontact);
- $magentoShippingModel->setData('shipper', $shipper);
- $magentoShippingModel->setData('shipAddr1', $shipaddr1);
- $magentoShippingModel->setData('shipAddr2', $shipaddr2);
- $magentoShippingModel->save();
- }
- class Pricebinc_Shipping_Model_Resource_Shipmentlist extends Mage_Core_Model_Resource_Db_Abstract
- {
- protected function _construct()
- {
- $mainTable = 'shipping_shipmentlist'; // check the node in the config.xml
- $idFieldName = 'autoid'; // whatever the column is named.
- $this->_init($mainTable, $idFieldName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement