Version Notes
--
Download this release
Release Info
| Developer | DHL Vertriebs GmbH |
| Extension | DHL_MeinPaket2 |
| Version | 2.0.15 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.10 to 2.0.15
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/Backlog/Product/Grid.php +5 -2
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/CategoryImport/Import.php +0 -1
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/CategoryImport/Index.php +5 -8
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/LeftMenu.php +0 -2
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/OrderImport/Index.php +5 -8
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/ProductExport/Index.php +0 -2
- app/code/community/Dhl/MeinPaket/Block/Adminhtml/Steps.php +0 -2
- app/code/community/Dhl/MeinPaket/Block/Checkout/Abort.php +0 -12
- app/code/community/Dhl/MeinPaket/Block/Checkout/Error.php +0 -12
- app/code/community/Dhl/MeinPaket/Block/Checkout/Success.php +0 -12
- app/code/community/Dhl/MeinPaket/Helper/Cron.php +2 -2
- app/code/community/Dhl/MeinPaket/Helper/Data.php +3 -4
- app/code/community/Dhl/MeinPaket/Helper/Order.php +0 -1
- app/code/community/Dhl/MeinPaket/Helper/Product.php +2 -2
- app/code/community/Dhl/MeinPaket/Helper/Shipment.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Async.php +0 -7
- app/code/community/Dhl/MeinPaket/Model/Category.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Cron.php +0 -52
- app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Frontend/LabelTranslation.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Source/Taxclass.php +1 -1
- app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Source/Taxrate.php +1 -1
- app/code/community/Dhl/MeinPaket/Model/Exception/InvalidDataException.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Exception/MissingDataException.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Async.php +0 -11
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Async/Collection.php +0 -11
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Category.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Category/Collection.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Log.php +0 -11
- app/code/community/Dhl/MeinPaket/Model/Mysql4/Log/Collection.php +0 -11
- app/code/community/Dhl/MeinPaket/Model/Observer.php +8 -534
- app/code/community/Dhl/MeinPaket/Model/Payment/Method/Meinpaket.php +8 -1
- app/code/community/Dhl/MeinPaket/Model/Resource/Eav/Mysql4/Setup.php +13 -81
- app/code/community/Dhl/MeinPaket/Model/Service/Async.php +0 -52
- app/code/community/Dhl/MeinPaket/Model/Service/MarketplaceCategoryImport/ImportService.php +5 -7
- app/code/community/Dhl/MeinPaket/Model/Service/MarketplaceCategoryImport/Result.php +1 -2
- app/code/community/Dhl/MeinPaket/Model/Service/Order/CancellationService.php +0 -85
- app/code/community/Dhl/MeinPaket/Model/Service/Order/ShipmentExportService.php +0 -71
- app/code/community/Dhl/MeinPaket/Model/Service/Product/Export.php +63 -52
- app/code/community/Dhl/MeinPaket/Model/Service/Product/Export/Exception/InvalidEan.php +0 -1
- app/code/community/Dhl/MeinPaket/Model/Service/ProductData/RequestService.php +4 -4
- app/code/community/Dhl/MeinPaket/Model/Service/Result/Abstract.php +1 -1
- app/code/community/Dhl/MeinPaket/Model/Service/Result/Upload.php +1 -1
- app/code/community/Dhl/MeinPaket/Model/Validation/ValidatorFactory.php +0 -76
- app/code/community/Dhl/MeinPaket/Model/Xml/Request/QueryRequest.php +0 -72
- app/code/community/Dhl/MeinPaket/Model/Xml/Request/SubmitCartRequest.php +0 -32
- app/code/community/Dhl/MeinPaket/Model/Xml/Response/QueryResponse.php +0 -34
- app/code/community/Dhl/MeinPaket/Model/Xml/XmlRequestFactory.php +0 -548
- app/code/community/Dhl/MeinPaket/Model/Xml/XmlResponseParser.php +0 -58
- app/code/community/Dhl/MeinPaket/controllers/Adminhtml/CategoryImportController.php +0 -2
- app/code/community/Dhl/MeinPaket/controllers/Adminhtml/ProductExportController.php +0 -2
- app/code/community/Dhl/MeinPaket/etc/adminhtml.xml +5 -27
- app/code/community/Dhl/MeinPaket/etc/config.xml +25 -145
- app/code/community/Dhl/MeinPaket/etc/system.xml +27 -248
- app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-install-1.0.0.php +2 -54
- app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-upgrade-1.0.0-1.1.0.php +1 -68
- app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-upgrade-1.1.0-2.0.0.php +1 -39
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Async.php +4 -4
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Async/Grid.php +11 -11
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Log.php +4 -4
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Log/Grid.php +12 -19
- app/code/community/Dhl/MeinPaketCommon/Helper/Address.php +51 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Attribute.php +16 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Cron.php +68 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Data.php +128 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Order.php +21 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Product.php +330 -0
- app/code/community/Dhl/MeinPaketCommon/Helper/Shipment.php +39 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Async.php +7 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Carrier/Meinpaket.php +6 -6
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/BadHttpReturnCodeException.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/HttpException.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/HttpTimeoutException.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/XmlOverHttp.php +28 -21
- app/code/community/Dhl/MeinPaketCommon/Model/Cron.php +71 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Entity/Attribute/Source/Carrier.php +51 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Exception/InvalidDataException.php +72 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Exception/MissingDataException.php +25 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Log.php +2 -2
- app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Async.php +11 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Async/Collection.php +11 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Log.php +11 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Log/Collection.php +11 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Observer.php +536 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Payment/Method/Meinpaket.php +29 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Resource/Eav/Mysql4/Setup.php +53 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Abstract.php +1 -1
- app/code/community/Dhl/MeinPaketCommon/Model/Service/Async.php +55 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Service/Order/CancellationService.php +85 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/CancellationService/Result.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/ImportService.php +91 -46
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/RefundExportService.php +11 -11
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/RefundExportService/Result.php +1 -2
- app/code/community/Dhl/MeinPaketCommon/Model/Service/Order/ShipmentExportService.php +65 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/ShipmentExportService/Result.php +3 -4
- app/code/community/Dhl/MeinPaketCommon/Model/Service/Result/Abstract.php +63 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Service/Result/Upload.php +13 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/System/MemoryLimiter.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidationInterface.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/CDATAContent.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/Ean.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/IntGreaterZero.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/NonEmptyString.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/StringMaxLength.php +2 -3
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/Url.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidatorChain.php +4 -5
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidatorInterface.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/AbstractXmlPartial.php +12 -13
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/AbstractXmlRequest.php +5 -6
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/InvalidXmlException.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/AsynchronousStatusRequest.php +15 -13
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/DataRequest.php +3 -3
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/DownloadRequest.php +1 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/NotificationRequest.php +1 -2
- app/code/community/Dhl/MeinPaketCommon/Model/Xml/Request/QueryRequest.php +142 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Xml/Request/SubmitCartRequest.php +173 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/UploadRequest.php +30 -15
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Abstract.php +2 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/AsynchronousStatusResponse.php +13 -12
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/DataResponse.php +8 -8
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/DownloadResponse.php +4 -4
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/NotificationResponse.php +2 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Address.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Attribute.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Category.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/CategoryId.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/BestPrice.php +1 -3
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/Confirmation.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/MerchantData.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/ProductData.php +1 -3
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/QuotaData.php +1 -3
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Confirmation.php +6 -9
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Consignment.php +2 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Credit.php +2 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Return.php +2 -2
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order.php +9 -12
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order/ContactData.php +1 -4
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order/Entry.php +1 -4
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/ProductId.php +1 -1
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/VariantConfiguration.php +2 -2
- app/code/community/Dhl/MeinPaketCommon/Model/Xml/Response/QueryResponse.php +98 -0
- app/code/community/Dhl/MeinPaketCommon/Model/Xml/Response/SubmitCartResponse.php +26 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/UploadResponse.php +7 -7
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/XmlBuildException.php +1 -2
- app/code/community/Dhl/MeinPaketCommon/Model/Xml/XmlResponseParser.php +58 -0
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/AsyncController.php +8 -8
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/LogController.php +14 -15
- app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/OrderImportController.php +7 -4
- app/code/community/Dhl/MeinPaketCommon/etc/adminhtml.xml +40 -0
- app/code/community/Dhl/MeinPaketCommon/etc/config.xml +225 -0
- app/code/community/Dhl/MeinPaketCommon/etc/system.xml +277 -0
- app/code/community/Dhl/MeinPaketCommon/sql/meinpaketcommon_setup/mysql4-install-1.0.0.php +106 -0
- app/code/community/Dhl/Postpay/Block/Checkout.php +71 -0
- app/code/community/Dhl/Postpay/Block/Payment/Form/Standard.php +15 -0
- app/code/community/Dhl/Postpay/Block/Payment/Info/Standard.php +6 -0
- app/code/community/Dhl/Postpay/Helper/Cron.php +68 -0
- app/code/community/Dhl/Postpay/Helper/Data.php +14 -0
- app/code/community/Dhl/Postpay/Model/Cart.php +50 -0
- app/code/community/Dhl/Postpay/Model/Cron.php +29 -0
- app/code/community/Dhl/Postpay/Model/Mysql4/Cart.php +11 -0
- app/code/community/Dhl/Postpay/Model/Mysql4/Cart/Collection.php +11 -0
- app/code/community/Dhl/Postpay/Model/Observer.php +12 -0
- app/code/community/Dhl/Postpay/Model/Payment/Method/Express.php +73 -0
- app/code/community/Dhl/Postpay/Model/Payment/Method/Standard.php +165 -0
- app/code/community/Dhl/Postpay/Model/Resource/Eav/Mysql4/Setup.php +11 -0
- app/code/community/Dhl/Postpay/Model/Service/Order/ImportService.php +154 -0
- app/code/community/Dhl/Postpay/controllers/CheckoutController.php +46 -0
- app/code/community/Dhl/Postpay/controllers/NotificationController.php +40 -0
- app/code/community/Dhl/Postpay/controllers/ResponseController.php +51 -0
- app/code/community/Dhl/Postpay/etc/config.xml +128 -0
- app/code/community/Dhl/Postpay/etc/system.xml +46 -0
- app/code/community/Dhl/Postpay/sql/postpay_setup/mysql4-install-1.0.0.php +24 -0
- app/design/adminhtml/default/default/layout/meinpaket.xml +0 -35
- app/design/adminhtml/default/default/layout/meinpaketcommon.xml +38 -0
- app/design/adminhtml/default/default/layout/postpay.xml +3 -0
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit.phtml +0 -23
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/attributes.phtml +0 -21
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/mapping.phtml +0 -36
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/valuemapping.phtml +0 -41
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/editform.phtml +0 -15
- app/design/adminhtml/default/default/template/meinpaket/Attributemapping/index.phtml +0 -19
- app/design/adminhtml/default/default/template/meinpaket/CategoryImport/import.phtml +0 -121
- app/design/adminhtml/default/default/template/meinpaket/CategoryImport/index.phtml +0 -47
- app/design/adminhtml/default/default/template/meinpaket/OrderImport/import.phtml +0 -38
- app/design/adminhtml/default/default/template/meinpaket/OrderImport/index.phtml +0 -76
- app/design/adminhtml/default/default/template/meinpaket/ProductExport/empty.phtml +0 -35
- app/design/adminhtml/default/default/template/meinpaket/ProductExport/export.phtml +0 -213
- app/design/adminhtml/default/default/template/meinpaket/ProductExport/index.phtml +0 -52
- app/design/adminhtml/default/default/template/meinpaket/ProductExport/list.phtml +0 -32
- app/design/adminhtml/default/default/template/meinpaket/category/import/import.phtml +4 -4
- app/design/adminhtml/default/default/template/meinpaket/category_import/import.phtml +0 -121
- app/design/adminhtml/default/default/template/meinpaket/category_import/index.phtml +0 -47
- app/design/adminhtml/default/default/template/meinpaket/productexport.phtml +0 -29
- app/design/frontend/base/default/layout/meinpaketcommon.xml +3 -0
- app/design/frontend/base/default/layout/postpay.xml +21 -0
- app/design/frontend/base/default/template/dhl/meinpaket/checkout/abort.phtml +0 -6
- app/design/frontend/base/default/template/dhl/meinpaket/checkout/cartbutton.phtml +0 -19
- app/design/frontend/base/default/template/dhl/meinpaket/checkout/error.phtml +0 -2
- app/design/frontend/base/default/template/dhl/meinpaket/checkout/sidebarbutton.phtml +0 -21
- app/design/frontend/base/default/template/dhl/meinpaket/checkout/success.phtml +0 -2
- app/design/frontend/base/default/template/postpay/checkout.phtml +20 -0
- app/design/frontend/base/default/template/postpay/checkout/image.phtml +3 -0
- app/design/frontend/base/default/template/postpay/payment/redirect.phtml +8 -0
- app/etc/modules/Dhl_MeinPaket.xml +3 -0
- app/etc/modules/Dhl_MeinPaketCommon.xml +14 -0
- app/etc/modules/Dhl_Postpay.xml +13 -0
- app/locale/de_DE/Dhl_MeinPaketCommon.csv +183 -0
- app/locale/de_DE/Dhl_Postpay.csv +183 -0
- package.xml +5 -5
- shell/dhlmeinpaket-category-import.php +0 -1
- shell/dhlmeinpaket-order-import.php +5 -6
- shell/dhlmeinpaket-product-export.php +0 -1
- shell/dhlmeinpaket-request-bestprice.php +0 -1
- skin/adminhtml/default/default/meinpaket/attributemapping.js +0 -192
- skin/adminhtml/default/default/meinpaket/common.css +0 -1
- skin/adminhtml/default/default/meinpaket/common.js +0 -1
- skin/adminhtml/default/default/meinpaket/images/1.png +0 -0
- skin/adminhtml/default/default/meinpaket/images/2.png +0 -0
- skin/adminhtml/default/default/meinpaket/images/3.png +0 -0
- skin/adminhtml/default/default/meinpaket/images/Thumbs.db +0 -0
- skin/adminhtml/default/default/meinpaket/images/dhl_logo_kl.gif +0 -0
- skin/adminhtml/default/default/meinpaket/images/loader.gif +0 -0
- skin/adminhtml/default/default/meinpaket/images/meinpaket_logo.png +0 -0
- skin/adminhtml/default/default/meinpaket/images/shadowtopbg.png +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/1.png +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/2.png +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/3.png +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/dhl_logo_kl.gif +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/loader.gif +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/meinpaket_logo.png +0 -0
- skin/adminhtml/default/default/meinpaketcommon/images/shadowtopbg.png +0 -0
- skin/adminhtml/default/default/{meinpaket → meinpaketcommon}/module.css +0 -0
- skin/adminhtml/default/default/{meinpaket → meinpaketcommon}/module.js +0 -0
- skin/frontend/default/default/meinpaket/images/dhl_checkout_button.png +0 -0
app/code/community/Dhl/MeinPaket/Block/Adminhtml/Backlog/Product/Grid.php
CHANGED
|
@@ -9,7 +9,10 @@ class Dhl_MeinPaket_Block_Adminhtml_Backlog_Product_Grid extends Mage_Adminhtml_
|
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
$collection->getSelect ()->joinLeft ( array (
|
| 14 |
'product_table' => $collection->getTable ( 'catalog/product' )
|
| 15 |
), 'main_table.product_id=product_table.entity_id', array (
|
|
@@ -30,7 +33,7 @@ class Dhl_MeinPaket_Block_Adminhtml_Backlog_Product_Grid extends Mage_Adminhtml_
|
|
| 30 |
'type' => 'number',
|
| 31 |
'index' => 'product_id'
|
| 32 |
) );
|
| 33 |
-
|
| 34 |
$this->addColumn ( 'sku', array (
|
| 35 |
'header' => Mage::helper ( 'meinpaket' )->__ ( 'SKU' ),
|
| 36 |
'index' => 'sku'
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
+
/* @var $model Dhl_MeinPaket_Model_Backlog_Product */
|
| 13 |
+
$model = Mage::getModel ( 'meinpaket/backlog_product' );
|
| 14 |
+
/* @var $collection Dhl_MeinPaket_Model_Mysql4_Backlog_Product_Collection */
|
| 15 |
+
$collection = $model->getCollection ();
|
| 16 |
$collection->getSelect ()->joinLeft ( array (
|
| 17 |
'product_table' => $collection->getTable ( 'catalog/product' )
|
| 18 |
), 'main_table.product_id=product_table.entity_id', array (
|
| 33 |
'type' => 'number',
|
| 34 |
'index' => 'product_id'
|
| 35 |
) );
|
| 36 |
+
|
| 37 |
$this->addColumn ( 'sku', array (
|
| 38 |
'header' => Mage::helper ( 'meinpaket' )->__ ( 'SKU' ),
|
| 39 |
'index' => 'sku'
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/CategoryImport/Import.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_CategoryImport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Import extends Mage_Adminhtml_Block_Template {
|
| 13 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_CategoryImport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Import extends Mage_Adminhtml_Block_Template {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/CategoryImport/Index.php
CHANGED
|
@@ -7,17 +7,14 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_CategoryImport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Index extends Mage_Adminhtml_Block_Template
|
| 13 |
-
{
|
| 14 |
/**
|
| 15 |
* Constructor.
|
| 16 |
-
*
|
| 17 |
* @return void
|
| 18 |
*/
|
| 19 |
-
public function __construct()
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
}
|
| 23 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_CategoryImport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Index extends Mage_Adminhtml_Block_Template {
|
|
|
|
| 12 |
/**
|
| 13 |
* Constructor.
|
| 14 |
+
*
|
| 15 |
* @return void
|
| 16 |
*/
|
| 17 |
+
public function __construct() {
|
| 18 |
+
parent::__construct ();
|
| 19 |
+
}
|
|
|
|
| 20 |
}
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/LeftMenu.php
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Block_Adminhtml_Leftmenu extends Mage_Adminhtml_Block_Template {
|
| 14 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Block_Adminhtml_Leftmenu extends Mage_Adminhtml_Block_Template {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/OrderImport/Index.php
CHANGED
|
@@ -7,17 +7,14 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_OrderImport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class Dhl_MeinPaket_Block_Adminhtml_OrderImport_Index extends Mage_Adminhtml_Block_Template
|
| 13 |
-
{
|
| 14 |
/**
|
| 15 |
* Constructor.
|
| 16 |
-
*
|
| 17 |
* @return void
|
| 18 |
*/
|
| 19 |
-
public function __construct()
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
}
|
| 23 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_OrderImport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaket_Block_Adminhtml_OrderImport_Index extends Mage_Adminhtml_Block_Template {
|
|
|
|
| 12 |
/**
|
| 13 |
* Constructor.
|
| 14 |
+
*
|
| 15 |
* @return void
|
| 16 |
*/
|
| 17 |
+
public function __construct() {
|
| 18 |
+
parent::__construct ();
|
| 19 |
+
}
|
|
|
|
| 20 |
}
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/ProductExport/Index.php
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_ProductExport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Block_Adminhtml_ProductExport_Index extends Mage_Adminhtml_Block_Template {
|
| 14 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml_ProductExport
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Block_Adminhtml_ProductExport_Index extends Mage_Adminhtml_Block_Template {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Block/Adminhtml/Steps.php
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Block_Adminhtml_Steps extends Mage_Adminhtml_Block_Template {
|
| 14 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Block_Adminhtml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Block_Adminhtml_Steps extends Mage_Adminhtml_Block_Template {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Block/Checkout/Abort.php
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Block template for aborted external checkout with MeinPaket
|
| 4 |
-
*
|
| 5 |
-
* @category Dhl
|
| 6 |
-
* @package Dhl_MeinPaket
|
| 7 |
-
* @subpackage Dhl_MeinPaket_Block_Checkout
|
| 8 |
-
* @version $Id$
|
| 9 |
-
* @author Andreas Demmer <andreas.demmer@aoemedia.de>
|
| 10 |
-
*/
|
| 11 |
-
class Dhl_MeinPaket_Block_Checkout_Abort extends Mage_Core_Block_Template {
|
| 12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Block/Checkout/Error.php
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Block template for error while external checkout with MeinPaket
|
| 4 |
-
*
|
| 5 |
-
* @category Dhl
|
| 6 |
-
* @package Dhl_MeinPaket
|
| 7 |
-
* @subpackage Dhl_MeinPaket_Block_Checkout
|
| 8 |
-
* @version $Id$
|
| 9 |
-
* @author Andreas Demmer <andreas.demmer@aoemedia.de>
|
| 10 |
-
*/
|
| 11 |
-
class Dhl_MeinPaket_Block_Checkout_Error extends Mage_Core_Block_Template {
|
| 12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Block/Checkout/Success.php
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* Block template for successful external checkout with MeinPaket
|
| 4 |
-
*
|
| 5 |
-
* @category Dhl
|
| 6 |
-
* @package Dhl_MeinPaket
|
| 7 |
-
* @subpackage Dhl_MeinPaket_Block_Checkout
|
| 8 |
-
* @version $Id$
|
| 9 |
-
* @author Andreas Demmer <andreas.demmer@aoemedia.de>
|
| 10 |
-
*/
|
| 11 |
-
class Dhl_MeinPaket_Block_Checkout_Success extends Mage_Core_Block_Template {
|
| 12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Helper/Cron.php
CHANGED
|
@@ -45,10 +45,10 @@ class Dhl_MeinPaket_Helper_Cron extends Mage_Core_Helper_Abstract {
|
|
| 45 |
$res = Mage::getSingleton ( 'meinpaket/service_product_export' )->exportProducts ();
|
| 46 |
break;
|
| 47 |
case Dhl_MeinPaket_Model_Cron::SYNC_ORDERS :
|
| 48 |
-
$res = Mage::getSingleton ( '
|
| 49 |
break;
|
| 50 |
case Dhl_MeinPaket_Model_Cron::SYNC_ASYNC :
|
| 51 |
-
$res = Mage::getSingleton ( '
|
| 52 |
break;
|
| 53 |
}
|
| 54 |
|
| 45 |
$res = Mage::getSingleton ( 'meinpaket/service_product_export' )->exportProducts ();
|
| 46 |
break;
|
| 47 |
case Dhl_MeinPaket_Model_Cron::SYNC_ORDERS :
|
| 48 |
+
$res = Mage::getSingleton ( 'meinpaketcommon/service_order_importService' )->importOrders ();
|
| 49 |
break;
|
| 50 |
case Dhl_MeinPaket_Model_Cron::SYNC_ASYNC :
|
| 51 |
+
$res = Mage::getSingleton ( 'meinpaketcommon/service_async' )->process ();
|
| 52 |
break;
|
| 53 |
}
|
| 54 |
|
app/code/community/Dhl/MeinPaket/Helper/Data.php
CHANGED
|
@@ -6,7 +6,6 @@
|
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Helper
|
| 9 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 12 |
/**
|
|
@@ -59,12 +58,12 @@ class Dhl_MeinPaket_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
| 59 |
|
| 60 |
return $labelProperty;
|
| 61 |
}
|
| 62 |
-
const STORE_VIEW_CONFIG = 'meinpaket/store/view';
|
| 63 |
-
private $_meinpaketStore = null;
|
| 64 |
-
private $_meinpaketRootCategory = null;
|
| 65 |
public function getExtensionVersion() {
|
| 66 |
return ( string ) Mage::getConfig ()->getModuleConfig ( 'Dhl_MeinPaket' )->version;
|
| 67 |
}
|
|
|
|
|
|
|
|
|
|
| 68 |
public function getMeinPaketStore() {
|
| 69 |
if ($this->_meinpaketStore == null) {
|
| 70 |
$this->_meinpaketStore = Mage::app ()->getStore ( Mage::getStoreConfig ( self::STORE_VIEW_CONFIG ) );
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Helper
|
|
|
|
| 9 |
*/
|
| 10 |
class Dhl_MeinPaket_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 11 |
/**
|
| 58 |
|
| 59 |
return $labelProperty;
|
| 60 |
}
|
|
|
|
|
|
|
|
|
|
| 61 |
public function getExtensionVersion() {
|
| 62 |
return ( string ) Mage::getConfig ()->getModuleConfig ( 'Dhl_MeinPaket' )->version;
|
| 63 |
}
|
| 64 |
+
const STORE_VIEW_CONFIG = 'meinpaket/store/view';
|
| 65 |
+
private $_meinpaketStore = null;
|
| 66 |
+
private $_meinpaketRootCategory = null;
|
| 67 |
public function getMeinPaketStore() {
|
| 68 |
if ($this->_meinpaketStore == null) {
|
| 69 |
$this->_meinpaketStore = Mage::app ()->getStore ( Mage::getStoreConfig ( self::STORE_VIEW_CONFIG ) );
|
app/code/community/Dhl/MeinPaket/Helper/Order.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Util
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Helper_Order extends Mage_Core_Helper_Abstract {
|
| 13 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Util
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Helper_Order extends Mage_Core_Helper_Abstract {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Helper/Product.php
CHANGED
|
@@ -30,7 +30,7 @@ class Dhl_MeinPaket_Helper_Product extends Mage_Core_Helper_Abstract {
|
|
| 30 |
* @return void
|
| 31 |
*/
|
| 32 |
public function __construct() {
|
| 33 |
-
$this->_eanValidator = Mage::getSingleton ( '
|
| 34 |
}
|
| 35 |
|
| 36 |
/**
|
|
@@ -52,7 +52,7 @@ class Dhl_MeinPaket_Helper_Product extends Mage_Core_Helper_Abstract {
|
|
| 52 |
public function getEan(Mage_Catalog_Model_Product $product) {
|
| 53 |
$eanAttributeCode = Mage::getStoreConfig ( 'meinpaket/product_attributes/ean_attribute' );
|
| 54 |
|
| 55 |
-
if (! empty ( $eanAttributeCode ) && $product->hasData($eanAttributeCode)) {
|
| 56 |
return $product->getData ( $eanAttributeCode );
|
| 57 |
} else {
|
| 58 |
return null;
|
| 30 |
* @return void
|
| 31 |
*/
|
| 32 |
public function __construct() {
|
| 33 |
+
$this->_eanValidator = Mage::getSingleton ( 'meinpaketcommon/validation_validator_ean' );
|
| 34 |
}
|
| 35 |
|
| 36 |
/**
|
| 52 |
public function getEan(Mage_Catalog_Model_Product $product) {
|
| 53 |
$eanAttributeCode = Mage::getStoreConfig ( 'meinpaket/product_attributes/ean_attribute' );
|
| 54 |
|
| 55 |
+
if (! empty ( $eanAttributeCode ) && $product->hasData ( $eanAttributeCode ) && $this->_eanValidator->isValid ( $product->getData ( $eanAttributeCode ) )) {
|
| 56 |
return $product->getData ( $eanAttributeCode );
|
| 57 |
} else {
|
| 58 |
return null;
|
app/code/community/Dhl/MeinPaket/Helper/Shipment.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Util
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Helper_Shipment extends Mage_Core_Helper_Abstract {
|
| 13 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Util
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Helper_Shipment extends Mage_Core_Helper_Abstract {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Async.php
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Async extends Mage_Core_Model_Abstract {
|
| 3 |
-
public function _construct() {
|
| 4 |
-
parent::_construct ();
|
| 5 |
-
$this->_init ( 'meinpaket/async' );
|
| 6 |
-
}
|
| 7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Category.php
CHANGED
|
@@ -5,7 +5,6 @@
|
|
| 5 |
*
|
| 6 |
* @category Mage
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 9 |
*/
|
| 10 |
class Dhl_MeinPaket_Model_Category extends Mage_Core_Model_Abstract {
|
| 11 |
/**
|
| 5 |
*
|
| 6 |
* @category Mage
|
| 7 |
* @package Dhl_MeinPaket
|
|
|
|
| 8 |
*/
|
| 9 |
class Dhl_MeinPaket_Model_Category extends Mage_Core_Model_Abstract {
|
| 10 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Cron.php
CHANGED
|
@@ -31,34 +31,6 @@ class Dhl_MeinPaket_Model_Cron {
|
|
| 31 |
return null;
|
| 32 |
}
|
| 33 |
|
| 34 |
-
/**
|
| 35 |
-
* Called to download orders.
|
| 36 |
-
*
|
| 37 |
-
* @return NULL
|
| 38 |
-
*/
|
| 39 |
-
public function importOrders() {
|
| 40 |
-
try {
|
| 41 |
-
return Mage::getSingleton ( 'meinpaket/service_order_importService' )->importOrders ();
|
| 42 |
-
} catch ( Exception $e ) {
|
| 43 |
-
Mage::logException ( $e );
|
| 44 |
-
}
|
| 45 |
-
return null;
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
/**
|
| 49 |
-
* Called to download responses for async requests.
|
| 50 |
-
*
|
| 51 |
-
* @return NULL
|
| 52 |
-
*/
|
| 53 |
-
public function processAsyncTasks() {
|
| 54 |
-
try {
|
| 55 |
-
return Mage::getSingleton ( 'meinpaket/service_async' )->process ();
|
| 56 |
-
} catch ( Exception $e ) {
|
| 57 |
-
Mage::logException ( $e );
|
| 58 |
-
}
|
| 59 |
-
return null;
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
/**
|
| 63 |
* Called to request best prices.
|
| 64 |
*
|
|
@@ -72,28 +44,4 @@ class Dhl_MeinPaket_Model_Cron {
|
|
| 72 |
}
|
| 73 |
return null;
|
| 74 |
}
|
| 75 |
-
|
| 76 |
-
/**
|
| 77 |
-
* Called to request best prices.
|
| 78 |
-
*
|
| 79 |
-
* @return NULL
|
| 80 |
-
*/
|
| 81 |
-
public function cleanup() {
|
| 82 |
-
try {
|
| 83 |
-
// Delete all log entries older than 40 days
|
| 84 |
-
$date = Zend_Date::now ();
|
| 85 |
-
$date->subDay ( 40 );
|
| 86 |
-
|
| 87 |
-
$logCollection = Mage::getModel ( 'meinpaket/log' )->getCollection ();
|
| 88 |
-
$logCollection->addFieldToFilter ( 'createdAt', array (
|
| 89 |
-
'to' => $date->toString ( 'YYYY-MM-dd' )
|
| 90 |
-
) );
|
| 91 |
-
foreach ( $logCollection as $log ) {
|
| 92 |
-
$log->delete ();
|
| 93 |
-
}
|
| 94 |
-
} catch ( Exception $e ) {
|
| 95 |
-
Mage::logException ( $e );
|
| 96 |
-
}
|
| 97 |
-
return null;
|
| 98 |
-
}
|
| 99 |
}
|
| 31 |
return null;
|
| 32 |
}
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
/**
|
| 35 |
* Called to request best prices.
|
| 36 |
*
|
| 44 |
}
|
| 45 |
return null;
|
| 46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Frontend/LabelTranslation.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Entity_Attribute_Frontend
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Model_Entity_Attribute_Frontend_LabelTranslation extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract {
|
| 13 |
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Entity_Attribute_Frontend
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Model_Entity_Attribute_Frontend_LabelTranslation extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract {
|
| 12 |
|
app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Source/Taxclass.php
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
* @subpackage Model_Entity_Attribute_Source
|
| 10 |
* @version $Id$
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* returns tax classes from database
|
| 15 |
*
|
| 9 |
* @subpackage Model_Entity_Attribute_Source
|
| 10 |
* @version $Id$
|
| 11 |
*/
|
| 12 |
+
class Dhl_MeinPaket_Model_Entity_Attribute_Source_Taxclass extends Mage_Eav_Model_Entity_Attribute_Abstract {
|
| 13 |
/**
|
| 14 |
* returns tax classes from database
|
| 15 |
*
|
app/code/community/Dhl/MeinPaket/Model/Entity/Attribute/Source/Taxrate.php
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
* @subpackage Model_Entity_Attribute_Source
|
| 10 |
* @version $Id$
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* returns tax rates from database
|
| 15 |
*
|
| 9 |
* @subpackage Model_Entity_Attribute_Source
|
| 10 |
* @version $Id$
|
| 11 |
*/
|
| 12 |
+
class Dhl_MeinPaket_Model_Entity_Attribute_Source_Taxrate extends Mage_Eav_Model_Entity_Attribute_Abstract {
|
| 13 |
/**
|
| 14 |
* returns tax rates from database
|
| 15 |
*
|
app/code/community/Dhl/MeinPaket/Model/Exception/InvalidDataException.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Exception
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Model_Exception_InvalidDataException extends Varien_Exception {
|
| 13 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Exception
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Model_Exception_InvalidDataException extends Varien_Exception {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Exception/MissingDataException.php
CHANGED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Exception
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Model_Exception_MissingDataException extends Dhl_MeinPaket_Model_Exception_InvalidDataException {
|
| 13 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Exception
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Model_Exception_MissingDataException extends Dhl_MeinPaket_Model_Exception_InvalidDataException {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Async.php
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Mysql4_Async extends Mage_Core_Model_Mysql4_Abstract {
|
| 3 |
-
/**
|
| 4 |
-
* Initialize domain model and set primary key
|
| 5 |
-
*
|
| 6 |
-
* @return void
|
| 7 |
-
*/
|
| 8 |
-
protected function _construct() {
|
| 9 |
-
$this->_init ( 'meinpaket/async', 'async_id' );
|
| 10 |
-
}
|
| 11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Async/Collection.php
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Mysql4_Async_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 3 |
-
/**
|
| 4 |
-
* Initialize domain model
|
| 5 |
-
*
|
| 6 |
-
* @return void
|
| 7 |
-
*/
|
| 8 |
-
protected function _construct() {
|
| 9 |
-
$this->_init ( 'meinpaket/async' );
|
| 10 |
-
}
|
| 11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Category.php
CHANGED
|
@@ -5,7 +5,6 @@
|
|
| 5 |
*
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 9 |
*/
|
| 10 |
class Dhl_MeinPaket_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract {
|
| 11 |
protected function _construct() {
|
| 5 |
*
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
|
|
|
| 8 |
*/
|
| 9 |
class Dhl_MeinPaket_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract {
|
| 10 |
protected function _construct() {
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Category/Collection.php
CHANGED
|
@@ -5,7 +5,6 @@
|
|
| 5 |
*
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 9 |
*/
|
| 10 |
class Dhl_MeinPaket_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 11 |
/**
|
| 5 |
*
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
|
|
|
| 8 |
*/
|
| 9 |
class Dhl_MeinPaket_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 10 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Log.php
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
|
| 3 |
-
/**
|
| 4 |
-
* Initialize domain model and set primary key
|
| 5 |
-
*
|
| 6 |
-
* @return void
|
| 7 |
-
*/
|
| 8 |
-
protected function _construct() {
|
| 9 |
-
$this->_init ( 'meinpaket/log', 'log_id' );
|
| 10 |
-
}
|
| 11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Mysql4/Log/Collection.php
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 3 |
-
/**
|
| 4 |
-
* Initialize domain model
|
| 5 |
-
*
|
| 6 |
-
* @return void
|
| 7 |
-
*/
|
| 8 |
-
protected function _construct() {
|
| 9 |
-
$this->_init ( 'meinpaket/log' );
|
| 10 |
-
}
|
| 11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Observer.php
CHANGED
|
@@ -7,63 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Model_Observer {
|
| 13 |
-
/**
|
| 14 |
-
* Stock attributes.
|
| 15 |
-
*
|
| 16 |
-
* @var array
|
| 17 |
-
*/
|
| 18 |
-
private $STOCK_ATTRIBUTES = array (
|
| 19 |
-
'qty',
|
| 20 |
-
'manage_stock',
|
| 21 |
-
'is_in_stock',
|
| 22 |
-
'min_qty',
|
| 23 |
-
'min_sale_qty',
|
| 24 |
-
'max_sale_qty'
|
| 25 |
-
);
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Holds the id of the order whose save_after event is actually triggered.
|
| 29 |
-
*
|
| 30 |
-
* @var integer
|
| 31 |
-
*/
|
| 32 |
-
protected static $currentlySavedOrderId = - 1;
|
| 33 |
-
|
| 34 |
-
/**
|
| 35 |
-
* Tells if the save_after has been triggered twice or more on
|
| 36 |
-
* the same order during script lifetime.
|
| 37 |
-
*
|
| 38 |
-
* @var boolean
|
| 39 |
-
*/
|
| 40 |
-
protected static $isSameSavedOrder = false;
|
| 41 |
-
|
| 42 |
-
/**
|
| 43 |
-
* Sets the id of the order whose save_after event has been triggered.
|
| 44 |
-
*
|
| 45 |
-
* @param integer $orderId
|
| 46 |
-
* @return void
|
| 47 |
-
*/
|
| 48 |
-
protected static function setCurrentOrderId($orderId) {
|
| 49 |
-
if (self::$currentlySavedOrderId === $orderId) {
|
| 50 |
-
self::$isSameSavedOrder = true;
|
| 51 |
-
} else {
|
| 52 |
-
self::$isSameSavedOrder = false;
|
| 53 |
-
}
|
| 54 |
-
self::$currentlySavedOrderId = $orderId;
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
/**
|
| 58 |
-
* Tells if the save_after event of the current order has been triggered
|
| 59 |
-
* at least once during the lifecycle of the current script.
|
| 60 |
-
*
|
| 61 |
-
* @return boolean
|
| 62 |
-
*/
|
| 63 |
-
protected static function saveEventHasBeenTriggeredOnSameOrderBefore() {
|
| 64 |
-
return self::$isSameSavedOrder;
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
/**
|
| 68 |
* Triggered when product is duplicated.
|
| 69 |
*
|
|
@@ -77,464 +22,6 @@ class Dhl_MeinPaket_Model_Observer {
|
|
| 77 |
return $this;
|
| 78 |
}
|
| 79 |
|
| 80 |
-
/**
|
| 81 |
-
* Is triggered when an order is saved.
|
| 82 |
-
*
|
| 83 |
-
* @param Varien_Event_Observer $observer
|
| 84 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 85 |
-
*/
|
| 86 |
-
public function salesOrderSaveAfter(Varien_Event_Observer $observer) {
|
| 87 |
-
$order = $observer->getData ( 'order' );
|
| 88 |
-
|
| 89 |
-
self::setCurrentOrderId ( $order->getId () );
|
| 90 |
-
|
| 91 |
-
$this->_updateMeinPaketOrderId ( $order );
|
| 92 |
-
$this->_handleOrderItemsChange ( $order );
|
| 93 |
-
$this->_cancelMeinPaketOrder ( $order );
|
| 94 |
-
|
| 95 |
-
return $this;
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
/**
|
| 99 |
-
* Sets the dhl_mein_paket_order_id for the given order.
|
| 100 |
-
* This is necessary if an order is edit and so created a new one.
|
| 101 |
-
* The new one will not have it's dhl_mein_paket_order_id attribute
|
| 102 |
-
* automatically.
|
| 103 |
-
*
|
| 104 |
-
* @param Varien_Object $order
|
| 105 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 106 |
-
*/
|
| 107 |
-
protected function _updateMeinPaketOrderId($order) {
|
| 108 |
-
// return if the order doesn't have a parent order
|
| 109 |
-
// or if it already has a MeinPaket.de order id...
|
| 110 |
-
if (! $order->hasData ( 'relation_parent_id' ) || $order->hasData ( 'dhl_mein_paket_order_id' )) {
|
| 111 |
-
return;
|
| 112 |
-
}
|
| 113 |
-
|
| 114 |
-
/* @var $parentOrder Mage_Sales_Model_Order */
|
| 115 |
-
$parentOrder = Mage::getModel ( 'sales/order' )->load ( $order->getData ( 'relation_parent_id' ) );
|
| 116 |
-
|
| 117 |
-
if (! $parentOrder->hasData ( 'relation_parent_id' ) || $parentOrder->hasData ( 'dhl_mein_paket_order_id' )) {
|
| 118 |
-
$order->setData ( 'dhl_mein_paket_order_id', $parentOrder->getDhlMeinPaketOrderId () );
|
| 119 |
-
$parentOrder->setData ( 'dhl_mein_paket_order_id', '' )->getResource ()->saveAttribute ( $parentOrder, 'dhl_mein_paket_order_id' );
|
| 120 |
-
}
|
| 121 |
-
|
| 122 |
-
return $this;
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
-
/**
|
| 126 |
-
* Cancels single order items.
|
| 127 |
-
*
|
| 128 |
-
* @param Mage_Sales_Model_Order $order
|
| 129 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 130 |
-
*/
|
| 131 |
-
protected function _handleOrderItemsChange(Mage_Sales_Model_Order $order) {
|
| 132 |
-
if (self::saveEventHasBeenTriggeredOnSameOrderBefore ()) {
|
| 133 |
-
return;
|
| 134 |
-
}
|
| 135 |
-
|
| 136 |
-
if ($order->getData ( 'state' ) === Mage_Sales_Model_Order::STATE_CANCELED) {
|
| 137 |
-
return $this;
|
| 138 |
-
}
|
| 139 |
-
|
| 140 |
-
if (! $order->hasData ( 'relation_parent_id' )) {
|
| 141 |
-
return $this;
|
| 142 |
-
}
|
| 143 |
-
|
| 144 |
-
/* @var $orderHelper Dhl_MeinPaket_Helper_Order */
|
| 145 |
-
$orderHelper = Mage::helper ( 'meinpaket/order' );
|
| 146 |
-
|
| 147 |
-
/* @var $parentOrder Mage_Sales_Model_Order */
|
| 148 |
-
$parentOrder = Mage::getModel ( 'sales/order' )->load ( $order->getData ( 'relation_parent_id' ) );
|
| 149 |
-
|
| 150 |
-
if ($orderHelper->isMeinPaketOrder ( $order )) {
|
| 151 |
-
|
| 152 |
-
$orderItemCollection = $order->getItemsCollection ();
|
| 153 |
-
$parentItemCollection = $parentOrder->getItemsCollection ();
|
| 154 |
-
$items = array ();
|
| 155 |
-
$parentItems = array ();
|
| 156 |
-
$reduceList = array ();
|
| 157 |
-
$submitChanges = false;
|
| 158 |
-
|
| 159 |
-
foreach ( $orderItemCollection as $item ) {
|
| 160 |
-
$options = $item->getProductOptions ();
|
| 161 |
-
if (isset ( $options ['info_buyRequest'] ) && isset ( $options ['info_buyRequest'] ['dhl_mein_paket_item_id'] )) {
|
| 162 |
-
$items [$options ['info_buyRequest'] ['dhl_mein_paket_item_id']] = array (
|
| 163 |
-
'qty' => ( integer ) $item->getQtyOrdered (),
|
| 164 |
-
'productId' => $item->getProductId ()
|
| 165 |
-
);
|
| 166 |
-
}
|
| 167 |
-
}
|
| 168 |
-
foreach ( $parentItemCollection as $item ) {
|
| 169 |
-
$options = $item->getProductOptions ();
|
| 170 |
-
if ($item->getQtyCanceled () != $item->getQtyOrdered ()) {
|
| 171 |
-
$submitChanges = true;
|
| 172 |
-
}
|
| 173 |
-
if (isset ( $options ['info_buyRequest'] ) && isset ( $options ['info_buyRequest'] ['dhl_mein_paket_item_id'] )) {
|
| 174 |
-
$parentItems [$options ['info_buyRequest'] ['dhl_mein_paket_item_id']] = array (
|
| 175 |
-
'qty' => ( integer ) $item->getQtyOrdered (),
|
| 176 |
-
'productId' => $item->getProductId ()
|
| 177 |
-
);
|
| 178 |
-
}
|
| 179 |
-
}
|
| 180 |
-
|
| 181 |
-
if ($submitChanges === false) {
|
| 182 |
-
return $this;
|
| 183 |
-
}
|
| 184 |
-
|
| 185 |
-
// find items with lowered quantity
|
| 186 |
-
if (sizeof ( $items ) < sizeof ( $parentItems )) {
|
| 187 |
-
foreach ( $parentItems as $dhlItemId => $item ) {
|
| 188 |
-
if (! array_key_exists ( $dhlItemId, $items )) {
|
| 189 |
-
$reduceList [$dhlItemId] = array (
|
| 190 |
-
'qty' => $item ['qty'],
|
| 191 |
-
'productId' => $item ['productId']
|
| 192 |
-
);
|
| 193 |
-
} elseif ($items [$dhlItemId] ['qty'] < $item ['qty']) {
|
| 194 |
-
$reduceList [$dhlItemId] = array (
|
| 195 |
-
'qty' => $item ['qty'] - $items [$dhlItemId] ['qty'],
|
| 196 |
-
'productId' => $item ['productId']
|
| 197 |
-
);
|
| 198 |
-
}
|
| 199 |
-
}
|
| 200 |
-
} else {
|
| 201 |
-
foreach ( $items as $dhlItemId => $item ) {
|
| 202 |
-
if (array_key_exists ( $dhlItemId, $parentItems ) && $item ['qty'] < $parentItems [$dhlItemId] ['qty']) {
|
| 203 |
-
$reduceList [$dhlItemId] = array (
|
| 204 |
-
'qty' => $parentItems [$dhlItemId] ['qty'] - $item ['qty'],
|
| 205 |
-
'productId' => $item ['productId']
|
| 206 |
-
);
|
| 207 |
-
}
|
| 208 |
-
}
|
| 209 |
-
}
|
| 210 |
-
|
| 211 |
-
if (sizeof ( $reduceList ) > 0) {
|
| 212 |
-
// make request
|
| 213 |
-
/* @var $cancellationService Dhl_MeinPaket_Model_Service_Order_CancellationService */
|
| 214 |
-
$cancellationService = Mage::getModel ( 'meinpaket/service_order_cancellationService' );
|
| 215 |
-
$result = null;
|
| 216 |
-
$helper = Mage::helper ( 'meinpaket/data' );
|
| 217 |
-
$errMsg = '';
|
| 218 |
-
|
| 219 |
-
try {
|
| 220 |
-
$result = $cancellationService->cancelOrderItems ( $order, $reduceList );
|
| 221 |
-
} catch ( Dhl_MeinPaket_Model_Xml_XmlBuildException $e ) {
|
| 222 |
-
Mage::logException ( $e );
|
| 223 |
-
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 224 |
-
} catch ( Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException $e ) {
|
| 225 |
-
Mage::logException ( $e );
|
| 226 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 227 |
-
} catch ( Dhl_MeinPaket_Model_Client_HttpTimeoutException $e ) {
|
| 228 |
-
Mage::logException ( $e );
|
| 229 |
-
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 230 |
-
} catch ( Dhl_MeinPaket_Model_Xml_InvalidXmlException $e ) {
|
| 231 |
-
Mage::logException ( $e );
|
| 232 |
-
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 233 |
-
} catch ( Exception $e ) {
|
| 234 |
-
Mage::logException ( $e );
|
| 235 |
-
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 236 |
-
}
|
| 237 |
-
if (is_object ( $result ) && $result->hasError ()) {
|
| 238 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned error code %s.' ), $result->getError () );
|
| 239 |
-
}
|
| 240 |
-
|
| 241 |
-
if (strlen ( $errMsg ) > 0) {
|
| 242 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on tranfering cancelled items to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 243 |
-
throw new Exception ( 'Failed transfering cancelled items to MeinPaket.de server.' );
|
| 244 |
-
}
|
| 245 |
-
}
|
| 246 |
-
}
|
| 247 |
-
|
| 248 |
-
return $this;
|
| 249 |
-
}
|
| 250 |
-
|
| 251 |
-
/**
|
| 252 |
-
* Cancels the given order in MeinPaket.de if the given order is a MeinPaket.de order
|
| 253 |
-
* and its state is Mage_Sales_Model_Order::STATE_CANCELED.
|
| 254 |
-
*
|
| 255 |
-
* @param Mage_Sales_Model_Order $order
|
| 256 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 257 |
-
*/
|
| 258 |
-
protected function _cancelMeinPaketOrder(Mage_Sales_Model_Order $order) {
|
| 259 |
-
$meinPaketOrderId = $order->getData ( 'dhl_mein_paket_order_id' );
|
| 260 |
-
|
| 261 |
-
if (strlen ( $meinPaketOrderId ) > 1 && $order->getData ( 'state' ) === Mage_Sales_Model_Order::STATE_CANCELED) {
|
| 262 |
-
|
| 263 |
-
$col = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToFilter ( 'relation_parent_id', $order->getId () )->load ();
|
| 264 |
-
|
| 265 |
-
if ($col->count () > 0) {
|
| 266 |
-
return $this;
|
| 267 |
-
}
|
| 268 |
-
|
| 269 |
-
// TODO: Class missing
|
| 270 |
-
|
| 271 |
-
/* @var $orderCancellationService Dhl_MeinPaket_Model_Service_Order_CancellationService */
|
| 272 |
-
$orderCancellationService = Mage::getModel ( 'meinpaket/service_order_cancellationService' );
|
| 273 |
-
|
| 274 |
-
$result = null;
|
| 275 |
-
$helper = Mage::helper ( 'meinpaket/data' );
|
| 276 |
-
$errMsg = '';
|
| 277 |
-
|
| 278 |
-
try {
|
| 279 |
-
$result = $orderCancellationService->cancelOrder ( $order );
|
| 280 |
-
} catch ( Dhl_MeinPaket_Model_Xml_XmlBuildException $e ) {
|
| 281 |
-
Mage::logException ( $e );
|
| 282 |
-
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 283 |
-
} catch ( Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException $e ) {
|
| 284 |
-
Mage::logException ( $e );
|
| 285 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 286 |
-
} catch ( Dhl_MeinPaket_Model_Client_HttpTimeoutException $e ) {
|
| 287 |
-
Mage::logException ( $e );
|
| 288 |
-
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 289 |
-
} catch ( Dhl_MeinPaket_Model_Xml_InvalidXmlException $e ) {
|
| 290 |
-
Mage::logException ( $e );
|
| 291 |
-
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 292 |
-
} catch ( Exception $e ) {
|
| 293 |
-
Mage::logException ( $e );
|
| 294 |
-
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 295 |
-
}
|
| 296 |
-
if (is_object ( $result ) && $result->hasError ()) {
|
| 297 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned error code %s.' ), $result->getError () );
|
| 298 |
-
}
|
| 299 |
-
|
| 300 |
-
if (strlen ( $errMsg ) > 0) {
|
| 301 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on tranfering cancelled items to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 302 |
-
throw new Exception ( 'Failed transfering cancelled items to MeinPaket.de server.' );
|
| 303 |
-
}
|
| 304 |
-
}
|
| 305 |
-
|
| 306 |
-
return $this;
|
| 307 |
-
}
|
| 308 |
-
|
| 309 |
-
/**
|
| 310 |
-
* Is triggered when a shipment is saved.
|
| 311 |
-
*
|
| 312 |
-
* @param Varien_Event_Observer $observer
|
| 313 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 314 |
-
*/
|
| 315 |
-
public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer) {
|
| 316 |
-
/* @var $order Dhl_MeinPaket_Helper_Shipment */
|
| 317 |
-
$shipmentHelper = Mage::helper ( 'meinpaket/shipment' );
|
| 318 |
-
|
| 319 |
-
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 320 |
-
$shipment = Mage::getModel ( 'sales/order_shipment' )->load ( $observer->getData ( 'shipment' )->getId () );
|
| 321 |
-
|
| 322 |
-
if ($shipmentHelper->isExportedToDhlMeinPaket ( $shipment )) {
|
| 323 |
-
return $this;
|
| 324 |
-
}
|
| 325 |
-
|
| 326 |
-
if (! $shipmentHelper->isMeinPaketShipment ( $shipment )) {
|
| 327 |
-
return $this;
|
| 328 |
-
}
|
| 329 |
-
|
| 330 |
-
// send shipment request to MeinPaket.
|
| 331 |
-
$this->_exportShipmentToMeinPaket ( $shipment );
|
| 332 |
-
|
| 333 |
-
return $this;
|
| 334 |
-
}
|
| 335 |
-
|
| 336 |
-
/**
|
| 337 |
-
* Is called after a shipment save is committed.
|
| 338 |
-
* Sets the shipment's "shipment_was_exported_for_dhl_mein_paket" attribute
|
| 339 |
-
* value to "1" if it isn't set yet.
|
| 340 |
-
*
|
| 341 |
-
* @param Varien_Event_Observer $observer
|
| 342 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 343 |
-
*/
|
| 344 |
-
public function salesOrderShipmentSaveCommitAfter(Varien_Event_Observer $observer) {
|
| 345 |
-
/* @var $order Dhl_MeinPaket_Helper_Shipment */
|
| 346 |
-
$shipmentHelper = Mage::helper ( 'meinpaket/shipment' );
|
| 347 |
-
|
| 348 |
-
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 349 |
-
$shipment = $observer->getShipment ();
|
| 350 |
-
|
| 351 |
-
if ($shipmentHelper->isExportedToDhlMeinPaket ( $shipment )) {
|
| 352 |
-
return $this;
|
| 353 |
-
}
|
| 354 |
-
|
| 355 |
-
if (! $shipmentHelper->isMeinPaketShipment ( $shipment )) {
|
| 356 |
-
return $this;
|
| 357 |
-
}
|
| 358 |
-
|
| 359 |
-
if ($shipmentHelper->isMeinPaketShipment ( $shipment ) && ! $shipment->getData ( 'shipment_was_exported_for_dhl_mein_paket' )) {
|
| 360 |
-
$shipment->setData ( 'shipment_was_exported_for_dhl_mein_paket', 1 )->getResource ()->saveAttribute ( $shipment, 'shipment_was_exported_for_dhl_mein_paket' );
|
| 361 |
-
}
|
| 362 |
-
}
|
| 363 |
-
|
| 364 |
-
/**
|
| 365 |
-
* Exports an saved shipment to MeinPaket.de.
|
| 366 |
-
*
|
| 367 |
-
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 368 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 369 |
-
*/
|
| 370 |
-
protected function _exportShipmentToMeinPaket(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 371 |
-
/* @var $shipmentExportService Dhl_MeinPaket_Model_Service_Order_ShipmentExportService */
|
| 372 |
-
$shipmentExportService = Mage::getModel ( 'meinpaket/service_order_shipmentExportService' );
|
| 373 |
-
|
| 374 |
-
$result = null;
|
| 375 |
-
$errMsg = '';
|
| 376 |
-
$helper = Mage::helper ( 'meinpaket/data' );
|
| 377 |
-
|
| 378 |
-
try {
|
| 379 |
-
$result = $shipmentExportService->exportShipment ( $shipment );
|
| 380 |
-
} catch ( Dhl_MeinPaket_Model_Xml_XmlBuildException $e ) {
|
| 381 |
-
Mage::logException ( $e );
|
| 382 |
-
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 383 |
-
} catch ( Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException $e ) {
|
| 384 |
-
Mage::logException ( $e );
|
| 385 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 386 |
-
} catch ( Dhl_MeinPaket_Model_Client_HttpTimeoutException $e ) {
|
| 387 |
-
Mage::logException ( $e );
|
| 388 |
-
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 389 |
-
} catch ( Dhl_MeinPaket_Model_Xml_InvalidXmlException $e ) {
|
| 390 |
-
Mage::logException ( $e );
|
| 391 |
-
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 392 |
-
} catch ( Exception $e ) {
|
| 393 |
-
Mage::logException ( $e );
|
| 394 |
-
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 395 |
-
}
|
| 396 |
-
|
| 397 |
-
if ($result == null || $result->hasErrors ()) {
|
| 398 |
-
$errMsg .= $helper->__ ( 'Shipment has not been accepted by MeinPaket.de.' );
|
| 399 |
-
}
|
| 400 |
-
|
| 401 |
-
if (strlen ( $errMsg ) > 0) {
|
| 402 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering shipment to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 403 |
-
throw new Exception ( 'Failed exporting shipment to MeinPaket.de server.' );
|
| 404 |
-
}
|
| 405 |
-
|
| 406 |
-
return $this;
|
| 407 |
-
}
|
| 408 |
-
|
| 409 |
-
/**
|
| 410 |
-
* Is called when a creditmemo is saved.
|
| 411 |
-
* If the creditmemo is refunded, a notification will be send to MeinPaket.de.
|
| 412 |
-
*
|
| 413 |
-
* @param Varien_Event_Observer $observer
|
| 414 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 415 |
-
*/
|
| 416 |
-
public function salesOrderCreditmemoSaveAfter(Varien_Event_Observer $observer) {
|
| 417 |
-
/* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
|
| 418 |
-
$creditmemo = $observer->getData ( 'creditmemo' );
|
| 419 |
-
|
| 420 |
-
// check if creditmemo is refunded
|
| 421 |
-
if ($creditmemo->getState () != Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED) {
|
| 422 |
-
return $this;
|
| 423 |
-
}
|
| 424 |
-
|
| 425 |
-
// check if the order is a MeinPaket.de order
|
| 426 |
-
if (! Mage::helper('meinpaket/order')->isMeinPaketOrder ( $creditmemo->getOrder () )) {
|
| 427 |
-
return $this;
|
| 428 |
-
}
|
| 429 |
-
|
| 430 |
-
/* @var $result Dhl_MeinPaket_Model_Sevice_RefundExport_Result */
|
| 431 |
-
$result = null;
|
| 432 |
-
|
| 433 |
-
/* @var $exportService Dhl_MeinPaket_Model_Sevice_RefundExportService */
|
| 434 |
-
$exportService = Mage::getModel ( 'meinpaket/service_order_refundExportService' );
|
| 435 |
-
|
| 436 |
-
$helper = Mage::helper ( 'meinpaket/data' );
|
| 437 |
-
$errMsg = '';
|
| 438 |
-
|
| 439 |
-
try {
|
| 440 |
-
$result = $exportService->exportRefund ( $creditmemo );
|
| 441 |
-
} catch ( Dhl_MeinPaket_Model_Xml_XmlBuildException $e ) {
|
| 442 |
-
Mage::logException ( $e );
|
| 443 |
-
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 444 |
-
} catch ( Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException $e ) {
|
| 445 |
-
Mage::logException ( $e );
|
| 446 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 447 |
-
} catch ( Dhl_MeinPaket_Model_Client_HttpTimeoutException $e ) {
|
| 448 |
-
Mage::logException ( $e );
|
| 449 |
-
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 450 |
-
} catch ( Dhl_MeinPaket_Model_Xml_InvalidXmlException $e ) {
|
| 451 |
-
Mage::logException ( $e );
|
| 452 |
-
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 453 |
-
} catch ( Exception $e ) {
|
| 454 |
-
Mage::logException ( $e );
|
| 455 |
-
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 456 |
-
}
|
| 457 |
-
|
| 458 |
-
if ($result == null) {
|
| 459 |
-
$errMsg .= $helper->__ ( 'Refund has not been accepted by MeinPaket.de.' );
|
| 460 |
-
}
|
| 461 |
-
|
| 462 |
-
if (strlen ( $errMsg ) > 0) {
|
| 463 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering refund to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 464 |
-
throw new Exception ( 'Failed exporting refund to MeinPaket.de server.' );
|
| 465 |
-
}
|
| 466 |
-
|
| 467 |
-
return $this;
|
| 468 |
-
}
|
| 469 |
-
|
| 470 |
-
/**
|
| 471 |
-
* Is called when a shipment track is saved.
|
| 472 |
-
* The tracking code will be sent to MeinPaket.de if it's the first track
|
| 473 |
-
* for the shipment.
|
| 474 |
-
*
|
| 475 |
-
* @param Varien_Event_Observer $observer
|
| 476 |
-
* @return Dhl_MeinPaket_Model_Observer
|
| 477 |
-
*/
|
| 478 |
-
public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer) {
|
| 479 |
-
/* @var $track Mage_Sales_Model_Order_Shipment_Track */
|
| 480 |
-
$track = $observer->getData ( 'track' );
|
| 481 |
-
|
| 482 |
-
if ($track == null) {
|
| 483 |
-
return this;
|
| 484 |
-
}
|
| 485 |
-
|
| 486 |
-
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 487 |
-
$shipment = $track->getShipment ();
|
| 488 |
-
|
| 489 |
-
/* @var $order Mage_Sales_Model_Order */
|
| 490 |
-
$order = $shipment->getOrder ();
|
| 491 |
-
|
| 492 |
-
// check if order is a MeinPaket.de order...
|
| 493 |
-
if (! Mage::helper ( 'meinpaket/order' )->isMeinPaketOrder ( $order )) {
|
| 494 |
-
return $this;
|
| 495 |
-
}
|
| 496 |
-
|
| 497 |
-
$helper = Mage::helper ( 'meinpaket' );
|
| 498 |
-
$result = null;
|
| 499 |
-
$errMsg = '';
|
| 500 |
-
|
| 501 |
-
/* @var $service Dhl_MeinPaket_Model_Service_Order_ShipmentExportService */
|
| 502 |
-
$service = Mage::getModel ( 'meinpaket/service_order_shipmentExportService' );
|
| 503 |
-
|
| 504 |
-
try {
|
| 505 |
-
$result = $service->exportTrackingNumber ( $track );
|
| 506 |
-
} catch ( Dhl_MeinPaket_Model_Xml_XmlBuildException $e ) {
|
| 507 |
-
Mage::logException ( $e );
|
| 508 |
-
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 509 |
-
} catch ( Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException $e ) {
|
| 510 |
-
Mage::logException ( $e );
|
| 511 |
-
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 512 |
-
} catch ( Dhl_MeinPaket_Model_Client_HttpTimeoutException $e ) {
|
| 513 |
-
Mage::logException ( $e );
|
| 514 |
-
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 515 |
-
} catch ( Dhl_MeinPaket_Model_Xml_InvalidXmlException $e ) {
|
| 516 |
-
Mage::logException ( $e );
|
| 517 |
-
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 518 |
-
} catch ( Exception $e ) {
|
| 519 |
-
Mage::logException ( $e );
|
| 520 |
-
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 521 |
-
}
|
| 522 |
-
|
| 523 |
-
if ($result !== null && ! $result->hasBeenAccepted ()) {
|
| 524 |
-
$errMsg .= $helper->__ ( 'Tracking code has not been accepted by MeinPaket.de.' );
|
| 525 |
-
if ($result->hasError ()) {
|
| 526 |
-
$errMsg .= ' (' . sprintf ( $helper->__ ( 'MeinPaket.de returned error code %s.' ), $result->getError () ) . ')';
|
| 527 |
-
}
|
| 528 |
-
}
|
| 529 |
-
|
| 530 |
-
if (strlen ( $errMsg ) > 0) {
|
| 531 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering tracking code to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 532 |
-
throw new Exception ( 'Failed exporting tracking code to MeinPaket.de server.' );
|
| 533 |
-
}
|
| 534 |
-
|
| 535 |
-
return $this;
|
| 536 |
-
}
|
| 537 |
-
|
| 538 |
/**
|
| 539 |
* Is triggered after a product has been deleted.
|
| 540 |
* If the product has been exported to MeinPake.de once before, the
|
|
@@ -655,28 +142,15 @@ class Dhl_MeinPaket_Model_Observer {
|
|
| 655 |
}
|
| 656 |
return $this;
|
| 657 |
}
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
//
|
| 661 |
-
// $collection->addAttributeToSelect ( 'dhl_mein_paket_order_id' );
|
| 662 |
-
return $this;
|
| 663 |
-
}
|
| 664 |
-
public function gridAddAttributes(Varien_Event_Observer $observer) {
|
| 665 |
-
$block = $observer->getBlock ();
|
| 666 |
-
if (! isset ( $block )) {
|
| 667 |
-
return $this;
|
| 668 |
-
}
|
| 669 |
-
|
| 670 |
-
if ($block->getType () == 'adminhtml/sales_order_grid') {
|
| 671 |
-
/* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
|
| 672 |
-
|
| 673 |
-
$block->addColumnAfter ( 'dhl_mein_paket_order_id', array (
|
| 674 |
-
'header' => __ ( 'MeinPaket.de Order No.' ),
|
| 675 |
-
'index' => 'dhl_mein_paket_order_id'
|
| 676 |
-
), 'real_order_id' );
|
| 677 |
-
}
|
| 678 |
-
return $this;
|
| 679 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 680 |
public function addMeinPaketAttributes($observer) {
|
| 681 |
$fieldset = $observer->getForm ()->getElement ( 'base_fieldset' );
|
| 682 |
$attribute = $observer->getAttribute ();
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Model_Observer {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
/**
|
| 13 |
* Triggered when product is duplicated.
|
| 14 |
*
|
| 22 |
return $this;
|
| 23 |
}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
/**
|
| 26 |
* Is triggered after a product has been deleted.
|
| 27 |
* If the product has been exported to MeinPake.de once before, the
|
| 142 |
}
|
| 143 |
return $this;
|
| 144 |
}
|
| 145 |
+
|
| 146 |
+
public function catalogInventoryStockItemSaveAfter() {
|
| 147 |
+
//TODO:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
}
|
| 149 |
+
|
| 150 |
+
/**
|
| 151 |
+
*
|
| 152 |
+
* @param unknown $observer
|
| 153 |
+
*/
|
| 154 |
public function addMeinPaketAttributes($observer) {
|
| 155 |
$fieldset = $observer->getForm ()->getElement ( 'base_fieldset' );
|
| 156 |
$attribute = $observer->getAttribute ();
|
app/code/community/Dhl/MeinPaket/Model/Payment/Method/Meinpaket.php
CHANGED
|
@@ -15,8 +15,15 @@ class Dhl_MeinPaket_Model_Payment_Method_Meinpaket extends Mage_Payment_Model_Me
|
|
| 15 |
protected $_code = 'meinpaket';
|
| 16 |
|
| 17 |
/**
|
| 18 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
* @var boolean
|
| 20 |
*/
|
| 21 |
protected $_canUseCheckout = false;
|
|
|
|
| 22 |
}
|
| 15 |
protected $_code = 'meinpaket';
|
| 16 |
|
| 17 |
/**
|
| 18 |
+
* Can use this payment method in administration panel?
|
| 19 |
+
* @var boolean
|
| 20 |
+
*/
|
| 21 |
+
protected $_canUseInternal = false;
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Can show this payment method as an option on checkout payment page?
|
| 25 |
* @var boolean
|
| 26 |
*/
|
| 27 |
protected $_canUseCheckout = false;
|
| 28 |
+
|
| 29 |
}
|
app/code/community/Dhl/MeinPaket/Model/Resource/Eav/Mysql4/Setup.php
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup extends
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @return array
|
|
@@ -16,18 +16,10 @@ class Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entit
|
|
| 16 |
'meinpaket_id' => array (
|
| 17 |
'type' => 'int',
|
| 18 |
'label' => 'Product DHL MeinPaket Id',
|
|
|
|
| 19 |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 20 |
'visible' => false,
|
| 21 |
-
'
|
| 22 |
-
'required' => false,
|
| 23 |
-
'user_defined' => false,
|
| 24 |
-
'searchable' => false,
|
| 25 |
-
'filterable' => false,
|
| 26 |
-
'comparable' => false,
|
| 27 |
-
'visible_on_front' => false,
|
| 28 |
-
'visible_in_advanced_search' => false,
|
| 29 |
-
'unique' => false,
|
| 30 |
-
'is_configurable' => false
|
| 31 |
),
|
| 32 |
'sync_with_dhl_mein_paket' => array (
|
| 33 |
'type' => 'int',
|
|
@@ -35,90 +27,30 @@ class Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entit
|
|
| 35 |
'frontend' => 'meinpaket/entity_attribute_frontend_labelTranslation',
|
| 36 |
'input' => 'select',
|
| 37 |
'source' => 'meinpaket/entity_attribute_source_productSyncMode',
|
| 38 |
-
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 39 |
-
'visible' => false,
|
| 40 |
'required' => false,
|
| 41 |
-
'
|
| 42 |
-
'
|
| 43 |
-
'
|
| 44 |
-
'comparable' => false,
|
| 45 |
-
'visible_on_front' => false,
|
| 46 |
-
'visible_in_advanced_search' => false,
|
| 47 |
-
'unique' => false
|
| 48 |
),
|
| 49 |
'max_stock_for_dhl_mein_paket' => array (
|
| 50 |
'type' => 'int',
|
| 51 |
'label' => 'Maximum stock qty. for MeinPaket.de',
|
| 52 |
'frontend' => 'meinpaket/entity_attribute_frontend_labelTranslation',
|
| 53 |
'input' => 'text',
|
| 54 |
-
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 55 |
-
'visible' => false,
|
| 56 |
'required' => false,
|
| 57 |
-
'
|
| 58 |
-
'
|
| 59 |
-
'
|
| 60 |
-
'comparable' => false,
|
| 61 |
-
'visible_on_front' => false,
|
| 62 |
-
'visible_in_advanced_search' => false,
|
| 63 |
-
'unique' => false
|
| 64 |
),
|
| 65 |
'meinpaket_category' => array (
|
| 66 |
'type' => 'text',
|
| 67 |
-
'label' => 'DHL MeinPaket
|
| 68 |
'input' => 'select',
|
| 69 |
'source' => 'meinpaket/entity_attribute_source_meinPaketCategory',
|
| 70 |
-
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 71 |
-
'visible' => false,
|
| 72 |
-
'required' => false,
|
| 73 |
-
'user_defined' => false,
|
| 74 |
-
'searchable' => false,
|
| 75 |
-
'filterable' => false,
|
| 76 |
-
'comparable' => false,
|
| 77 |
-
'visible_on_front' => false,
|
| 78 |
-
'visible_in_advanced_search' => false,
|
| 79 |
-
'unique' => false
|
| 80 |
-
)
|
| 81 |
-
)
|
| 82 |
-
),
|
| 83 |
-
'order' => array (
|
| 84 |
-
'entity_model' => 'sales/order',
|
| 85 |
-
'table' => 'sales/order',
|
| 86 |
-
'increment_model' => 'eav/entity_increment_numeric',
|
| 87 |
-
'increment_per_store' => true,
|
| 88 |
-
'backend_prefix' => 'sales_entity/order_attribute_backend',
|
| 89 |
-
'attributes' => array (
|
| 90 |
-
'meinpaket_id' => array (
|
| 91 |
-
'type' => 'int',
|
| 92 |
-
'label' => 'Order MeinPaket Id',
|
| 93 |
'required' => false,
|
| 94 |
-
'
|
| 95 |
-
'visible' =>
|
| 96 |
-
|
| 97 |
-
)
|
| 98 |
-
) ,
|
| 99 |
-
'customer' => array (
|
| 100 |
-
'entity_model' => 'customer/customer',
|
| 101 |
-
'attribute_model' => 'customer/attribute',
|
| 102 |
-
'table' => 'customer/entity',
|
| 103 |
-
'increment_model' => 'eav/entity_increment_numeric',
|
| 104 |
-
'additional_attribute_table' => 'customer/eav_attribute',
|
| 105 |
-
'entity_attribute_collection' => 'customer/attribute_collection',
|
| 106 |
-
'attributes' => array (
|
| 107 |
-
'meinpaket_buyer_id' => array (
|
| 108 |
-
'type' => 'int',
|
| 109 |
-
'label' => 'VIA eBay Buyer Id',
|
| 110 |
-
'input' => 'text',
|
| 111 |
-
'required' => false,
|
| 112 |
-
'sort_order' => 200,
|
| 113 |
-
'visible' => false
|
| 114 |
-
),
|
| 115 |
-
'meinpaket_buyer_name' => array (
|
| 116 |
-
'type' => 'varchar',
|
| 117 |
-
'label' => 'VIA eBay Buyer Name',
|
| 118 |
-
'input' => 'text',
|
| 119 |
-
'required' => false,
|
| 120 |
-
'sort_order' => 201,
|
| 121 |
-
'visible' => false
|
| 122 |
)
|
| 123 |
)
|
| 124 |
)
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup extends Mage_Catalog_Model_Resource_Setup {
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @return array
|
| 16 |
'meinpaket_id' => array (
|
| 17 |
'type' => 'int',
|
| 18 |
'label' => 'Product DHL MeinPaket Id',
|
| 19 |
+
'required' => false,
|
| 20 |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 21 |
'visible' => false,
|
| 22 |
+
'group' => 'DHL MeinPaket'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
),
|
| 24 |
'sync_with_dhl_mein_paket' => array (
|
| 25 |
'type' => 'int',
|
| 27 |
'frontend' => 'meinpaket/entity_attribute_frontend_labelTranslation',
|
| 28 |
'input' => 'select',
|
| 29 |
'source' => 'meinpaket/entity_attribute_source_productSyncMode',
|
|
|
|
|
|
|
| 30 |
'required' => false,
|
| 31 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 32 |
+
'visible' => true,
|
| 33 |
+
'group' => 'DHL MeinPaket'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
),
|
| 35 |
'max_stock_for_dhl_mein_paket' => array (
|
| 36 |
'type' => 'int',
|
| 37 |
'label' => 'Maximum stock qty. for MeinPaket.de',
|
| 38 |
'frontend' => 'meinpaket/entity_attribute_frontend_labelTranslation',
|
| 39 |
'input' => 'text',
|
|
|
|
|
|
|
| 40 |
'required' => false,
|
| 41 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 42 |
+
'visible' => true,
|
| 43 |
+
'group' => 'DHL MeinPaket'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
),
|
| 45 |
'meinpaket_category' => array (
|
| 46 |
'type' => 'text',
|
| 47 |
+
'label' => 'DHL MeinPaket Category',
|
| 48 |
'input' => 'select',
|
| 49 |
'source' => 'meinpaket/entity_attribute_source_meinPaketCategory',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
'required' => false,
|
| 51 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
|
| 52 |
+
'visible' => true,
|
| 53 |
+
'group' => 'DHL MeinPaket'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
)
|
| 55 |
)
|
| 56 |
)
|
app/code/community/Dhl/MeinPaket/Model/Service/Async.php
DELETED
|
@@ -1,52 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Result class which encapsulates information concerning the shipment export process.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Service_ShipmentExport
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Service_Async extends Dhl_MeinPaket_Model_Service_Abstract {
|
| 13 |
-
/**
|
| 14 |
-
* Exports products.
|
| 15 |
-
*
|
| 16 |
-
* @param integer $selectionMode
|
| 17 |
-
* @return Dhl_MeinPaket_Model_Service_Product_Export_Result
|
| 18 |
-
*/
|
| 19 |
-
public function process() {
|
| 20 |
-
$seenMagentoProducts = array ();
|
| 21 |
-
|
| 22 |
-
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 23 |
-
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 24 |
-
|
| 25 |
-
/* var $logCollection Dhl_MeinPaket_Model_Mysql4_Log_Collection */
|
| 26 |
-
$asyncCollection = Mage::getModel ( 'meinpaket/async' )->getCollection ();
|
| 27 |
-
|
| 28 |
-
$count = 0;
|
| 29 |
-
|
| 30 |
-
foreach ( $asyncCollection as $async ) {
|
| 31 |
-
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_AsynchronousStatusRequest */
|
| 32 |
-
$statusRequest = Mage::getModel ( 'meinpaket/xml_request_asynchronousStatusRequest' );
|
| 33 |
-
$statusRequest->addRequestStatus ( $async->getRequestId () );
|
| 34 |
-
$response = $client->send ( $statusRequest );
|
| 35 |
-
|
| 36 |
-
if ($response instanceof Dhl_MeinPaket_Model_Xml_Response_AsynchronousStatusResponse) {
|
| 37 |
-
/* @var $response Dhl_MeinPaket_Model_Xml_Response_AsynchronousStatusResponse */
|
| 38 |
-
$async->setRequestId ( $response->getRequestId () );
|
| 39 |
-
$async->setStatus ( $response->getStatus () );
|
| 40 |
-
$async->setUpdatedAt ( Varien_Date::now () );
|
| 41 |
-
$async->save ();
|
| 42 |
-
} else {
|
| 43 |
-
$async->delete ();
|
| 44 |
-
}
|
| 45 |
-
|
| 46 |
-
$count ++;
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d async jobs", $count );
|
| 50 |
-
}
|
| 51 |
-
}
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Service/MarketplaceCategoryImport/ImportService.php
CHANGED
|
@@ -8,8 +8,6 @@
|
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Model_Service_MarketplaceCategoryImport
|
| 10 |
* @version $Id$
|
| 11 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 12 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 13 |
*/
|
| 14 |
class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extends Varien_Object {
|
| 15 |
/**
|
|
@@ -55,7 +53,7 @@ class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extend
|
|
| 55 |
$collection = $rootCategory->getCollection ();
|
| 56 |
|
| 57 |
/* @var $memoryLimiter Dhl_MeinPaket_Model_System_MemoryLimiter */
|
| 58 |
-
$memoryLimiter = Mage::getModel ( '
|
| 59 |
|
| 60 |
/* @var $requestXml string */
|
| 61 |
$requestXml = '';
|
|
@@ -67,9 +65,9 @@ class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extend
|
|
| 67 |
$structure = null;
|
| 68 |
|
| 69 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 70 |
-
$client = Mage::getModel ( '
|
| 71 |
|
| 72 |
-
$memoryLimiter->setMemoryLimit (
|
| 73 |
|
| 74 |
/* @var $ids array */
|
| 75 |
$ids = array ();
|
|
@@ -80,7 +78,7 @@ class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extend
|
|
| 80 |
$transaction->beginTransaction ();
|
| 81 |
|
| 82 |
/* @var $request Dhl_MeinPaket_Model_Xml_Request_DownloadRequest */
|
| 83 |
-
$request = Mage::getModel ( '
|
| 84 |
$request->addDownloadMarketplaceCategories ();
|
| 85 |
|
| 86 |
$dom = $client->send ( $request );
|
|
@@ -125,7 +123,7 @@ class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extend
|
|
| 125 |
}
|
| 126 |
|
| 127 |
foreach ( $ids as $id ) {
|
| 128 |
-
$model = Mage::getModel ( 'meinpaket/category' )->load ( $
|
| 129 |
if ($model->getId () != null) {
|
| 130 |
$this->result->addDeletedCategory ( $model );
|
| 131 |
$model->delete ();
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Model_Service_MarketplaceCategoryImport
|
| 10 |
* @version $Id$
|
|
|
|
|
|
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_ImportService extends Varien_Object {
|
| 13 |
/**
|
| 53 |
$collection = $rootCategory->getCollection ();
|
| 54 |
|
| 55 |
/* @var $memoryLimiter Dhl_MeinPaket_Model_System_MemoryLimiter */
|
| 56 |
+
$memoryLimiter = Mage::getModel ( 'meinpaketcommon/system_memoryLimiter' );
|
| 57 |
|
| 58 |
/* @var $requestXml string */
|
| 59 |
$requestXml = '';
|
| 65 |
$structure = null;
|
| 66 |
|
| 67 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 68 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 69 |
|
| 70 |
+
$memoryLimiter->setMemoryLimit ( Dhl_MeinPaketCommon_Model_System_MemoryLimiter::MEMORY_LIMIT_VERY_HIGH );
|
| 71 |
|
| 72 |
/* @var $ids array */
|
| 73 |
$ids = array ();
|
| 78 |
$transaction->beginTransaction ();
|
| 79 |
|
| 80 |
/* @var $request Dhl_MeinPaket_Model_Xml_Request_DownloadRequest */
|
| 81 |
+
$request = Mage::getModel ( 'meinpaketcommon/xml_request_downloadRequest' );
|
| 82 |
$request->addDownloadMarketplaceCategories ();
|
| 83 |
|
| 84 |
$dom = $client->send ( $request );
|
| 123 |
}
|
| 124 |
|
| 125 |
foreach ( $ids as $id ) {
|
| 126 |
+
$model = Mage::getModel ( 'meinpaket/category' )->load ( $id );
|
| 127 |
if ($model->getId () != null) {
|
| 128 |
$this->result->addDeletedCategory ( $model );
|
| 129 |
$model->delete ();
|
app/code/community/Dhl/MeinPaket/Model/Service/MarketplaceCategoryImport/Result.php
CHANGED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_MarketplaceCategoryImport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_Result extends
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var array
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_MarketplaceCategoryImport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_Result extends Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var array
|
app/code/community/Dhl/MeinPaket/Model/Service/Order/CancellationService.php
DELETED
|
@@ -1,85 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Service class which cancels an order.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_OrderCancellation
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Service_Order_CancellationService extends Varien_Object {
|
| 13 |
-
/**
|
| 14 |
-
* Cancels the given MeinPaket order.
|
| 15 |
-
*
|
| 16 |
-
* @param Mage_Sales_Model_Order $order
|
| 17 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 18 |
-
* @throws Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException
|
| 19 |
-
* @throws Dhl_MeinPaket_Model_Client_HttpTimeoutException
|
| 20 |
-
* @throws Dhl_MeinPaket_Model_Xml_InvalidXmlException
|
| 21 |
-
* @return Dhl_MeinPaket_Model_OrderCancellation_Result
|
| 22 |
-
*/
|
| 23 |
-
public function cancelOrder(Mage_Sales_Model_Order $order) {
|
| 24 |
-
|
| 25 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Request_NotificationRequest */
|
| 26 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/xml_request_notificationRequest' );
|
| 27 |
-
|
| 28 |
-
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 29 |
-
$httpClient = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 30 |
-
|
| 31 |
-
/* @var $result Dhl_MeinPaket_Model_Service_Order_CancellationService_Result */
|
| 32 |
-
$result = Mage::getModel ( 'meinpaket/service_order_cancellationService_result' );
|
| 33 |
-
|
| 34 |
-
try {
|
| 35 |
-
$notificationRequest->addCancellation ( $order );
|
| 36 |
-
$responseXml = $httpClient->send ( $notificationRequest );
|
| 37 |
-
} catch ( Exception $e ) {
|
| 38 |
-
Mage::logException ( $e );
|
| 39 |
-
throw $e;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
return $result;
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
/**
|
| 46 |
-
* Cancels a set of items for MeinPaket order.
|
| 47 |
-
*
|
| 48 |
-
* @param Mage_Sales_Model_Order $order
|
| 49 |
-
* @param array $items
|
| 50 |
-
* of the array have to be associative arrays
|
| 51 |
-
* containing the keys "productId" and "qty" (Quantity to reduce).
|
| 52 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 53 |
-
* @throws Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException
|
| 54 |
-
* @throws Dhl_MeinPaket_Model_Client_HttpTimeoutException
|
| 55 |
-
* @throws Dhl_MeinPaket_Model_Xml_InvalidXmlException
|
| 56 |
-
* @return Dhl_MeinPaket_Model_OrderCancellation_Result
|
| 57 |
-
*/
|
| 58 |
-
public function cancelOrderItems(Mage_Sales_Model_Order $order, array $items) {
|
| 59 |
-
/* @var $xmlRequestFactory Dhl_MeinPaket_Model_Xml_XmlRequestFactory */
|
| 60 |
-
$xmlRequestFactory = Mage::getModel ( 'meinpaket/Xml_XmlRequestFactory' );
|
| 61 |
-
|
| 62 |
-
/* @var $xmlResponseParser Dhl_MeinPaket_Model_Xml_XmlResponseParser */
|
| 63 |
-
$xmlResponseParser = Mage::getModel ( 'meinpaket/Xml_XmlResponseParser' );
|
| 64 |
-
|
| 65 |
-
/* @var $httpClient Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 66 |
-
$httpClient = Mage::getModel ( 'meinpaket/Client_XmlOverHttp' );
|
| 67 |
-
|
| 68 |
-
/* @var $result Dhl_MeinPaket_Model_Service_Order_CancellationService_Result */
|
| 69 |
-
$result = Mage::getModel ( 'meinpaket/service_order_cancellationService_result' );
|
| 70 |
-
|
| 71 |
-
$requestXml = '';
|
| 72 |
-
$responseXml = '';
|
| 73 |
-
|
| 74 |
-
try {
|
| 75 |
-
// TODO: see Observer line 220
|
| 76 |
-
$response = $httpClient->send ( $xmlRequestFactory->createPartialOrderCancellationRequest ( $order, $items ) );
|
| 77 |
-
$xmlResponseParser->parseOrderCancellationResultFromXml ( $responseXml, $result );
|
| 78 |
-
} catch ( Exception $e ) {
|
| 79 |
-
Mage::logException ( $e );
|
| 80 |
-
throw $e;
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
return $result;
|
| 84 |
-
}
|
| 85 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Service/Order/ShipmentExportService.php
DELETED
|
@@ -1,71 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Service which exports an order's shipment to MeinPaket.de.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Service_ShipmentExport
|
| 9 |
-
* @version $Id$
|
| 10 |
-
*/
|
| 11 |
-
class Dhl_MeinPaket_Model_Service_Order_ShipmentExportService {
|
| 12 |
-
/**
|
| 13 |
-
* Exports a shipment to MeinPaket.de.
|
| 14 |
-
*
|
| 15 |
-
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 16 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 17 |
-
* @throws Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException
|
| 18 |
-
* @throws Dhl_MeinPaket_Model_Client_HttpTimeoutException
|
| 19 |
-
* @throws Dhl_MeinPaket_Model_Xml_InvalidXmlException
|
| 20 |
-
* @return Dhl_MeinPaket_Model_Xml_Response_NotificationResponse
|
| 21 |
-
*/
|
| 22 |
-
public function exportShipment(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 23 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Request_NotificationRequest */
|
| 24 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/xml_request_notificationRequest' );
|
| 25 |
-
|
| 26 |
-
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 27 |
-
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 28 |
-
|
| 29 |
-
$notificationRequest->addConsignment ( $shipment );
|
| 30 |
-
|
| 31 |
-
/* @var $responseXml Dhl_MeinPaket_Model_Xml_Response_NotificationResponse */
|
| 32 |
-
$responseXml = $client->send ( $notificationRequest );
|
| 33 |
-
|
| 34 |
-
return $responseXml;
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
/**
|
| 38 |
-
* Exports the tracking number of a shipment to MeinPaket.de.
|
| 39 |
-
*
|
| 40 |
-
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 41 |
-
* The shipment which tracking numbers shall be exported.
|
| 42 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 43 |
-
* @throws Dhl_MeinPaket_Model_Client_BadHttpReturnCodeException
|
| 44 |
-
* @throws Dhl_MeinPaket_Model_Client_HttpTimeoutException
|
| 45 |
-
* @throws Dhl_MeinPaket_Model_Xml_InvalidXmlException
|
| 46 |
-
* @return Dhl_MeinPaket_Model_Service_TrackingNumberExport_Result
|
| 47 |
-
*/
|
| 48 |
-
public function exportTrackingNumber(Mage_Sales_Model_Order_Shipment_Track $track) {
|
| 49 |
-
|
| 50 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Request_NotificationRequest */
|
| 51 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/xml_request_notificationRequest' );
|
| 52 |
-
|
| 53 |
-
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 54 |
-
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 55 |
-
|
| 56 |
-
/* @var $result Dhl_MeinPaket_Model_Service_Product_Export_Result */
|
| 57 |
-
$result = Mage::getModel ( 'meinpaket/service_product_export_result' );
|
| 58 |
-
|
| 59 |
-
$notificationRequest->addTrackingNumber ( $track );
|
| 60 |
-
|
| 61 |
-
try {
|
| 62 |
-
$responseXml = $client->send ( $notificationRequest );
|
| 63 |
-
// TODO: parse
|
| 64 |
-
} catch ( Exception $e ) {
|
| 65 |
-
Mage::logException ( $e );
|
| 66 |
-
throw $e;
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
return null;
|
| 70 |
-
}
|
| 71 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Service/Product/Export.php
CHANGED
|
@@ -7,8 +7,7 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_Product
|
| 9 |
*/
|
| 10 |
-
class Dhl_MeinPaket_Model_Service_Product_Export extends
|
| 11 |
-
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var Dhl_MeinPaket_Helper_Product
|
|
@@ -32,85 +31,97 @@ class Dhl_MeinPaket_Model_Service_Product_Export extends Dhl_MeinPaket_Model_Ser
|
|
| 32 |
* @return Dhl_MeinPaket_Model_Service_Product_Export_Result
|
| 33 |
*/
|
| 34 |
public function exportProducts() {
|
| 35 |
-
$
|
| 36 |
|
| 37 |
-
|
| 38 |
-
$productBacklogs = Mage::getModel ( 'meinpaket/backlog_product' )->getCollection ();
|
| 39 |
|
| 40 |
-
|
| 41 |
-
$uploadRequest = Mage::getModel ( 'meinpaket/xml_request_uploadRequest' );
|
| 42 |
|
| 43 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 44 |
-
$client = Mage::getModel ( '
|
| 45 |
|
| 46 |
$count = 0;
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
$
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
break;
|
| 69 |
-
default :
|
| 70 |
-
$uploadRequest->removeProduct($product);
|
| 71 |
-
break;
|
| 72 |
-
}
|
| 73 |
-
} else {
|
| 74 |
-
Mage::log ( 'Product m' . $productId . ' already synced' );
|
| 75 |
}
|
| 76 |
-
|
| 77 |
-
$count ++;
|
| 78 |
-
|
| 79 |
-
$productBacklog->delete ();
|
| 80 |
-
} catch ( Exception $ex ) {
|
| 81 |
-
Mage::logException ( $ex );
|
| 82 |
-
// TODO: add error
|
| 83 |
-
// $result ['error'] ++;
|
| 84 |
-
Mage::log ( 'Error syncing product m' . $productId );
|
| 85 |
}
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
-
if ($uploadRequest->isHasData()) {
|
| 89 |
$response = $client->send ( $uploadRequest, true );
|
| 90 |
}
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d products", $count );
|
| 93 |
}
|
| 94 |
|
| 95 |
/**
|
| 96 |
* Exports products.
|
| 97 |
*
|
| 98 |
-
* @param Mage_Catalog_Model_Product $product
|
| 99 |
* @return Dhl_MeinPaket_Model_Service_Product_Export_Result
|
| 100 |
*/
|
| 101 |
public function deleteProduct(Mage_Catalog_Model_Product $product) {
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 106 |
-
$client = Mage::getModel ( '
|
| 107 |
-
|
| 108 |
-
$uploadRequest->removeProduct($product);
|
| 109 |
|
| 110 |
-
|
|
|
|
|
|
|
| 111 |
$response = $client->send ( $uploadRequest, true );
|
| 112 |
}
|
| 113 |
-
|
| 114 |
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d products", $count );
|
| 115 |
}
|
| 116 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_Product
|
| 9 |
*/
|
| 10 |
+
class Dhl_MeinPaket_Model_Service_Product_Export extends Dhl_MeinPaketCommon_Model_Service_Abstract {
|
|
|
|
| 11 |
/**
|
| 12 |
*
|
| 13 |
* @var Dhl_MeinPaket_Helper_Product
|
| 31 |
* @return Dhl_MeinPaket_Model_Service_Product_Export_Result
|
| 32 |
*/
|
| 33 |
public function exportProducts() {
|
| 34 |
+
$cycleCount = Mage::getStoreConfig ( 'meinpaket/advanced/cycle_product_count' );
|
| 35 |
|
| 36 |
+
$seenMagentoProducts = array ();
|
|
|
|
| 37 |
|
| 38 |
+
$uploadRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_UploadRequest ();
|
|
|
|
| 39 |
|
| 40 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 41 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 42 |
|
| 43 |
$count = 0;
|
| 44 |
|
| 45 |
+
/* @var $productBacklogs Dhl_MeinPaket_Model_Mysql4_Backlog_Product_Collection */
|
| 46 |
+
$productBacklogs = Mage::getModel ( 'meinpaket/backlog_product' )->getCollection ();
|
| 47 |
+
$productBacklogs->setPageSize ( 100 )->setCurPage ( 1 );
|
| 48 |
+
|
| 49 |
+
while ( $count < $cycleCount && $productBacklogs->count () > 0 && $productBacklogs->getCurPage () <= $productBacklogs->getLastPageNumber () ) {
|
| 50 |
+
foreach ( $productBacklogs as $productBacklog ) {
|
| 51 |
+
$productId = $productBacklog->getProductId ();
|
| 52 |
+
|
| 53 |
+
$changes = explode ( ',', $productBacklog->getChanges () );
|
| 54 |
+
|
| 55 |
+
try {
|
| 56 |
+
if (! isset ( $seenMagentoProducts [$productId] )) {
|
| 57 |
+
$seenMagentoProducts [$productId] = true;
|
| 58 |
+
|
| 59 |
+
/* @var $product Mage_Catalog_Model_Product */
|
| 60 |
+
$product = Mage::getModel ( 'catalog/product' )->load ( $productId );
|
| 61 |
+
|
| 62 |
+
$syncMode = $product->getData ( 'sync_with_dhl_mein_paket' );
|
| 63 |
+
|
| 64 |
+
switch ($syncMode) {
|
| 65 |
+
case Dhl_MeinPaket_Model_Entity_Attribute_Source_ProductSyncMode::COMPLETE :
|
| 66 |
+
$uploadRequest->addProductDescription ( $product );
|
| 67 |
+
break;
|
| 68 |
+
case Dhl_MeinPaket_Model_Entity_Attribute_Source_ProductSyncMode::OFFER :
|
| 69 |
+
$uploadRequest->addOffer ( $product );
|
| 70 |
+
break;
|
| 71 |
+
default :
|
| 72 |
+
$uploadRequest->removeProduct ( $product );
|
| 73 |
+
break;
|
| 74 |
+
}
|
| 75 |
+
} else {
|
| 76 |
+
Mage::log ( 'Product m' . $productId . ' already synced' );
|
| 77 |
+
}
|
| 78 |
|
| 79 |
+
$count ++;
|
| 80 |
|
| 81 |
+
$productBacklog->delete ();
|
| 82 |
+
} catch ( Exception $ex ) {
|
| 83 |
+
Mage::logException ( $ex );
|
| 84 |
+
// TODO: add error
|
| 85 |
+
// $result ['error'] ++;
|
| 86 |
+
Mage::log ( 'Error syncing product m' . $productId );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
}
|
| 89 |
+
|
| 90 |
+
// Set next page
|
| 91 |
+
$productBacklogs->setCurPage ( $productBacklogs->getCurPage () + 1 );
|
| 92 |
}
|
| 93 |
|
| 94 |
+
if ($uploadRequest->isHasData ()) {
|
| 95 |
$response = $client->send ( $uploadRequest, true );
|
| 96 |
}
|
| 97 |
|
| 98 |
+
if ($productBacklogs->count () >= $cycleCount) {
|
| 99 |
+
Mage::helper ( 'meinpaket/cron' )->scheduleJobs ( array (
|
| 100 |
+
Dhl_MeinPaket_Model_Cron::SYNC_ASYNC
|
| 101 |
+
), false );
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d products", $count );
|
| 105 |
}
|
| 106 |
|
| 107 |
/**
|
| 108 |
* Exports products.
|
| 109 |
*
|
| 110 |
+
* @param Mage_Catalog_Model_Product $product
|
| 111 |
* @return Dhl_MeinPaket_Model_Service_Product_Export_Result
|
| 112 |
*/
|
| 113 |
public function deleteProduct(Mage_Catalog_Model_Product $product) {
|
| 114 |
+
$uploadRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_UploadRequest ();
|
| 115 |
+
|
|
|
|
| 116 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 117 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
|
|
|
|
|
|
| 118 |
|
| 119 |
+
$uploadRequest->removeProduct ( $product );
|
| 120 |
+
|
| 121 |
+
if ($uploadRequest->isHasData ()) {
|
| 122 |
$response = $client->send ( $uploadRequest, true );
|
| 123 |
}
|
| 124 |
+
|
| 125 |
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d products", $count );
|
| 126 |
}
|
| 127 |
}
|
app/code/community/Dhl/MeinPaket/Model/Service/Product/Export/Exception/InvalidEan.php
CHANGED
|
@@ -6,7 +6,6 @@
|
|
| 6 |
* @category Mage
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_Product_Export_Exception_InvalidEan
|
| 9 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Model_Service_Product_Export_Exception_InvalidEan extends Dhl_MeinPaket_Model_Exception_InvalidDataException {
|
| 12 |
/**
|
| 6 |
* @category Mage
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_Product_Export_Exception_InvalidEan
|
|
|
|
| 9 |
*/
|
| 10 |
class Dhl_MeinPaket_Model_Service_Product_Export_Exception_InvalidEan extends Dhl_MeinPaket_Model_Exception_InvalidDataException {
|
| 11 |
/**
|
app/code/community/Dhl/MeinPaket/Model/Service/ProductData/RequestService.php
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
* Exports a shipment to MeinPaket.de.
|
| 14 |
*
|
|
@@ -21,7 +21,7 @@ class Dhl_MeinPaket_Model_Service_ProductData_RequestService {
|
|
| 21 |
*/
|
| 22 |
public function getProductData(Mage_Catalog_Model_Product $product, $sendEAN = false, $sendName = false) {
|
| 23 |
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */
|
| 24 |
-
$productDataRequest = Mage::getModel ( '
|
| 25 |
|
| 26 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 27 |
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
|
@@ -50,10 +50,10 @@ class Dhl_MeinPaket_Model_Service_ProductData_RequestService {
|
|
| 50 |
*/
|
| 51 |
public function requestBestPrices() {
|
| 52 |
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */
|
| 53 |
-
$productDataRequest = Mage::getModel ( '
|
| 54 |
|
| 55 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 56 |
-
$client = Mage::getModel ( '
|
| 57 |
|
| 58 |
try {
|
| 59 |
/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_ProductData_RequestService {
|
| 12 |
/**
|
| 13 |
* Exports a shipment to MeinPaket.de.
|
| 14 |
*
|
| 21 |
*/
|
| 22 |
public function getProductData(Mage_Catalog_Model_Product $product, $sendEAN = false, $sendName = false) {
|
| 23 |
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */
|
| 24 |
+
$productDataRequest = Mage::getModel ( 'meinpaketcommon/xml_request_dataRequest' );
|
| 25 |
|
| 26 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 27 |
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 50 |
*/
|
| 51 |
public function requestBestPrices() {
|
| 52 |
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */
|
| 53 |
+
$productDataRequest = Mage::getModel ( 'meinpaketcommon/xml_request_dataRequest' );
|
| 54 |
|
| 55 |
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 56 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 57 |
|
| 58 |
try {
|
| 59 |
/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
|
app/code/community/Dhl/MeinPaket/Model/Service/Result/Abstract.php
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
* @subpackage Model_Service
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
-
abstract class
|
| 12 |
|
| 13 |
/**
|
| 14 |
*
|
| 8 |
* @subpackage Model_Service
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
+
abstract class Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
|
| 13 |
/**
|
| 14 |
*
|
app/code/community/Dhl/MeinPaket/Model/Service/Result/Upload.php
CHANGED
|
@@ -8,6 +8,6 @@
|
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
| 10 |
S */
|
| 11 |
-
class
|
| 12 |
}
|
| 13 |
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
| 10 |
S */
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Result_Upload extends Dhl_MeinPaket_Model_Service_Result_Abstract {
|
| 12 |
}
|
| 13 |
|
app/code/community/Dhl/MeinPaket/Model/Validation/ValidatorFactory.php
DELETED
|
@@ -1,76 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Factory for validators.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Validation
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Validation_ValidatorFactory extends Varien_Object {
|
| 13 |
-
/**
|
| 14 |
-
*
|
| 15 |
-
* @var string
|
| 16 |
-
*/
|
| 17 |
-
protected $packagePrefix = 'meinpaket/Validation_Validator_';
|
| 18 |
-
|
| 19 |
-
/**
|
| 20 |
-
*
|
| 21 |
-
* @return Dhl_MeinPaket_Model_Validation_ValidatorChain
|
| 22 |
-
*/
|
| 23 |
-
public function createValidatorChain() {
|
| 24 |
-
return Mage::getModel ( 'meinpaket/Validation_ValidatorChain' );
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
*
|
| 29 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_NonEmptyString
|
| 30 |
-
*/
|
| 31 |
-
public function createNonEmptyStringValidator() {
|
| 32 |
-
return Mage::getModel ( $this->packagePrefix . 'NonEmptyString' );
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
/**
|
| 36 |
-
*
|
| 37 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_Ean
|
| 38 |
-
*/
|
| 39 |
-
public function createEanValidator() {
|
| 40 |
-
return Mage::getModel ( $this->packagePrefix . 'Ean' );
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
-
/**
|
| 44 |
-
*
|
| 45 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_IntGreaterZero
|
| 46 |
-
*/
|
| 47 |
-
public function createIntGreaterZeroValidator() {
|
| 48 |
-
return Mage::getModel ( $this->packagePrefix . 'IntGreaterZero' );
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
/**
|
| 52 |
-
*
|
| 53 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_CDATAContent
|
| 54 |
-
*/
|
| 55 |
-
public function createCDATAContentValidator() {
|
| 56 |
-
return Mage::getModel ( $this->packagePrefix . 'CDATAContent' );
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
/**
|
| 60 |
-
*
|
| 61 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_Url
|
| 62 |
-
*/
|
| 63 |
-
public function createUrlValidator() {
|
| 64 |
-
return Mage::getModel ( $this->packagePrefix . 'Url' );
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
/**
|
| 68 |
-
*
|
| 69 |
-
* @param integer $maxLength
|
| 70 |
-
* @return Dhl_MeinPaket_Model_Validation_Validator_StringMaxLength
|
| 71 |
-
*/
|
| 72 |
-
public function createStringMaxLengthValidator($maxLength = Dhl_MeinPaket_Model_Validation_Validator_StringMaxLength::LENGTH_INFINITE) {
|
| 73 |
-
return Mage::getModel ( $this->packagePrefix . 'StringMaxLength' )->setMaxLength ( $maxLength );
|
| 74 |
-
}
|
| 75 |
-
}
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Xml/Request/QueryRequest.php
DELETED
|
@@ -1,72 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Partial which represents the 'queryRequest' element.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Xml_Partial
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Xml_Request_QueryRequest extends Dhl_MeinPaket_Model_Xml_AbstractXmlRequest {
|
| 13 |
-
|
| 14 |
-
/**
|
| 15 |
-
* Default Constructor.
|
| 16 |
-
*/
|
| 17 |
-
public function __construct() {
|
| 18 |
-
parent::__construct ();
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
/**
|
| 22 |
-
* Create the root element for the document.
|
| 23 |
-
*
|
| 24 |
-
* @return DOMNode
|
| 25 |
-
*/
|
| 26 |
-
public function createDocumentElement() {
|
| 27 |
-
$this->node = $this->getDocument ()->createElement ( 'queryRequest' );
|
| 28 |
-
$this->node->setAttribute ( 'xmlns', self::XMLNS_ORDERS );
|
| 29 |
-
$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );
|
| 30 |
-
$this->node->setAttribute ( 'version', '1.0' );
|
| 31 |
-
$this->getDocument ()->appendChild ( $this->node );
|
| 32 |
-
}
|
| 33 |
-
|
| 34 |
-
/**
|
| 35 |
-
* Add order request.
|
| 36 |
-
*
|
| 37 |
-
* @param string $from
|
| 38 |
-
* @param string $to
|
| 39 |
-
* @param string $status
|
| 40 |
-
*/
|
| 41 |
-
public function addOrders($from = null, $to = null, $status = null) {
|
| 42 |
-
$this->orders = $this->getDocument ()->createElement ( 'orders' );
|
| 43 |
-
$this->getDocumentElement ()->appendChild ( $this->orders );
|
| 44 |
-
$this->orders->setAttribute ( 'getEmail', 'true' );
|
| 45 |
-
$this->orders->setAttribute ( 'additionalInfos', true );
|
| 46 |
-
|
| 47 |
-
if ($from != null) {
|
| 48 |
-
$dateFromNode = $this->getDocument ()->createElement ( "dateFrom", $this->getFormatedDate ( $from ) );
|
| 49 |
-
$this->orders->appendChild ( $dateFromNode );
|
| 50 |
-
} else {
|
| 51 |
-
// One week ago
|
| 52 |
-
/* @var $date Zend_Date */
|
| 53 |
-
$date = Zend_Date::now ();
|
| 54 |
-
$date->subWeek ( 1 );
|
| 55 |
-
$date->setHour ( 0 );
|
| 56 |
-
$date->setMinute ( 0 );
|
| 57 |
-
$date->setMilliSecond ( 0 );
|
| 58 |
-
$dateFromNode = $this->getDocument ()->createElement ( "dateFrom", $date->toString ( Zend_Date::ISO_8601 ) );
|
| 59 |
-
$this->orders->appendChild ( $dateFromNode );
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
-
if ($to != null) {
|
| 63 |
-
$dateToNode = $this->getDocument ()->createElement ( "dateTo", $this->getFormatedDate ( $to ) );
|
| 64 |
-
$this->orders->appendChild ( $dateToNode );
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
if ($status != null) {
|
| 68 |
-
$statusNode = $this->getDocument ()->createElement ( "orderStatus", $status );
|
| 69 |
-
$this->orders->appendChild ( $statusNode );
|
| 70 |
-
}
|
| 71 |
-
}
|
| 72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Xml/Request/SubmitCartRequest.php
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Partial which represents the 'submitCartRequest' element.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Xml_Partial
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Xml_Request_SubmitCartRequest extends Dhl_MeinPaket_Model_Xml_AbstractXmlRequest {
|
| 13 |
-
/**
|
| 14 |
-
* Default Constructor.
|
| 15 |
-
*/
|
| 16 |
-
public function __construct() {
|
| 17 |
-
parent::__construct ();
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Create the root element for the document.
|
| 22 |
-
*
|
| 23 |
-
* @return DOMNode
|
| 24 |
-
*/
|
| 25 |
-
public function createDocumentElement() {
|
| 26 |
-
$this->node = $this->getDocument ()->createElement ( 'submitCartRequest' );
|
| 27 |
-
$this->node->setAttribute ( 'xmlns', self::XMLNS_CHECKOUT );
|
| 28 |
-
$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );
|
| 29 |
-
$this->node->setAttribute ( 'version', '1.0' );
|
| 30 |
-
$this->getDocument ()->appendChild ( $this->node );
|
| 31 |
-
}
|
| 32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Xml/Response/QueryResponse.php
DELETED
|
@@ -1,34 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Dhl_MeinPaket_Model_Xml_Response_QueryResponse extends Dhl_MeinPaket_Model_Xml_Response_Abstract {
|
| 3 |
-
/**
|
| 4 |
-
*
|
| 5 |
-
* @var $orders array
|
| 6 |
-
*/
|
| 7 |
-
private $orders = array ();
|
| 8 |
-
|
| 9 |
-
/**
|
| 10 |
-
* Constructor
|
| 11 |
-
*
|
| 12 |
-
* @param unknown $domElement
|
| 13 |
-
*/
|
| 14 |
-
public function __construct(DOMElement $domElement) {
|
| 15 |
-
parent::__construct ( $domElement );
|
| 16 |
-
assert ( $domElement->localName == 'queryResponse' );
|
| 17 |
-
|
| 18 |
-
foreach ( $domElement->childNodes as $queryResponseEntries ) {
|
| 19 |
-
switch ($queryResponseEntries->localName) {
|
| 20 |
-
case 'order' :
|
| 21 |
-
$this->orders [] = new Dhl_MeinPaket_Model_Xml_Response_Partial_Order ( $queryResponseEntries );
|
| 22 |
-
break;
|
| 23 |
-
}
|
| 24 |
-
}
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
*
|
| 29 |
-
* @return $orders
|
| 30 |
-
*/
|
| 31 |
-
public function getOrders() {
|
| 32 |
-
return $this->orders;
|
| 33 |
-
}
|
| 34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Xml/XmlRequestFactory.php
DELETED
|
@@ -1,548 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* XML Request builder class which generates the requests to communicate with
|
| 5 |
-
* the MeinPaket.de webservice.
|
| 6 |
-
*
|
| 7 |
-
* @category Dhl
|
| 8 |
-
* @package Dhl_MeinPaket
|
| 9 |
-
* @subpackage Model_Xml
|
| 10 |
-
* @version $Id$
|
| 11 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 12 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 13 |
-
*/
|
| 14 |
-
class Dhl_MeinPaket_Model_Xml_XmlRequestFactory extends Varien_Object {
|
| 15 |
-
|
| 16 |
-
/**
|
| 17 |
-
* The XML-version of the generated XML.
|
| 18 |
-
*
|
| 19 |
-
* @var string
|
| 20 |
-
*/
|
| 21 |
-
const XML_VERSION = '1.0';
|
| 22 |
-
|
| 23 |
-
/**
|
| 24 |
-
* The charset which is set in the XML prologue of the generated XML.
|
| 25 |
-
*
|
| 26 |
-
* @var string
|
| 27 |
-
*/
|
| 28 |
-
const XML_CHARSET = 'UTF-8';
|
| 29 |
-
|
| 30 |
-
/**
|
| 31 |
-
* Constructor.
|
| 32 |
-
*
|
| 33 |
-
* @return void
|
| 34 |
-
*/
|
| 35 |
-
public function __construct() {
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
-
/**
|
| 39 |
-
* NEW
|
| 40 |
-
* Creates the XML for upload request.
|
| 41 |
-
*
|
| 42 |
-
* @param Dhl_MeinPaket_Model_Service_Product_Export_Result $result
|
| 43 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 44 |
-
* @return Dhl_MeinPaket_Model_Xml_Partial_UploadRequest
|
| 45 |
-
*/
|
| 46 |
-
public function createUploadRequest() {
|
| 47 |
-
return Mage::getModel ( 'meinpaket/xml_requets_uploadRequest' );
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
/**
|
| 51 |
-
* Crates XML for a variant group upload.
|
| 52 |
-
*
|
| 53 |
-
* @param Dhl_MeinPaket_Model_Service_Product_Export_Variant_Group_Collection $variantGroups
|
| 54 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 55 |
-
* @return string
|
| 56 |
-
*/
|
| 57 |
-
public function createVariantGroupUploadRequest(Dhl_MeinPaket_Model_Service_Product_Export_Variant_Group_Collection $variantGroups) {
|
| 58 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 59 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
-
if ($variantGroups->count () < 1) {
|
| 63 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No variant groups.' );
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
$xml = '';
|
| 67 |
-
$document = $this->createDocument ();
|
| 68 |
-
|
| 69 |
-
/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Partial_UploadRequest */
|
| 70 |
-
$uploadRequest = Mage::getModel ( 'meinpaket/xml_partial_uploadRequest' );
|
| 71 |
-
|
| 72 |
-
/* @var $variantGroupsPartial Dhl_MeinPaket_Model_Xml_Partial_VariantGroups */
|
| 73 |
-
$variantGroupsPartial = Mage::getModel ( 'meinpaket/xml_partial_variantGroups' );
|
| 74 |
-
|
| 75 |
-
$uploadRequest->setDocument ( $document )->build ();
|
| 76 |
-
$variantGroupsPartial->setDocument ( $document )->build ();
|
| 77 |
-
|
| 78 |
-
foreach ( $variantGroups as $variantGroup ) {
|
| 79 |
-
/* @var $variantGroupPartial Dhl_MeinPaket_Model_Xml_Partial_VariantGroup */
|
| 80 |
-
$variantGroupPartial = Mage::getModel ( 'meinpaket/xml_partial_variantGroup' );
|
| 81 |
-
|
| 82 |
-
$variantGroupPartial->setDocument ( $document )->setVariantGroup ( $variantGroup )->build ();
|
| 83 |
-
|
| 84 |
-
$variantGroupsPartial->getNode ()->appendChild ( $variantGroupPartial->getNode () );
|
| 85 |
-
}
|
| 86 |
-
|
| 87 |
-
$uploadRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 88 |
-
$uploadRequest->getNode ()->appendChild ( $variantGroupsPartial->getNode () );
|
| 89 |
-
|
| 90 |
-
$document->appendChild ( $uploadRequest->getNode () );
|
| 91 |
-
|
| 92 |
-
$xml = $document->saveXML ();
|
| 93 |
-
|
| 94 |
-
return $xml;
|
| 95 |
-
}
|
| 96 |
-
|
| 97 |
-
/**
|
| 98 |
-
* Creates the XML for a product upload request.
|
| 99 |
-
*
|
| 100 |
-
* @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection
|
| 101 |
-
* @param Dhl_MeinPaket_Model_Service_Product_Export_Result $result
|
| 102 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 103 |
-
* @return string
|
| 104 |
-
*/
|
| 105 |
-
public function createProductsUploadRequestXml(Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection, Dhl_MeinPaket_Model_Service_Product_Export_Result $result) {
|
| 106 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 107 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 108 |
-
}
|
| 109 |
-
|
| 110 |
-
$document = $this->createDocument ();
|
| 111 |
-
$uploadRequest = Mage::getModel ( 'meinpaket/xml_partial_uploadRequest' );
|
| 112 |
-
$descriptions = Mage::getModel ( 'meinpaket/xml_partial_descriptions' );
|
| 113 |
-
$offers = Mage::getModel ( 'meinpaket/xml_partial_offers' );
|
| 114 |
-
$description = null;
|
| 115 |
-
$offer = null;
|
| 116 |
-
$xml = '';
|
| 117 |
-
|
| 118 |
-
$uploadRequest->setDocument ( $document )->build ();
|
| 119 |
-
$descriptions->setDocument ( $document )->build ();
|
| 120 |
-
$offers->setDocument ( $document )->build ();
|
| 121 |
-
|
| 122 |
-
if ($productCollection->count () > 0) {
|
| 123 |
-
|
| 124 |
-
/* @var $attributeHelper Dhl_MeinPaket_Helper_Attribute */
|
| 125 |
-
$attributeHelper = Mage::helper ( 'meinpaket/attribute' );
|
| 126 |
-
|
| 127 |
-
foreach ( $productCollection as $product ) {
|
| 128 |
-
// $product->load($product->getId());
|
| 129 |
-
// $setAttributes = $product->getTypeInstance(true)->getSetAttributes($product);
|
| 130 |
-
// foreach($setAttributes as $attributeIndex => $setAttribute) {
|
| 131 |
-
// if($attributeHelper->isExportableAttribute($setAttribute)) {
|
| 132 |
-
// Mage::log("Attribute is exportable: ".$attributeIndex);
|
| 133 |
-
// }
|
| 134 |
-
// }
|
| 135 |
-
// Mage::log('Export: '.$product->getId().' , '.$product->getTypeId());
|
| 136 |
-
// Mage::log("Custom Options: ".print_r($attrs,true));
|
| 137 |
-
// Mage::log("Default Attr Set Id: ".$product->getDefaultAttributeSetId());
|
| 138 |
-
// Mage::log("Ver3: ".print_r(Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId()),true));
|
| 139 |
-
// Mage::log("ks: ".print_r(get_class($x),true));
|
| 140 |
-
// Mage::log("Full: ".print_r(gettype($x[0]),true));
|
| 141 |
-
// Mage::log(print_r($product->loadParentProductIds()->getData('parent_product_ids'),true));
|
| 142 |
-
// $configurable_product = Mage::getModel('catalog/product_type_configurable');
|
| 143 |
-
// $parentIdArray = $configurable_product->getParentIdsByChild($product->getId());
|
| 144 |
-
// Mage::log("solution B: ".print_r($parentIdArray,true));
|
| 145 |
-
|
| 146 |
-
try {
|
| 147 |
-
$description = Mage::getModel ( 'meinpaket/xml_partial_productDescription' );
|
| 148 |
-
$description->setDocument ( $document )->setProduct ( $product )->build ();
|
| 149 |
-
$descriptions->getNode ()->appendChild ( $description->getNode () );
|
| 150 |
-
} catch ( Dhl_MeinPaket_Model_Exception_InvalidDataException $e ) {
|
| 151 |
-
Mage::logException ( $e );
|
| 152 |
-
|
| 153 |
-
$result->addErrorForProductDescription ( $e->getEntityId (), $e->getFieldName (), $e->getErrorType () );
|
| 154 |
-
|
| 155 |
-
// not all required data set for a description - we skip the description therefore
|
| 156 |
-
// but we need at least a valid ean (sku) to still send an offer
|
| 157 |
-
if (! $this->hasValidSku ( $product )) {
|
| 158 |
-
$result->addErrorForProductDescription ( $e->getEntityId (), 'sku', Dhl_MeinPaket_Model_Validation_ValidationInterface::ERROR_FIELD_IS_INVALID );
|
| 159 |
-
continue; // skip current
|
| 160 |
-
}
|
| 161 |
-
}
|
| 162 |
-
// if description is not set - we need at least an sku - otherwise skip this item!
|
| 163 |
-
$offer = Mage::getModel ( 'meinpaket/xml_partial_productOffer' );
|
| 164 |
-
$offer->setDocument ( $document )->setProduct ( $product )->build ();
|
| 165 |
-
$offers->getNode ()->appendChild ( $offer->getNode () );
|
| 166 |
-
$result->incrementTotalRequestCount ();
|
| 167 |
-
}
|
| 168 |
-
}
|
| 169 |
-
|
| 170 |
-
$uploadRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 171 |
-
$uploadRequest->getNode ()->appendChild ( $descriptions->getNode () );
|
| 172 |
-
$uploadRequest->getNode ()->appendChild ( $offers->getNode () );
|
| 173 |
-
|
| 174 |
-
$document->appendChild ( $uploadRequest->getNode () );
|
| 175 |
-
|
| 176 |
-
$xml = $document->saveXML ();
|
| 177 |
-
|
| 178 |
-
$result->setRequestXml ( $xml );
|
| 179 |
-
|
| 180 |
-
return $xml;
|
| 181 |
-
}
|
| 182 |
-
|
| 183 |
-
/**
|
| 184 |
-
* Creates the XML for an order cancellation request.
|
| 185 |
-
*
|
| 186 |
-
* @param Mage_Sales_Model_Order $order
|
| 187 |
-
* @param Mage_Sales_Model_Quote $quote
|
| 188 |
-
* @param Dhl_MeinPaket_Model_OrderCancellation_Result $result
|
| 189 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 190 |
-
* @return string
|
| 191 |
-
*/
|
| 192 |
-
public function createOrderCancellationRequest(Mage_Sales_Model_Order $order, Mage_Sales_Model_Quote $quote, Dhl_MeinPaket_Model_OrderCancellation_Result $result) {
|
| 193 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 194 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 195 |
-
}
|
| 196 |
-
|
| 197 |
-
$document = $this->createDocument ();
|
| 198 |
-
|
| 199 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Partial_NotificationRequest */
|
| 200 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/Xml_Partial_NotificationRequest' );
|
| 201 |
-
|
| 202 |
-
/* @var $cancellations Dhl_MeinPaket_Model_Xml_Partial_Cancellations */
|
| 203 |
-
$cancellations = Mage::getModel ( 'meinpaket/Xml_Partial_Cancellations' );
|
| 204 |
-
|
| 205 |
-
/* @var $cancellation Dhl_MeinPaket_Model_Xml_Partial_Cancellation */
|
| 206 |
-
$cancellation = Mage::getModel ( 'meinpaket/Xml_Partial_Cancellation' );
|
| 207 |
-
|
| 208 |
-
/* @var $cancellationEntry Dhl_MeinPaket_Model_Xml_Partial_CancellationEntry */
|
| 209 |
-
$cancellationEntry = null;
|
| 210 |
-
|
| 211 |
-
$notificationRequest->setDocument ( $document )->build ();
|
| 212 |
-
|
| 213 |
-
$cancellations->setDocument ( $document )->build ();
|
| 214 |
-
|
| 215 |
-
$cancellation->setDocument ( $document )->setOrderId ( $order->getDhlMeinPaketOrderId () )->setConsignmentId ( $order->getId () )->build ();
|
| 216 |
-
|
| 217 |
-
foreach ( $quote->getItemsCollection () as $item ) {
|
| 218 |
-
$cancellationEntry = Mage::getModel ( 'meinpaket/Xml_Partial_CancellationEntry' );
|
| 219 |
-
$cancellationEntry->setDocument ( $document )->setProductId ( $item->getProductId () )->setQuantity ( $item->getQty () )->setReason ( 'OutOfStock' )->build ();
|
| 220 |
-
$cancellation->getNode ()->appendChild ( $cancellationEntry->getNode () );
|
| 221 |
-
}
|
| 222 |
-
|
| 223 |
-
$cancellations->getNode ()->appendChild ( $cancellation->getNode () );
|
| 224 |
-
$notificationRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 225 |
-
$notificationRequest->getNode ()->appendChild ( $cancellations->getNode () );
|
| 226 |
-
$document->appendChild ( $notificationRequest->getNode () );
|
| 227 |
-
|
| 228 |
-
return $document->saveXML ();
|
| 229 |
-
}
|
| 230 |
-
|
| 231 |
-
/**
|
| 232 |
-
* Creates the XML for a request that cancels single items of an order.
|
| 233 |
-
*
|
| 234 |
-
* @param Mage_Sales_Model_Order $order
|
| 235 |
-
* @param array $items
|
| 236 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 237 |
-
* @return string
|
| 238 |
-
*/
|
| 239 |
-
public function createPartialOrderCancellationRequest(Mage_Sales_Model_Order $order, array $items) {
|
| 240 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 241 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 242 |
-
}
|
| 243 |
-
|
| 244 |
-
$document = $this->createDocument ();
|
| 245 |
-
|
| 246 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Partial_NotificationRequest */
|
| 247 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/Xml_Partial_NotificationRequest' );
|
| 248 |
-
|
| 249 |
-
/* @var $cancellations Dhl_MeinPaket_Model_Xml_Partial_Cancellations */
|
| 250 |
-
$cancellations = Mage::getModel ( 'meinpaket/Xml_Partial_Cancellations' );
|
| 251 |
-
|
| 252 |
-
/* @var $cancellation Dhl_MeinPaket_Model_Xml_Partial_Cancellation */
|
| 253 |
-
$cancellation = Mage::getModel ( 'meinpaket/Xml_Partial_Cancellation' );
|
| 254 |
-
|
| 255 |
-
/* @var $cancellationEntry Dhl_MeinPaket_Model_Xml_Partial_CancellationEntry */
|
| 256 |
-
$cancellationEntry = null;
|
| 257 |
-
|
| 258 |
-
$notificationRequest->setDocument ( $document )->build ();
|
| 259 |
-
|
| 260 |
-
$cancellations->setDocument ( $document )->build ();
|
| 261 |
-
|
| 262 |
-
$cancellation->setDocument ( $document )->setOrderId ( $order->getDhlMeinPaketOrderId () )->setConsignmentId ( ( string ) $order->getId () )->build ();
|
| 263 |
-
|
| 264 |
-
foreach ( $items as $item ) {
|
| 265 |
-
$cancellationEntry = Mage::getModel ( 'meinpaket/Xml_Partial_CancellationEntry' );
|
| 266 |
-
$cancellationEntry->setDocument ( $document )->setProductId ( $item ['productId'] )->setQuantity ( $item ['qty'] )->setReason ( 'CustomerRequest' )->build ();
|
| 267 |
-
$cancellation->getNode ()->appendChild ( $cancellationEntry->getNode () );
|
| 268 |
-
}
|
| 269 |
-
|
| 270 |
-
$cancellations->getNode ()->appendChild ( $cancellation->getNode () );
|
| 271 |
-
$notificationRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 272 |
-
$notificationRequest->getNode ()->appendChild ( $cancellations->getNode () );
|
| 273 |
-
$document->appendChild ( $notificationRequest->getNode () );
|
| 274 |
-
|
| 275 |
-
return $document->saveXML ();
|
| 276 |
-
}
|
| 277 |
-
|
| 278 |
-
/**
|
| 279 |
-
* Creates XML for an order download request.
|
| 280 |
-
*
|
| 281 |
-
* @param integer $dateFrom
|
| 282 |
-
* @param integer $dateTo
|
| 283 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 284 |
-
* @return string
|
| 285 |
-
*/
|
| 286 |
-
public function createOrderRequestXml($dateFrom, $dateTo) {
|
| 287 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 288 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 289 |
-
}
|
| 290 |
-
|
| 291 |
-
$document = $this->createDocument ();
|
| 292 |
-
$orderRequest = Mage::getModel ( 'meinpaket/xml_partial_orderRequest' );
|
| 293 |
-
$orders = Mage::getModel ( 'meinpaket/xml_partial_orders' );
|
| 294 |
-
|
| 295 |
-
$orderRequest->setDocument ( $document )->build ();
|
| 296 |
-
$orders->setDateFrom ( $dateFrom )->setDateTo ( $dateTo )->setDocument ( $document )->build ();
|
| 297 |
-
|
| 298 |
-
$orderRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 299 |
-
$orderRequest->getNode ()->appendChild ( $orders->getNode () );
|
| 300 |
-
|
| 301 |
-
$document->appendChild ( $orderRequest->getNode () );
|
| 302 |
-
|
| 303 |
-
return $document->saveXML ();
|
| 304 |
-
}
|
| 305 |
-
|
| 306 |
-
/**
|
| 307 |
-
* Creates XML for a shipment export request.
|
| 308 |
-
*
|
| 309 |
-
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 310 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 311 |
-
* @return string
|
| 312 |
-
*/
|
| 313 |
-
public function createShipmentRequest(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 314 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 315 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 316 |
-
}
|
| 317 |
-
|
| 318 |
-
$document = $this->createDocument ();
|
| 319 |
-
|
| 320 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Partial_NotificationRequest */
|
| 321 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/Xml_Partial_NotificationRequest' );
|
| 322 |
-
|
| 323 |
-
/* @var $consignments Dhl_MeinPaket_Model_Xml_Partial_Consignments */
|
| 324 |
-
$consignments = Mage::getModel ( 'meinpaket/Xml_Partial_Consignments' );
|
| 325 |
-
|
| 326 |
-
/* @var $consignment Dhl_MeinPaket_Model_Xml_Partial_Consignment */
|
| 327 |
-
$consignment = null;
|
| 328 |
-
|
| 329 |
-
/* @var $consignmentEntry Dhl_MeinPaket_Model_Xml_Partial_ConsignmentEntry */
|
| 330 |
-
$consignmentEntry = null;
|
| 331 |
-
|
| 332 |
-
/* @var $shipmentUtil Dhl_MeinPaket_Model_Util_Shipment */
|
| 333 |
-
$shipmentUtil = Mage::getSingleton ( 'meinpaket/Util_Shipment' );
|
| 334 |
-
|
| 335 |
-
$consignmentId = $shipmentUtil->getConsignmentIdForShipment ( $shipment );
|
| 336 |
-
|
| 337 |
-
$notificationRequest->setDocument ( $document )->build ();
|
| 338 |
-
|
| 339 |
-
$consignments->setDocument ( $document )->build ();
|
| 340 |
-
|
| 341 |
-
$itemsCollection = Mage::getModel ( 'sales/order_shipment_item' )->getCollection ();
|
| 342 |
-
$itemsCollection->addAttributeToSelect ( 'qty' )->addAttributeToSelect ( 'product_id' )->addAttributeToFilter ( 'parent_id', $shipment->getId () )->load ();
|
| 343 |
-
|
| 344 |
-
foreach ( $itemsCollection as $item ) {
|
| 345 |
-
|
| 346 |
-
$consignment = Mage::getModel ( 'meinpaket/Xml_Partial_Consignment' );
|
| 347 |
-
$consignment->setDocument ( $document )->setOrderId ( $shipment->getOrder ()->getDhlMeinPaketOrderId () )->setConsignmentId ( $consignmentId )->build ();
|
| 348 |
-
|
| 349 |
-
$consignmentEntry = Mage::getModel ( 'meinpaket/Xml_Partial_ConsignmentEntry' );
|
| 350 |
-
$consignmentEntry->setDocument ( $document )->setProductId ( $item->getProductId () )->setQuantity ( $item->getQty () )->build ();
|
| 351 |
-
|
| 352 |
-
$consignment->getNode ()->appendChild ( $consignmentEntry->getNode () );
|
| 353 |
-
$consignments->getNode ()->appendChild ( $consignment->getNode () );
|
| 354 |
-
}
|
| 355 |
-
|
| 356 |
-
$notificationRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 357 |
-
$notificationRequest->getNode ()->appendChild ( $consignments->getNode () );
|
| 358 |
-
$document->appendChild ( $notificationRequest->getNode () );
|
| 359 |
-
|
| 360 |
-
return $document->saveXML ();
|
| 361 |
-
}
|
| 362 |
-
|
| 363 |
-
/**
|
| 364 |
-
* Creates XML for a request which notifies MeinPaket.de about returned shipments.
|
| 365 |
-
*
|
| 366 |
-
* @param Mage_Sales_Model_Order_Creditmemo $creditMemo
|
| 367 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 368 |
-
* @return string
|
| 369 |
-
*/
|
| 370 |
-
public function createReturnRequest(Mage_Sales_Model_Order_Creditmemo $creditMemo) {
|
| 371 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 372 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 373 |
-
}
|
| 374 |
-
|
| 375 |
-
$document = $this->createDocument ();
|
| 376 |
-
|
| 377 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Partial_NotificationRequest */
|
| 378 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/Xml_Partial_NotificationRequest' );
|
| 379 |
-
|
| 380 |
-
/* @var $returns Dhl_MeinPaket_Model_Xml_Partial_Returns */
|
| 381 |
-
$returns = Mage::getModel ( 'meinpaket/Xml_Partial_Returns' );
|
| 382 |
-
|
| 383 |
-
/* @var $return Dhl_MeinPaket_Model_Xml_Partial_Return */
|
| 384 |
-
$return = Mage::getModel ( 'meinpaket/Xml_Partial_Return' );
|
| 385 |
-
|
| 386 |
-
/* @var $returnEntry Dhl_MeinPaket_Model_Xml_Partial_ReturnEntry */
|
| 387 |
-
$returnEntry = null;
|
| 388 |
-
|
| 389 |
-
$comment = '';
|
| 390 |
-
|
| 391 |
-
$notificationRequest->setDocument ( $document )->build ();
|
| 392 |
-
|
| 393 |
-
$returns->setDocument ( $document )->build ();
|
| 394 |
-
|
| 395 |
-
if ($creditMemo->getCommentsCollection ()->count () > 0) {
|
| 396 |
-
$comment = $creditMemo->getCommentsCollection ()->getFirstItem ()->getComment ();
|
| 397 |
-
}
|
| 398 |
-
|
| 399 |
-
$return->setDocument ( $document )->setOrderId ( $creditMemo->getOrder ()->getDhlMeinPaketOrderId () )->setReturnId ( $creditMemo->getId () )->setComment ( $comment )->setReimbursedDeliveryCosts ( $creditMemo->getShippingAmount () )->setReduction ( $creditMemo->getAdjustment () * (- 1) )->build ();
|
| 400 |
-
|
| 401 |
-
foreach ( $creditMemo->getItemsCollection () as $item ) {
|
| 402 |
-
$returnEntry = Mage::getModel ( 'meinpaket/Xml_Partial_ReturnEntry' );
|
| 403 |
-
$returnEntry->setDocument ( $document )->setProductId ( $item->getProductId () )->setQuantity ( $item->getQty () )->build ();
|
| 404 |
-
$return->getNode ()->appendChild ( $returnEntry->getNode () );
|
| 405 |
-
}
|
| 406 |
-
|
| 407 |
-
$returns->getNode ()->appendChild ( $return->getNode () );
|
| 408 |
-
$notificationRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 409 |
-
$notificationRequest->getNode ()->appendChild ( $returns->getNode () );
|
| 410 |
-
|
| 411 |
-
$document->appendChild ( $notificationRequest->getNode () );
|
| 412 |
-
|
| 413 |
-
return $document->saveXML ();
|
| 414 |
-
}
|
| 415 |
-
|
| 416 |
-
/**
|
| 417 |
-
* Creates the XML request which contains the tracking code for particular shipment.
|
| 418 |
-
*
|
| 419 |
-
* @param Mage_Sales_Model_Order_Shipment_Track $track
|
| 420 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 421 |
-
* @return string
|
| 422 |
-
*/
|
| 423 |
-
public function createShipmentTrackRequestXml(Mage_Sales_Model_Order_Shipment_Track $track) {
|
| 424 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 425 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 426 |
-
}
|
| 427 |
-
|
| 428 |
-
$document = $this->createDocument ();
|
| 429 |
-
|
| 430 |
-
/* @var $notificationRequest Dhl_MeinPaket_Model_Xml_Partial_NotificationRequest */
|
| 431 |
-
$notificationRequest = Mage::getModel ( 'meinpaket/Xml_Partial_NotificationRequest' );
|
| 432 |
-
|
| 433 |
-
/* @var $trackingNumbers Dhl_MeinPaket_Model_Xml_Partial_TrackingNumbers */
|
| 434 |
-
$trackingNumbers = Mage::getModel ( 'meinpaket/Xml_Partial_TrackingNumbers' );
|
| 435 |
-
|
| 436 |
-
/* @var $trackingNumber Dhl_MeinPaket_Model_Xml_Partial_TrackingNumber */
|
| 437 |
-
$trackingNumber = Mage::getModel ( 'meinpaket/Xml_Partial_TrackingNumber' );
|
| 438 |
-
|
| 439 |
-
/* @var $shipmentUtil Dhl_MeinPaket_Model_Util_Shipment */
|
| 440 |
-
$shipmentUtil = Mage::getSingleton ( 'meinpaket/Util_Shipment' );
|
| 441 |
-
|
| 442 |
-
$consignmentId = $shipmentUtil->getConsignmentIdForShipment ( $track->getShipment () );
|
| 443 |
-
|
| 444 |
-
$notificationRequest->setDocument ( $document )->build ();
|
| 445 |
-
|
| 446 |
-
$trackingNumbers->setDocument ( $document )->build ();
|
| 447 |
-
|
| 448 |
-
$trackingNumber->setConsignmentId ( $consignmentId )->setTrackingId ( $track->getNumber () )->setDocument ( $document )->build ();
|
| 449 |
-
|
| 450 |
-
$trackingNumbers->getNode ()->appendChild ( $trackingNumber->getNode () );
|
| 451 |
-
$notificationRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 452 |
-
$notificationRequest->getNode ()->appendChild ( $trackingNumbers->getNode () );
|
| 453 |
-
|
| 454 |
-
$document->appendChild ( $notificationRequest->getNode () );
|
| 455 |
-
|
| 456 |
-
return $document->saveXML ();
|
| 457 |
-
}
|
| 458 |
-
public function createProductDeleteRequest($product) {
|
| 459 |
-
}
|
| 460 |
-
|
| 461 |
-
/**
|
| 462 |
-
* Creates the XML for an external checkout.
|
| 463 |
-
*
|
| 464 |
-
* @param Dhl_MeinPaket_Model_Service_Cart_Export_Checkout $checkout
|
| 465 |
-
* @return string
|
| 466 |
-
*/
|
| 467 |
-
public function createSubmitCartRequest(Dhl_MeinPaket_Model_Service_Cart_Export_Checkout $checkout) {
|
| 468 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 469 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 470 |
-
}
|
| 471 |
-
|
| 472 |
-
$document = $this->createDocument ();
|
| 473 |
-
|
| 474 |
-
/* @var $submitCartRequest Dhl_MeinPaket_Model_Xml_Partial_SubmitCartRequest */
|
| 475 |
-
$submitCartRequest = Mage::getModel ( 'meinpaket/Xml_Partial_SubmitCartRequest' );
|
| 476 |
-
|
| 477 |
-
/* @var $shoppingCart Dhl_MeinPaket_Model_Xml_Partial_ShoppingCart */
|
| 478 |
-
$shoppingCart = Mage::getModel ( 'meinpaket/Xml_Partial_ShoppingCart' );
|
| 479 |
-
|
| 480 |
-
/* @var $shoppingCartItem Dhl_MeinPaket_Model_Xml_Partial_ShoppingCartItem */
|
| 481 |
-
$shoppingCartItem = null;
|
| 482 |
-
|
| 483 |
-
$submitCartRequest->setDocument ( $document )->build ();
|
| 484 |
-
|
| 485 |
-
foreach ( $checkout->getCart ()->getItems () as $item ) {
|
| 486 |
-
$shoppingCartItem = Mage::getModel ( 'meinpaket/xml_partial_shoppingCartItem' );
|
| 487 |
-
$shoppingCartItem->setDocument ( $document )->setItem ( $item )->build ();
|
| 488 |
-
$shoppingCart->addItem ( $shoppingCartItem );
|
| 489 |
-
}
|
| 490 |
-
|
| 491 |
-
$shoppingCart->setDocument ( $document )->setCheckout ( $checkout );
|
| 492 |
-
|
| 493 |
-
$shoppingCart->build ();
|
| 494 |
-
|
| 495 |
-
$submitCartRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 496 |
-
$submitCartRequest->getNode ()->appendChild ( $shoppingCart->getNode () );
|
| 497 |
-
|
| 498 |
-
$document->appendChild ( $submitCartRequest->getNode () );
|
| 499 |
-
|
| 500 |
-
return $document->saveXML ();
|
| 501 |
-
}
|
| 502 |
-
|
| 503 |
-
/**
|
| 504 |
-
* Creates the XML request for a variant configurations download.
|
| 505 |
-
*
|
| 506 |
-
* @throws Dhl_MeinPaket_Model_Xml_XmlBuildException
|
| 507 |
-
* @return string
|
| 508 |
-
*/
|
| 509 |
-
public function createVariantConfigurationDownloadRequest() {
|
| 510 |
-
if (! $this->areAuthenticationParamtersSet ()) {
|
| 511 |
-
throw new Dhl_MeinPaket_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 512 |
-
}
|
| 513 |
-
|
| 514 |
-
$document = $this->createDocument ();
|
| 515 |
-
$downloadRequest = Mage::getModel ( 'meinpaket/xml_partial_downloadRequest' );
|
| 516 |
-
$variantConfigurations = Mage::getModel ( 'meinpaket/xml_partial_variantConfigurations' );
|
| 517 |
-
|
| 518 |
-
$downloadRequest->setDocument ( $document )->build ();
|
| 519 |
-
$variantConfigurations->setDocument ( $document )->build ();
|
| 520 |
-
|
| 521 |
-
$downloadRequest->getNode ()->appendChild ( $this->createHeaderNode ( $document ) );
|
| 522 |
-
$downloadRequest->getNode ()->appendChild ( $variantConfigurations->getNode () );
|
| 523 |
-
|
| 524 |
-
$document->appendChild ( $downloadRequest->getNode () );
|
| 525 |
-
|
| 526 |
-
return $document->saveXML ();
|
| 527 |
-
}
|
| 528 |
-
|
| 529 |
-
/**
|
| 530 |
-
* Checks if the necessary authentication have been set.
|
| 531 |
-
*
|
| 532 |
-
* @return boolean
|
| 533 |
-
*/
|
| 534 |
-
public function areAuthenticationParamtersSet() {
|
| 535 |
-
return (is_string ( $this->username ) && is_string ( $this->password ) && (strlen ( $this->username ) > 0) && (strlen ( $this->password ) > 0));
|
| 536 |
-
}
|
| 537 |
-
|
| 538 |
-
/**
|
| 539 |
-
* Creates XML for the header element which encapsulates the user credentials.
|
| 540 |
-
*
|
| 541 |
-
* @param DOMDocument $document
|
| 542 |
-
* @return DOMNode
|
| 543 |
-
*/
|
| 544 |
-
public function createHeaderNode(DOMDocument $document) {
|
| 545 |
-
return Mage::getModel ( 'meinpaket/xml_partial_header' )->setDocument ( $document )->setUsername ( $this->username )->setPassword ( $this->password )->build ()->getNode ();
|
| 546 |
-
}
|
| 547 |
-
}
|
| 548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/Model/Xml/XmlResponseParser.php
DELETED
|
@@ -1,58 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
/**
|
| 4 |
-
* Parses raw XML responses returned by the MeinPaket webservice.
|
| 5 |
-
*
|
| 6 |
-
* @category Dhl
|
| 7 |
-
* @package Dhl_MeinPaket
|
| 8 |
-
* @subpackage Model_Xml
|
| 9 |
-
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
-
*/
|
| 12 |
-
class Dhl_MeinPaket_Model_Xml_XmlResponseParser extends Varien_Object {
|
| 13 |
-
/**
|
| 14 |
-
*
|
| 15 |
-
* @param DOMDocument $dom
|
| 16 |
-
* @return Dhl_MeinPaket_Model_Xml_Response_Abstract
|
| 17 |
-
*/
|
| 18 |
-
public function parseResponse(DOMDocument $dom) {
|
| 19 |
-
if (!isset($dom->documentElement)) {
|
| 20 |
-
return null;
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
$documentElement = $dom->documentElement;
|
| 24 |
-
|
| 25 |
-
/* @var $result Dhl_MeinPaket_Model_Xml_Response_Abstract */
|
| 26 |
-
$result = null;
|
| 27 |
-
|
| 28 |
-
switch ($documentElement->localName) {
|
| 29 |
-
case 'asynchronousStatusResponse' :
|
| 30 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_AsynchronousStatusResponse ( $documentElement );
|
| 31 |
-
break;
|
| 32 |
-
case 'downloadResponse' :
|
| 33 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_DownloadResponse ( $documentElement );
|
| 34 |
-
break;
|
| 35 |
-
case 'uploadResponse' :
|
| 36 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_UploadResponse ( $documentElement );
|
| 37 |
-
break;
|
| 38 |
-
case 'dataResponse' :
|
| 39 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_DataResponse ( $documentElement );
|
| 40 |
-
break;
|
| 41 |
-
case 'notificationResponse' :
|
| 42 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_NotificationResponse ( $documentElement );
|
| 43 |
-
break;
|
| 44 |
-
case 'queryResponse' :
|
| 45 |
-
$result = new Dhl_MeinPaket_Model_Xml_Response_QueryResponse ( $documentElement );
|
| 46 |
-
break;
|
| 47 |
-
case 'shoppingCartStatusResponse' :
|
| 48 |
-
break;
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
if ($result != null) {
|
| 52 |
-
$result->process ();
|
| 53 |
-
}
|
| 54 |
-
|
| 55 |
-
return $result;
|
| 56 |
-
}
|
| 57 |
-
}
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dhl/MeinPaket/controllers/Adminhtml/CategoryImportController.php
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Adminhtml_CategoryImportController extends Mage_Adminhtml_Controller_Action {
|
| 14 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Adminhtml_CategoryImportController extends Mage_Adminhtml_Controller_Action {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/controllers/Adminhtml/ProductExportController.php
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Adminhtml_ProductExportController extends Mage_Adminhtml_Controller_Action {
|
| 14 |
/**
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
class Dhl_MeinPaket_Adminhtml_ProductExportController extends Mage_Adminhtml_Controller_Action {
|
| 12 |
/**
|
app/code/community/Dhl/MeinPaket/etc/adminhtml.xml
CHANGED
|
@@ -1,40 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
-
<translate>
|
| 4 |
-
<modules>
|
| 5 |
-
<Dhl_adminhtml>
|
| 6 |
-
<files>
|
| 7 |
-
<meinpaket>Dhl_Meinpaket.csv</meinpaket>
|
| 8 |
-
</files>
|
| 9 |
-
</Dhl_adminhtml>
|
| 10 |
-
</modules>
|
| 11 |
-
</translate>
|
| 12 |
<menu>
|
| 13 |
<meinpaket>
|
| 14 |
-
<title>MeinPaket
|
| 15 |
<children>
|
| 16 |
<meinpaket_backlog translate="title" module="meinpaket">
|
| 17 |
<title>Synchronisation</title>
|
| 18 |
<action>meinpaket/adminhtml_backlog_product</action>
|
| 19 |
</meinpaket_backlog>
|
| 20 |
-
|
| 21 |
-
</meinpaket_productexport> <meinpaket_orderimport translate="title"> <title>import orders</title> <action>meinpaket/adminhtml_orderImport</action>
|
| 22 |
-
</meinpaket_orderimport> -->
|
| 23 |
-
<meinpaket_categoryimport translate="title">
|
| 24 |
<title>import categories</title>
|
| 25 |
<action>meinpaket/adminhtml_categoryImport</action>
|
| 26 |
</meinpaket_categoryimport>
|
| 27 |
-
|
| 28 |
-
</meinpaket_attributemapping> -->
|
| 29 |
-
<meinpaket_log translate="title" module="meinpaket">
|
| 30 |
-
<title>Log</title>
|
| 31 |
-
<action>meinpaket/adminhtml_log</action>
|
| 32 |
-
</meinpaket_log>
|
| 33 |
-
<meinpaket_async translate="title" module="meinpaket">
|
| 34 |
-
<title>Async</title>
|
| 35 |
-
<action>meinpaket/adminhtml_async</action>
|
| 36 |
-
</meinpaket_async>
|
| 37 |
-
<meinpaket_bestprice translate="title">
|
| 38 |
<title>best prices</title>
|
| 39 |
<action>meinpaket/adminhtml_bestPrice</action>
|
| 40 |
</meinpaket_bestprice>
|
|
@@ -51,8 +29,8 @@
|
|
| 51 |
<children>
|
| 52 |
<config>
|
| 53 |
<children>
|
| 54 |
-
<meinpaket translate="title" module="
|
| 55 |
-
<title>MeinPaket
|
| 56 |
<sort_order>100</sort_order>
|
| 57 |
</meinpaket>
|
| 58 |
</children>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
<menu>
|
| 4 |
<meinpaket>
|
| 5 |
+
<title>MeinPaket/Postpay</title>
|
| 6 |
<children>
|
| 7 |
<meinpaket_backlog translate="title" module="meinpaket">
|
| 8 |
<title>Synchronisation</title>
|
| 9 |
<action>meinpaket/adminhtml_backlog_product</action>
|
| 10 |
</meinpaket_backlog>
|
| 11 |
+
<meinpaket_categoryimport translate="title" module="meinpaket">
|
|
|
|
|
|
|
|
|
|
| 12 |
<title>import categories</title>
|
| 13 |
<action>meinpaket/adminhtml_categoryImport</action>
|
| 14 |
</meinpaket_categoryimport>
|
| 15 |
+
<meinpaket_bestprice translate="title" module="meinpaket">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<title>best prices</title>
|
| 17 |
<action>meinpaket/adminhtml_bestPrice</action>
|
| 18 |
</meinpaket_bestprice>
|
| 29 |
<children>
|
| 30 |
<config>
|
| 31 |
<children>
|
| 32 |
+
<meinpaket translate="title" module="meinpaket">
|
| 33 |
+
<title>MeinPaket/Postpay</title>
|
| 34 |
<sort_order>100</sort_order>
|
| 35 |
</meinpaket>
|
| 36 |
</children>
|
app/code/community/Dhl/MeinPaket/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Dhl_MeinPaket>
|
| 5 |
-
<version>2.0.
|
| 6 |
</Dhl_MeinPaket>
|
| 7 |
</modules>
|
| 8 |
<admin>
|
|
@@ -36,22 +36,6 @@
|
|
| 36 |
</adminhtml>
|
| 37 |
<crontab>
|
| 38 |
<jobs>
|
| 39 |
-
<meinpaket_processAsyncTasks>
|
| 40 |
-
<schedule>
|
| 41 |
-
<config_path>meinpaket/cron/async</config_path>
|
| 42 |
-
</schedule>
|
| 43 |
-
<run>
|
| 44 |
-
<model>meinpaket/cron::processAsyncTasks</model>
|
| 45 |
-
</run>
|
| 46 |
-
</meinpaket_processAsyncTasks>
|
| 47 |
-
<meinpaket_importOrders>
|
| 48 |
-
<schedule>
|
| 49 |
-
<config_path>meinpaket/cron/order</config_path>
|
| 50 |
-
</schedule>
|
| 51 |
-
<run>
|
| 52 |
-
<model>meinpaket/cron::importOrders</model>
|
| 53 |
-
</run>
|
| 54 |
-
</meinpaket_importOrders>
|
| 55 |
<meinpaket_exportProducts>
|
| 56 |
<schedule>
|
| 57 |
<config_path>meinpaket/cron/product</config_path>
|
|
@@ -68,65 +52,24 @@
|
|
| 68 |
<model>meinpaket/cron::getBestPrice</model>
|
| 69 |
</run>
|
| 70 |
</meinpaket_getBestPrice>
|
| 71 |
-
<meinpaket_cleanup>
|
| 72 |
-
<schedule>
|
| 73 |
-
<config_path>meinpaket/cron/cleanup</config_path>
|
| 74 |
-
</schedule>
|
| 75 |
-
<run>
|
| 76 |
-
<model>meinpaket/cron::cleanup</model>
|
| 77 |
-
</run>
|
| 78 |
-
</meinpaket_cleanup>
|
| 79 |
</jobs>
|
| 80 |
</crontab>
|
| 81 |
<default>
|
| 82 |
-
<payment>
|
| 83 |
-
<meinpaket>
|
| 84 |
-
<active>1</active>
|
| 85 |
-
<model>meinpaket/payment_method_meinpaket</model>
|
| 86 |
-
<order_status>pending</order_status>
|
| 87 |
-
<title>MeinPaket</title>
|
| 88 |
-
<allowspecific>0</allowspecific>
|
| 89 |
-
<group>offline</group>
|
| 90 |
-
</meinpaket>
|
| 91 |
-
</payment>
|
| 92 |
-
<carriers>
|
| 93 |
-
<meinpaket>
|
| 94 |
-
<active>1</active>
|
| 95 |
-
<sallowspecific>0</sallowspecific>
|
| 96 |
-
<allowed_methods>method1</allowed_methods>
|
| 97 |
-
<title>MeinPaket.de</title>
|
| 98 |
-
<name>MeinPaket</name>
|
| 99 |
-
<handling_fee>1.00</handling_fee>
|
| 100 |
-
<handling_type>F</handling_type>
|
| 101 |
-
<handling_action>P</handling_action>
|
| 102 |
-
<model>meinpaket/carrier_meinpaket</model>
|
| 103 |
-
</meinpaket>
|
| 104 |
-
</carriers>
|
| 105 |
<meinpaket>
|
| 106 |
-
<endpoint>
|
| 107 |
-
<sandbox>0</sandbox>
|
| 108 |
-
<https>1</https>
|
| 109 |
-
<proxy></proxy>
|
| 110 |
-
<proxy_host></proxy_host>
|
| 111 |
-
<proxy_port></proxy_port>
|
| 112 |
-
</endpoint>
|
| 113 |
-
<shipment>
|
| 114 |
-
<default_shipment_method>flatrate_flatrate</default_shipment_method>
|
| 115 |
-
</shipment>
|
| 116 |
<checkout>
|
| 117 |
<available>0</available>
|
| 118 |
-
<submit_shipping_costs>0</submit_shipping_costs>
|
| 119 |
</checkout>
|
| 120 |
<product_attributes>
|
| 121 |
<default_delivery_time>5</default_delivery_time>
|
| 122 |
</product_attributes>
|
| 123 |
<cron>
|
| 124 |
-
<async>*/10 * * * *</async>
|
| 125 |
<product>0 * * * *</product>
|
| 126 |
<order>*/15 * * * *</order>
|
| 127 |
<bestprice>15 3 * * *</bestprice>
|
| 128 |
-
<cleanup>0 6 * * *</cleanup>
|
| 129 |
</cron>
|
|
|
|
|
|
|
|
|
|
| 130 |
</meinpaket>
|
| 131 |
</default>
|
| 132 |
<frontend>
|
|
@@ -163,6 +106,9 @@
|
|
| 163 |
<module>Dhl_MeinPaket</module>
|
| 164 |
<class>Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup</class>
|
| 165 |
</setup>
|
|
|
|
|
|
|
|
|
|
| 166 |
</meinpaket_setup>
|
| 167 |
</resources>
|
| 168 |
<models>
|
|
@@ -182,9 +128,6 @@
|
|
| 182 |
<bestprice>
|
| 183 |
<table>meinpaket_bestprice</table>
|
| 184 |
</bestprice>
|
| 185 |
-
<log>
|
| 186 |
-
<table>meinpaket_log</table>
|
| 187 |
-
</log>
|
| 188 |
<async>
|
| 189 |
<table>meinpaket_async</table>
|
| 190 |
</async>
|
|
@@ -206,6 +149,24 @@
|
|
| 206 |
</meinpaket>
|
| 207 |
</helpers>
|
| 208 |
<events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
<catalog_product_save_before>
|
| 210 |
<observers>
|
| 211 |
<meinpaket_product_save_before>
|
|
@@ -233,15 +194,6 @@
|
|
| 233 |
</meinpaket_product_attribute_update_before>
|
| 234 |
</observers>
|
| 235 |
</catalog_product_attribute_update_before>
|
| 236 |
-
<catalog_product_delete_before>
|
| 237 |
-
<observers>
|
| 238 |
-
<meinpaket_delete_product>
|
| 239 |
-
<type>singleton</type>
|
| 240 |
-
<class>meinpaket/observer</class>
|
| 241 |
-
<method>catalogProductDeleteBefore</method>
|
| 242 |
-
</meinpaket_delete_product>
|
| 243 |
-
</observers>
|
| 244 |
-
</catalog_product_delete_before>
|
| 245 |
<cataloginventory_stock_item_save_after>
|
| 246 |
<observers>
|
| 247 |
<meinpaket_stock_item_save_after>
|
|
@@ -251,51 +203,6 @@
|
|
| 251 |
</meinpaket_stock_item_save_after>
|
| 252 |
</observers>
|
| 253 |
</cataloginventory_stock_item_save_after>
|
| 254 |
-
<sales_order_save_after>
|
| 255 |
-
<observers>
|
| 256 |
-
<meinpaket_cancel_order>
|
| 257 |
-
<type>singleton</type>
|
| 258 |
-
<class>meinpaket/observer</class>
|
| 259 |
-
<method>salesOrderSaveAfter</method>
|
| 260 |
-
</meinpaket_cancel_order>
|
| 261 |
-
</observers>
|
| 262 |
-
</sales_order_save_after>
|
| 263 |
-
<sales_order_shipment_save_after>
|
| 264 |
-
<observers>
|
| 265 |
-
<meinpaket_save_sales_order_shipment>
|
| 266 |
-
<type>singleton</type>
|
| 267 |
-
<class>meinpaket/observer</class>
|
| 268 |
-
<method>salesOrderShipmentSaveAfter</method>
|
| 269 |
-
</meinpaket_save_sales_order_shipment>
|
| 270 |
-
</observers>
|
| 271 |
-
</sales_order_shipment_save_after>
|
| 272 |
-
<sales_order_shipment_save_commit_after>
|
| 273 |
-
<observers>
|
| 274 |
-
<meinpaket_commit_sales_order_shipment>
|
| 275 |
-
<type>singleton</type>
|
| 276 |
-
<class>meinpaket/observer</class>
|
| 277 |
-
<method>salesOrderShipmentSaveCommitAfter</method>
|
| 278 |
-
</meinpaket_commit_sales_order_shipment>
|
| 279 |
-
</observers>
|
| 280 |
-
</sales_order_shipment_save_commit_after>
|
| 281 |
-
<sales_order_shipment_track_save_after>
|
| 282 |
-
<observers>
|
| 283 |
-
<meinpaket_save_sales_order_shipment_track>
|
| 284 |
-
<type>singleton</type>
|
| 285 |
-
<class>meinpaket/observer</class>
|
| 286 |
-
<method>salesOrderShipmentTrackSaveAfter</method>
|
| 287 |
-
</meinpaket_save_sales_order_shipment_track>
|
| 288 |
-
</observers>
|
| 289 |
-
</sales_order_shipment_track_save_after>
|
| 290 |
-
<sales_order_creditmemo_save_after>
|
| 291 |
-
<observers>
|
| 292 |
-
<meinpaket_save_creditmemo>
|
| 293 |
-
<type>singleton</type>
|
| 294 |
-
<class>meinpaket/observer</class>
|
| 295 |
-
<method>salesOrderCreditmemoSaveAfter</method>
|
| 296 |
-
</meinpaket_save_creditmemo>
|
| 297 |
-
</observers>
|
| 298 |
-
</sales_order_creditmemo_save_after>
|
| 299 |
<adminhtml_catalog_product_attribute_edit_prepare_form>
|
| 300 |
<observers>
|
| 301 |
<add_meinpaket_to_attribute_editor>
|
|
@@ -305,33 +212,6 @@
|
|
| 305 |
</add_meinpaket_to_attribute_editor>
|
| 306 |
</observers>
|
| 307 |
</adminhtml_catalog_product_attribute_edit_prepare_form>
|
| 308 |
-
<catalog_model_product_duplicate>
|
| 309 |
-
<observers>
|
| 310 |
-
<meinpaket_product_duplicate>
|
| 311 |
-
<type>singleton</type>
|
| 312 |
-
<class>meinpaket/observer</class>
|
| 313 |
-
<method>productDuplicate</method>
|
| 314 |
-
</meinpaket_product_duplicate>
|
| 315 |
-
</observers>
|
| 316 |
-
</catalog_model_product_duplicate>
|
| 317 |
-
<sales_order_grid_collection_load_before>
|
| 318 |
-
<observers>
|
| 319 |
-
<meinpaket_sales_order_grid_collection_add_attribute>
|
| 320 |
-
<type>singleton</type>
|
| 321 |
-
<model>meinpaket/observer</model>
|
| 322 |
-
<method>salesOrderGridCollectionLoadBefore</method>
|
| 323 |
-
</meinpaket_sales_order_grid_collection_add_attribute>
|
| 324 |
-
</observers>
|
| 325 |
-
</sales_order_grid_collection_load_before>
|
| 326 |
-
<core_block_abstract_prepare_layout_before>
|
| 327 |
-
<observers>
|
| 328 |
-
<meinpaket_grid_column_append>
|
| 329 |
-
<type>singleton</type>
|
| 330 |
-
<class>meinpaket/observer</class>
|
| 331 |
-
<method>gridAddAttributes</method>
|
| 332 |
-
</meinpaket_grid_column_append>
|
| 333 |
-
</observers>
|
| 334 |
-
</core_block_abstract_prepare_layout_before>
|
| 335 |
</events>
|
| 336 |
</global>
|
| 337 |
</config>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Dhl_MeinPaket>
|
| 5 |
+
<version>2.0.15</version>
|
| 6 |
</Dhl_MeinPaket>
|
| 7 |
</modules>
|
| 8 |
<admin>
|
| 36 |
</adminhtml>
|
| 37 |
<crontab>
|
| 38 |
<jobs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
<meinpaket_exportProducts>
|
| 40 |
<schedule>
|
| 41 |
<config_path>meinpaket/cron/product</config_path>
|
| 52 |
<model>meinpaket/cron::getBestPrice</model>
|
| 53 |
</run>
|
| 54 |
</meinpaket_getBestPrice>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
</jobs>
|
| 56 |
</crontab>
|
| 57 |
<default>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
<meinpaket>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
<checkout>
|
| 60 |
<available>0</available>
|
|
|
|
| 61 |
</checkout>
|
| 62 |
<product_attributes>
|
| 63 |
<default_delivery_time>5</default_delivery_time>
|
| 64 |
</product_attributes>
|
| 65 |
<cron>
|
|
|
|
| 66 |
<product>0 * * * *</product>
|
| 67 |
<order>*/15 * * * *</order>
|
| 68 |
<bestprice>15 3 * * *</bestprice>
|
|
|
|
| 69 |
</cron>
|
| 70 |
+
<advanced>
|
| 71 |
+
<cycle_product_count>100</cycle_product_count>
|
| 72 |
+
</advanced>
|
| 73 |
</meinpaket>
|
| 74 |
</default>
|
| 75 |
<frontend>
|
| 106 |
<module>Dhl_MeinPaket</module>
|
| 107 |
<class>Dhl_MeinPaket_Model_Resource_Eav_Mysql4_Setup</class>
|
| 108 |
</setup>
|
| 109 |
+
<connection>
|
| 110 |
+
<use>core_setup</use>
|
| 111 |
+
</connection>
|
| 112 |
</meinpaket_setup>
|
| 113 |
</resources>
|
| 114 |
<models>
|
| 128 |
<bestprice>
|
| 129 |
<table>meinpaket_bestprice</table>
|
| 130 |
</bestprice>
|
|
|
|
|
|
|
|
|
|
| 131 |
<async>
|
| 132 |
<table>meinpaket_async</table>
|
| 133 |
</async>
|
| 149 |
</meinpaket>
|
| 150 |
</helpers>
|
| 151 |
<events>
|
| 152 |
+
<catalog_model_product_duplicate>
|
| 153 |
+
<observers>
|
| 154 |
+
<meinpaket_product_duplicate>
|
| 155 |
+
<type>singleton</type>
|
| 156 |
+
<class>meinpaket/observer</class>
|
| 157 |
+
<method>productDuplicate</method>
|
| 158 |
+
</meinpaket_product_duplicate>
|
| 159 |
+
</observers>
|
| 160 |
+
</catalog_model_product_duplicate>
|
| 161 |
+
<catalog_product_delete_before>
|
| 162 |
+
<observers>
|
| 163 |
+
<meinpaket_delete_product>
|
| 164 |
+
<type>singleton</type>
|
| 165 |
+
<class>meinpaket/observer</class>
|
| 166 |
+
<method>catalogProductDeleteBefore</method>
|
| 167 |
+
</meinpaket_delete_product>
|
| 168 |
+
</observers>
|
| 169 |
+
</catalog_product_delete_before>
|
| 170 |
<catalog_product_save_before>
|
| 171 |
<observers>
|
| 172 |
<meinpaket_product_save_before>
|
| 194 |
</meinpaket_product_attribute_update_before>
|
| 195 |
</observers>
|
| 196 |
</catalog_product_attribute_update_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
<cataloginventory_stock_item_save_after>
|
| 198 |
<observers>
|
| 199 |
<meinpaket_stock_item_save_after>
|
| 203 |
</meinpaket_stock_item_save_after>
|
| 204 |
</observers>
|
| 205 |
</cataloginventory_stock_item_save_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
<adminhtml_catalog_product_attribute_edit_prepare_form>
|
| 207 |
<observers>
|
| 208 |
<add_meinpaket_to_attribute_editor>
|
| 212 |
</add_meinpaket_to_attribute_editor>
|
| 213 |
</observers>
|
| 214 |
</adminhtml_catalog_product_attribute_edit_prepare_form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
</events>
|
| 216 |
</global>
|
| 217 |
</config>
|
app/code/community/Dhl/MeinPaket/etc/system.xml
CHANGED
|
@@ -2,184 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<sections>
|
| 4 |
<meinpaket module="core" translate="label">
|
| 5 |
-
<comment>Test</comment>
|
| 6 |
-
<label>DHL MeinPaket.de</label>
|
| 7 |
-
<tab>general</tab>
|
| 8 |
-
<frontend_type>text</frontend_type>
|
| 9 |
-
<sort_order>1000</sort_order>
|
| 10 |
-
<show_in_default>1</show_in_default>
|
| 11 |
-
<show_in_website>1</show_in_website>
|
| 12 |
-
<show_in_store>1</show_in_store>
|
| 13 |
-
<class>meinpaket</class>
|
| 14 |
<groups>
|
| 15 |
-
<store>
|
| 16 |
-
<label>Store</label>
|
| 17 |
-
<frontend_type>text</frontend_type>
|
| 18 |
-
<sort_order>1</sort_order>
|
| 19 |
-
<show_in_default>1</show_in_default>
|
| 20 |
-
<show_in_website>1</show_in_website>
|
| 21 |
-
<show_in_store>1</show_in_store>
|
| 22 |
-
<frontend_class>meinpaket</frontend_class>
|
| 23 |
-
<fields translate="label">
|
| 24 |
-
<view translate="label">
|
| 25 |
-
<label>Store View</label>
|
| 26 |
-
<frontend_type>select</frontend_type>
|
| 27 |
-
<source_model>adminhtml/system_config_source_store</source_model>
|
| 28 |
-
<sort_order>1</sort_order>
|
| 29 |
-
<show_in_default>1</show_in_default>
|
| 30 |
-
<show_in_website>0</show_in_website>
|
| 31 |
-
<show_in_store>0</show_in_store>
|
| 32 |
-
</view>
|
| 33 |
-
</fields>
|
| 34 |
-
</store>
|
| 35 |
-
<credentials translate="label">
|
| 36 |
-
<label>Credentials</label>
|
| 37 |
-
<frontend_type>text</frontend_type>
|
| 38 |
-
<sort_order>3</sort_order>
|
| 39 |
-
<show_in_default>1</show_in_default>
|
| 40 |
-
<show_in_website>1</show_in_website>
|
| 41 |
-
<show_in_store>0</show_in_store>
|
| 42 |
-
<frontend_class>meinpaket</frontend_class>
|
| 43 |
-
<fields>
|
| 44 |
-
<username translate="label comment">
|
| 45 |
-
<label>DHL Username</label>
|
| 46 |
-
<comment><![CDATA[This is the username that was given to you by DHL, mostly your email address.]]></comment>
|
| 47 |
-
<frontend_type>text</frontend_type>
|
| 48 |
-
<sort_order>10</sort_order>
|
| 49 |
-
<show_in_default>1</show_in_default>
|
| 50 |
-
<show_in_website>1</show_in_website>
|
| 51 |
-
<show_in_store>0</show_in_store>
|
| 52 |
-
</username>
|
| 53 |
-
<password translate="label comment">
|
| 54 |
-
<label>DHL Password</label>
|
| 55 |
-
<comment><![CDATA[This is the password that was given to you by DHL.]]></comment>
|
| 56 |
-
<frontend_type>password</frontend_type>
|
| 57 |
-
<sort_order>20</sort_order>
|
| 58 |
-
<show_in_default>1</show_in_default>
|
| 59 |
-
<show_in_website>1</show_in_website>
|
| 60 |
-
<show_in_store>0</show_in_store>
|
| 61 |
-
</password>
|
| 62 |
-
</fields>
|
| 63 |
-
</credentials>
|
| 64 |
-
<endpoint translate="label">
|
| 65 |
-
<label>Remote system</label>
|
| 66 |
-
<frontend_type>text</frontend_type>
|
| 67 |
-
<sort_order>2</sort_order>
|
| 68 |
-
<show_in_default>1</show_in_default>
|
| 69 |
-
<show_in_website>1</show_in_website>
|
| 70 |
-
<show_in_store>1</show_in_store>
|
| 71 |
-
<frontend_class>meinpaket</frontend_class>
|
| 72 |
-
<fields>
|
| 73 |
-
<https translate="label comment">
|
| 74 |
-
<label>Use HTTPs</label>
|
| 75 |
-
<comment><![CDATA[Use https:// to connect to DHL MeinPaket]]></comment>
|
| 76 |
-
<frontend_type>select</frontend_type>
|
| 77 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 78 |
-
<sort_order>10</sort_order>
|
| 79 |
-
<show_in_default>1</show_in_default>
|
| 80 |
-
<show_in_website>0</show_in_website>
|
| 81 |
-
<show_in_store>0</show_in_store>
|
| 82 |
-
</https>
|
| 83 |
-
<sandbox translate="label comment">
|
| 84 |
-
<label>Use Sandbox</label>
|
| 85 |
-
<comment><![CDATA[Use DHL MeinPaket sandbox]]></comment>
|
| 86 |
-
<frontend_type>select</frontend_type>
|
| 87 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 88 |
-
<sort_order>11</sort_order>
|
| 89 |
-
<show_in_default>1</show_in_default>
|
| 90 |
-
<show_in_website>0</show_in_website>
|
| 91 |
-
<show_in_store>0</show_in_store>
|
| 92 |
-
</sandbox>
|
| 93 |
-
<proxy translate="label comment">
|
| 94 |
-
<label>Use Proxy</label>
|
| 95 |
-
<comment><![CDATA[Use proxy to connect to DHL MeinPaket]]></comment>
|
| 96 |
-
<frontend_type>select</frontend_type>
|
| 97 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 98 |
-
<sort_order>20</sort_order>
|
| 99 |
-
<show_in_default>1</show_in_default>
|
| 100 |
-
<show_in_website>0</show_in_website>
|
| 101 |
-
<show_in_store>0</show_in_store>
|
| 102 |
-
</proxy>
|
| 103 |
-
<proxy_host translate="label comment">
|
| 104 |
-
<label>Proxy Host</label>
|
| 105 |
-
<comment><![CDATA[Used proxy host to connect to DHL MeinPaket. Disabled when empty]]></comment>
|
| 106 |
-
<frontend_type>text</frontend_type>
|
| 107 |
-
<sort_order>21</sort_order>
|
| 108 |
-
<show_in_default>1</show_in_default>
|
| 109 |
-
<show_in_website>0</show_in_website>
|
| 110 |
-
<show_in_store>0</show_in_store>
|
| 111 |
-
<depends>
|
| 112 |
-
<proxy>1</proxy>
|
| 113 |
-
</depends>
|
| 114 |
-
</proxy_host>
|
| 115 |
-
<proxy_port translate="label comment">
|
| 116 |
-
<label>Proxy Port</label>
|
| 117 |
-
<comment><![CDATA[Use proxy port to connect to DHL MeinPaket. Disabled when empty]]></comment>
|
| 118 |
-
<frontend_type>text</frontend_type>
|
| 119 |
-
<sort_order>22</sort_order>
|
| 120 |
-
<show_in_default>1</show_in_default>
|
| 121 |
-
<show_in_website>0</show_in_website>
|
| 122 |
-
<show_in_store>0</show_in_store>
|
| 123 |
-
<depends>
|
| 124 |
-
<proxy>1</proxy>
|
| 125 |
-
</depends>
|
| 126 |
-
</proxy_port>
|
| 127 |
-
</fields>
|
| 128 |
-
</endpoint>
|
| 129 |
-
<shipment translate="label">
|
| 130 |
-
<label>Shipment</label>
|
| 131 |
-
<frontend_type>text</frontend_type>
|
| 132 |
-
<sort_order>15</sort_order>
|
| 133 |
-
<show_in_default>1</show_in_default>
|
| 134 |
-
<show_in_website>1</show_in_website>
|
| 135 |
-
<show_in_store>1</show_in_store>
|
| 136 |
-
<frontend_class>meinpaket</frontend_class>
|
| 137 |
-
<fields>
|
| 138 |
-
<default_shipment_method translate="label comment">
|
| 139 |
-
<label>Default Shipment Method</label>
|
| 140 |
-
<comment><![CDATA[Shipment method which is used for order import and POSTPAY.]]></comment>
|
| 141 |
-
<frontend_type>select</frontend_type>
|
| 142 |
-
<type>text</type>
|
| 143 |
-
<source_model>meinpaket/entity_attribute_source_carrier
|
| 144 |
-
</source_model>
|
| 145 |
-
<sort_order>20</sort_order>
|
| 146 |
-
<show_in_default>1</show_in_default>
|
| 147 |
-
<show_in_website>1</show_in_website>
|
| 148 |
-
<show_in_store>0</show_in_store>
|
| 149 |
-
</default_shipment_method>
|
| 150 |
-
</fields>
|
| 151 |
-
</shipment>
|
| 152 |
-
<checkout translate="label">
|
| 153 |
-
<label>POSTPAY</label>
|
| 154 |
-
<frontend_type>text</frontend_type>
|
| 155 |
-
<sort_order>20</sort_order>
|
| 156 |
-
<show_in_default>1</show_in_default>
|
| 157 |
-
<show_in_website>1</show_in_website>
|
| 158 |
-
<show_in_store>1</show_in_store>
|
| 159 |
-
<frontend_class>meinpaket</frontend_class>
|
| 160 |
-
<fields>
|
| 161 |
-
<available translate="label comment">
|
| 162 |
-
<label>POSTPAY available</label>
|
| 163 |
-
<comment><![CDATA[This defines wether the external Checkout with DHL is available for customers.]]></comment>
|
| 164 |
-
<frontend_type>select</frontend_type>
|
| 165 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 166 |
-
<sort_order>10</sort_order>
|
| 167 |
-
<show_in_default>1</show_in_default>
|
| 168 |
-
<show_in_website>0</show_in_website>
|
| 169 |
-
<show_in_store>0</show_in_store>
|
| 170 |
-
</available>
|
| 171 |
-
<submit_shipping_costs translate="label comment">
|
| 172 |
-
<label>Submit shipping costs for POSTPAY</label>
|
| 173 |
-
<comment><![CDATA[If set to yes, the shippingscosts for the POSTPAY will be calculated based on the default shipment method.]]></comment>
|
| 174 |
-
<frontend_type>select</frontend_type>
|
| 175 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 176 |
-
<sort_order>20</sort_order>
|
| 177 |
-
<show_in_default>1</show_in_default>
|
| 178 |
-
<show_in_website>0</show_in_website>
|
| 179 |
-
<show_in_store>0</show_in_store>
|
| 180 |
-
</submit_shipping_costs>
|
| 181 |
-
</fields>
|
| 182 |
-
</checkout>
|
| 183 |
<taxrates translate="label">
|
| 184 |
<label>Tax rates</label>
|
| 185 |
<frontend_type>text</frontend_type>
|
|
@@ -225,8 +48,7 @@
|
|
| 225 |
<label>EAN</label>
|
| 226 |
<comment><![CDATA[Attribute containing EAN]]></comment>
|
| 227 |
<frontend_type>select</frontend_type>
|
| 228 |
-
<source_model>meinpaket/entity_attribute_source_productAttribute
|
| 229 |
-
</source_model>
|
| 230 |
<sort_order>1</sort_order>
|
| 231 |
<show_in_default>1</show_in_default>
|
| 232 |
<show_in_website>1</show_in_website>
|
|
@@ -236,8 +58,7 @@
|
|
| 236 |
<label>Delivery time</label>
|
| 237 |
<comment><![CDATA[Please select the product attribute which represents the approx. delivery time]]></comment>
|
| 238 |
<frontend_type>select</frontend_type>
|
| 239 |
-
<source_model>meinpaket/entity_attribute_source_productAttribute
|
| 240 |
-
</source_model>
|
| 241 |
<sort_order>10</sort_order>
|
| 242 |
<show_in_default>1</show_in_default>
|
| 243 |
<show_in_website>1</show_in_website>
|
|
@@ -253,6 +74,16 @@
|
|
| 253 |
<show_in_website>1</show_in_website>
|
| 254 |
<show_in_store>0</show_in_store>
|
| 255 |
</default_delivery_time>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
</fields>
|
| 257 |
</product_attributes>
|
| 258 |
<customer translate="label">
|
|
@@ -285,24 +116,6 @@
|
|
| 285 |
<show_in_store>0</show_in_store>
|
| 286 |
<frontend_class>meinpaket</frontend_class>
|
| 287 |
<fields>
|
| 288 |
-
<async translate="label comment">
|
| 289 |
-
<label>Async Request</label>
|
| 290 |
-
<comment><![CDATA[Async request check interval]]></comment>
|
| 291 |
-
<frontend_type>text</frontend_type>
|
| 292 |
-
<sort_order>10</sort_order>
|
| 293 |
-
<show_in_default>1</show_in_default>
|
| 294 |
-
<show_in_website>1</show_in_website>
|
| 295 |
-
<show_in_store>0</show_in_store>
|
| 296 |
-
</async>
|
| 297 |
-
<product translate="label comment">
|
| 298 |
-
<label>Product Export</label>
|
| 299 |
-
<comment><![CDATA[Product export interval]]></comment>
|
| 300 |
-
<frontend_type>text</frontend_type>
|
| 301 |
-
<sort_order>20</sort_order>
|
| 302 |
-
<show_in_default>1</show_in_default>
|
| 303 |
-
<show_in_website>1</show_in_website>
|
| 304 |
-
<show_in_store>0</show_in_store>
|
| 305 |
-
</product>
|
| 306 |
<order translate="label comment">
|
| 307 |
<label>Order Import</label>
|
| 308 |
<comment><![CDATA[Order import interval.]]></comment>
|
|
@@ -312,15 +125,6 @@
|
|
| 312 |
<show_in_website>1</show_in_website>
|
| 313 |
<show_in_store>0</show_in_store>
|
| 314 |
</order>
|
| 315 |
-
<bestprice translate="label comment">
|
| 316 |
-
<label>BestPrice Interval</label>
|
| 317 |
-
<comment><![CDATA[BestPrice refresh interval.]]></comment>
|
| 318 |
-
<frontend_type>text</frontend_type>
|
| 319 |
-
<sort_order>40</sort_order>
|
| 320 |
-
<show_in_default>1</show_in_default>
|
| 321 |
-
<show_in_website>1</show_in_website>
|
| 322 |
-
<show_in_store>0</show_in_store>
|
| 323 |
-
</bestprice>
|
| 324 |
<cleanup translate="label comment">
|
| 325 |
<label>Cleanup Interval</label>
|
| 326 |
<comment><![CDATA[Interval to run cleanups.]]></comment>
|
|
@@ -332,54 +136,29 @@
|
|
| 332 |
</cleanup>
|
| 333 |
</fields>
|
| 334 |
</cron>
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
<carriers>
|
| 338 |
-
<groups>
|
| 339 |
-
<meinpaket translate="label" module="meinpaket">
|
| 340 |
-
<label>MeinPaket Versand Modul</label>
|
| 341 |
-
<frontend_type>text</frontend_type>
|
| 342 |
-
<sort_order>20</sort_order>
|
| 343 |
-
<show_in_default>1</show_in_default>
|
| 344 |
-
<show_in_website>1</show_in_website>
|
| 345 |
-
<show_in_store>1</show_in_store>
|
| 346 |
-
<fields>
|
| 347 |
-
<active translate="label">
|
| 348 |
-
<label>Enabled</label>
|
| 349 |
-
<frontend_type>select</frontend_type>
|
| 350 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 351 |
-
<sort_order>10</sort_order>
|
| 352 |
-
<show_in_default>1</show_in_default>
|
| 353 |
-
<show_in_website>1</show_in_website>
|
| 354 |
-
<show_in_store>1</show_in_store>
|
| 355 |
-
</active>
|
| 356 |
-
</fields>
|
| 357 |
-
</meinpaket>
|
| 358 |
-
</groups>
|
| 359 |
-
</carriers>
|
| 360 |
-
<payment>
|
| 361 |
-
<groups>
|
| 362 |
-
<meinpaket translate="label comment" module="meinpaket">
|
| 363 |
-
<label>MeinPaket</label>
|
| 364 |
<frontend_type>text</frontend_type>
|
| 365 |
-
<sort_order>
|
| 366 |
<show_in_default>1</show_in_default>
|
| 367 |
<show_in_website>1</show_in_website>
|
| 368 |
-
<show_in_store>
|
|
|
|
| 369 |
<fields>
|
| 370 |
-
<
|
| 371 |
-
<label>
|
| 372 |
-
<
|
| 373 |
-
<
|
| 374 |
-
<
|
|
|
|
| 375 |
<show_in_default>1</show_in_default>
|
| 376 |
<show_in_website>1</show_in_website>
|
| 377 |
-
<show_in_store>
|
| 378 |
-
</
|
| 379 |
</fields>
|
| 380 |
-
</
|
| 381 |
</groups>
|
| 382 |
-
</
|
| 383 |
</sections>
|
| 384 |
</config>
|
| 385 |
|
| 2 |
<config>
|
| 3 |
<sections>
|
| 4 |
<meinpaket module="core" translate="label">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
<groups>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
<taxrates translate="label">
|
| 7 |
<label>Tax rates</label>
|
| 8 |
<frontend_type>text</frontend_type>
|
| 48 |
<label>EAN</label>
|
| 49 |
<comment><![CDATA[Attribute containing EAN]]></comment>
|
| 50 |
<frontend_type>select</frontend_type>
|
| 51 |
+
<source_model>meinpaket/entity_attribute_source_productAttribute</source_model>
|
|
|
|
| 52 |
<sort_order>1</sort_order>
|
| 53 |
<show_in_default>1</show_in_default>
|
| 54 |
<show_in_website>1</show_in_website>
|
| 58 |
<label>Delivery time</label>
|
| 59 |
<comment><![CDATA[Please select the product attribute which represents the approx. delivery time]]></comment>
|
| 60 |
<frontend_type>select</frontend_type>
|
| 61 |
+
<source_model>meinpaket/entity_attribute_source_productAttribute</source_model>
|
|
|
|
| 62 |
<sort_order>10</sort_order>
|
| 63 |
<show_in_default>1</show_in_default>
|
| 64 |
<show_in_website>1</show_in_website>
|
| 74 |
<show_in_website>1</show_in_website>
|
| 75 |
<show_in_store>0</show_in_store>
|
| 76 |
</default_delivery_time>
|
| 77 |
+
<use_available_special_price translate="label comment">
|
| 78 |
+
<label>Use special price if available</label>
|
| 79 |
+
<comment><![CDATA[Use product special price if available]]></comment>
|
| 80 |
+
<frontend_type>select</frontend_type>
|
| 81 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 82 |
+
<sort_order>30</sort_order>
|
| 83 |
+
<show_in_default>1</show_in_default>
|
| 84 |
+
<show_in_website>1</show_in_website>
|
| 85 |
+
<show_in_store>0</show_in_store>
|
| 86 |
+
</use_available_special_price>
|
| 87 |
</fields>
|
| 88 |
</product_attributes>
|
| 89 |
<customer translate="label">
|
| 116 |
<show_in_store>0</show_in_store>
|
| 117 |
<frontend_class>meinpaket</frontend_class>
|
| 118 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
<order translate="label comment">
|
| 120 |
<label>Order Import</label>
|
| 121 |
<comment><![CDATA[Order import interval.]]></comment>
|
| 125 |
<show_in_website>1</show_in_website>
|
| 126 |
<show_in_store>0</show_in_store>
|
| 127 |
</order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
<cleanup translate="label comment">
|
| 129 |
<label>Cleanup Interval</label>
|
| 130 |
<comment><![CDATA[Interval to run cleanups.]]></comment>
|
| 136 |
</cleanup>
|
| 137 |
</fields>
|
| 138 |
</cron>
|
| 139 |
+
<advanced translate="label">
|
| 140 |
+
<label>Advanced</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
<frontend_type>text</frontend_type>
|
| 142 |
+
<sort_order>150</sort_order>
|
| 143 |
<show_in_default>1</show_in_default>
|
| 144 |
<show_in_website>1</show_in_website>
|
| 145 |
+
<show_in_store>0</show_in_store>
|
| 146 |
+
<frontend_class>meinpaket</frontend_class>
|
| 147 |
<fields>
|
| 148 |
+
<cycle_product_count translate="label comment">
|
| 149 |
+
<label>Cycle product count</label>
|
| 150 |
+
<comment><![CDATA[Count of products transfered during a single cycle]]></comment>
|
| 151 |
+
<frontend_type>text</frontend_type>
|
| 152 |
+
<validate>validate-digits</validate>
|
| 153 |
+
<sort_order>15</sort_order>
|
| 154 |
<show_in_default>1</show_in_default>
|
| 155 |
<show_in_website>1</show_in_website>
|
| 156 |
+
<show_in_store>0</show_in_store>
|
| 157 |
+
</cycle_product_count>
|
| 158 |
</fields>
|
| 159 |
+
</advanced>
|
| 160 |
</groups>
|
| 161 |
+
</meinpaket>
|
| 162 |
</sections>
|
| 163 |
</config>
|
| 164 |
|
app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-install-1.0.0.php
CHANGED
|
@@ -22,59 +22,7 @@
|
|
| 22 |
$installer = $this;
|
| 23 |
$installer->startSetup ();
|
| 24 |
|
| 25 |
-
//
|
| 26 |
-
$db = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
|
| 27 |
-
$table_prefix = Mage::getConfig ()->getTablePrefix ();
|
| 28 |
|
| 29 |
-
|
| 30 |
-
// ############### create dhl_mein_paket_order_id attribute #################
|
| 31 |
-
|
| 32 |
-
// check wether dhl_mein_paket_order_id column exists for orders
|
| 33 |
-
$orderIdFieldExists = false;
|
| 34 |
-
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_order" );
|
| 35 |
-
|
| 36 |
-
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 37 |
-
if ($resultset ['Field'] == 'dhl_mein_paket_order_id')
|
| 38 |
-
$orderIdFieldExists = true;
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
if (! $orderIdFieldExists) {
|
| 42 |
-
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_order' ), 'dhl_mein_paket_order_id', 'varchar(255) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 43 |
-
|
| 44 |
-
$installer->addAttribute ( 'order', 'dhl_mein_paket_order_id', array (
|
| 45 |
-
'type' => 'static'
|
| 46 |
-
// 'visible' => false
|
| 47 |
-
) );
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
// check wether dhl_mein_paket_order_id column exists for orders grid
|
| 51 |
-
$orderIdFieldExists = false;
|
| 52 |
-
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_order_grid" );
|
| 53 |
-
|
| 54 |
-
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 55 |
-
if ($resultset ['Field'] == 'dhl_mein_paket_order_id')
|
| 56 |
-
$orderIdFieldExists = true;
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
if (! $orderIdFieldExists) {
|
| 60 |
-
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_order_grid' ), 'dhl_mein_paket_order_id', 'varchar(255) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 61 |
-
}
|
| 62 |
-
|
| 63 |
-
// ############### create shipment_was_exported_for_dhl_mein_paket attribute #################
|
| 64 |
-
|
| 65 |
-
$orderIdFieldExists = false;
|
| 66 |
-
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_shipment" );
|
| 67 |
-
|
| 68 |
-
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 69 |
-
if ($resultset ['Field'] == 'shipment_was_exported_for_dhl_mein_paket')
|
| 70 |
-
$orderIdFieldExists = true;
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
if (! $orderIdFieldExists) {
|
| 74 |
-
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_shipment' ), 'shipment_was_exported_for_dhl_mein_paket', 'int(1) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 75 |
-
}
|
| 76 |
-
|
| 77 |
-
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( 'DHL MeinPaket.de extension was successfully installed!' );
|
| 78 |
-
|
| 79 |
-
$installer->installEntities();
|
| 80 |
$installer->endSetup ();
|
| 22 |
$installer = $this;
|
| 23 |
$installer->startSetup ();
|
| 24 |
|
| 25 |
+
// Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( 'DHL MeinPaket.de extension was successfully installed!' );
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
$installer->installEntities ();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
$installer->endSetup ();
|
app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-upgrade-1.0.0-1.1.0.php
CHANGED
|
@@ -4,73 +4,6 @@
|
|
| 4 |
$installer = $this;
|
| 5 |
$installer->startSetup ();
|
| 6 |
|
| 7 |
-
$installer->installEntities();
|
| 8 |
-
|
| 9 |
-
/*
|
| 10 |
-
$installer->run ( "
|
| 11 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/variants')};
|
| 12 |
-
CREATE TABLE {$this->getTable('meinpaket/variants')} (
|
| 13 |
-
`variant_id` int(10) unsigned not null auto_increment ,
|
| 14 |
-
`meinpaket_code` varchar(255) not null ,
|
| 15 |
-
`meinpaket_name` varchar(255) not null ,
|
| 16 |
-
`meinpaket_selection_rule` varchar(255) not null ,
|
| 17 |
-
`meinpaket_index_as_group` tinyint(1) unsigned not null ,
|
| 18 |
-
PRIMARY KEY (`variant_id`)
|
| 19 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Variants';
|
| 20 |
-
" );
|
| 21 |
-
|
| 22 |
-
$installer->run ( "
|
| 23 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/attributes')};
|
| 24 |
-
CREATE TABLE {$this->getTable('meinpaket/attributes')} (
|
| 25 |
-
`attribute_id` int(10) unsigned not null auto_increment ,
|
| 26 |
-
`variant_id` int(10) unsigned not null ,
|
| 27 |
-
`meinpaket_code` varchar(255) not null ,
|
| 28 |
-
`meinpaket_name` varchar(255) not null ,
|
| 29 |
-
PRIMARY KEY (`attribute_id`)
|
| 30 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Attributes';
|
| 31 |
-
" );
|
| 32 |
-
|
| 33 |
-
$installer->run ( "
|
| 34 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/values')};
|
| 35 |
-
CREATE TABLE {$this->getTable('meinpaket/values')} (
|
| 36 |
-
`value_id` int(10) unsigned not null auto_increment ,
|
| 37 |
-
`attribute_id` int(10) unsigned not null ,
|
| 38 |
-
`value` varchar(255) not null ,
|
| 39 |
-
PRIMARY KEY (`value_id`)
|
| 40 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Attribute Values';
|
| 41 |
-
" );
|
| 42 |
-
|
| 43 |
-
$installer->run ( "
|
| 44 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/variant_mappings')};
|
| 45 |
-
CREATE TABLE {$this->getTable('meinpaket/variant_mappings')} (
|
| 46 |
-
`variant_mapping_id` int(10) unsigned not null auto_increment ,
|
| 47 |
-
`meinpaket_variant_id` int(10) unsigned not null ,
|
| 48 |
-
`attribute_set_id` int(10) unsigned not null ,
|
| 49 |
-
PRIMARY KEY (`variant_mapping_id`)
|
| 50 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Variant to Magento Attribute Set Mapping';
|
| 51 |
-
" );
|
| 52 |
-
|
| 53 |
-
$installer->run ( "
|
| 54 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/attribute_mappings')};
|
| 55 |
-
CREATE TABLE {$this->getTable('meinpaket/attribute_mappings')} (
|
| 56 |
-
`attribute_mapping_id` int(10) unsigned not null auto_increment ,
|
| 57 |
-
`variant_mapping_id` int(10) unsigned not null ,
|
| 58 |
-
`meinpaket_attribute_id` int(10) unsigned not null ,
|
| 59 |
-
`attribute_id` int(10) unsigned not null ,
|
| 60 |
-
PRIMARY KEY (`attribute_mapping_id`)
|
| 61 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Attribute to Magento Attribute Mapping';
|
| 62 |
-
" );
|
| 63 |
-
|
| 64 |
-
$installer->run ( "
|
| 65 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/value_mappings')};
|
| 66 |
-
CREATE TABLE {$this->getTable('meinpaket/value_mappings')} (
|
| 67 |
-
`value_mapping_id` int(10) unsigned not null auto_increment ,
|
| 68 |
-
`attribute_mapping_id` int(10) unsigned not null ,
|
| 69 |
-
`meinpaket_value_id` int(10) unsigned not null ,
|
| 70 |
-
`option_id` int(10) unsigned not null ,
|
| 71 |
-
PRIMARY KEY (`value_mapping_id`)
|
| 72 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Value to Magento Option Mapping';
|
| 73 |
-
" );
|
| 74 |
|
| 75 |
$installer->endSetup ();
|
| 76 |
-
*/
|
| 4 |
$installer = $this;
|
| 5 |
$installer->startSetup ();
|
| 6 |
|
| 7 |
+
$installer->installEntities ();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
$installer->endSetup ();
|
|
|
app/code/community/Dhl/MeinPaket/sql/meinpaket_setup/mysql4-upgrade-1.1.0-2.0.0.php
CHANGED
|
@@ -6,17 +6,6 @@ $installer->startSetup ();
|
|
| 6 |
|
| 7 |
$installer->installEntities ();
|
| 8 |
|
| 9 |
-
/*
|
| 10 |
-
$installer->run ( "
|
| 11 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/variants')};
|
| 12 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/attributes')};
|
| 13 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/values')};
|
| 14 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/variant_mappings')};
|
| 15 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/attribute_mappings')};
|
| 16 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/value_mappings')};
|
| 17 |
-
" );
|
| 18 |
-
*/
|
| 19 |
-
|
| 20 |
$installer->run ( "
|
| 21 |
DROP TABLE IF EXISTS {$this->getTable('meinpaket/category')};
|
| 22 |
CREATE TABLE {$this->getTable('meinpaket/category')} (
|
|
@@ -41,32 +30,6 @@ $installer->run ( "
|
|
| 41 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Backlog';
|
| 42 |
" );
|
| 43 |
|
| 44 |
-
$installer->run ( "
|
| 45 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/log')};
|
| 46 |
-
CREATE TABLE {$this->getTable('meinpaket/log')} (
|
| 47 |
-
`log_id` int(11) unsigned NOT NULL auto_increment,
|
| 48 |
-
`request_id` varchar(255),
|
| 49 |
-
`status` varchar(255),
|
| 50 |
-
`send` text default '',
|
| 51 |
-
`received` text default '',
|
| 52 |
-
`error` text default '',
|
| 53 |
-
`created_at` datetime default '0000-00-00 00:00:00',
|
| 54 |
-
PRIMARY KEY(`log_id`)
|
| 55 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Sync';
|
| 56 |
-
" );
|
| 57 |
-
|
| 58 |
-
$installer->run ( "
|
| 59 |
-
DROP TABLE IF EXISTS {$this->getTable('meinpaket/async')};
|
| 60 |
-
CREATE TABLE {$this->getTable('meinpaket/async')} (
|
| 61 |
-
`async_id` int(11) unsigned NOT NULL auto_increment,
|
| 62 |
-
`request_id` varchar(255),
|
| 63 |
-
`status` varchar(255),
|
| 64 |
-
`created_at` datetime default '0000-00-00 00:00:00',
|
| 65 |
-
`updated_at` datetime default '0000-00-00 00:00:00',
|
| 66 |
-
PRIMARY KEY(`async_id`)
|
| 67 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Async Requests';
|
| 68 |
-
" );
|
| 69 |
-
|
| 70 |
$installer->run ( "
|
| 71 |
DROP TABLE IF EXISTS {$this->getTable('meinpaket/bestprice')};
|
| 72 |
CREATE TABLE {$this->getTable('meinpaket/bestprice')} (
|
|
@@ -86,7 +49,6 @@ $installer->run ( "
|
|
| 86 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket BestPrices';
|
| 87 |
" );
|
| 88 |
|
| 89 |
-
|
| 90 |
$installer->getConnection ()->addColumn ( $installer->getTable ( 'catalog/eav_attribute' ), 'meinpaket_attribute', "VARCHAR( 255 ) DEFAULT 'None' COMMENT 'MeinPaket Attribute'" );
|
| 91 |
|
| 92 |
-
$installer->endSetup ();
|
| 6 |
|
| 7 |
$installer->installEntities ();
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
$installer->run ( "
|
| 10 |
DROP TABLE IF EXISTS {$this->getTable('meinpaket/category')};
|
| 11 |
CREATE TABLE {$this->getTable('meinpaket/category')} (
|
| 30 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Backlog';
|
| 31 |
" );
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
$installer->run ( "
|
| 34 |
DROP TABLE IF EXISTS {$this->getTable('meinpaket/bestprice')};
|
| 35 |
CREATE TABLE {$this->getTable('meinpaket/bestprice')} (
|
| 49 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket BestPrices';
|
| 50 |
" );
|
| 51 |
|
|
|
|
| 52 |
$installer->getConnection ()->addColumn ( $installer->getTable ( 'catalog/eav_attribute' ), 'meinpaket_attribute', "VARCHAR( 255 ) DEFAULT 'None' COMMENT 'MeinPaket Attribute'" );
|
| 53 |
|
| 54 |
+
$installer->endSetup ();
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Async.php
RENAMED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
* Constructor for Cron Adminhtml Block
|
| 5 |
*/
|
| 6 |
public function __construct() {
|
| 7 |
-
$this->_blockGroup = '
|
| 8 |
$this->_controller = 'adminhtml_async';
|
| 9 |
-
$this->_headerText = Mage::helper ( '
|
| 10 |
parent::__construct ();
|
| 11 |
}
|
| 12 |
/**
|
|
@@ -18,7 +18,7 @@ class Dhl_MeinPaket_Block_Adminhtml_Async extends Mage_Adminhtml_Block_Widget_Gr
|
|
| 18 |
$this->removeButton ( 'add' );
|
| 19 |
|
| 20 |
$this->_addButton ( 'run_async', array (
|
| 21 |
-
'label' => Mage::helper ( '
|
| 22 |
'onclick' => 'setLocation(\'' . $this->getUrl ( '*/*/run', array (
|
| 23 |
'cronjob' => Dhl_MeinPaket_Model_Cron::SYNC_ASYNC
|
| 24 |
) ) . '\')',
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Block_Adminhtml_Async extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
| 3 |
/**
|
| 4 |
* Constructor for Cron Adminhtml Block
|
| 5 |
*/
|
| 6 |
public function __construct() {
|
| 7 |
+
$this->_blockGroup = 'meinpaketcommon';
|
| 8 |
$this->_controller = 'adminhtml_async';
|
| 9 |
+
$this->_headerText = Mage::helper ( 'meinpaketcommon' )->__ ( 'Async' );
|
| 10 |
parent::__construct ();
|
| 11 |
}
|
| 12 |
/**
|
| 18 |
$this->removeButton ( 'add' );
|
| 19 |
|
| 20 |
$this->_addButton ( 'run_async', array (
|
| 21 |
+
'label' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Synchronize Async Jobs' ),
|
| 22 |
'onclick' => 'setLocation(\'' . $this->getUrl ( '*/*/run', array (
|
| 23 |
'cronjob' => Dhl_MeinPaket_Model_Cron::SYNC_ASYNC
|
| 24 |
) ) . '\')',
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Async/Grid.php
RENAMED
|
@@ -1,48 +1,48 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
public function __construct() {
|
| 4 |
parent::__construct ();
|
| 5 |
-
$this->setId ( '
|
| 6 |
$this->setDefaultSort ( 'async_id' );
|
| 7 |
$this->setDefaultDir ( 'ASC' );
|
| 8 |
$this->setUseAjax ( true );
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
-
$collection = Mage::getModel ( '
|
| 13 |
$this->setCollection ( $collection );
|
| 14 |
return parent::_prepareCollection ();
|
| 15 |
}
|
| 16 |
protected function _prepareColumns() {
|
| 17 |
$this->addColumn ( 'async_id', array (
|
| 18 |
-
'header' => Mage::helper ( '
|
| 19 |
'type' => 'number',
|
| 20 |
'index' => 'async_id'
|
| 21 |
) );
|
| 22 |
|
| 23 |
$this->addColumn ( 'request_id', array (
|
| 24 |
-
'header' => Mage::helper ( '
|
| 25 |
'index' => 'request_id'
|
| 26 |
) );
|
| 27 |
|
| 28 |
$this->addColumn ( 'status', array (
|
| 29 |
-
'header' => Mage::helper ( '
|
| 30 |
'index' => 'status'
|
| 31 |
) );
|
| 32 |
|
| 33 |
$this->addColumn ( 'created_at', array (
|
| 34 |
-
'header' => Mage::helper ( '
|
| 35 |
'type' => 'datetime',
|
| 36 |
'index' => 'created_at'
|
| 37 |
) );
|
| 38 |
|
| 39 |
$this->addColumn ( 'updated_at', array (
|
| 40 |
-
'header' => Mage::helper ( '
|
| 41 |
'type' => 'datetime',
|
| 42 |
'index' => 'updated_at'
|
| 43 |
) );
|
| 44 |
|
| 45 |
-
$this->addExportType ( '*/*/exportExcel', Mage::helper ( '
|
| 46 |
|
| 47 |
return parent::_prepareColumns ();
|
| 48 |
}
|
|
@@ -50,9 +50,9 @@ class Dhl_MeinPaket_Block_Adminhtml_Async_Grid extends Mage_Adminhtml_Block_Widg
|
|
| 50 |
$this->setMassactionIdField ( 'async_id' );
|
| 51 |
$this->getMassactionBlock ()->setFormFieldName ( 'asyncIds' );
|
| 52 |
$this->getMassactionBlock ()->addItem ( 'delete', array (
|
| 53 |
-
'label' => Mage::helper ( '
|
| 54 |
'url' => $this->getUrl ( '*/*/massDelete', array () ),
|
| 55 |
-
'confirm' => Mage::helper ( '
|
| 56 |
) );
|
| 57 |
|
| 58 |
return $this;
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Block_Adminhtml_Async_Grid extends Mage_Adminhtml_Block_Widget_Grid {
|
| 3 |
public function __construct() {
|
| 4 |
parent::__construct ();
|
| 5 |
+
$this->setId ( 'meinpaketcommon_async_grid' );
|
| 6 |
$this->setDefaultSort ( 'async_id' );
|
| 7 |
$this->setDefaultDir ( 'ASC' );
|
| 8 |
$this->setUseAjax ( true );
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
+
$collection = Mage::getModel ( 'meinpaketcommon/async' )->getCollection ();
|
| 13 |
$this->setCollection ( $collection );
|
| 14 |
return parent::_prepareCollection ();
|
| 15 |
}
|
| 16 |
protected function _prepareColumns() {
|
| 17 |
$this->addColumn ( 'async_id', array (
|
| 18 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'ID' ),
|
| 19 |
'type' => 'number',
|
| 20 |
'index' => 'async_id'
|
| 21 |
) );
|
| 22 |
|
| 23 |
$this->addColumn ( 'request_id', array (
|
| 24 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Request ID' ),
|
| 25 |
'index' => 'request_id'
|
| 26 |
) );
|
| 27 |
|
| 28 |
$this->addColumn ( 'status', array (
|
| 29 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Status' ),
|
| 30 |
'index' => 'status'
|
| 31 |
) );
|
| 32 |
|
| 33 |
$this->addColumn ( 'created_at', array (
|
| 34 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Created At' ),
|
| 35 |
'type' => 'datetime',
|
| 36 |
'index' => 'created_at'
|
| 37 |
) );
|
| 38 |
|
| 39 |
$this->addColumn ( 'updated_at', array (
|
| 40 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Updated At' ),
|
| 41 |
'type' => 'datetime',
|
| 42 |
'index' => 'updated_at'
|
| 43 |
) );
|
| 44 |
|
| 45 |
+
$this->addExportType ( '*/*/exportExcel', Mage::helper ( 'meinpaketcommon' )->__ ( 'Excel XML' ) );
|
| 46 |
|
| 47 |
return parent::_prepareColumns ();
|
| 48 |
}
|
| 50 |
$this->setMassactionIdField ( 'async_id' );
|
| 51 |
$this->getMassactionBlock ()->setFormFieldName ( 'asyncIds' );
|
| 52 |
$this->getMassactionBlock ()->addItem ( 'delete', array (
|
| 53 |
+
'label' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Delete' ),
|
| 54 |
'url' => $this->getUrl ( '*/*/massDelete', array () ),
|
| 55 |
+
'confirm' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Are you sure?' )
|
| 56 |
) );
|
| 57 |
|
| 58 |
return $this;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Log.php
RENAMED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
* Constructor for Cron Adminhtml Block
|
| 5 |
*/
|
| 6 |
public function __construct() {
|
| 7 |
-
$this->_blockGroup = '
|
| 8 |
$this->_controller = 'adminhtml_log';
|
| 9 |
-
$this->_headerText = Mage::helper ( '
|
| 10 |
parent::__construct ();
|
| 11 |
}
|
| 12 |
/**
|
| 13 |
* Prepare layout
|
| 14 |
*
|
| 15 |
-
* @return
|
| 16 |
*/
|
| 17 |
protected function _prepareLayout() {
|
| 18 |
$this->removeButton ( 'add' );
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container {
|
| 3 |
/**
|
| 4 |
* Constructor for Cron Adminhtml Block
|
| 5 |
*/
|
| 6 |
public function __construct() {
|
| 7 |
+
$this->_blockGroup = 'meinpaketcommon';
|
| 8 |
$this->_controller = 'adminhtml_log';
|
| 9 |
+
$this->_headerText = Mage::helper ( 'meinpaketcommon' )->__ ( 'Log' );
|
| 10 |
parent::__construct ();
|
| 11 |
}
|
| 12 |
/**
|
| 13 |
* Prepare layout
|
| 14 |
*
|
| 15 |
+
* @return Dhl_MeinPaketCommon_Block_Adminhtml_Backlog_Product_Grid_Container
|
| 16 |
*/
|
| 17 |
protected function _prepareLayout() {
|
| 18 |
$this->removeButton ( 'add' );
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Block/Adminhtml/Log/Grid.php
RENAMED
|
@@ -1,52 +1,52 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
public function __construct() {
|
| 4 |
parent::__construct ();
|
| 5 |
-
$this->setId ( '
|
| 6 |
$this->setDefaultSort ( 'log_id' );
|
| 7 |
$this->setDefaultDir ( 'ASC' );
|
| 8 |
$this->setUseAjax ( true );
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
-
$collection = Mage::getModel ( '
|
| 13 |
$this->setCollection ( $collection );
|
| 14 |
return parent::_prepareCollection ();
|
| 15 |
}
|
| 16 |
protected function _prepareColumns() {
|
| 17 |
$this->addColumn ( 'log_id', array (
|
| 18 |
-
'header' => Mage::helper ( '
|
| 19 |
'type' => 'number',
|
| 20 |
'index' => 'log_id'
|
| 21 |
) );
|
| 22 |
|
| 23 |
$this->addColumn ( 'request_id', array (
|
| 24 |
-
'header' => Mage::helper ( '
|
| 25 |
'index' => 'request_id'
|
| 26 |
) );
|
| 27 |
|
| 28 |
$this->addColumn ( 'send', array (
|
| 29 |
-
'header' => Mage::helper ( '
|
| 30 |
'index' => 'send'
|
| 31 |
) );
|
| 32 |
|
| 33 |
$this->addColumn ( 'received', array (
|
| 34 |
-
'header' => Mage::helper ( '
|
| 35 |
'index' => 'received'
|
| 36 |
) );
|
| 37 |
|
| 38 |
$this->addColumn ( 'error', array (
|
| 39 |
-
'header' => Mage::helper ( '
|
| 40 |
'index' => 'error'
|
| 41 |
) );
|
| 42 |
|
| 43 |
$this->addColumn ( 'created_at', array (
|
| 44 |
-
'header' => Mage::helper ( '
|
| 45 |
'type' => 'datetime',
|
| 46 |
'index' => 'created_at'
|
| 47 |
) );
|
| 48 |
|
| 49 |
-
$this->addExportType ( '*/*/exportExcel', Mage::helper ( '
|
| 50 |
|
| 51 |
return parent::_prepareColumns ();
|
| 52 |
}
|
|
@@ -54,18 +54,11 @@ class Dhl_MeinPaket_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget
|
|
| 54 |
$this->setMassactionIdField ( 'log_id' );
|
| 55 |
$this->getMassactionBlock ()->setFormFieldName ( 'logIds' );
|
| 56 |
$this->getMassactionBlock ()->addItem ( 'delete', array (
|
| 57 |
-
'label' => Mage::helper ( '
|
| 58 |
'url' => $this->getUrl ( '*/*/massDelete', array () ),
|
| 59 |
-
'confirm' => Mage::helper ( '
|
| 60 |
) );
|
| 61 |
|
| 62 |
-
//$this->getMassactionBlock ()->addItem ( 'process', array (
|
| 63 |
-
// 'label' => Mage::helper ( 'meinpaket' )->__ ( 'Process' ),
|
| 64 |
-
// 'url' => $this->getUrl ( '*/*/massProcess', array () ),
|
| 65 |
-
// 'confirm' => Mage::helper ( 'meinpaket' )->__ ( 'Are you sure?' )
|
| 66 |
-
//) );
|
| 67 |
-
|
| 68 |
-
|
| 69 |
return $this;
|
| 70 |
}
|
| 71 |
public function getGridUrl() {
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid {
|
| 3 |
public function __construct() {
|
| 4 |
parent::__construct ();
|
| 5 |
+
$this->setId ( 'meinpaketcommon_log_grid' );
|
| 6 |
$this->setDefaultSort ( 'log_id' );
|
| 7 |
$this->setDefaultDir ( 'ASC' );
|
| 8 |
$this->setUseAjax ( true );
|
| 9 |
$this->setSaveParametersInSession ( true );
|
| 10 |
}
|
| 11 |
protected function _prepareCollection() {
|
| 12 |
+
$collection = Mage::getModel ( 'meinpaketcommon/log' )->getCollection ();
|
| 13 |
$this->setCollection ( $collection );
|
| 14 |
return parent::_prepareCollection ();
|
| 15 |
}
|
| 16 |
protected function _prepareColumns() {
|
| 17 |
$this->addColumn ( 'log_id', array (
|
| 18 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'ID' ),
|
| 19 |
'type' => 'number',
|
| 20 |
'index' => 'log_id'
|
| 21 |
) );
|
| 22 |
|
| 23 |
$this->addColumn ( 'request_id', array (
|
| 24 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Request ID' ),
|
| 25 |
'index' => 'request_id'
|
| 26 |
) );
|
| 27 |
|
| 28 |
$this->addColumn ( 'send', array (
|
| 29 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Send' ),
|
| 30 |
'index' => 'send'
|
| 31 |
) );
|
| 32 |
|
| 33 |
$this->addColumn ( 'received', array (
|
| 34 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Received' ),
|
| 35 |
'index' => 'received'
|
| 36 |
) );
|
| 37 |
|
| 38 |
$this->addColumn ( 'error', array (
|
| 39 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Error' ),
|
| 40 |
'index' => 'error'
|
| 41 |
) );
|
| 42 |
|
| 43 |
$this->addColumn ( 'created_at', array (
|
| 44 |
+
'header' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Created At' ),
|
| 45 |
'type' => 'datetime',
|
| 46 |
'index' => 'created_at'
|
| 47 |
) );
|
| 48 |
|
| 49 |
+
$this->addExportType ( '*/*/exportExcel', Mage::helper ( 'meinpaketcommon' )->__ ( 'Excel XML' ) );
|
| 50 |
|
| 51 |
return parent::_prepareColumns ();
|
| 52 |
}
|
| 54 |
$this->setMassactionIdField ( 'log_id' );
|
| 55 |
$this->getMassactionBlock ()->setFormFieldName ( 'logIds' );
|
| 56 |
$this->getMassactionBlock ()->addItem ( 'delete', array (
|
| 57 |
+
'label' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Delete' ),
|
| 58 |
'url' => $this->getUrl ( '*/*/massDelete', array () ),
|
| 59 |
+
'confirm' => Mage::helper ( 'meinpaketcommon' )->__ ( 'Are you sure?' )
|
| 60 |
) );
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
return $this;
|
| 63 |
}
|
| 64 |
public function getGridUrl() {
|
app/code/community/Dhl/MeinPaketCommon/Helper/Address.php
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Default helper for the Dhl_MeinPaket package.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Helper
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_MeinPaketCommon_Helper_Address extends Mage_Core_Helper_Abstract {
|
| 11 |
+
const STREET_HOUSENUMBER = '/^(?P<street>\D+)\s*(?P<houseNumber>\d.*)$/';
|
| 12 |
+
const HOUSENUMBER_STREET = '/^(?P<houseNumber>\d\S*)\s*(?P<street>\D.*)$/';
|
| 13 |
+
|
| 14 |
+
/**
|
| 15 |
+
* Parse address and return array with keys "street" and "houseNumber".
|
| 16 |
+
*
|
| 17 |
+
* @return array
|
| 18 |
+
*/
|
| 19 |
+
public function parseAddress(Mage_Sales_Model_Order_Address $address) {
|
| 20 |
+
return $this->parseStreetHouseNumber ( $address->getStreet1 () );
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Parse address and return array with keys "street" and "houseNumber".
|
| 25 |
+
*
|
| 26 |
+
* @return array
|
| 27 |
+
*/
|
| 28 |
+
public function parseStreetHouseNumber($address) {
|
| 29 |
+
if ($address == null) {
|
| 30 |
+
return null;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
$matches = null;
|
| 34 |
+
|
| 35 |
+
if (preg_match ( self::STREET_HOUSENUMBER, $address, $matches )) {
|
| 36 |
+
return $matches;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
if (preg_match ( self::HOUSENUMBER_STREET, $address, $matches )) {
|
| 40 |
+
return $matches;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
return array (
|
| 44 |
+
0 => $address,
|
| 45 |
+
1 => $address,
|
| 46 |
+
2 => "",
|
| 47 |
+
"street" => $address,
|
| 48 |
+
"houseNumber" => ""
|
| 49 |
+
);
|
| 50 |
+
}
|
| 51 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Attribute.php
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Helper_Attribute extends Mage_Core_Helper_Abstract {
|
| 3 |
+
protected $_ignoredAttributeCodes = array (
|
| 4 |
+
'status'
|
| 5 |
+
);
|
| 6 |
+
public function isExportableAttribute(Mage_Catalog_Model_Resource_Eav_Attribute $attribute) {
|
| 7 |
+
$isExportable = false;
|
| 8 |
+
$data = $attribute->getData ( '' );
|
| 9 |
+
|
| 10 |
+
if (! in_array ( $data ['attribute_code'], $this->_ignoredAttributeCodes ) && (! array_key_exists ( 'is_configurable', $data ) || $data ['is_configurable'])) {
|
| 11 |
+
$isExportable = true;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
return $isExportable;
|
| 15 |
+
}
|
| 16 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Cron.php
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Helper_Cron extends Mage_Core_Helper_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Schedule jobs for next cron run.
|
| 5 |
+
*
|
| 6 |
+
* @param array $cronjobs
|
| 7 |
+
* to schedule
|
| 8 |
+
* @param string $addMessage
|
| 9 |
+
* add messages to session
|
| 10 |
+
*/
|
| 11 |
+
public function scheduleJobs(array $cronjobs, $addMessage = true) {
|
| 12 |
+
$session = Mage::getSingleton ( 'adminhtml/session' );
|
| 13 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 14 |
+
|
| 15 |
+
$time = time ();
|
| 16 |
+
$timeString = strftime ( '%Y-%m-%d %H:%M:%S', $time );
|
| 17 |
+
foreach ( $cronjobs as $code ) {
|
| 18 |
+
$schedule = Mage::getModel ( 'cron/schedule' );
|
| 19 |
+
$schedule->setJobCode ( $code );
|
| 20 |
+
$schedule->setStatus ( Mage_Cron_Model_Schedule::STATUS_PENDING );
|
| 21 |
+
$schedule->setCreatedAt ( $timeString );
|
| 22 |
+
$schedule->setScheduledAt ( $timeString );
|
| 23 |
+
$schedule->save ();
|
| 24 |
+
if ($addMessage) {
|
| 25 |
+
$session->addSuccess ( $this->__ ( 'Scheduled "%s" at %s', $code, $timeString ) );
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
/**
|
| 30 |
+
* Run jobs now.
|
| 31 |
+
*
|
| 32 |
+
* @param array $cronjobs
|
| 33 |
+
* to run
|
| 34 |
+
* @param string $addMessage
|
| 35 |
+
* add messages to session
|
| 36 |
+
*/
|
| 37 |
+
public function runJobs(array $cronjobs, $addMessage = true) {
|
| 38 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 39 |
+
$session = Mage::getSingleton ( 'adminhtml/session' );
|
| 40 |
+
|
| 41 |
+
foreach ( $cronjobs as $code ) {
|
| 42 |
+
try {
|
| 43 |
+
switch ($code) {
|
| 44 |
+
case Dhl_MeinPaketCommon_Model_Cron::SYNC_CATALOG :
|
| 45 |
+
$res = Mage::getSingleton ( 'meinpaket/service_product_export' )->exportProducts ();
|
| 46 |
+
break;
|
| 47 |
+
case Dhl_MeinPaketCommon_Model_Cron::SYNC_ORDERS :
|
| 48 |
+
$res = Mage::getSingleton ( 'meinpaketcommon/service_order_importService' )->importOrders ();
|
| 49 |
+
break;
|
| 50 |
+
case Dhl_MeinPaketCommon_Model_Cron::SYNC_ASYNC :
|
| 51 |
+
$res = Mage::getSingleton ( 'meinpaketcommon/service_async' )->process ();
|
| 52 |
+
break;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
$message = is_string ( $res ) ? $res : Zend_Debug::dump ( $res, null, false );
|
| 56 |
+
|
| 57 |
+
if ($addMessage && strlen ( $message ) > 0) {
|
| 58 |
+
$session->addSuccess ( $this->__ ( 'Ran "%s":<pre>%s</pre>', $code, $message ) );
|
| 59 |
+
}
|
| 60 |
+
} catch ( Exception $e ) {
|
| 61 |
+
if ($addMessage) {
|
| 62 |
+
$session->addError ( $this->__ ( 'Error while running "%s":<pre>%s</pre>', $code, $e->getMessage () ) );
|
| 63 |
+
}
|
| 64 |
+
Mage::logException ( $e );
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Data.php
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Default helper for the Dhl_MeinPaket package.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Helper
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_MeinPaketCommon_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 11 |
+
/**
|
| 12 |
+
* Creates/extends JavaScript language object by the given labels.
|
| 13 |
+
* The given labels array must have the structure array('key1'=>'label1','key2'=>'label2',...).
|
| 14 |
+
* Key is the key under which the label will be accessible in frontend JavaScript.
|
| 15 |
+
* Label is the untranslated label.
|
| 16 |
+
* Example: Element is 'foo'=>'Bar'. So use MeinPaket.locale.foo .
|
| 17 |
+
*
|
| 18 |
+
* @param array $labels
|
| 19 |
+
* @return string
|
| 20 |
+
*/
|
| 21 |
+
public function createLocaleJS(array $labels) {
|
| 22 |
+
$js = 'if(typeof MeinPaket === "undefined"){var MeinPaket={};}';
|
| 23 |
+
$js .= 'if(typeof MeinPaket.locale === "undefined"){MeinPaket.locale={};}';
|
| 24 |
+
$js .= 'Object.extend(MeinPaket.locale,{';
|
| 25 |
+
|
| 26 |
+
$firstItem = true;
|
| 27 |
+
if (sizeof ( $labels ) > 0) {
|
| 28 |
+
foreach ( $labels as $key => $label ) {
|
| 29 |
+
$js .= $this->_addJSLocaleLabel ( $key, $this->__ ( $label ), $firstItem );
|
| 30 |
+
if ($firstItem) {
|
| 31 |
+
$firstItem = false;
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
$js .= '});';
|
| 37 |
+
|
| 38 |
+
return $js;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Creates a json property.
|
| 43 |
+
*
|
| 44 |
+
* @param string $key
|
| 45 |
+
* @param string $label
|
| 46 |
+
* @param boolean $isFirst
|
| 47 |
+
* Tells if the label is the first in the list.
|
| 48 |
+
* @return string
|
| 49 |
+
*/
|
| 50 |
+
protected function _addJSLocaleLabel($key, $label, $isFirst = false) {
|
| 51 |
+
$labelProperty = '';
|
| 52 |
+
|
| 53 |
+
if (! $isFirst) {
|
| 54 |
+
$labelProperty .= ',';
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
$labelProperty .= $key . ':"' . $label . '"';
|
| 58 |
+
|
| 59 |
+
return $labelProperty;
|
| 60 |
+
}
|
| 61 |
+
public function getExtensionVersion() {
|
| 62 |
+
return ( string ) Mage::getConfig ()->getModuleConfig ( 'Dhl_MeinPaketCommon' )->version;
|
| 63 |
+
}
|
| 64 |
+
const STORE_VIEW_CONFIG = 'meinpaket/store/view';
|
| 65 |
+
private $_meinpaketStore = null;
|
| 66 |
+
private $_meinpaketRootCategory = null;
|
| 67 |
+
public function getMeinPaketStore() {
|
| 68 |
+
if ($this->_meinpaketStore == null) {
|
| 69 |
+
$this->_meinpaketStore = Mage::app ()->getStore ( Mage::getStoreConfig ( self::STORE_VIEW_CONFIG ) );
|
| 70 |
+
}
|
| 71 |
+
return $this->_meinpaketStore;
|
| 72 |
+
}
|
| 73 |
+
public function getMeinPaketStoreId() {
|
| 74 |
+
$store = $this->getMeinPaketStore ();
|
| 75 |
+
if ($store == null) {
|
| 76 |
+
return null;
|
| 77 |
+
} else {
|
| 78 |
+
return $store->getId ();
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* Get filtered quote from session.
|
| 84 |
+
*
|
| 85 |
+
* @return NULL|Mage_Sales_Model_Quote
|
| 86 |
+
*/
|
| 87 |
+
public function getQuoteFiltered() {
|
| 88 |
+
$quote = Mage::getSingleton ( 'checkout/session' )->getQuote ();
|
| 89 |
+
/* @var $quote Mage_Sales_Model_Quote */
|
| 90 |
+
|
| 91 |
+
if ($quote === null) {
|
| 92 |
+
return null;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
foreach ( $quote->getAllVisibleItems () as $item ) {
|
| 96 |
+
if (! $this->checkItem ( $item )) {
|
| 97 |
+
return null;
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
return $quote;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
/**
|
| 105 |
+
* Get filtered quote from session.
|
| 106 |
+
*
|
| 107 |
+
* @return boolean
|
| 108 |
+
*/
|
| 109 |
+
public function checkItem(Mage_Sales_Model_Order_Item $item) {
|
| 110 |
+
$options = Mage::helper ( 'catalog/product_configuration' )->getCustomOptions ( $item );
|
| 111 |
+
// $options = $item->getProduct ()->getTypeInstance ( true )->getOrderOptions ( $item->getProduct () );
|
| 112 |
+
|
| 113 |
+
if (count ( $options ) || $item->getIsNominal () || $item->getIsVirtual () || $item->getIsRecurring ()) {
|
| 114 |
+
return false;
|
| 115 |
+
}
|
| 116 |
+
// Mage::log ( Zend_Debug::dump ( $options ) );
|
| 117 |
+
|
| 118 |
+
if ($item->getParentItemId ()) {
|
| 119 |
+
true;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
if ($item->getProduct ()->isVirtual () || $item->getProduct ()->isRecurring ()) {
|
| 123 |
+
return false;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
return true;
|
| 127 |
+
}
|
| 128 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Order.php
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Order model related helper methods.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Util
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Helper_Order extends Mage_Core_Helper_Abstract {
|
| 12 |
+
/**
|
| 13 |
+
* Tells if the given order is an order that was imported from MeinPaket.de.
|
| 14 |
+
*
|
| 15 |
+
* @param Mage_Sales_Model_Order $order
|
| 16 |
+
* @return boolean
|
| 17 |
+
*/
|
| 18 |
+
public function isMeinPaketOrder(Mage_Sales_Model_Order $order) {
|
| 19 |
+
return ($order->hasData ( 'dhl_mein_paket_order_id' ) && $order->getData ( 'dhl_mein_paket_order_id' ));
|
| 20 |
+
}
|
| 21 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Product.php
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Helper_Product extends Mage_Core_Helper_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* @var string
|
| 6 |
+
*/
|
| 7 |
+
const TAX_CLASS_STANDARD = 'Standard';
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
*
|
| 11 |
+
* @var string
|
| 12 |
+
*/
|
| 13 |
+
const TAX_CLASS_REDUCED = 'Reduced';
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
*
|
| 17 |
+
* @var string
|
| 18 |
+
*/
|
| 19 |
+
const TAX_CLASS_FREE = 'Free';
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
*
|
| 23 |
+
* @var Dhl_MeinPaketCommon_Model_Validation_Validator_Ean
|
| 24 |
+
*/
|
| 25 |
+
protected $_eanValidator = null;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Constructor.
|
| 29 |
+
*
|
| 30 |
+
* @return void
|
| 31 |
+
*/
|
| 32 |
+
public function __construct() {
|
| 33 |
+
$this->_eanValidator = Mage::getSingleton ( 'meinpaket/validation_validatorFactory' )->createEanValidator ();
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Tells if the given product has a valid ean.
|
| 38 |
+
*
|
| 39 |
+
* @param Mage_Catalog_Model_Product $product
|
| 40 |
+
* @return boolean
|
| 41 |
+
*/
|
| 42 |
+
public function hasValidEan(Mage_Catalog_Model_Product $product) {
|
| 43 |
+
return $this->_eanValidator->isValid ( $this->getEan ( $product ) );
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* Returns the EAN of the given product.
|
| 48 |
+
*
|
| 49 |
+
* @param Mage_Catalog_Model_Product $product
|
| 50 |
+
* @return string
|
| 51 |
+
*/
|
| 52 |
+
public function getEan(Mage_Catalog_Model_Product $product) {
|
| 53 |
+
$eanAttributeCode = Mage::getStoreConfig ( 'meinpaket/product_attributes/ean_attribute' );
|
| 54 |
+
|
| 55 |
+
if (! empty ( $eanAttributeCode ) && $product->hasData ( $eanAttributeCode ) && $this->_eanValidator->isValid ( $product->getData ( $eanAttributeCode ) )) {
|
| 56 |
+
return $product->getData ( $eanAttributeCode );
|
| 57 |
+
} else {
|
| 58 |
+
return null;
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Returns the images for the given product.
|
| 64 |
+
* The items of the returned array are arrays themselves and have the
|
| 65 |
+
* following structure:
|
| 66 |
+
* array(
|
| 67 |
+
* 'url' => 'the url of the image',
|
| 68 |
+
* 'caption' => 'the images description'
|
| 69 |
+
* )
|
| 70 |
+
*
|
| 71 |
+
* @param Mage_Catalog_Model_Product $product
|
| 72 |
+
* @return array
|
| 73 |
+
*/
|
| 74 |
+
public function getImages(Mage_Catalog_Model_Product $product) {
|
| 75 |
+
$images = array ();
|
| 76 |
+
$galleryImages = Mage::getModel ( 'catalog/product' )->load ( $product->getId () )->getMediaGalleryImages ();
|
| 77 |
+
$imageUrl = '';
|
| 78 |
+
$imageCaption = '';
|
| 79 |
+
|
| 80 |
+
if (is_object ( $galleryImages ) && $galleryImages->count () > 0) {
|
| 81 |
+
foreach ( $galleryImages as $image ) {
|
| 82 |
+
$images [] = array (
|
| 83 |
+
'url' => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_MEDIA ) . 'catalog/product' . $image ['file'],
|
| 84 |
+
'caption' => $image ['label']
|
| 85 |
+
);
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
return $images;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* Returns the MeinPaket marketplace category code which is assigned to the
|
| 94 |
+
* product.
|
| 95 |
+
* If no marketplace category is assigned, an empty string will be
|
| 96 |
+
* returned.
|
| 97 |
+
*
|
| 98 |
+
* @param Mage_Catalog_Model_Product $product
|
| 99 |
+
* @return string
|
| 100 |
+
*/
|
| 101 |
+
public function getMeinPaketMarketplaceCategoryCode(Mage_Catalog_Model_Product $product) {
|
| 102 |
+
$category = $this->getFirstMarketplaceCategory ( $product );
|
| 103 |
+
|
| 104 |
+
return (is_object ( $category ) && get_class ( $category ) === 'Mage_Catalog_Model_Category') ? $category->getDhlMarketplaceCategoryId () : '';
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/**
|
| 108 |
+
* Returns all marketplace categories the product exists in.
|
| 109 |
+
*
|
| 110 |
+
* @param Mage_Catalog_Model_Product $product
|
| 111 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection
|
| 112 |
+
*/
|
| 113 |
+
public function getMarketplaceCategories(Mage_Catalog_Model_Product $product) {
|
| 114 |
+
return $product->getCategoryCollection ()->addAttributeToSelect ( 'dhl_marketplace_category_id' )->addAttributeToFilter ( 'dhl_marketplace_category_id', array (
|
| 115 |
+
'notnull' => 1
|
| 116 |
+
) )->load ();
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
/**
|
| 120 |
+
* Returns the first marketplace category for the given product.
|
| 121 |
+
*
|
| 122 |
+
* @param Mage_Catalog_Model_Product $product
|
| 123 |
+
* @return Mage_Catalog_Model_Category
|
| 124 |
+
*/
|
| 125 |
+
public function getFirstMarketplaceCategory(Mage_Catalog_Model_Product $product) {
|
| 126 |
+
/* @var $category Mage_Catalog_Model_Category */
|
| 127 |
+
$category = null;
|
| 128 |
+
|
| 129 |
+
$collection = $this->getMarketplaceCategories ( $product );
|
| 130 |
+
|
| 131 |
+
if ($collection->count () > 0) {
|
| 132 |
+
$category = $collection->getFirstItem ();
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
return $category;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* Returns the price of the given product depending on tax settings.
|
| 140 |
+
*
|
| 141 |
+
* @param Mage_Catalog_Model_Product $product
|
| 142 |
+
* @return float
|
| 143 |
+
*/
|
| 144 |
+
public function getPriceConsideringTaxes(Mage_Catalog_Model_Product $product) {
|
| 145 |
+
/* @var $taxHelper Mage_Tax_Helper_Data */
|
| 146 |
+
$taxHelper = Mage::helper ( 'tax' );
|
| 147 |
+
$priceIncludesTax = ( bool ) Mage::getStoreConfig ( 'tax/calculation/price_includes_tax' ) ? true : null;
|
| 148 |
+
|
| 149 |
+
return $taxHelper->getPrice ( $product, $product->getPrice (), $priceIncludesTax );
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* Returns the stock count of the product which can be used for MeinPaket.
|
| 154 |
+
*
|
| 155 |
+
* @param Mage_Catalog_Model_Product $product
|
| 156 |
+
* @return integer
|
| 157 |
+
*/
|
| 158 |
+
public function getMeinPaketStock(Mage_Catalog_Model_Product $product) {
|
| 159 |
+
$customDhlMeinPaketStock = 0;
|
| 160 |
+
$hasCustomMeinPaketStock = false;
|
| 161 |
+
$defaultStock = 0;
|
| 162 |
+
$stock = 0;
|
| 163 |
+
|
| 164 |
+
if ($product->hasData ( 'max_stock_for_dhl_mein_paket' )) {
|
| 165 |
+
$hasCustomMeinPaketStock = (strlen ( $product->getMaxStockForDhlMeinPaket () ) > 0);
|
| 166 |
+
$customDhlMeinPaketStock = ( integer ) $product->getMaxStockForDhlMeinPaket ();
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
/* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */
|
| 170 |
+
$stockItem = Mage::getModel ( 'cataloginventory/stock_item' )->loadByProduct ( $product->getId () );
|
| 171 |
+
|
| 172 |
+
if (! $stockItem->getIsInStock ()) {
|
| 173 |
+
return 0;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
$defaultStock = ( integer ) $stockItem->getQty ();
|
| 177 |
+
|
| 178 |
+
if ($hasCustomMeinPaketStock && is_integer ( $customDhlMeinPaketStock ) && $customDhlMeinPaketStock >= 0) {
|
| 179 |
+
$stock = $customDhlMeinPaketStock;
|
| 180 |
+
if ($stock > $defaultStock) {
|
| 181 |
+
$stock = $defaultStock;
|
| 182 |
+
}
|
| 183 |
+
} else {
|
| 184 |
+
$stock = $defaultStock;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
return $stock;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* Returns a date from which on the product won't be available on MeinPaket
|
| 192 |
+
* anymore.
|
| 193 |
+
*
|
| 194 |
+
* @param Mage_Catalog_Model_Product $product
|
| 195 |
+
* @return Zend_Date
|
| 196 |
+
*/
|
| 197 |
+
public function getMeinPaketEndDate(Mage_Catalog_Model_Product $product) {
|
| 198 |
+
$endDate = new Zend_Date ();
|
| 199 |
+
|
| 200 |
+
if ($product->getStatus () == Mage_Catalog_Model_Product_Status::STATUS_DISABLED/* ||
|
| 201 |
+
$product->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE*/
|
| 202 |
+
) {
|
| 203 |
+
$endDate->setTimestamp ( time () - 86400 );
|
| 204 |
+
} else {
|
| 205 |
+
$endDate->setTimestamp ( time () + 31536000 );
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
return $endDate;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
/**
|
| 212 |
+
* Returns the delivery time for orders from MeinPaket for the given product.
|
| 213 |
+
*
|
| 214 |
+
* @param Mage_Catalog_Model_Product $product
|
| 215 |
+
* @return integer The delivery time in days
|
| 216 |
+
*/
|
| 217 |
+
public function getMeinPaketDeliveryTime(Mage_Catalog_Model_Product $product) {
|
| 218 |
+
$attributeId = Mage::getStoreConfig ( 'meinpaket/product_attributes/delivery_time' );
|
| 219 |
+
$deliveryTime = Mage::getStoreConfig ( 'meinpaket/product_attributes/default_delivery_time' );
|
| 220 |
+
|
| 221 |
+
if (strlen ( $attributeId ) > 0 && $product->hasData ( $attributeId ) && @preg_match ( "/^[0-9]+$/", $product->getData ( $attributeId ) )) {
|
| 222 |
+
$deliveryTime = $product->getData ( $attributeId );
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
return $deliveryTime;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* Returns the parent configurable product of the given product.
|
| 230 |
+
* Returns null if the given product isn't a simple one or it has
|
| 231 |
+
* no parent configurable.
|
| 232 |
+
*
|
| 233 |
+
* @param Mage_Catalog_Model_Product $simpleProduct
|
| 234 |
+
* @return Mage_Catalog_Model_Product
|
| 235 |
+
*/
|
| 236 |
+
public function getParentConfigurable(Mage_Catalog_Model_Product $simpleProduct) {
|
| 237 |
+
$parentConfigurable = null;
|
| 238 |
+
|
| 239 |
+
if ($simpleProduct->getTypeId () === Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
|
| 240 |
+
$parentIds = Mage::getModel ( 'catalog/product_type_configurable' )->getParentIdsByChild ( $simpleProduct->getId () );
|
| 241 |
+
if (isset ( $parentIds [0] )) {
|
| 242 |
+
$parentConfigurable = Mage::getModel ( 'catalog/product' )->load ( $parentIds [0] );
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
return $parentConfigurable;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
/**
|
| 250 |
+
* Returns an translated error description.
|
| 251 |
+
*
|
| 252 |
+
* @param string $errorType
|
| 253 |
+
* @param string $errorCode
|
| 254 |
+
* @return string
|
| 255 |
+
*/
|
| 256 |
+
public function getErrorDescription($errorType, $errorCode = '') {
|
| 257 |
+
$description = '';
|
| 258 |
+
|
| 259 |
+
switch ($errorType) {
|
| 260 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_FIELD_IS_INVALID :
|
| 261 |
+
$description = $this->__ ( 'Invalid value for field' ) . ' "<i><b>' . $this->__ ( $this->getLabelForFieldName ( $errorCode ) ) . '</b></i>".';
|
| 262 |
+
break;
|
| 263 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_REQUIRED_FIELD_IS_EMPTY :
|
| 264 |
+
$description = $this->__ ( 'Missing value for field' ) . ' "<i><b>' . $this->__ ( $this->getLabelForFieldName ( $errorCode ) ) . '</b></i>".';
|
| 265 |
+
break;
|
| 266 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_PRODUCT_NOT_EXISTS_IN_MEINPAKET :
|
| 267 |
+
$description = $this->__ ( 'Product is unknown in MeinPaket marketplace' ) . '.';
|
| 268 |
+
break;
|
| 269 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_PRODUCT_NEGATIVE_STOCK :
|
| 270 |
+
$description = $this->__ ( 'Product stock is lower than zero.' );
|
| 271 |
+
break;
|
| 272 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_MEINPAKET_SERVER_ERROR :
|
| 273 |
+
$description = $this->__ ( 'Internal error on MeinPaket server' ) . '.';
|
| 274 |
+
break;
|
| 275 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_NOT_AUTHORIZED :
|
| 276 |
+
$description = $this->__ ( 'You are not authorized to execute the requested functionality on MeinPaket' );
|
| 277 |
+
break;
|
| 278 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_INVALID_DATA :
|
| 279 |
+
$description = $this->__ ( 'The provided data was incorrect' );
|
| 280 |
+
break;
|
| 281 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_INVALID_MODIFICATION :
|
| 282 |
+
$description = $this->__ ( 'Ivalid modification of element' );
|
| 283 |
+
break;
|
| 284 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_NO_CATEGORIZATION :
|
| 285 |
+
$description = $this->__ ( 'The product is not mapped to neither a marketplace nor a shop category' );
|
| 286 |
+
break;
|
| 287 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_PRODUCT_NOT_SELLABLE :
|
| 288 |
+
$description = $this->__ ( 'The referenced product cannot be sold' );
|
| 289 |
+
break;
|
| 290 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_MARKETPLACE_CATEGORY_NOT_FOUND :
|
| 291 |
+
$description = $this->__ ( 'The referenced marketplace category could not be found at MeinPaket' );
|
| 292 |
+
break;
|
| 293 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_SHOP_CATEGORY_NOT_FOUND :
|
| 294 |
+
$description = $this->__ ( 'The referenced shop category could not be found at MeinPaket' );
|
| 295 |
+
break;
|
| 296 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_MISSING_VALUE_FOR_ATTRIBUTE :
|
| 297 |
+
$description = $this->__ ( 'Missing value mapping for attribute' ) . ' "' . $errorCode . '".';
|
| 298 |
+
break;
|
| 299 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_VARIANT_GROUP_NOT_EXISTS :
|
| 300 |
+
$description = $this->__ ( 'Variant group does not exist on MeinPaket' ) . ' "' . $errorCode . '".';
|
| 301 |
+
break;
|
| 302 |
+
case Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_UNDEFINED :
|
| 303 |
+
default :
|
| 304 |
+
$description = $this->__ ( 'Undefined Error' );
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
return $description;
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
/**
|
| 311 |
+
* Returns the frontend label for a given attribute.
|
| 312 |
+
*
|
| 313 |
+
* @param string $fieldName
|
| 314 |
+
* @return string
|
| 315 |
+
*/
|
| 316 |
+
public function getLabelForFieldName($fieldName) {
|
| 317 |
+
$productAttributeModel = Mage::getModel ( 'eav/config' )->getAttribute ( 'catalog_product', $fieldName );
|
| 318 |
+
$categoryAttributeModel = Mage::getModel ( 'eav/config' )->getAttribute ( 'catalog_category', $fieldName );
|
| 319 |
+
|
| 320 |
+
$label = $productAttributeModel->getFrontendLabel ();
|
| 321 |
+
|
| 322 |
+
if (! ( bool ) $label)
|
| 323 |
+
$label = $categoryAttributeModel->getFrontendLabel ();
|
| 324 |
+
|
| 325 |
+
if (! ( bool ) $label)
|
| 326 |
+
$label = $fieldName;
|
| 327 |
+
|
| 328 |
+
return $label;
|
| 329 |
+
}
|
| 330 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Helper/Shipment.php
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Shipment model related helper methods.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Util
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Helper_Shipment extends Mage_Core_Helper_Abstract {
|
| 12 |
+
/**
|
| 13 |
+
* Tells if the given order is an order that was imported from MeinPaket.de.
|
| 14 |
+
*
|
| 15 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 16 |
+
* to check
|
| 17 |
+
* @return boolean
|
| 18 |
+
*/
|
| 19 |
+
public function isMeinPaketShipment(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 20 |
+
$paymentMethodCode = $shipment->getOrder ()->getPayment ()->getMethodInstance ()->getCode ();
|
| 21 |
+
|
| 22 |
+
if ($paymentMethodCode == 'postpay') {
|
| 23 |
+
return false;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
return Mage::helper ( 'meinpaket/order' )->isMeinPaketOrder ( $shipment->getOrder () );
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Tells if the given $shipment is exported to MeinPaket
|
| 31 |
+
*
|
| 32 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 33 |
+
* to be shipped
|
| 34 |
+
* @return boolean
|
| 35 |
+
*/
|
| 36 |
+
public function isExportedToDhlMeinPaket(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 37 |
+
return $shipment->hasData ( 'shipment_was_exported_for_dhl_mein_paket' ) && $shipment->getData ( 'shipment_was_exported_for_dhl_mein_paket' );
|
| 38 |
+
}
|
| 39 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Async.php
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Async extends Mage_Core_Model_Abstract {
|
| 3 |
+
public function _construct() {
|
| 4 |
+
parent::_construct ();
|
| 5 |
+
$this->_init ( 'meinpaketcommon/async' );
|
| 6 |
+
}
|
| 7 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Carrier/Meinpaket.php
RENAMED
|
@@ -6,9 +6,8 @@
|
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model
|
| 9 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var string
|
|
@@ -54,7 +53,8 @@ class Dhl_MeinPaket_Model_Carrier_Meinpaket extends Mage_Shipping_Model_Carrier_
|
|
| 54 |
*/
|
| 55 |
public function getAllowedMethods() {
|
| 56 |
return array (
|
| 57 |
-
'
|
|
|
|
| 58 |
);
|
| 59 |
}
|
| 60 |
|
|
@@ -89,8 +89,8 @@ class Dhl_MeinPaket_Model_Carrier_Meinpaket extends Mage_Shipping_Model_Carrier_
|
|
| 89 |
|
| 90 |
$method->setCarrier ( $this->_code );
|
| 91 |
$method->setCarrierTitle ( $this->getConfigData ( 'title' ) );
|
| 92 |
-
$method->setMethod ( '
|
| 93 |
-
$method->setMethodTitle (
|
| 94 |
|
| 95 |
$method->setPrice ( self::$_deliveryCosts );
|
| 96 |
|
|
@@ -101,7 +101,7 @@ class Dhl_MeinPaket_Model_Carrier_Meinpaket extends Mage_Shipping_Model_Carrier_
|
|
| 101 |
|
| 102 |
/**
|
| 103 |
* Sets the total delivery costs
|
| 104 |
-
*
|
| 105 |
* @param float $deliveryCosts
|
| 106 |
* @return void
|
| 107 |
*/
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model
|
|
|
|
| 9 |
*/
|
| 10 |
+
class Dhl_MeinPaketCommon_Model_Carrier_Meinpaket extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface {
|
| 11 |
/**
|
| 12 |
*
|
| 13 |
* @var string
|
| 53 |
*/
|
| 54 |
public function getAllowedMethods() {
|
| 55 |
return array (
|
| 56 |
+
'standard' => 'MeinPaket',
|
| 57 |
+
'method1' => 'MeinPaket'
|
| 58 |
);
|
| 59 |
}
|
| 60 |
|
| 89 |
|
| 90 |
$method->setCarrier ( $this->_code );
|
| 91 |
$method->setCarrierTitle ( $this->getConfigData ( 'title' ) );
|
| 92 |
+
$method->setMethod ( 'method' );
|
| 93 |
+
$method->setMethodTitle ( 'MeinPaket' );
|
| 94 |
|
| 95 |
$method->setPrice ( self::$_deliveryCosts );
|
| 96 |
|
| 101 |
|
| 102 |
/**
|
| 103 |
* Sets the total delivery costs
|
| 104 |
+
*
|
| 105 |
* @param float $deliveryCosts
|
| 106 |
* @return void
|
| 107 |
*/
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/BadHttpReturnCodeException.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var integer
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException extends Dhl_MeinPaketCommon_Model_Client_HttpException {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var integer
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/HttpException.php
RENAMED
|
@@ -7,8 +7,7 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
}
|
| 14 |
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Client_HttpException extends Varien_Exception {
|
| 12 |
}
|
| 13 |
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/HttpTimeoutException.php
RENAMED
|
@@ -7,8 +7,7 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
}
|
| 14 |
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException extends Dhl_MeinPaketCommon_Model_Client_HttpException {
|
| 12 |
}
|
| 13 |
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Client/XmlOverHttp.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Endpoint for production
|
| 15 |
*
|
|
@@ -49,16 +48,17 @@ class Dhl_MeinPaket_Model_Client_XmlOverHttp extends Varien_Object {
|
|
| 49 |
* @return void
|
| 50 |
*/
|
| 51 |
public function __construct() {
|
| 52 |
-
$this->config = array (
|
|
|
|
|
|
|
| 53 |
$scheme = Mage::getStoreConfigFlag ( 'meinpaket/endpoint/https' ) ? 'https://' : 'http://';
|
| 54 |
$path = Mage::getStoreConfigFlag ( 'meinpaket/endpoint/sandbox' ) ? self::SANDBOX_ENDPOINT : self::PRODUCTIVE_ENDPOINT;
|
| 55 |
$this->endpoint = $scheme . $path;
|
| 56 |
|
| 57 |
-
$host = Mage::getStoreConfig ( 'meinpaket/endpoint/proxy_host' );
|
| 58 |
-
$port = Mage::getStoreConfig ( 'meinpaket/endpoint/proxy_port' );
|
| 59 |
-
|
| 60 |
if (Mage::getStoreConfigFlag ( 'meinpaket/endpoint/proxy' )) {
|
| 61 |
$this->config ['adapter'] = 'Zend_Http_Client_Adapter_Proxy';
|
|
|
|
|
|
|
| 62 |
|
| 63 |
if (strlen ( $host ) > 0) {
|
| 64 |
$this->config ['proxy_host'] = $host;
|
|
@@ -77,36 +77,41 @@ class Dhl_MeinPaket_Model_Client_XmlOverHttp extends Varien_Object {
|
|
| 77 |
/**
|
| 78 |
* Sends raw XML and returns the response body.
|
| 79 |
*
|
| 80 |
-
* @param
|
| 81 |
-
* @throws
|
| 82 |
-
* @throws
|
| 83 |
-
* @return
|
| 84 |
*/
|
| 85 |
public function send($xml, $async = false) {
|
| 86 |
-
$xmlData = $xml instanceof
|
| 87 |
|
| 88 |
$url = $this->endpoint . ($async ? self::ASYNC_SUFFIX : '');
|
| 89 |
$httpClient = new Zend_Http_Client ( $url, $this->config );
|
| 90 |
-
//Zend_Debug::dump($
|
|
|
|
| 91 |
$httpClient->setMethod ( Zend_Http_Client::POST );
|
| 92 |
$httpClient->setRawData ( $xmlData );
|
| 93 |
|
| 94 |
-
/* @var $log
|
| 95 |
-
$log = Mage::getModel ( '
|
| 96 |
$log->setSend ( $xmlData );
|
| 97 |
$log->setCreatedAt ( Varien_Date::now () );
|
| 98 |
-
if ($xml instanceof
|
| 99 |
$log->setRequestId ( $xml->getRequestId () );
|
| 100 |
}
|
| 101 |
$log->save ();
|
| 102 |
|
|
|
|
|
|
|
| 103 |
try {
|
|
|
|
| 104 |
$serverResponse = $httpClient->request ();
|
|
|
|
| 105 |
} catch ( Zend_Http_Client_Adapter_Exception $e ) {
|
| 106 |
Mage::logException ( $e );
|
| 107 |
$log->setError ( $e->getMessage () );
|
| 108 |
$log->save ();
|
| 109 |
-
throw new
|
| 110 |
}
|
| 111 |
|
| 112 |
$body = $serverResponse->getBody ();
|
|
@@ -115,10 +120,12 @@ class Dhl_MeinPaket_Model_Client_XmlOverHttp extends Varien_Object {
|
|
| 115 |
$log->setReceived ( $body4Mysql );
|
| 116 |
$status = $serverResponse->getStatus ();
|
| 117 |
|
|
|
|
|
|
|
| 118 |
if ($status !== 200) {
|
| 119 |
$log->setError ( 'FAILURE: Client returned HTTP return code "' . $status . '".' );
|
| 120 |
$log->save ();
|
| 121 |
-
throw new
|
| 122 |
}
|
| 123 |
$log->save ();
|
| 124 |
|
|
@@ -128,14 +135,14 @@ class Dhl_MeinPaket_Model_Client_XmlOverHttp extends Varien_Object {
|
|
| 128 |
try {
|
| 129 |
$valid = $dom->loadXML ( $body );
|
| 130 |
if (! $valid) {
|
| 131 |
-
throw new
|
| 132 |
}
|
| 133 |
|
| 134 |
-
/* @var $parser
|
| 135 |
-
$parser = Mage::getModel ( '
|
| 136 |
$response = $parser->parseResponse ( $dom );
|
| 137 |
|
| 138 |
-
if ($response instanceof
|
| 139 |
$log->setRequestId ( $response->getRequestId () );
|
| 140 |
}
|
| 141 |
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Client
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Client_XmlOverHttp extends Varien_Object {
|
| 12 |
/**
|
| 13 |
* Endpoint for production
|
| 14 |
*
|
| 48 |
* @return void
|
| 49 |
*/
|
| 50 |
public function __construct() {
|
| 51 |
+
$this->config = array (
|
| 52 |
+
'useragent' => 'Magento ' . Mage::getVersion () . ' Extension ' . Mage::helper ( 'meinpaket/data' )->getExtensionVersion ()
|
| 53 |
+
);
|
| 54 |
$scheme = Mage::getStoreConfigFlag ( 'meinpaket/endpoint/https' ) ? 'https://' : 'http://';
|
| 55 |
$path = Mage::getStoreConfigFlag ( 'meinpaket/endpoint/sandbox' ) ? self::SANDBOX_ENDPOINT : self::PRODUCTIVE_ENDPOINT;
|
| 56 |
$this->endpoint = $scheme . $path;
|
| 57 |
|
|
|
|
|
|
|
|
|
|
| 58 |
if (Mage::getStoreConfigFlag ( 'meinpaket/endpoint/proxy' )) {
|
| 59 |
$this->config ['adapter'] = 'Zend_Http_Client_Adapter_Proxy';
|
| 60 |
+
$host = Mage::getStoreConfig ( 'meinpaket/endpoint/proxy_host' );
|
| 61 |
+
$port = Mage::getStoreConfig ( 'meinpaket/endpoint/proxy_port' );
|
| 62 |
|
| 63 |
if (strlen ( $host ) > 0) {
|
| 64 |
$this->config ['proxy_host'] = $host;
|
| 77 |
/**
|
| 78 |
* Sends raw XML and returns the response body.
|
| 79 |
*
|
| 80 |
+
* @param Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest $xml
|
| 81 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException
|
| 82 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException
|
| 83 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_Response_Abstract
|
| 84 |
*/
|
| 85 |
public function send($xml, $async = false) {
|
| 86 |
+
$xmlData = $xml instanceof Dhl_MeinPaketCommon_Model_Xml_AbstractXmlPartial ? $xml->__toString () : $xml;
|
| 87 |
|
| 88 |
$url = $this->endpoint . ($async ? self::ASYNC_SUFFIX : '');
|
| 89 |
$httpClient = new Zend_Http_Client ( $url, $this->config );
|
| 90 |
+
// Zend_Debug::dump($this->config);
|
| 91 |
+
// Zend_Debug::dump($httpClient);die;
|
| 92 |
$httpClient->setMethod ( Zend_Http_Client::POST );
|
| 93 |
$httpClient->setRawData ( $xmlData );
|
| 94 |
|
| 95 |
+
/* @var $log Dhl_MeinPaketCommon_Model_Log */
|
| 96 |
+
$log = Mage::getModel ( 'meinpaketcommon/log' );
|
| 97 |
$log->setSend ( $xmlData );
|
| 98 |
$log->setCreatedAt ( Varien_Date::now () );
|
| 99 |
+
if ($xml instanceof Dhl_MeinPaketCommon_Model_Xml_Request_AsynchronousStatusRequest) {
|
| 100 |
$log->setRequestId ( $xml->getRequestId () );
|
| 101 |
}
|
| 102 |
$log->save ();
|
| 103 |
|
| 104 |
+
Mage::log ( $xmlData, 'meinpaket.log' );
|
| 105 |
+
|
| 106 |
try {
|
| 107 |
+
// echo $xmlData . "\n";
|
| 108 |
$serverResponse = $httpClient->request ();
|
| 109 |
+
// echo $serverResponse . "\n";
|
| 110 |
} catch ( Zend_Http_Client_Adapter_Exception $e ) {
|
| 111 |
Mage::logException ( $e );
|
| 112 |
$log->setError ( $e->getMessage () );
|
| 113 |
$log->save ();
|
| 114 |
+
throw new Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException ( $e->getMessage () );
|
| 115 |
}
|
| 116 |
|
| 117 |
$body = $serverResponse->getBody ();
|
| 120 |
$log->setReceived ( $body4Mysql );
|
| 121 |
$status = $serverResponse->getStatus ();
|
| 122 |
|
| 123 |
+
Mage::log ( $status + "\n" + $body, 'meinpaket.log' );
|
| 124 |
+
|
| 125 |
if ($status !== 200) {
|
| 126 |
$log->setError ( 'FAILURE: Client returned HTTP return code "' . $status . '".' );
|
| 127 |
$log->save ();
|
| 128 |
+
throw new Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException ( $status, 'FAILURE: Client returned HTTP return code "' . $status . '".' );
|
| 129 |
}
|
| 130 |
$log->save ();
|
| 131 |
|
| 135 |
try {
|
| 136 |
$valid = $dom->loadXML ( $body );
|
| 137 |
if (! $valid) {
|
| 138 |
+
throw new Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException ( "Invalid XML" );
|
| 139 |
}
|
| 140 |
|
| 141 |
+
/* @var $parser Dhl_MeinPaketCommon_Model_Xml_XmlResponseParser */
|
| 142 |
+
$parser = Mage::getModel ( 'meinpaketcommon/xml_xmlResponseParser' );
|
| 143 |
$response = $parser->parseResponse ( $dom );
|
| 144 |
|
| 145 |
+
if ($response instanceof Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse) {
|
| 146 |
$log->setRequestId ( $response->getRequestId () );
|
| 147 |
}
|
| 148 |
|
app/code/community/Dhl/MeinPaketCommon/Model/Cron.php
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Cron handler for Dhl MeinPaket.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_MeinPaketCommon_Model_Cron {
|
| 11 |
+
const SYNC_CATALOG = 'meinpaket_sync_catalog';
|
| 12 |
+
const SYNC_ORDERS = 'meinpaket_sync_orders';
|
| 13 |
+
const SYNC_ASYNC = 'meinpaket_sync_async';
|
| 14 |
+
public static $CRONJOBS = array (
|
| 15 |
+
self::SYNC_CATALOG,
|
| 16 |
+
self::SYNC_ORDERS,
|
| 17 |
+
self::SYNC_ASYNC
|
| 18 |
+
);
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Called to download orders.
|
| 22 |
+
*
|
| 23 |
+
* @return NULL
|
| 24 |
+
*/
|
| 25 |
+
public function importOrders() {
|
| 26 |
+
try {
|
| 27 |
+
return Mage::getSingleton ( 'meinpaket/service_order_importService' )->importOrders ();
|
| 28 |
+
} catch ( Exception $e ) {
|
| 29 |
+
Mage::logException ( $e );
|
| 30 |
+
}
|
| 31 |
+
return null;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Called to download responses for async requests.
|
| 36 |
+
*
|
| 37 |
+
* @return NULL
|
| 38 |
+
*/
|
| 39 |
+
public function processAsyncTasks() {
|
| 40 |
+
try {
|
| 41 |
+
return Mage::getSingleton ( 'meinpaket/service_async' )->process ();
|
| 42 |
+
} catch ( Exception $e ) {
|
| 43 |
+
Mage::logException ( $e );
|
| 44 |
+
}
|
| 45 |
+
return null;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* Called to request best prices.
|
| 50 |
+
*
|
| 51 |
+
* @return NULL
|
| 52 |
+
*/
|
| 53 |
+
public function cleanup() {
|
| 54 |
+
try {
|
| 55 |
+
// Delete all log entries older than 40 days
|
| 56 |
+
$date = Zend_Date::now ();
|
| 57 |
+
$date->subDay ( 40 );
|
| 58 |
+
|
| 59 |
+
$logCollection = Mage::getModel ( 'meinpaketcommon/log' )->getCollection ();
|
| 60 |
+
$logCollection->addFieldToFilter ( 'createdAt', array (
|
| 61 |
+
'to' => $date->toString ( 'YYYY-MM-dd' )
|
| 62 |
+
) );
|
| 63 |
+
foreach ( $logCollection as $log ) {
|
| 64 |
+
$log->delete ();
|
| 65 |
+
}
|
| 66 |
+
} catch ( Exception $e ) {
|
| 67 |
+
Mage::logException ( $e );
|
| 68 |
+
}
|
| 69 |
+
return null;
|
| 70 |
+
}
|
| 71 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Entity/Attribute/Source/Carrier.php
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Attribute source model for shipment methods based on the available carriers.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Entity_Attribute_Source
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Entity_Attribute_Source_Carrier extends Mage_Eav_Model_Entity_Attribute_Abstract {
|
| 12 |
+
/**
|
| 13 |
+
* Returns the available shipment methods.
|
| 14 |
+
*
|
| 15 |
+
* @return array
|
| 16 |
+
*/
|
| 17 |
+
protected function getActiveShipmentCarriers() {
|
| 18 |
+
$carriersArray = array ();
|
| 19 |
+
|
| 20 |
+
/* @var $shippingConfig Mage_Shipping_Model_Config */
|
| 21 |
+
$shippingConfig = Mage::getModel ( 'shipping/config' );
|
| 22 |
+
|
| 23 |
+
$activeCarriers = $shippingConfig->getActiveCarriers ();
|
| 24 |
+
|
| 25 |
+
if (sizeof ( $activeCarriers ) > 0) {
|
| 26 |
+
|
| 27 |
+
foreach ( $activeCarriers as $carrier ) {
|
| 28 |
+
|
| 29 |
+
$code = $carrier->getCarrierCode ();
|
| 30 |
+
$carrierMethods = $carrier->getAllowedMethods ();
|
| 31 |
+
$carrierTitle = Mage::getStoreConfig ( 'carriers/' . $code . '/title' );
|
| 32 |
+
|
| 33 |
+
foreach ( $carrierMethods as $methodCode => $methodTitle ) {
|
| 34 |
+
$carriersArray [$code . '_' . $methodCode] = $carrierTitle . ' - ' . $methodTitle;
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
return $carriersArray;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Returns the available shipment methods.
|
| 44 |
+
*
|
| 45 |
+
* @return array
|
| 46 |
+
*/
|
| 47 |
+
public function toOptionArray() {
|
| 48 |
+
return $this->getActiveShipmentCarriers ();
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
app/code/community/Dhl/MeinPaketCommon/Model/Exception/InvalidDataException.php
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Basic exception class for invalid data.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Exception
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Exception_InvalidDataException extends Varien_Exception {
|
| 12 |
+
/**
|
| 13 |
+
*
|
| 14 |
+
* @var string
|
| 15 |
+
*/
|
| 16 |
+
protected $errorType;
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
*
|
| 20 |
+
* @var string
|
| 21 |
+
*/
|
| 22 |
+
protected $fieldName;
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
*
|
| 26 |
+
* @var integer
|
| 27 |
+
*/
|
| 28 |
+
protected $entityId;
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* Constructor.
|
| 32 |
+
*
|
| 33 |
+
* @param integer $entityId
|
| 34 |
+
* of the model entity on which the error occured.
|
| 35 |
+
* @param string $fieldName
|
| 36 |
+
* of the attribute which is invalid.
|
| 37 |
+
* @param string $errorType
|
| 38 |
+
* type defined in Dhl_MeinPaketCommon_Model_Validation_ValidationInterface.
|
| 39 |
+
* @return void
|
| 40 |
+
*/
|
| 41 |
+
public function __construct($entityId, $fieldName, $errorType = Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_FIELD_IS_INVALID) {
|
| 42 |
+
parent::__construct ( 'Invalid data field "' . $fieldName . '" for entity (id=' . $entityId . '). Error type is "' . $errorType . '".' );
|
| 43 |
+
|
| 44 |
+
$this->entityId = $entityId;
|
| 45 |
+
$this->fieldName = $fieldName;
|
| 46 |
+
$this->errorType = $errorType;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
*
|
| 51 |
+
* @return string
|
| 52 |
+
*/
|
| 53 |
+
public function getFieldName() {
|
| 54 |
+
return $this->fieldName;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
*
|
| 59 |
+
* @return integer
|
| 60 |
+
*/
|
| 61 |
+
public function getEntityId() {
|
| 62 |
+
return $this->entityId;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
*
|
| 67 |
+
* @return string
|
| 68 |
+
*/
|
| 69 |
+
public function getErrorType() {
|
| 70 |
+
return $this->errorType;
|
| 71 |
+
}
|
| 72 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Exception/MissingDataException.php
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Basic exception class for invalid data.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Exception
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Exception_MissingDataException extends Dhl_MeinPaketCommon_Model_Exception_InvalidDataException {
|
| 12 |
+
/**
|
| 13 |
+
* Constructor.
|
| 14 |
+
*
|
| 15 |
+
* @param integer $entityId
|
| 16 |
+
* of the model entity on which the error occured.
|
| 17 |
+
* @param string $fieldName
|
| 18 |
+
* of the attribute that is missing.
|
| 19 |
+
* @return void
|
| 20 |
+
*/
|
| 21 |
+
public function __construct($entityId, $fieldName) {
|
| 22 |
+
parent::__construct ( $entityId, $fieldName, Dhl_MeinPaketCommon_Model_Validation_ValidationInterface::ERROR_REQUIRED_FIELD_IS_EMPTY );
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Log.php
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
public function _construct() {
|
| 4 |
parent::_construct ();
|
| 5 |
-
$this->_init ( '
|
| 6 |
}
|
| 7 |
|
| 8 |
/**
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Log extends Mage_Core_Model_Abstract {
|
| 3 |
public function _construct() {
|
| 4 |
parent::_construct ();
|
| 5 |
+
$this->_init ( 'meinpaketcommon/log' );
|
| 6 |
}
|
| 7 |
|
| 8 |
/**
|
app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Async.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Mysql4_Async extends Mage_Core_Model_Mysql4_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model and set primary key
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'meinpaketcommon/async', 'async_id' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Async/Collection.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Mysql4_Async_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'meinpaketcommon/async' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Log.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model and set primary key
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'meinpaketcommon/log', 'log_id' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Mysql4/Log/Collection.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'meinpaketcommon/log' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Observer.php
ADDED
|
@@ -0,0 +1,536 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Observer for all events the DHL MeinPaket extension has to catch.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Observer {
|
| 12 |
+
/**
|
| 13 |
+
* Holds the id of the order whose save_after event is actually triggered.
|
| 14 |
+
*
|
| 15 |
+
* @var integer
|
| 16 |
+
*/
|
| 17 |
+
protected static $currentlySavedOrderId = - 1;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Tells if the save_after has been triggered twice or more on
|
| 21 |
+
* the same order during script lifetime.
|
| 22 |
+
*
|
| 23 |
+
* @var boolean
|
| 24 |
+
*/
|
| 25 |
+
protected static $isSameSavedOrder = false;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Sets the id of the order whose save_after event has been triggered.
|
| 29 |
+
*
|
| 30 |
+
* @param integer $orderId
|
| 31 |
+
* @return void
|
| 32 |
+
*/
|
| 33 |
+
protected static function setCurrentOrderId($orderId) {
|
| 34 |
+
if (self::$currentlySavedOrderId === $orderId) {
|
| 35 |
+
self::$isSameSavedOrder = true;
|
| 36 |
+
} else {
|
| 37 |
+
self::$isSameSavedOrder = false;
|
| 38 |
+
}
|
| 39 |
+
self::$currentlySavedOrderId = $orderId;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
*
|
| 44 |
+
* @param unknown $observer
|
| 45 |
+
*/
|
| 46 |
+
public function gridAddAttributes(Varien_Event_Observer $observer) {
|
| 47 |
+
$block = $observer->getBlock ();
|
| 48 |
+
if (! isset ( $block )) {
|
| 49 |
+
return $this;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
if ($block->getType () == 'adminhtml/sales_order_grid') {
|
| 53 |
+
/* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
|
| 54 |
+
|
| 55 |
+
$block->addColumnAfter ( 'dhl_mein_paket_order_id', array (
|
| 56 |
+
'header' => __ ( 'MeinPaket.de Order No.' ),
|
| 57 |
+
'index' => 'dhl_mein_paket_order_id'
|
| 58 |
+
), 'real_order_id' );
|
| 59 |
+
}
|
| 60 |
+
return $this;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* Tells if the save_after event of the current order has been triggered
|
| 65 |
+
* at least once during the lifecycle of the current script.
|
| 66 |
+
*
|
| 67 |
+
* @return boolean
|
| 68 |
+
*/
|
| 69 |
+
protected static function saveEventHasBeenTriggeredOnSameOrderBefore() {
|
| 70 |
+
return self::$isSameSavedOrder;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/**
|
| 74 |
+
* Is triggered when an order is saved.
|
| 75 |
+
*
|
| 76 |
+
* @param Varien_Event_Observer $observer
|
| 77 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 78 |
+
*/
|
| 79 |
+
public function salesOrderSaveAfter(Varien_Event_Observer $observer) {
|
| 80 |
+
$order = $observer->getData ( 'order' );
|
| 81 |
+
|
| 82 |
+
self::setCurrentOrderId ( $order->getId () );
|
| 83 |
+
|
| 84 |
+
$this->_updateMeinPaketOrderId ( $order );
|
| 85 |
+
$this->_handleOrderItemsChange ( $order );
|
| 86 |
+
$this->_cancelMeinPaketOrder ( $order );
|
| 87 |
+
|
| 88 |
+
return $this;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/**
|
| 92 |
+
* Sets the dhl_mein_paket_order_id for the given order.
|
| 93 |
+
* This is necessary if an order is edit and so created a new one.
|
| 94 |
+
* The new one will not have it's dhl_mein_paket_order_id attribute
|
| 95 |
+
* automatically.
|
| 96 |
+
*
|
| 97 |
+
* @param Varien_Object $order
|
| 98 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 99 |
+
*/
|
| 100 |
+
protected function _updateMeinPaketOrderId($order) {
|
| 101 |
+
// return if the order doesn't have a parent order
|
| 102 |
+
// or if it already has a MeinPaket.de order id...
|
| 103 |
+
if (! $order->hasData ( 'relation_parent_id' ) || $order->hasData ( 'dhl_mein_paket_order_id' )) {
|
| 104 |
+
return;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/* @var $parentOrder Mage_Sales_Model_Order */
|
| 108 |
+
$parentOrder = Mage::getModel ( 'sales/order' )->load ( $order->getData ( 'relation_parent_id' ) );
|
| 109 |
+
|
| 110 |
+
if (! $parentOrder->hasData ( 'relation_parent_id' ) || $parentOrder->hasData ( 'dhl_mein_paket_order_id' )) {
|
| 111 |
+
$order->setData ( 'dhl_mein_paket_order_id', $parentOrder->getDhlMeinPaketOrderId () );
|
| 112 |
+
$parentOrder->setData ( 'dhl_mein_paket_order_id', '' )->getResource ()->saveAttribute ( $parentOrder, 'dhl_mein_paket_order_id' );
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
return $this;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* Cancels single order items.
|
| 120 |
+
*
|
| 121 |
+
* @param Mage_Sales_Model_Order $order
|
| 122 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 123 |
+
*/
|
| 124 |
+
protected function _handleOrderItemsChange(Mage_Sales_Model_Order $order) {
|
| 125 |
+
if (self::saveEventHasBeenTriggeredOnSameOrderBefore ()) {
|
| 126 |
+
return;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
if ($order->getData ( 'state' ) === Mage_Sales_Model_Order::STATE_CANCELED) {
|
| 130 |
+
return $this;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
if (! $order->hasData ( 'relation_parent_id' )) {
|
| 134 |
+
return $this;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
/* @var $orderHelper Dhl_MeinPaketCommon_Helper_Order */
|
| 138 |
+
$orderHelper = Mage::helper ( 'meinpaketcommon/order' );
|
| 139 |
+
|
| 140 |
+
/* @var $parentOrder Mage_Sales_Model_Order */
|
| 141 |
+
$parentOrder = Mage::getModel ( 'sales/order' )->load ( $order->getData ( 'relation_parent_id' ) );
|
| 142 |
+
|
| 143 |
+
if ($orderHelper->isMeinPaketOrder ( $order )) {
|
| 144 |
+
|
| 145 |
+
$orderItemCollection = $order->getItemsCollection ();
|
| 146 |
+
$parentItemCollection = $parentOrder->getItemsCollection ();
|
| 147 |
+
$items = array ();
|
| 148 |
+
$parentItems = array ();
|
| 149 |
+
$reduceList = array ();
|
| 150 |
+
$submitChanges = false;
|
| 151 |
+
|
| 152 |
+
foreach ( $orderItemCollection as $item ) {
|
| 153 |
+
$options = $item->getProductOptions ();
|
| 154 |
+
if (isset ( $options ['info_buyRequest'] ) && isset ( $options ['info_buyRequest'] ['dhl_mein_paket_item_id'] )) {
|
| 155 |
+
$items [$options ['info_buyRequest'] ['dhl_mein_paket_item_id']] = array (
|
| 156 |
+
'qty' => ( integer ) $item->getQtyOrdered (),
|
| 157 |
+
'productId' => $item->getProductId ()
|
| 158 |
+
);
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
foreach ( $parentItemCollection as $item ) {
|
| 162 |
+
$options = $item->getProductOptions ();
|
| 163 |
+
if ($item->getQtyCanceled () != $item->getQtyOrdered ()) {
|
| 164 |
+
$submitChanges = true;
|
| 165 |
+
}
|
| 166 |
+
if (isset ( $options ['info_buyRequest'] ) && isset ( $options ['info_buyRequest'] ['dhl_mein_paket_item_id'] )) {
|
| 167 |
+
$parentItems [$options ['info_buyRequest'] ['dhl_mein_paket_item_id']] = array (
|
| 168 |
+
'qty' => ( integer ) $item->getQtyOrdered (),
|
| 169 |
+
'productId' => $item->getProductId ()
|
| 170 |
+
);
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
if ($submitChanges === false) {
|
| 175 |
+
return $this;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
// find items with lowered quantity
|
| 179 |
+
if (sizeof ( $items ) < sizeof ( $parentItems )) {
|
| 180 |
+
foreach ( $parentItems as $dhlItemId => $item ) {
|
| 181 |
+
if (! array_key_exists ( $dhlItemId, $items )) {
|
| 182 |
+
$reduceList [$dhlItemId] = array (
|
| 183 |
+
'qty' => $item ['qty'],
|
| 184 |
+
'productId' => $item ['productId']
|
| 185 |
+
);
|
| 186 |
+
} elseif ($items [$dhlItemId] ['qty'] < $item ['qty']) {
|
| 187 |
+
$reduceList [$dhlItemId] = array (
|
| 188 |
+
'qty' => $item ['qty'] - $items [$dhlItemId] ['qty'],
|
| 189 |
+
'productId' => $item ['productId']
|
| 190 |
+
);
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
} else {
|
| 194 |
+
foreach ( $items as $dhlItemId => $item ) {
|
| 195 |
+
if (array_key_exists ( $dhlItemId, $parentItems ) && $item ['qty'] < $parentItems [$dhlItemId] ['qty']) {
|
| 196 |
+
$reduceList [$dhlItemId] = array (
|
| 197 |
+
'qty' => $parentItems [$dhlItemId] ['qty'] - $item ['qty'],
|
| 198 |
+
'productId' => $item ['productId']
|
| 199 |
+
);
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
if (sizeof ( $reduceList ) > 0) {
|
| 205 |
+
// make request
|
| 206 |
+
$cancellationService = new Dhl_MeinPaketCommon_Model_Service_Order_CancellationService ();
|
| 207 |
+
$result = null;
|
| 208 |
+
$helper = Mage::helper ( 'meinpaketcommon/data' );
|
| 209 |
+
$errMsg = '';
|
| 210 |
+
|
| 211 |
+
try {
|
| 212 |
+
$result = $cancellationService->cancelOrderItems ( $order, $reduceList );
|
| 213 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_XmlBuildException $e ) {
|
| 214 |
+
Mage::logException ( $e );
|
| 215 |
+
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 216 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException $e ) {
|
| 217 |
+
Mage::logException ( $e );
|
| 218 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 219 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException $e ) {
|
| 220 |
+
Mage::logException ( $e );
|
| 221 |
+
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 222 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException $e ) {
|
| 223 |
+
Mage::logException ( $e );
|
| 224 |
+
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 225 |
+
} catch ( Exception $e ) {
|
| 226 |
+
Mage::logException ( $e );
|
| 227 |
+
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 228 |
+
}
|
| 229 |
+
if (is_object ( $result ) && $result->hasError ()) {
|
| 230 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned error code %s.' ), $result->getError () );
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
if (strlen ( $errMsg ) > 0) {
|
| 234 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on tranfering cancelled items to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 235 |
+
throw new Exception ( 'Failed transfering cancelled items to MeinPaket.de server.' );
|
| 236 |
+
}
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
return $this;
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
/**
|
| 244 |
+
* Cancels the given order in MeinPaket.de if the given order is a MeinPaket.de order
|
| 245 |
+
* and its state is Mage_Sales_Model_Order::STATE_CANCELED.
|
| 246 |
+
*
|
| 247 |
+
* @param Mage_Sales_Model_Order $order
|
| 248 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 249 |
+
*/
|
| 250 |
+
protected function _cancelMeinPaketOrder(Mage_Sales_Model_Order $order) {
|
| 251 |
+
$meinPaketOrderId = $order->getData ( 'dhl_mein_paket_order_id' );
|
| 252 |
+
|
| 253 |
+
if (strlen ( $meinPaketOrderId ) > 1 && $order->getData ( 'state' ) === Mage_Sales_Model_Order::STATE_CANCELED) {
|
| 254 |
+
|
| 255 |
+
$col = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToFilter ( 'relation_parent_id', $order->getId () )->load ();
|
| 256 |
+
|
| 257 |
+
if ($col->count () > 0) {
|
| 258 |
+
return $this;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
// TODO: Class missing
|
| 262 |
+
|
| 263 |
+
/* @var $orderCancellationService Dhl_MeinPaketCommon_Model_Service_Order_CancellationService */
|
| 264 |
+
$orderCancellationService = new Dhl_MeinPaketCommon_Model_Service_Order_CancellationService ();
|
| 265 |
+
|
| 266 |
+
$result = null;
|
| 267 |
+
$helper = Mage::helper ( 'meinpaketcommon/data' );
|
| 268 |
+
$errMsg = '';
|
| 269 |
+
|
| 270 |
+
try {
|
| 271 |
+
$result = $orderCancellationService->cancelOrder ( $order );
|
| 272 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_XmlBuildException $e ) {
|
| 273 |
+
Mage::logException ( $e );
|
| 274 |
+
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 275 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException $e ) {
|
| 276 |
+
Mage::logException ( $e );
|
| 277 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 278 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException $e ) {
|
| 279 |
+
Mage::logException ( $e );
|
| 280 |
+
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 281 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException $e ) {
|
| 282 |
+
Mage::logException ( $e );
|
| 283 |
+
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 284 |
+
} catch ( Exception $e ) {
|
| 285 |
+
Mage::logException ( $e );
|
| 286 |
+
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 287 |
+
}
|
| 288 |
+
if (is_object ( $result ) && $result->hasError ()) {
|
| 289 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned error code %s.' ), $result->getError () );
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
if (strlen ( $errMsg ) > 0) {
|
| 293 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on tranfering cancelled items to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 294 |
+
throw new Exception ( 'Failed transfering cancelled items to MeinPaket.de server.' );
|
| 295 |
+
}
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
return $this;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
/**
|
| 302 |
+
* Is triggered when a shipment is saved.
|
| 303 |
+
*
|
| 304 |
+
* @param Varien_Event_Observer $observer
|
| 305 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 306 |
+
*/
|
| 307 |
+
public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer) {
|
| 308 |
+
/* @var $order Dhl_MeinPaketCommon_Helper_Shipment */
|
| 309 |
+
$shipmentHelper = Mage::helper ( 'meinpaketcommon/shipment' );
|
| 310 |
+
|
| 311 |
+
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 312 |
+
$shipment = $observer->getData ( 'shipment' );
|
| 313 |
+
|
| 314 |
+
self::setCurrentOrderId ( $shipment->getOrder ()->getId () );
|
| 315 |
+
|
| 316 |
+
if ($shipmentHelper->isExportedToDhlMeinPaket ( $shipment )) {
|
| 317 |
+
return $this;
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
if (! $shipmentHelper->isMeinPaketShipment ( $shipment )) {
|
| 321 |
+
return $this;
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
// send shipment request to MeinPaket.
|
| 325 |
+
$this->_exportShipmentToMeinPaket ( $shipment );
|
| 326 |
+
|
| 327 |
+
return $this;
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
/**
|
| 331 |
+
* Is called after a shipment save is committed.
|
| 332 |
+
* Sets the shipment's "shipment_was_exported_for_dhl_mein_paket" attribute
|
| 333 |
+
* value to "1" if it isn't set yet.
|
| 334 |
+
*
|
| 335 |
+
* @param Varien_Event_Observer $observer
|
| 336 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 337 |
+
*/
|
| 338 |
+
public function salesOrderShipmentSaveCommitAfter(Varien_Event_Observer $observer) {
|
| 339 |
+
/* @var $order Dhl_MeinPaketCommon_Helper_Shipment */
|
| 340 |
+
$shipmentHelper = Mage::helper ( 'meinpaketcommon/shipment' );
|
| 341 |
+
|
| 342 |
+
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 343 |
+
$shipment = $observer->getShipment ();
|
| 344 |
+
|
| 345 |
+
self::setCurrentOrderId ( $shipment->getOrder ()->getId () );
|
| 346 |
+
|
| 347 |
+
if ($shipmentHelper->isExportedToDhlMeinPaket ( $shipment )) {
|
| 348 |
+
return $this;
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
if (! $shipmentHelper->isMeinPaketShipment ( $shipment )) {
|
| 352 |
+
return $this;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
if ($shipmentHelper->isMeinPaketShipment ( $shipment ) && ! $shipment->getData ( 'shipment_was_exported_for_dhl_mein_paket' )) {
|
| 356 |
+
$shipment->setData ( 'shipment_was_exported_for_dhl_mein_paket', 1 )->getResource ()->saveAttribute ( $shipment, 'shipment_was_exported_for_dhl_mein_paket' );
|
| 357 |
+
}
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
/**
|
| 361 |
+
* Exports an saved shipment to MeinPaket.de.
|
| 362 |
+
*
|
| 363 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 364 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 365 |
+
*/
|
| 366 |
+
protected function _exportShipmentToMeinPaket(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 367 |
+
$shipmentExportService = new Dhl_MeinPaketCommon_Model_Service_Order_ShipmentExportService ();
|
| 368 |
+
|
| 369 |
+
$result = null;
|
| 370 |
+
$errMsg = '';
|
| 371 |
+
$helper = Mage::helper ( 'meinpaketcommon/data' );
|
| 372 |
+
|
| 373 |
+
try {
|
| 374 |
+
$result = $shipmentExportService->exportShipment ( $shipment );
|
| 375 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_XmlBuildException $e ) {
|
| 376 |
+
Mage::logException ( $e );
|
| 377 |
+
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 378 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException $e ) {
|
| 379 |
+
Mage::logException ( $e );
|
| 380 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 381 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException $e ) {
|
| 382 |
+
Mage::logException ( $e );
|
| 383 |
+
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 384 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException $e ) {
|
| 385 |
+
Mage::logException ( $e );
|
| 386 |
+
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 387 |
+
} catch ( Exception $e ) {
|
| 388 |
+
Mage::logException ( $e );
|
| 389 |
+
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
if ($result == null || $result->hasErrors ()) {
|
| 393 |
+
$errMsg .= $helper->__ ( 'Shipment has not been accepted by MeinPaket.de.' );
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
if (strlen ( $errMsg ) > 0) {
|
| 397 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering shipment to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 398 |
+
throw new Exception ( 'Failed exporting shipment to MeinPaket.de server.' );
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
return $this;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
/**
|
| 405 |
+
* Is called when a creditmemo is saved.
|
| 406 |
+
* If the creditmemo is refunded, a notification will be send to MeinPaket.de.
|
| 407 |
+
*
|
| 408 |
+
* @param Varien_Event_Observer $observer
|
| 409 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 410 |
+
*/
|
| 411 |
+
public function salesOrderCreditmemoSaveAfter(Varien_Event_Observer $observer) {
|
| 412 |
+
/* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
|
| 413 |
+
$creditmemo = $observer->getData ( 'creditmemo' );
|
| 414 |
+
|
| 415 |
+
self::setCurrentOrderId ( $creditmemo->getOrder ()->getId () );
|
| 416 |
+
|
| 417 |
+
// check if creditmemo is refunded
|
| 418 |
+
if ($creditmemo->getState () != Mage_Sales_Model_Order_Creditmemo::STATE_REFUNDED) {
|
| 419 |
+
return $this;
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
// check if the order is a MeinPaket.de order
|
| 423 |
+
if (! Mage::helper ( 'meinpaketcommon/order' )->isMeinPaketOrder ( $creditmemo->getOrder () )) {
|
| 424 |
+
return $this;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
/* @var $result Dhl_MeinPaketCommon_Model_Sevice_RefundExport_Result */
|
| 428 |
+
$result = null;
|
| 429 |
+
|
| 430 |
+
/* @var $exportService Dhl_MeinPaketCommon_Model_Service_Order_RefundExportService */
|
| 431 |
+
$exportService = new Dhl_MeinPaketCommon_Model_Service_Order_RefundExportService ();
|
| 432 |
+
|
| 433 |
+
$helper = Mage::helper ( 'meinpaketcommon/data' );
|
| 434 |
+
$errMsg = '';
|
| 435 |
+
|
| 436 |
+
try {
|
| 437 |
+
$result = $exportService->exportRefund ( $creditmemo );
|
| 438 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_XmlBuildException $e ) {
|
| 439 |
+
Mage::logException ( $e );
|
| 440 |
+
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 441 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException $e ) {
|
| 442 |
+
Mage::logException ( $e );
|
| 443 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 444 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException $e ) {
|
| 445 |
+
Mage::logException ( $e );
|
| 446 |
+
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 447 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException $e ) {
|
| 448 |
+
Mage::logException ( $e );
|
| 449 |
+
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 450 |
+
} catch ( Exception $e ) {
|
| 451 |
+
Mage::logException ( $e );
|
| 452 |
+
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
if ($result == null) {
|
| 456 |
+
$errMsg .= $helper->__ ( 'Refund has not been accepted by MeinPaket.de.' );
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
if (strlen ( $errMsg ) > 0) {
|
| 460 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering refund to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 461 |
+
throw new Exception ( 'Failed exporting refund to MeinPaket.de server.' );
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
return $this;
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
/**
|
| 468 |
+
* Is called when a shipment track is saved.
|
| 469 |
+
* The tracking code will be sent to MeinPaket.de if it's the first track
|
| 470 |
+
* for the shipment.
|
| 471 |
+
*
|
| 472 |
+
* @param Varien_Event_Observer $observer
|
| 473 |
+
* @return Dhl_MeinPaketCommon_Model_Observer
|
| 474 |
+
*/
|
| 475 |
+
public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer) {
|
| 476 |
+
/* @var $track Mage_Sales_Model_Order_Shipment_Track */
|
| 477 |
+
$track = $observer->getData ( 'track' );
|
| 478 |
+
|
| 479 |
+
if ($track == null) {
|
| 480 |
+
return this;
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
self::setCurrentOrderId ( $track->getOrderId () );
|
| 484 |
+
|
| 485 |
+
if (self::$isSameSavedOrder) {
|
| 486 |
+
return $this;
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
/* @var $shipment Mage_Sales_Model_Order_Shipment */
|
| 490 |
+
$shipment = $track->getShipment ();
|
| 491 |
+
|
| 492 |
+
// check if order is a MeinPaket.de order...
|
| 493 |
+
if (! Mage::helper ( 'meinpaketcommon/shipment' )->isMeinPaketShipment ( $shipment )) {
|
| 494 |
+
return $this;
|
| 495 |
+
}
|
| 496 |
+
|
| 497 |
+
$helper = Mage::helper ( 'meinpaketcommon/data' );
|
| 498 |
+
$result = null;
|
| 499 |
+
$errMsg = '';
|
| 500 |
+
|
| 501 |
+
$service = new Dhl_MeinPaketCommon_Model_Service_Order_ShipmentExportService ();
|
| 502 |
+
|
| 503 |
+
try {
|
| 504 |
+
$result = $service->exportTrackingNumber ( $track );
|
| 505 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_XmlBuildException $e ) {
|
| 506 |
+
Mage::logException ( $e );
|
| 507 |
+
$errMsg .= $helper->__ ( 'Request could not be built.' );
|
| 508 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException $e ) {
|
| 509 |
+
Mage::logException ( $e );
|
| 510 |
+
$errMsg .= sprintf ( $helper->__ ( 'MeinPaket.de server returned HTPP code %s.' ), $e->getHttpReturnCode () );
|
| 511 |
+
} catch ( Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException $e ) {
|
| 512 |
+
Mage::logException ( $e );
|
| 513 |
+
$errMsg .= $helper->__ ( 'Connection to MeinPaket.de server timed out.' );
|
| 514 |
+
} catch ( Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException $e ) {
|
| 515 |
+
Mage::logException ( $e );
|
| 516 |
+
$errMsg .= $helper->__ ( 'Invalid response from MeinPaket.de server.' );
|
| 517 |
+
} catch ( Exception $e ) {
|
| 518 |
+
Mage::logException ( $e );
|
| 519 |
+
$errMsg .= $helper->__ ( 'Unknown error.' );
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
if ($result !== null && ! $result->hasBeenAccepted ()) {
|
| 523 |
+
$errMsg .= $helper->__ ( 'Tracking code has not been accepted by MeinPaket.de.' );
|
| 524 |
+
if ($result->hasError ()) {
|
| 525 |
+
$errMsg .= ' (' . sprintf ( $helper->__ ( 'MeinPaket.de returned error code %s.' ), $result->getError () ) . ')';
|
| 526 |
+
}
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
if (strlen ( $errMsg ) > 0) {
|
| 530 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $helper->__ ( 'Error on transfering tracking code to MeinPaket.de.' ) . ' (' . $errMsg . ')' );
|
| 531 |
+
throw new Exception ( 'Failed exporting tracking code to MeinPaket.de server.' );
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
return $this;
|
| 535 |
+
}
|
| 536 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Payment/Method/Meinpaket.php
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* MeinPaket payment method for imported orders.
|
| 5 |
+
*
|
| 6 |
+
* @category Mage
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Payment_Method
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_MeinPaketCommon_Model_Payment_Method_Meinpaket extends Mage_Payment_Model_Method_Abstract {
|
| 11 |
+
/**
|
| 12 |
+
*
|
| 13 |
+
* @var string
|
| 14 |
+
*/
|
| 15 |
+
protected $_code = 'meinpaket';
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* Can use this payment method in administration panel?
|
| 19 |
+
* @var boolean
|
| 20 |
+
*/
|
| 21 |
+
protected $_canUseInternal = false;
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* Can show this payment method as an option on checkout payment page?
|
| 25 |
+
* @var boolean
|
| 26 |
+
*/
|
| 27 |
+
protected $_canUseCheckout = false;
|
| 28 |
+
|
| 29 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Resource/Eav/Mysql4/Setup.php
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Resource_Eav_Mysql4_Setup extends Mage_Catalog_Model_Resource_Setup {
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* @return array
|
| 6 |
+
*/
|
| 7 |
+
public function getDefaultEntities() {
|
| 8 |
+
return array (
|
| 9 |
+
'order' => array (
|
| 10 |
+
'entity_model' => 'sales/order',
|
| 11 |
+
'table' => 'sales/order',
|
| 12 |
+
'increment_model' => 'eav/entity_increment_numeric',
|
| 13 |
+
'increment_per_store' => true,
|
| 14 |
+
'backend_prefix' => 'sales_entity/order_attribute_backend',
|
| 15 |
+
'attributes' => array (
|
| 16 |
+
'meinpaket_id' => array (
|
| 17 |
+
'type' => 'int',
|
| 18 |
+
'label' => 'Order MeinPaket Id',
|
| 19 |
+
'required' => false,
|
| 20 |
+
'is_visible' => false,
|
| 21 |
+
'visible' => false
|
| 22 |
+
)
|
| 23 |
+
)
|
| 24 |
+
),
|
| 25 |
+
'customer' => array (
|
| 26 |
+
'entity_model' => 'customer/customer',
|
| 27 |
+
'attribute_model' => 'customer/attribute',
|
| 28 |
+
'table' => 'customer/entity',
|
| 29 |
+
'increment_model' => 'eav/entity_increment_numeric',
|
| 30 |
+
'additional_attribute_table' => 'customer/eav_attribute',
|
| 31 |
+
'entity_attribute_collection' => 'customer/attribute_collection',
|
| 32 |
+
'attributes' => array (
|
| 33 |
+
'meinpaket_buyer_id' => array (
|
| 34 |
+
'type' => 'int',
|
| 35 |
+
'label' => 'MeinPaket Buyer Id',
|
| 36 |
+
'input' => 'text',
|
| 37 |
+
'required' => false,
|
| 38 |
+
'sort_order' => 200,
|
| 39 |
+
'visible' => false
|
| 40 |
+
),
|
| 41 |
+
'meinpaket_buyer_name' => array (
|
| 42 |
+
'type' => 'varchar',
|
| 43 |
+
'label' => 'MeinPaket Buyer Name',
|
| 44 |
+
'input' => 'text',
|
| 45 |
+
'required' => false,
|
| 46 |
+
'sort_order' => 201,
|
| 47 |
+
'visible' => false
|
| 48 |
+
)
|
| 49 |
+
)
|
| 50 |
+
)
|
| 51 |
+
);
|
| 52 |
+
}
|
| 53 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Abstract.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
* Process ID.
|
| 5 |
*/
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Service_Abstract {
|
| 3 |
/**
|
| 4 |
* Process ID.
|
| 5 |
*/
|
app/code/community/Dhl/MeinPaketCommon/Model/Service/Async.php
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Result class which encapsulates information concerning the shipment export process.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Service_ShipmentExport
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Async extends Dhl_MeinPaketCommon_Model_Service_Abstract {
|
| 12 |
+
/**
|
| 13 |
+
* Exports products.
|
| 14 |
+
*
|
| 15 |
+
* @param integer $selectionMode
|
| 16 |
+
* @return Dhl_MeinPaketCommon_Model_Service_Product_Export_Result
|
| 17 |
+
*/
|
| 18 |
+
public function process() {
|
| 19 |
+
$seenMagentoProducts = array ();
|
| 20 |
+
|
| 21 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 22 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 23 |
+
|
| 24 |
+
/* var $logCollection Dhl_MeinPaketCommon_Model_Mysql4_Log_Collection */
|
| 25 |
+
$asyncCollection = Mage::getModel ( 'meinpaketcommon/async' )->getCollection ();
|
| 26 |
+
|
| 27 |
+
$count = 0;
|
| 28 |
+
|
| 29 |
+
foreach ( $asyncCollection as $async ) {
|
| 30 |
+
/* @var $statusRequest Dhl_MeinPaketCommon_Model_Xml_Request_AsynchronousStatusRequest */
|
| 31 |
+
$statusRequest = Mage::getModel ( 'meinpaketcommon/xml_request_asynchronousStatusRequest' );
|
| 32 |
+
$statusRequest->addRequestStatus ( $async->getRequestId () );
|
| 33 |
+
|
| 34 |
+
$response = null;
|
| 35 |
+
if ($statusRequest->isHasData ()) {
|
| 36 |
+
$response = $client->send ( $statusRequest );
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
if ($response != null && $response instanceof Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse) {
|
| 40 |
+
/* @var $response Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse */
|
| 41 |
+
$async->setRequestId ( $response->getRequestId () );
|
| 42 |
+
$async->setStatus ( $response->getStatus () );
|
| 43 |
+
$async->setUpdatedAt ( Varien_Date::now () );
|
| 44 |
+
$async->save ();
|
| 45 |
+
} else {
|
| 46 |
+
$async->delete ();
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
$count ++;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
return Mage::helper ( 'meinpaket/data' )->__ ( "Processed %d async jobs", $count );
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
app/code/community/Dhl/MeinPaketCommon/Model/Service/Order/CancellationService.php
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Service class which cancels an order.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaketCommon
|
| 8 |
+
* @subpackage Model_OrderCancellation
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommonModel_Service_Order_CancellationService extends Varien_Object {
|
| 12 |
+
/**
|
| 13 |
+
* Cancels the given MeinPaket order.
|
| 14 |
+
*
|
| 15 |
+
* @param Mage_Sales_Model_Order $order
|
| 16 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_XmlBuildException
|
| 17 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException
|
| 18 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException
|
| 19 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException
|
| 20 |
+
* @return Dhl_MeinPaketCommon_Model_OrderCancellation_Result
|
| 21 |
+
*/
|
| 22 |
+
public function cancelOrder(Mage_Sales_Model_Order $order) {
|
| 23 |
+
|
| 24 |
+
/* @var $notificationRequest Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest */
|
| 25 |
+
$notificationRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest ();
|
| 26 |
+
|
| 27 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 28 |
+
$httpClient = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 29 |
+
|
| 30 |
+
/* @var $result Dhl_MeinPaketCommon_Model_Service_Order_CancellationService_Result */
|
| 31 |
+
$result = new Dhl_MeinPaketCommon_Model_Service_Order_CancellationService_Result ();
|
| 32 |
+
|
| 33 |
+
try {
|
| 34 |
+
$notificationRequest->addCancellation ( $order );
|
| 35 |
+
$responseXml = $httpClient->send ( $notificationRequest );
|
| 36 |
+
} catch ( Exception $e ) {
|
| 37 |
+
Mage::logException ( $e );
|
| 38 |
+
throw $e;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
return $result;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* TODO: broken
|
| 46 |
+
*
|
| 47 |
+
* Cancels a set of items for MeinPaket order.
|
| 48 |
+
*
|
| 49 |
+
* @param Mage_Sales_Model_Order $order
|
| 50 |
+
* @param array $items
|
| 51 |
+
* of the array have to be associative arrays
|
| 52 |
+
* containing the keys "productId" and "qty" (Quantity to reduce).
|
| 53 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_XmlBuildException
|
| 54 |
+
* @throws Dhl_MeinPaketCommonModel_Client_BadHttpReturnCodeException
|
| 55 |
+
* @throws Dhl_MeinPaketCommonModel_Client_HttpTimeoutException
|
| 56 |
+
* @throws Dhl_MeinPaketCommonModel_Xml_InvalidXmlException
|
| 57 |
+
* @return Dhl_MeinPaketCommonModel_OrderCancellation_Result
|
| 58 |
+
*/
|
| 59 |
+
public function cancelOrderItems(Mage_Sales_Model_Order $order, array $items) {
|
| 60 |
+
$notificationRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest();
|
| 61 |
+
|
| 62 |
+
/* @var $xmlResponseParser Dhl_MeinPaketCommonModel_Xml_XmlResponseParser */
|
| 63 |
+
$xmlResponseParser = Mage::getModel ( 'meinpaketcommon/Xml_XmlResponseParser' );
|
| 64 |
+
|
| 65 |
+
/* @var $httpClient Dhl_MeinPaketCommonModel_Client_XmlOverHttp */
|
| 66 |
+
$httpClient = Mage::getModel ( 'meinpaketcommon/Client_XmlOverHttp' );
|
| 67 |
+
|
| 68 |
+
/* @var $result Dhl_MeinPaketCommonModel_Service_Order_CancellationService_Result */
|
| 69 |
+
$result = Mage::getModel ( 'meinpaketcommon/service_order_cancellationService_result' );
|
| 70 |
+
|
| 71 |
+
$requestXml = '';
|
| 72 |
+
$responseXml = '';
|
| 73 |
+
|
| 74 |
+
try {
|
| 75 |
+
// TODO: see Observer line 220
|
| 76 |
+
$response = $httpClient->send ( $xmlRequestFactory->createPartialOrderCancellationRequest ( $order, $items ) );
|
| 77 |
+
$xmlResponseParser->parseOrderCancellationResultFromXml ( $responseXml, $result );
|
| 78 |
+
} catch ( Exception $e ) {
|
| 79 |
+
Mage::logException ( $e );
|
| 80 |
+
throw $e;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
return $result;
|
| 84 |
+
}
|
| 85 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/CancellationService/Result.php
RENAMED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
* @subpackage Model_OrderCancellation
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var string
|
| 8 |
* @subpackage Model_OrderCancellation
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_CancellationService_Result extends Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var string
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/ImportService.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Order
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Andreas Demmer <andreas.demmer@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* counts of imported and duplicate orders
|
| 15 |
*
|
|
@@ -35,7 +34,7 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 35 |
*
|
| 36 |
* @var string
|
| 37 |
*/
|
| 38 |
-
const IMPORT_SHIPPING_METHOD = '
|
| 39 |
|
| 40 |
/**
|
| 41 |
*
|
|
@@ -61,6 +60,12 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 61 |
*/
|
| 62 |
const OUT_OF_STOCK_ORDER_STATUS = 3;
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
/**
|
| 65 |
* Status for a disabled product.
|
| 66 |
*
|
|
@@ -76,6 +81,13 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 76 |
*/
|
| 77 |
protected $serviceResponseWasMalformed = false;
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
/**
|
| 80 |
* Constructor.
|
| 81 |
*
|
|
@@ -86,7 +98,8 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 86 |
'imported' => 0,
|
| 87 |
'duplicates' => 0,
|
| 88 |
'outOfStock' => 0,
|
| 89 |
-
'disabled' => 0
|
|
|
|
| 90 |
);
|
| 91 |
|
| 92 |
$_outOfStockOrders = array ();
|
|
@@ -143,22 +156,22 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 143 |
* @return void
|
| 144 |
*/
|
| 145 |
public function importOrders($start = null, $stop = null) {
|
| 146 |
-
/* @var $
|
| 147 |
-
$
|
| 148 |
-
|
| 149 |
-
/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */
|
| 150 |
-
$client = Mage::getModel ( 'meinpaket/client_xmlOverHttp' );
|
| 151 |
|
| 152 |
-
|
| 153 |
-
$queryRequest = Mage::getModel ( 'meinpaket/xml_request_queryRequest' );
|
| 154 |
// $queryRequest->addOrders ( $start, $stop );
|
| 155 |
$queryRequest->addOrders ( $start, $stop, 'Open' );
|
| 156 |
|
| 157 |
-
/* @var $queryResult
|
| 158 |
$queryResult = $client->send ( $queryRequest );
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
foreach ( $queryResult->getOrders () as $order ) {
|
| 161 |
-
/* @var $order
|
| 162 |
$successCode = $this->_importOrder ( $order );
|
| 163 |
switch ($successCode) {
|
| 164 |
case self::IMPORTED_ORDER_STATUS :
|
|
@@ -170,6 +183,9 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 170 |
case self::OUT_OF_STOCK_ORDER_STATUS :
|
| 171 |
$this->_orderCount ['outOfStock'] ++;
|
| 172 |
break;
|
|
|
|
|
|
|
|
|
|
| 173 |
case self::DISABLED_ORDER_STATUS :
|
| 174 |
$this->_orderCount ['disabled'] ++;
|
| 175 |
break;
|
|
@@ -185,9 +201,9 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 185 |
* @param SimpleXMLElement $order
|
| 186 |
* @return int
|
| 187 |
*/
|
| 188 |
-
protected function _importOrder(
|
| 189 |
-
$storeId = Mage::helper ( '
|
| 190 |
-
$store = Mage::helper ( '
|
| 191 |
|
| 192 |
/* @var $orderObj Mage_Sales_Model_Order */
|
| 193 |
$orderObj = Mage::getModel ( 'sales/order' )->load ( $order->getOrderId (), 'dhl_mein_paket_order_id' );
|
|
@@ -218,7 +234,7 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 218 |
$quoteItems = array ();
|
| 219 |
|
| 220 |
foreach ( $order->getEntries () as $orderEntry ) {
|
| 221 |
-
/* var $orderEntry
|
| 222 |
$productId = ( string ) $orderEntry->getProductId ();
|
| 223 |
|
| 224 |
if ($hasNoConfigurables) {
|
|
@@ -235,15 +251,13 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 235 |
// check wether product is in stock
|
| 236 |
$stockItem = $productObj->getStockItem ();
|
| 237 |
|
| 238 |
-
$magentoPrice = number_format ( $productObj->getPrice (), 2 ) . " " . $store->getCurrentCurrencyCode ();
|
| 239 |
-
$meinPaketPrice = number_format ( ( string ) $orderEntry->getBasePrice (), 2 ) . " " . $store->getCurrentCurrencyCode ();
|
| 240 |
-
|
| 241 |
if ($productObj->getStatus () == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
|
| 242 |
$this->_disabledProductOrders [] = $order->getOrderId ();
|
| 243 |
return self::DISABLED_ORDER_STATUS;
|
| 244 |
} elseif (( bool ) $stockItem->getData ( 'is_in_stock' )) {
|
| 245 |
-
|
| 246 |
-
|
|
|
|
| 247 |
Mage::getSingleton ( 'adminhtml/session' )->addNotice ( $message );
|
| 248 |
}
|
| 249 |
|
|
@@ -251,13 +265,18 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 251 |
'qty' => ( string ) $orderEntry->getQuantity (),
|
| 252 |
'dhl_mein_paket_item_id' => ( string ) $orderEntry->getMeinPaketId ()
|
| 253 |
) ) );
|
|
|
|
| 254 |
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
} else {
|
| 262 |
$this->_outOfStockOrders [] = $order->getOrderId ();
|
| 263 |
return self::OUT_OF_STOCK_ORDER_STATUS;
|
|
@@ -279,6 +298,8 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 279 |
}
|
| 280 |
}
|
| 281 |
|
|
|
|
|
|
|
| 282 |
$billingAddress = $quoteObj->getBillingAddress ();
|
| 283 |
$billingAddress->addData ( $this->_getAddressData ( $order->getBillingAddress () ) );
|
| 284 |
$shippingAddress = $quoteObj->getShippingAddress ();
|
|
@@ -288,17 +309,20 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 288 |
$shippingAddress->addData ( $this->_getAddressData ( $order->getBillingAddress () ) );
|
| 289 |
}
|
| 290 |
|
| 291 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
$shippingAddress->setPaymentMethod ( $paymentMethod );
|
|
|
|
| 293 |
$quoteObj->getPayment ()->importData ( array (
|
| 294 |
'method' => $paymentMethod
|
| 295 |
) );
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
$shippingAddress->setShippingMethod ( self::IMPORT_SHIPPING_METHOD )->unsGrandTotal ()->unsBaseGrandTotal ()->setCollectShippingRates ( true )->save ();
|
| 301 |
-
$shippingAddress->collectTotals ();
|
| 302 |
|
| 303 |
$quoteObj->collectTotals ();
|
| 304 |
$quoteObj->save ();
|
|
@@ -321,17 +345,17 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 321 |
$orderModel->setData ( 'customer_email', strlen ( $contactData->getEmail () ) ? $contactData->getEmail () : Mage::getStoreConfig ( 'meinpaket/customer/default_email' ) );
|
| 322 |
$orderModel->setData ( 'ext_customer_id', $contactData->getCustomerId () );
|
| 323 |
$orderModel->setData ( 'dhl_mein_paket_order_id', $order->getOrderId () );
|
| 324 |
-
// Zend_Debug::dump($orderModel->
|
| 325 |
$orderModel->save ();
|
| 326 |
|
| 327 |
-
|
| 328 |
|
| 329 |
// dispatch event
|
| 330 |
Mage::dispatchEvent ( 'dhl_meinpaket_orderimport', array (
|
| 331 |
'orderId' => $orderModel->getId ()
|
| 332 |
) );
|
| 333 |
-
|
| 334 |
-
$this->createInvoice($orderModel);
|
| 335 |
|
| 336 |
return self::IMPORTED_ORDER_STATUS;
|
| 337 |
}
|
|
@@ -342,16 +366,17 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 342 |
* @param SimpleXMLElement $addressElement
|
| 343 |
* @return array
|
| 344 |
*/
|
| 345 |
-
protected function _getAddressData(
|
| 346 |
$addressArray = array (
|
| 347 |
'salutation' => ( string ) $address->getSalutation (),
|
| 348 |
'firstname' => ( string ) $address->getFirstName (),
|
| 349 |
'lastname' => ( string ) $address->getLastName (),
|
|
|
|
| 350 |
// 'street' => ( string ) $address->getStreet (),
|
| 351 |
'postcode' => ( string ) $address->getZipCode (),
|
| 352 |
'city' => ( string ) $address->getCity (),
|
| 353 |
-
'region_id' => '
|
| 354 |
-
'country_id' => (
|
| 355 |
'telephone' => '0000'
|
| 356 |
);
|
| 357 |
|
|
@@ -386,11 +411,11 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 386 |
/**
|
| 387 |
* Get or create customer.
|
| 388 |
*
|
| 389 |
-
* @param array $
|
| 390 |
* to check
|
| 391 |
* @return Mage_Customer_Model_Customer
|
| 392 |
*/
|
| 393 |
-
protected function getOrCreateCustomer(
|
| 394 |
/* @var $customer Mage_Customer_Model_Customer */
|
| 395 |
$customer = Mage::getModel ( 'customer/customer' )->getCollection ()->addAttributeToSelect ( 'meinpaket_buyer_id' )->addAttributeToFilter ( 'meinpaket_buyer_id', $order->getContactData ()->getCustomerId () )->load ()->getFirstItem ();
|
| 396 |
|
|
@@ -399,7 +424,7 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 399 |
}
|
| 400 |
|
| 401 |
// Set store and website for loadByEmail.
|
| 402 |
-
$customer->setStore ( Mage::helper ( '
|
| 403 |
// Could not find customer by meinpaket_buyer_id. As there can only be one customer for a given
|
| 404 |
// email try to load one.
|
| 405 |
$customer->loadByEmail ( $order->getContactData ()->getEmail () );
|
|
@@ -410,7 +435,7 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 410 |
|
| 411 |
// New customer
|
| 412 |
// Set store and website again after loadByEmail reset it.
|
| 413 |
-
$customer->setStore ( Mage::helper ( '
|
| 414 |
$customer->setFirstname ( $order->getBillingAddress ()->getFirstName () );
|
| 415 |
$customer->setLastname ( $order->getBillingAddress ()->getLastName () );
|
| 416 |
$customer->setEmail ( $order->getContactData ()->getEmail () );
|
|
@@ -427,7 +452,7 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 427 |
|
| 428 |
return $customer;
|
| 429 |
}
|
| 430 |
-
|
| 431 |
/* @var $invoiceModel Sales_Model_Order_Invoice */
|
| 432 |
$invoice = $order->prepareInvoice ();
|
| 433 |
|
|
@@ -437,4 +462,24 @@ class Dhl_MeinPaket_Model_Service_Order_ImportService extends Varien_Object {
|
|
| 437 |
|
| 438 |
$transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () )->save ();
|
| 439 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Order
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_ImportService extends Varien_Object {
|
| 12 |
/**
|
| 13 |
* counts of imported and duplicate orders
|
| 14 |
*
|
| 34 |
*
|
| 35 |
* @var string
|
| 36 |
*/
|
| 37 |
+
const IMPORT_SHIPPING_METHOD = 'meinpaket_standard';
|
| 38 |
|
| 39 |
/**
|
| 40 |
*
|
| 60 |
*/
|
| 61 |
const OUT_OF_STOCK_ORDER_STATUS = 3;
|
| 62 |
|
| 63 |
+
/**
|
| 64 |
+
*
|
| 65 |
+
* @var invalid products in orders, returncode
|
| 66 |
+
*/
|
| 67 |
+
const INVALID_PRODUCT_STATUS = 4;
|
| 68 |
+
|
| 69 |
/**
|
| 70 |
* Status for a disabled product.
|
| 71 |
*
|
| 81 |
*/
|
| 82 |
protected $serviceResponseWasMalformed = false;
|
| 83 |
|
| 84 |
+
/**
|
| 85 |
+
* Event prefix for this class
|
| 86 |
+
*
|
| 87 |
+
* @var string
|
| 88 |
+
*/
|
| 89 |
+
protected $_eventPrefix = 'meinpaketcommon_service_order_importService';
|
| 90 |
+
|
| 91 |
/**
|
| 92 |
* Constructor.
|
| 93 |
*
|
| 98 |
'imported' => 0,
|
| 99 |
'duplicates' => 0,
|
| 100 |
'outOfStock' => 0,
|
| 101 |
+
'disabled' => 0,
|
| 102 |
+
'invalid' => 0
|
| 103 |
);
|
| 104 |
|
| 105 |
$_outOfStockOrders = array ();
|
| 156 |
* @return void
|
| 157 |
*/
|
| 158 |
public function importOrders($start = null, $stop = null) {
|
| 159 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 160 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
+
$queryRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_QueryRequest ();
|
|
|
|
| 163 |
// $queryRequest->addOrders ( $start, $stop );
|
| 164 |
$queryRequest->addOrders ( $start, $stop, 'Open' );
|
| 165 |
|
| 166 |
+
/* @var $queryResult Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse */
|
| 167 |
$queryResult = $client->send ( $queryRequest );
|
| 168 |
|
| 169 |
+
if ($queryResult == null) {
|
| 170 |
+
return;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
foreach ( $queryResult->getOrders () as $order ) {
|
| 174 |
+
/* @var $order Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order */
|
| 175 |
$successCode = $this->_importOrder ( $order );
|
| 176 |
switch ($successCode) {
|
| 177 |
case self::IMPORTED_ORDER_STATUS :
|
| 183 |
case self::OUT_OF_STOCK_ORDER_STATUS :
|
| 184 |
$this->_orderCount ['outOfStock'] ++;
|
| 185 |
break;
|
| 186 |
+
case self::INVALID_PRODUCT_STATUS :
|
| 187 |
+
$this->_orderCount ['invalid'] ++;
|
| 188 |
+
break;
|
| 189 |
case self::DISABLED_ORDER_STATUS :
|
| 190 |
$this->_orderCount ['disabled'] ++;
|
| 191 |
break;
|
| 201 |
* @param SimpleXMLElement $order
|
| 202 |
* @return int
|
| 203 |
*/
|
| 204 |
+
protected function _importOrder(Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order $order, $paymentMethod = self::IMPORT_PAYMENT_METHOD) {
|
| 205 |
+
$storeId = Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStoreId ();
|
| 206 |
+
$store = Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStore ();
|
| 207 |
|
| 208 |
/* @var $orderObj Mage_Sales_Model_Order */
|
| 209 |
$orderObj = Mage::getModel ( 'sales/order' )->load ( $order->getOrderId (), 'dhl_mein_paket_order_id' );
|
| 234 |
$quoteItems = array ();
|
| 235 |
|
| 236 |
foreach ( $order->getEntries () as $orderEntry ) {
|
| 237 |
+
/* var $orderEntry Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_Entry */
|
| 238 |
$productId = ( string ) $orderEntry->getProductId ();
|
| 239 |
|
| 240 |
if ($hasNoConfigurables) {
|
| 251 |
// check wether product is in stock
|
| 252 |
$stockItem = $productObj->getStockItem ();
|
| 253 |
|
|
|
|
|
|
|
|
|
|
| 254 |
if ($productObj->getStatus () == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
|
| 255 |
$this->_disabledProductOrders [] = $order->getOrderId ();
|
| 256 |
return self::DISABLED_ORDER_STATUS;
|
| 257 |
} elseif (( bool ) $stockItem->getData ( 'is_in_stock' )) {
|
| 258 |
+
|
| 259 |
+
if (floatval ( $productObj->getPrice () ) != floatval ( $orderEntry->getBasePrice () )) {
|
| 260 |
+
$message = sprintf ( __ ( '%s was ordered with a different price (%s instead of current price %s). Was the price changed after exporting to MeinPaket.de?' ), $productObj->getName (), $orderEntry->getBasePrice (), $productObj->getPrice () );
|
| 261 |
Mage::getSingleton ( 'adminhtml/session' )->addNotice ( $message );
|
| 262 |
}
|
| 263 |
|
| 265 |
'qty' => ( string ) $orderEntry->getQuantity (),
|
| 266 |
'dhl_mein_paket_item_id' => ( string ) $orderEntry->getMeinPaketId ()
|
| 267 |
) ) );
|
| 268 |
+
/* @var $item Mage_Sales_Model_Quote_Item|string */
|
| 269 |
|
| 270 |
+
if (is_object ( $item )) {
|
| 271 |
+
$item->setStoreId ( $storeId );
|
| 272 |
+
$item->setCustomPrice ( $orderEntry->getBasePrice () );
|
| 273 |
+
$item->setOriginalCustomPrice ( $orderEntry->getBasePrice () );
|
| 274 |
+
$item->getProduct ()->setIsSuperMode ( true );
|
| 275 |
+
} else {
|
| 276 |
+
Mage::log ( $item );
|
| 277 |
+
Mage::getSingleton ( 'adminhtml/session' )->addWarning ( $item );
|
| 278 |
+
return self::INVALID_PRODUCT_STATUS;
|
| 279 |
+
}
|
| 280 |
} else {
|
| 281 |
$this->_outOfStockOrders [] = $order->getOrderId ();
|
| 282 |
return self::OUT_OF_STOCK_ORDER_STATUS;
|
| 298 |
}
|
| 299 |
}
|
| 300 |
|
| 301 |
+
$rate = $this->calculateRate ( $order );
|
| 302 |
+
|
| 303 |
$billingAddress = $quoteObj->getBillingAddress ();
|
| 304 |
$billingAddress->addData ( $this->_getAddressData ( $order->getBillingAddress () ) );
|
| 305 |
$shippingAddress = $quoteObj->getShippingAddress ();
|
| 309 |
$shippingAddress->addData ( $this->_getAddressData ( $order->getBillingAddress () ) );
|
| 310 |
}
|
| 311 |
|
| 312 |
+
$shippingAddress->setCollectShippingRates ( false );
|
| 313 |
+
$shippingAddress->addShippingRate ( $rate );
|
| 314 |
+
$shippingAddress->setShippingMethod ( $rate->getCode () );
|
| 315 |
+
|
| 316 |
+
$shippingAddress->setBaseShippingAmount ( $order->getTotalDeliveryCosts () );
|
| 317 |
+
$shippingAddress->setShippingAmount ( $order->getTotalDeliveryCosts () );
|
| 318 |
$shippingAddress->setPaymentMethod ( $paymentMethod );
|
| 319 |
+
|
| 320 |
$quoteObj->getPayment ()->importData ( array (
|
| 321 |
'method' => $paymentMethod
|
| 322 |
) );
|
| 323 |
|
| 324 |
+
// Dhl_MeinPaketCommon_Model_Carrier_Meinpaket::unlock ();
|
| 325 |
+
// Dhl_MeinPaketCommon_Model_Carrier_Meinpaket::setDeliveryCosts ( $order->getTotalDeliveryCosts () );
|
|
|
|
|
|
|
|
|
|
| 326 |
|
| 327 |
$quoteObj->collectTotals ();
|
| 328 |
$quoteObj->save ();
|
| 345 |
$orderModel->setData ( 'customer_email', strlen ( $contactData->getEmail () ) ? $contactData->getEmail () : Mage::getStoreConfig ( 'meinpaket/customer/default_email' ) );
|
| 346 |
$orderModel->setData ( 'ext_customer_id', $contactData->getCustomerId () );
|
| 347 |
$orderModel->setData ( 'dhl_mein_paket_order_id', $order->getOrderId () );
|
| 348 |
+
// Zend_Debug::dump($orderModel->debug());die;
|
| 349 |
$orderModel->save ();
|
| 350 |
|
| 351 |
+
// Dhl_MeinPaketCommon_Model_Carrier_Meinpaket::unlock ();
|
| 352 |
|
| 353 |
// dispatch event
|
| 354 |
Mage::dispatchEvent ( 'dhl_meinpaket_orderimport', array (
|
| 355 |
'orderId' => $orderModel->getId ()
|
| 356 |
) );
|
| 357 |
+
|
| 358 |
+
$this->createInvoice ( $orderModel );
|
| 359 |
|
| 360 |
return self::IMPORTED_ORDER_STATUS;
|
| 361 |
}
|
| 366 |
* @param SimpleXMLElement $addressElement
|
| 367 |
* @return array
|
| 368 |
*/
|
| 369 |
+
protected function _getAddressData(Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address $address) {
|
| 370 |
$addressArray = array (
|
| 371 |
'salutation' => ( string ) $address->getSalutation (),
|
| 372 |
'firstname' => ( string ) $address->getFirstName (),
|
| 373 |
'lastname' => ( string ) $address->getLastName (),
|
| 374 |
+
|
| 375 |
// 'street' => ( string ) $address->getStreet (),
|
| 376 |
'postcode' => ( string ) $address->getZipCode (),
|
| 377 |
'city' => ( string ) $address->getCity (),
|
| 378 |
+
'region_id' => '0', // TODO: make this optional - and add in documentation
|
| 379 |
+
'country_id' => strtoupper ( $address->getCountry () ),
|
| 380 |
'telephone' => '0000'
|
| 381 |
);
|
| 382 |
|
| 411 |
/**
|
| 412 |
* Get or create customer.
|
| 413 |
*
|
| 414 |
+
* @param array $order
|
| 415 |
* to check
|
| 416 |
* @return Mage_Customer_Model_Customer
|
| 417 |
*/
|
| 418 |
+
protected function getOrCreateCustomer(Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order $order) {
|
| 419 |
/* @var $customer Mage_Customer_Model_Customer */
|
| 420 |
$customer = Mage::getModel ( 'customer/customer' )->getCollection ()->addAttributeToSelect ( 'meinpaket_buyer_id' )->addAttributeToFilter ( 'meinpaket_buyer_id', $order->getContactData ()->getCustomerId () )->load ()->getFirstItem ();
|
| 421 |
|
| 424 |
}
|
| 425 |
|
| 426 |
// Set store and website for loadByEmail.
|
| 427 |
+
$customer->setStore ( Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStore () );
|
| 428 |
// Could not find customer by meinpaket_buyer_id. As there can only be one customer for a given
|
| 429 |
// email try to load one.
|
| 430 |
$customer->loadByEmail ( $order->getContactData ()->getEmail () );
|
| 435 |
|
| 436 |
// New customer
|
| 437 |
// Set store and website again after loadByEmail reset it.
|
| 438 |
+
$customer->setStore ( Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStore () );
|
| 439 |
$customer->setFirstname ( $order->getBillingAddress ()->getFirstName () );
|
| 440 |
$customer->setLastname ( $order->getBillingAddress ()->getLastName () );
|
| 441 |
$customer->setEmail ( $order->getContactData ()->getEmail () );
|
| 452 |
|
| 453 |
return $customer;
|
| 454 |
}
|
| 455 |
+
public function createInvoice(Mage_Sales_Model_Order $order) {
|
| 456 |
/* @var $invoiceModel Sales_Model_Order_Invoice */
|
| 457 |
$invoice = $order->prepareInvoice ();
|
| 458 |
|
| 462 |
|
| 463 |
$transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () )->save ();
|
| 464 |
}
|
| 465 |
+
|
| 466 |
+
/**
|
| 467 |
+
* Calculate carrier rate.
|
| 468 |
+
*
|
| 469 |
+
* @param Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order $order
|
| 470 |
+
* @return Mage_Sales_Model_Quote_Address_Rate
|
| 471 |
+
*/
|
| 472 |
+
protected function calculateRate(Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order $order) {
|
| 473 |
+
$carrier = Mage::getModel ( 'meinpaketcommon/carrier_meinpaket' );
|
| 474 |
+
/* @var $carrier Dhl_MeinPaketCommon_Model_Carrier_Meinpaket */
|
| 475 |
+
$methods = $carrier->getAllowedMethods ();
|
| 476 |
+
$result = Mage::getModel ( 'sales/quote_address_rate' );
|
| 477 |
+
/* @var $result Mage_Sales_Model_Quote_Address_Rate */
|
| 478 |
+
|
| 479 |
+
$parts = explode ( "_", self::IMPORT_SHIPPING_METHOD );
|
| 480 |
+
|
| 481 |
+
$result->setCarrierTitle ( 'MeinPaket' )->setCode ( self::IMPORT_SHIPPING_METHOD )->setCarrier ( $parts [0] )->setMethod ( 'standard' )->setMethodTitle ( 'MeinPaket' )->setMethodDescription ( 'MeinPaket' )->setCost ( $order->getTotalDeliveryCosts () )->setPrice ( $order->getTotalDeliveryCosts () );
|
| 482 |
+
|
| 483 |
+
return $result;
|
| 484 |
+
}
|
| 485 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/RefundExportService.php
RENAMED
|
@@ -8,23 +8,23 @@
|
|
| 8 |
* @subpackage Model_Service_RefundExport
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
* Exports the given refunded creditmemo to MeinPaket.de.
|
| 14 |
*
|
| 15 |
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
| 16 |
-
* @throws
|
| 17 |
-
* @throws
|
| 18 |
-
* @throws
|
| 19 |
-
* @throws
|
| 20 |
-
* @return
|
| 21 |
*/
|
| 22 |
public function exportRefund(Mage_Sales_Model_Order_Creditmemo $creditmemo) {
|
| 23 |
-
/* @var $httpClient
|
| 24 |
-
$httpClient = Mage::getModel ( '
|
| 25 |
|
| 26 |
-
/* @var $notificationRequest
|
| 27 |
-
$notificationRequest = Mage::getModel ( '
|
| 28 |
|
| 29 |
$order = $creditmemo->getOrder ();
|
| 30 |
if ($order->hasShipments ()) {
|
|
@@ -36,7 +36,7 @@ class Dhl_MeinPaket_Model_Service_Order_RefundExportService {
|
|
| 36 |
}
|
| 37 |
|
| 38 |
try {
|
| 39 |
-
if ($notificationRequest->isHasData()) {
|
| 40 |
return $httpClient->send ( $notificationRequest );
|
| 41 |
}
|
| 42 |
} catch ( Exception $e ) {
|
| 8 |
* @subpackage Model_Service_RefundExport
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_RefundExportService {
|
| 12 |
/**
|
| 13 |
* Exports the given refunded creditmemo to MeinPaket.de.
|
| 14 |
*
|
| 15 |
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
| 16 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_XmlBuildException
|
| 17 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException
|
| 18 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException
|
| 19 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException
|
| 20 |
+
* @return Dhl_MeinPaketCommon_Model_Sevice_RefundExport_Result
|
| 21 |
*/
|
| 22 |
public function exportRefund(Mage_Sales_Model_Order_Creditmemo $creditmemo) {
|
| 23 |
+
/* @var $httpClient Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 24 |
+
$httpClient = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 25 |
|
| 26 |
+
/* @var $notificationRequest Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest */
|
| 27 |
+
$notificationRequest = Mage::getModel ( 'meinpaketcommon/xml_request_notificationRequest' );
|
| 28 |
|
| 29 |
$order = $creditmemo->getOrder ();
|
| 30 |
if ($order->hasShipments ()) {
|
| 36 |
}
|
| 37 |
|
| 38 |
try {
|
| 39 |
+
if ($notificationRequest->isHasData ()) {
|
| 40 |
return $httpClient->send ( $notificationRequest );
|
| 41 |
}
|
| 42 |
} catch ( Exception $e ) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/RefundExportService/Result.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_RefundExport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var string
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_RefundExport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_RefundExportService_Result extends Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var string
|
app/code/community/Dhl/MeinPaketCommon/Model/Service/Order/ShipmentExportService.php
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Service which exports an order's shipment to MeinPaket.de.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Service_ShipmentExport
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_ShipmentExportService {
|
| 12 |
+
/**
|
| 13 |
+
* Exports a shipment to MeinPaket.de.
|
| 14 |
+
*
|
| 15 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 16 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_XmlBuildException
|
| 17 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException
|
| 18 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException
|
| 19 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException
|
| 20 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_Response_NotificationResponse
|
| 21 |
+
*/
|
| 22 |
+
public function exportShipment(Mage_Sales_Model_Order_Shipment $shipment) {
|
| 23 |
+
$notificationRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest ();
|
| 24 |
+
|
| 25 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 26 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 27 |
+
|
| 28 |
+
$notificationRequest->addConsignment ( $shipment );
|
| 29 |
+
|
| 30 |
+
/* @var $responseXml Dhl_MeinPaketCommon_Model_Xml_Response_NotificationResponse */
|
| 31 |
+
$responseXml = $client->send ( $notificationRequest );
|
| 32 |
+
|
| 33 |
+
return $responseXml;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Exports the tracking number of a shipment to MeinPaket.de.
|
| 38 |
+
*
|
| 39 |
+
* @param Mage_Sales_Model_Order_Shipment $shipment
|
| 40 |
+
* The shipment which tracking numbers shall be exported.
|
| 41 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_XmlBuildException
|
| 42 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_BadHttpReturnCodeException
|
| 43 |
+
* @throws Dhl_MeinPaketCommon_Model_Client_HttpTimeoutException
|
| 44 |
+
* @throws Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException
|
| 45 |
+
* @return Dhl_MeinPaketCommon_Model_Service_TrackingNumberExport_Result
|
| 46 |
+
*/
|
| 47 |
+
public function exportTrackingNumber(Mage_Sales_Model_Order_Shipment_Track $track) {
|
| 48 |
+
$notificationRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest ();
|
| 49 |
+
|
| 50 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 51 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 52 |
+
|
| 53 |
+
$notificationRequest->addTrackingNumber ( $track );
|
| 54 |
+
|
| 55 |
+
try {
|
| 56 |
+
$responseXml = $client->send ( $notificationRequest );
|
| 57 |
+
// TODO: parse
|
| 58 |
+
} catch ( Exception $e ) {
|
| 59 |
+
Mage::logException ( $e );
|
| 60 |
+
throw $e;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
return null;
|
| 64 |
+
}
|
| 65 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Service/Order/ShipmentExportService/Result.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var string
|
|
@@ -26,7 +25,7 @@ class Dhl_MeinPaket_Model_Service_Order_ShipmentExportService_Result extends Dhl
|
|
| 26 |
* Sets the consignment id of the shipment.
|
| 27 |
*
|
| 28 |
* @param string $consignmentId
|
| 29 |
-
* @return
|
| 30 |
*/
|
| 31 |
public function setConsignmentId($consignmentId) {
|
| 32 |
$this->consignmentId = $consignmentId;
|
|
@@ -37,7 +36,7 @@ class Dhl_MeinPaket_Model_Service_Order_ShipmentExportService_Result extends Dhl
|
|
| 37 |
* Sets the consignment id of the shipment which was returned from MeinPaket.de.
|
| 38 |
*
|
| 39 |
* @param string $consignmentId
|
| 40 |
-
* @return
|
| 41 |
*/
|
| 42 |
public function setResponseConsignmentId($responseConsignmentId) {
|
| 43 |
$this->responseConsignmentId = $responseConsignmentId;
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Service_ShipmentExport
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Order_ShipmentExportService_Result extends Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var string
|
| 25 |
* Sets the consignment id of the shipment.
|
| 26 |
*
|
| 27 |
* @param string $consignmentId
|
| 28 |
+
* @return Dhl_MeinPaketCommon_Model_Service_ShipmentExport_Result
|
| 29 |
*/
|
| 30 |
public function setConsignmentId($consignmentId) {
|
| 31 |
$this->consignmentId = $consignmentId;
|
| 36 |
* Sets the consignment id of the shipment which was returned from MeinPaket.de.
|
| 37 |
*
|
| 38 |
* @param string $consignmentId
|
| 39 |
+
* @return Dhl_MeinPaketCommon_Model_Service_ShipmentExport_Result
|
| 40 |
*/
|
| 41 |
public function setResponseConsignmentId($responseConsignmentId) {
|
| 42 |
$this->responseConsignmentId = $responseConsignmentId;
|
app/code/community/Dhl/MeinPaketCommon/Model/Service/Result/Abstract.php
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Result class which keeps information
|
| 5 |
+
*
|
| 6 |
+
* @category Mage
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Service
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
abstract class Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
*
|
| 15 |
+
* @var array
|
| 16 |
+
*/
|
| 17 |
+
protected $commonErrors = array ();
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Adds a common error which is not product related.
|
| 21 |
+
*
|
| 22 |
+
* @param string $code
|
| 23 |
+
* @param string $message
|
| 24 |
+
*/
|
| 25 |
+
public function addCommonError($code, $message) {
|
| 26 |
+
// check if error already exists
|
| 27 |
+
if (sizeof ( $this->commonErrors ) > 0) {
|
| 28 |
+
foreach ( $this->commonErrors as $error ) {
|
| 29 |
+
if ($error ['code'] === $code && $error ['message'] === $message) {
|
| 30 |
+
return;
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
// add error
|
| 36 |
+
$this->commonErrors [] = array (
|
| 37 |
+
'code' => $code,
|
| 38 |
+
'message' => $message
|
| 39 |
+
);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
*
|
| 44 |
+
* @return boolean
|
| 45 |
+
*/
|
| 46 |
+
public function hasErrors() {
|
| 47 |
+
return (sizeof ( $this->commonErrors ) > 0);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* Returns an array of common (not product related) errors.
|
| 52 |
+
* The elements of result array have the following structure:
|
| 53 |
+
* [
|
| 54 |
+
* 'code' => '...',
|
| 55 |
+
* 'message' => '...'
|
| 56 |
+
* ]
|
| 57 |
+
*
|
| 58 |
+
* @return array
|
| 59 |
+
*/
|
| 60 |
+
public function getCommonErrors() {
|
| 61 |
+
return $this->commonErrors;
|
| 62 |
+
}
|
| 63 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Service/Result/Upload.php
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Result class which encapsulates information concerning the upload process.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Service_ShipmentExport
|
| 9 |
+
* @version $Id$
|
| 10 |
+
S */
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Service_Result_Upload extends Dhl_MeinPaketCommon_Model_Service_Result_Abstract {
|
| 12 |
+
}
|
| 13 |
+
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/System/MemoryLimiter.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_System
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var integer
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_System
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_System_MemoryLimiter extends Varien_Object {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var integer
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidationInterface.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
interface
|
| 13 |
const ERROR_UNDEFINED = 'undefinedError';
|
| 14 |
const ERROR_REQUIRED_FIELD_IS_EMPTY = 'fieldIsEmpty';
|
| 15 |
const ERROR_FIELD_IS_INVALID = 'invalidField';
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
interface Dhl_MeinPaketCommon_Model_Validation_ValidationInterface {
|
| 12 |
const ERROR_UNDEFINED = 'undefinedError';
|
| 13 |
const ERROR_REQUIRED_FIELD_IS_EMPTY = 'fieldIsEmpty';
|
| 14 |
const ERROR_FIELD_IS_INVALID = 'invalidField';
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/CDATAContent.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Validates a string to be valid content of a CDATA block.
|
| 15 |
*
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_CDATAContent implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
* Validates a string to be valid content of a CDATA block.
|
| 14 |
*
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/Ean.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Validates an EAN.
|
| 15 |
*
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_Ean implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
* Validates an EAN.
|
| 14 |
*
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/IntGreaterZero.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Validates an integer value to be greater than zero.
|
| 15 |
*
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_IntGreaterZero implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
* Validates an integer value to be greater than zero.
|
| 14 |
*
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/NonEmptyString.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Validates the given value.
|
| 15 |
* Checks if the given has at least one character.
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_NonEmptyString implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
* Validates the given value.
|
| 14 |
* Checks if the given has at least one character.
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/StringMaxLength.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var integer
|
|
@@ -47,7 +46,7 @@ class Dhl_MeinPaket_Model_Validation_Validator_StringMaxLength implements Dhl_Me
|
|
| 47 |
* Sets the maximum allowed length.
|
| 48 |
*
|
| 49 |
* @param integer $length
|
| 50 |
-
* @return
|
| 51 |
*/
|
| 52 |
public function setMaxLength($length) {
|
| 53 |
if (is_integer ( $length ) && $length >= 0) {
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_StringMaxLength implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var integer
|
| 46 |
* Sets the maximum allowed length.
|
| 47 |
*
|
| 48 |
* @param integer $length
|
| 49 |
+
* @return Dhl_MeinPaketCommon_Model_Validation_Validator_StringMaxLength
|
| 50 |
*/
|
| 51 |
public function setMaxLength($length) {
|
| 52 |
if (is_integer ( $length ) && $length >= 0) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/Validator/Url.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Validates an URL.
|
| 15 |
*
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation_Validator
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_Validator_Url implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
* Validates an URL.
|
| 14 |
*
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidatorChain.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var array
|
|
@@ -37,10 +36,10 @@ class Dhl_MeinPaket_Model_Validation_ValidatorChain implements Dhl_MeinPaket_Mod
|
|
| 37 |
/**
|
| 38 |
* Adds a validator to the end of the chain.
|
| 39 |
*
|
| 40 |
-
* @param
|
| 41 |
-
* @return
|
| 42 |
*/
|
| 43 |
-
public function addValidator(
|
| 44 |
$this->validators [] = $validator;
|
| 45 |
return $this;
|
| 46 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Validation_ValidatorChain implements Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var array
|
| 36 |
/**
|
| 37 |
* Adds a validator to the end of the chain.
|
| 38 |
*
|
| 39 |
+
* @param Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface $validator
|
| 40 |
+
* @return Dhl_MeinPaketCommon_Model_Validation_ValidatorChain
|
| 41 |
*/
|
| 42 |
+
public function addValidator(Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface $validator) {
|
| 43 |
$this->validators [] = $validator;
|
| 44 |
return $this;
|
| 45 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Validation/ValidatorInterface.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
interface
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Validates the given value.
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Validation
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
interface Dhl_MeinPaketCommon_Model_Validation_ValidatorInterface {
|
| 12 |
|
| 13 |
/**
|
| 14 |
* Validates the given value.
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/AbstractXmlPartial.php
RENAMED
|
@@ -7,10 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
-
abstract class
|
| 14 |
/**
|
| 15 |
*
|
| 16 |
* @var DOMNode
|
|
@@ -22,18 +20,14 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlPartial {
|
|
| 22 |
* @var DOMDocument
|
| 23 |
*/
|
| 24 |
protected $document = null;
|
| 25 |
-
|
| 26 |
/**
|
| 27 |
* Default constructor.
|
| 28 |
*
|
| 29 |
* @param DOMDocument $document
|
| 30 |
*/
|
| 31 |
public function __construct(DOMDocument $document) {
|
| 32 |
-
$this->
|
| 33 |
-
|
| 34 |
-
if ($this->document == null || ! ($this->document instanceof DOMDocument)) {
|
| 35 |
-
throw new InvalidArgumentException ( "Invalid DOMDocument given" );
|
| 36 |
-
}
|
| 37 |
}
|
| 38 |
|
| 39 |
/**
|
|
@@ -71,9 +65,13 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlPartial {
|
|
| 71 |
* Sets the DOM document.
|
| 72 |
*
|
| 73 |
* @param DOMDocument $document
|
| 74 |
-
* @return
|
| 75 |
*/
|
| 76 |
public function setDocument(DOMDocument $document) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
$this->document = $document;
|
| 78 |
return $this;
|
| 79 |
}
|
|
@@ -133,9 +131,9 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlPartial {
|
|
| 133 |
}
|
| 134 |
|
| 135 |
/**
|
| 136 |
-
* Returns an instance of
|
| 137 |
*
|
| 138 |
-
* @return
|
| 139 |
*/
|
| 140 |
protected function getValidatorFactory() {
|
| 141 |
return Mage::getSingleton ( 'meinpaket/Validation_ValidatorFactory' );
|
|
@@ -162,6 +160,7 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlPartial {
|
|
| 162 |
}
|
| 163 |
/**
|
| 164 |
* Convert HTML entities to UTF- 8special chars while leaving the already existing special chars intact
|
|
|
|
| 165 |
* @param string $string
|
| 166 |
* @return string
|
| 167 |
*/
|
|
@@ -175,7 +174,7 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlPartial {
|
|
| 175 |
|
| 176 |
/**
|
| 177 |
* Create a string from created document.
|
| 178 |
-
*
|
| 179 |
* @return string
|
| 180 |
*/
|
| 181 |
public function __toString() {
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
+
abstract class Dhl_MeinPaketCommon_Model_Xml_AbstractXmlPartial {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var DOMNode
|
| 20 |
* @var DOMDocument
|
| 21 |
*/
|
| 22 |
protected $document = null;
|
| 23 |
+
|
| 24 |
/**
|
| 25 |
* Default constructor.
|
| 26 |
*
|
| 27 |
* @param DOMDocument $document
|
| 28 |
*/
|
| 29 |
public function __construct(DOMDocument $document) {
|
| 30 |
+
$this->setDocument ( $document );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
/**
|
| 65 |
* Sets the DOM document.
|
| 66 |
*
|
| 67 |
* @param DOMDocument $document
|
| 68 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_AbstractXmlPartial
|
| 69 |
*/
|
| 70 |
public function setDocument(DOMDocument $document) {
|
| 71 |
+
if ($document == null) {
|
| 72 |
+
throw new InvalidArgumentException ( "Invalid DOMDocument given" );
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
$this->document = $document;
|
| 76 |
return $this;
|
| 77 |
}
|
| 131 |
}
|
| 132 |
|
| 133 |
/**
|
| 134 |
+
* Returns an instance of Dhl_MeinPaketCommon_Model_Validation_ValidatorFactory.
|
| 135 |
*
|
| 136 |
+
* @return Dhl_MeinPaketCommon_Model_Validation_ValidatorFactory
|
| 137 |
*/
|
| 138 |
protected function getValidatorFactory() {
|
| 139 |
return Mage::getSingleton ( 'meinpaket/Validation_ValidatorFactory' );
|
| 160 |
}
|
| 161 |
/**
|
| 162 |
* Convert HTML entities to UTF- 8special chars while leaving the already existing special chars intact
|
| 163 |
+
*
|
| 164 |
* @param string $string
|
| 165 |
* @return string
|
| 166 |
*/
|
| 174 |
|
| 175 |
/**
|
| 176 |
* Create a string from created document.
|
| 177 |
+
*
|
| 178 |
* @return string
|
| 179 |
*/
|
| 180 |
public function __toString() {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/AbstractXmlRequest.php
RENAMED
|
@@ -7,10 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
-
abstract class
|
| 14 |
// const XMLNS = 'http://www.meinpaket.de/xsd/dietmar/1.0/products';
|
| 15 |
const XMLNS_COMMON = 'http://www.meinpaket.de/xsd/dietmar/1.0/common';
|
| 16 |
const XMLNS_DATA = 'http://www.meinpaket.de/xsd/dietmar/1.0/data';
|
|
@@ -52,10 +50,11 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlRequest extends Dhl_MeinPaket_
|
|
| 52 |
}
|
| 53 |
public function addHeader() {
|
| 54 |
$username = Mage::getStoreConfig ( 'meinpaket/credentials/username' );
|
| 55 |
-
$
|
|
|
|
| 56 |
|
| 57 |
if (! is_string ( $username ) || ! is_string ( $password ) || strlen ( $username ) <= 0 || strlen ( $password ) <= 0) {
|
| 58 |
-
throw new
|
| 59 |
}
|
| 60 |
|
| 61 |
$headerNode = $this->getDocument ()->createElement ( 'common:header' );
|
|
@@ -78,7 +77,7 @@ abstract class Dhl_MeinPaket_Model_Xml_AbstractXmlRequest extends Dhl_MeinPaket_
|
|
| 78 |
/**
|
| 79 |
* Builds the DOM node.
|
| 80 |
*
|
| 81 |
-
* @return
|
| 82 |
*/
|
| 83 |
public function build() {
|
| 84 |
// No need to be build
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
+
abstract class Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlPartial {
|
| 12 |
// const XMLNS = 'http://www.meinpaket.de/xsd/dietmar/1.0/products';
|
| 13 |
const XMLNS_COMMON = 'http://www.meinpaket.de/xsd/dietmar/1.0/common';
|
| 14 |
const XMLNS_DATA = 'http://www.meinpaket.de/xsd/dietmar/1.0/data';
|
| 50 |
}
|
| 51 |
public function addHeader() {
|
| 52 |
$username = Mage::getStoreConfig ( 'meinpaket/credentials/username' );
|
| 53 |
+
$passwordCrypted = Mage::getStoreConfig ( 'meinpaket/credentials/password' );
|
| 54 |
+
$password = Mage::helper ( 'core' )->decrypt ( $passwordCrypted );
|
| 55 |
|
| 56 |
if (! is_string ( $username ) || ! is_string ( $password ) || strlen ( $username ) <= 0 || strlen ( $password ) <= 0) {
|
| 57 |
+
throw new Dhl_MeinPaketCommon_Model_Xml_XmlBuildException ( 'No authentication parameters set.' );
|
| 58 |
}
|
| 59 |
|
| 60 |
$headerNode = $this->getDocument ()->createElement ( 'common:header' );
|
| 77 |
/**
|
| 78 |
* Builds the DOM node.
|
| 79 |
*
|
| 80 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_AbstractXmlPartial
|
| 81 |
*/
|
| 82 |
public function build() {
|
| 83 |
// No need to be build
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/InvalidXmlException.php
RENAMED
|
@@ -7,7 +7,6 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
}
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_InvalidXmlException extends Varien_Exception {
|
| 12 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/AsynchronousStatusRequest.php
RENAMED
|
@@ -7,12 +7,11 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* RequesdId for this request
|
| 15 |
-
*
|
| 16 |
* @var unknown
|
| 17 |
*/
|
| 18 |
protected $requestId;
|
|
@@ -41,16 +40,19 @@ class Dhl_MeinPaket_Model_Xml_Request_AsynchronousStatusRequest extends Dhl_Mein
|
|
| 41 |
* Creates the request XML for a category structure download request.
|
| 42 |
*/
|
| 43 |
public function addRequestStatus($requestId, $onlyStatus = 'false') {
|
| 44 |
-
$
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
return $this;
|
| 55 |
}
|
| 56 |
public function getRequestId() {
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_AsynchronousStatusRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
/**
|
| 13 |
* RequesdId for this request
|
| 14 |
+
*
|
| 15 |
* @var unknown
|
| 16 |
*/
|
| 17 |
protected $requestId;
|
| 40 |
* Creates the request XML for a category structure download request.
|
| 41 |
*/
|
| 42 |
public function addRequestStatus($requestId, $onlyStatus = 'false') {
|
| 43 |
+
if (strlen ( $requestId ) > 0) {
|
| 44 |
+
$this->requestId = $requestId;
|
| 45 |
+
$getRequestStatusNode = $this->getDocument ()->createElement ( 'getRequestStatus' );
|
| 46 |
+
$this->getDocumentElement ()->appendChild ( $getRequestStatusNode );
|
| 47 |
+
|
| 48 |
+
$requestIdNode = $this->getDocument ()->createElement ( 'requestId', $requestId );
|
| 49 |
+
$getRequestStatusNode->appendChild ( $requestIdNode );
|
| 50 |
+
|
| 51 |
+
$onlyStatusNode = $this->getDocument ()->createElement ( 'onlyStatus', $onlyStatus );
|
| 52 |
+
$getRequestStatusNode->appendChild ( $onlyStatusNode );
|
| 53 |
+
|
| 54 |
+
$this->setHasData ( true );
|
| 55 |
+
}
|
| 56 |
return $this;
|
| 57 |
}
|
| 58 |
public function getRequestId() {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/DataRequest.php
RENAMED
|
@@ -6,12 +6,12 @@
|
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
-
* @subpackage
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
-
* @var
|
| 15 |
*/
|
| 16 |
protected $productHelper = null;
|
| 17 |
protected $productDataRequest = null;
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
+
* @subpackage Dhl_MeinPaketCommon_Model_Xml_Partial
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_DataRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
+
* @var Dhl_MeinPaketCommon_Helper_Product
|
| 15 |
*/
|
| 16 |
protected $productHelper = null;
|
| 17 |
protected $productDataRequest = null;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/DownloadRequest.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
* Default Constructor.
|
| 15 |
*/
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_DownloadRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
/**
|
| 13 |
* Default Constructor.
|
| 14 |
*/
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/NotificationRequest.php
RENAMED
|
@@ -7,9 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var DOMNode
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_NotificationRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var DOMNode
|
app/code/community/Dhl/MeinPaketCommon/Model/Xml/Request/QueryRequest.php
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Partial which represents the 'queryRequest' element.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Xml_Partial
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_QueryRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
*
|
| 15 |
+
* @var DOMElement
|
| 16 |
+
*/
|
| 17 |
+
protected $orders;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
*
|
| 21 |
+
* @var DOMElement
|
| 22 |
+
*/
|
| 23 |
+
protected $order_externalIds;
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
*
|
| 27 |
+
* @var DOMElement
|
| 28 |
+
*/
|
| 29 |
+
protected $shoppingCartStatus;
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
*
|
| 33 |
+
* @var DOMElement
|
| 34 |
+
*/
|
| 35 |
+
protected $shoppingCartStatus_externalIds;
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* Default Constructor.
|
| 39 |
+
*/
|
| 40 |
+
public function __construct() {
|
| 41 |
+
parent::__construct ();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* Create the root element for the document.
|
| 46 |
+
*
|
| 47 |
+
* @return DOMNode
|
| 48 |
+
*/
|
| 49 |
+
public function createDocumentElement() {
|
| 50 |
+
$this->node = $this->getDocument ()->createElement ( 'queryRequest' );
|
| 51 |
+
$this->node->setAttribute ( 'xmlns', self::XMLNS_ORDERS );
|
| 52 |
+
$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );
|
| 53 |
+
$this->node->setAttribute ( 'version', '1.0' );
|
| 54 |
+
$this->getDocument ()->appendChild ( $this->node );
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* Add order request.
|
| 59 |
+
*
|
| 60 |
+
* @param string $from
|
| 61 |
+
* @param string $to
|
| 62 |
+
* @param string $status
|
| 63 |
+
*/
|
| 64 |
+
public function addOrders($from = null, $to = null, $status = null) {
|
| 65 |
+
$this->_initializeOrder ();
|
| 66 |
+
$this->setHasData ( true );
|
| 67 |
+
|
| 68 |
+
if ($from != null) {
|
| 69 |
+
$dateFromNode = $this->getDocument ()->createElement ( "dateFrom", $this->getFormatedDate ( $from ) );
|
| 70 |
+
$this->orders->appendChild ( $dateFromNode );
|
| 71 |
+
} else {
|
| 72 |
+
// One week ago
|
| 73 |
+
/* @var $date Zend_Date */
|
| 74 |
+
$date = Zend_Date::now ();
|
| 75 |
+
$date->subWeek ( 1 );
|
| 76 |
+
$date->setHour ( 0 );
|
| 77 |
+
$date->setMinute ( 0 );
|
| 78 |
+
$date->setMilliSecond ( 0 );
|
| 79 |
+
$dateFromNode = $this->getDocument ()->createElement ( "dateFrom", $date->toString ( Zend_Date::ISO_8601 ) );
|
| 80 |
+
$this->orders->appendChild ( $dateFromNode );
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
if ($to != null) {
|
| 84 |
+
$dateToNode = $this->getDocument ()->createElement ( "dateTo", $this->getFormatedDate ( $to ) );
|
| 85 |
+
$this->orders->appendChild ( $dateToNode );
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
if ($status != null) {
|
| 89 |
+
$statusNode = $this->getDocument ()->createElement ( "orderStatus", $status );
|
| 90 |
+
$this->orders->appendChild ( $statusNode );
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* Shopping Cart Status.
|
| 96 |
+
*
|
| 97 |
+
* @param
|
| 98 |
+
* string cartId
|
| 99 |
+
*/
|
| 100 |
+
public function addShoppingCartStatus($cartId) {
|
| 101 |
+
$this->setHasData ( true );
|
| 102 |
+
if ($this->shoppingCartStatus == null) {
|
| 103 |
+
$this->shoppingCartStatus = $this->getDocument ()->createElement ( 'shoppingCartStatus' );
|
| 104 |
+
$this->getDocumentElement ()->appendChild ( $this->shoppingCartStatus );
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
if ($this->shoppingCartStatus_externalIds == null) {
|
| 108 |
+
$this->shoppingCartStatus_externalIds = $this->getDocument ()->createElement ( 'externalIds' );
|
| 109 |
+
$this->shoppingCartStatus->appendChild ( $this->shoppingCartStatus_externalIds );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
$externalId = $this->getDocument ()->createElement ( "externalId", $cartId );
|
| 113 |
+
$this->shoppingCartStatus_externalIds->appendChild ( $externalId );
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Shopping Cart Status.
|
| 118 |
+
*
|
| 119 |
+
* @param
|
| 120 |
+
* string cartId
|
| 121 |
+
*/
|
| 122 |
+
public function addOrderExternalId($cartId) {
|
| 123 |
+
$this->setHasData ( true );
|
| 124 |
+
$this->_initializeOrder ();
|
| 125 |
+
|
| 126 |
+
if ($this->order_externalIds == null) {
|
| 127 |
+
$this->order_externalIds = $this->getDocument ()->createElement ( 'externalIds' );
|
| 128 |
+
$this->orders->appendChild ( $this->order_externalIds );
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
$externalId = $this->getDocument ()->createElement ( "externalId", $cartId );
|
| 132 |
+
$this->order_externalIds->appendChild ( $externalId );
|
| 133 |
+
}
|
| 134 |
+
protected function _initializeOrder() {
|
| 135 |
+
if ($this->orders == null) {
|
| 136 |
+
$this->orders = $this->getDocument ()->createElement ( 'orders' );
|
| 137 |
+
$this->getDocumentElement ()->appendChild ( $this->orders );
|
| 138 |
+
$this->orders->setAttribute ( 'getEmail', 'true' );
|
| 139 |
+
$this->orders->setAttribute ( 'additionalInfos', true );
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Xml/Request/SubmitCartRequest.php
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Partial which represents the 'submitCartRequest' element.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Xml_Partial
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_SubmitCartRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
+
const EU_MIN_STANDARD_TAX = 15;
|
| 13 |
+
const POSTPAY_TAX_FREE = 'Free';
|
| 14 |
+
const POSTPAY_TAX_REDUCED = 'Reduced';
|
| 15 |
+
const POSTPAY_TAX_STANDARD = 'Standard';
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* Default Constructor.
|
| 19 |
+
*/
|
| 20 |
+
public function __construct() {
|
| 21 |
+
parent::__construct ();
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Create the root element for the document.
|
| 26 |
+
*
|
| 27 |
+
* @return DOMNode
|
| 28 |
+
*/
|
| 29 |
+
public function createDocumentElement() {
|
| 30 |
+
$this->node = $this->getDocument ()->createElement ( 'submitCartRequest' );
|
| 31 |
+
$this->node->setAttribute ( 'xmlns', self::XMLNS_CHECKOUT );
|
| 32 |
+
$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );
|
| 33 |
+
$this->node->setAttribute ( 'version', '1.0' );
|
| 34 |
+
$this->getDocument ()->appendChild ( $this->node );
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
*
|
| 39 |
+
* @param Mage_Sales_Model_Order|Mage_Sales_Model_Quote $order
|
| 40 |
+
* @param Dhl_Paypal_Model_Cart $cart
|
| 41 |
+
* @return string
|
| 42 |
+
*/
|
| 43 |
+
public function addCart($order, $cart) {
|
| 44 |
+
if ($order == null) {
|
| 45 |
+
return;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
$shoppingCartNode = $this->getDocument ()->createElement ( 'shoppingCart' );
|
| 49 |
+
$cartIdnode = $this->getDocument ()->createElement ( 'cartId', ( string ) $cart->getId () );
|
| 50 |
+
$shoppingCartNode->appendChild ( $cartIdnode );
|
| 51 |
+
|
| 52 |
+
foreach ( $order->getAllVisibleItems () as $item ) {
|
| 53 |
+
/* @var $item Mage_Sales_Model_Order_Item */
|
| 54 |
+
$this->addCartItem ( $shoppingCartNode, $item );
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
if ($order instanceof Mage_Sales_Model_Order) {
|
| 58 |
+
$this->addCustomerData ( $shoppingCartNode, $order );
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
if ($order->hasShippingInclTax ()) {
|
| 62 |
+
// If shipping availabe -> no quote
|
| 63 |
+
$shippingCostNode = $this->getDocument ()->createElement ( "shippingCost", $order->getShippingInclTax () );
|
| 64 |
+
$shoppingCartNode->appendChild ( $shippingCostNode );
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$params = array (
|
| 68 |
+
'_forced_secure' => true
|
| 69 |
+
);
|
| 70 |
+
|
| 71 |
+
if ($order instanceof Mage_Sales_Model_Order) {
|
| 72 |
+
$params ['order'] = $order->getIncrementId ();
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
$redirectURLSuccessNode = $this->getDocument ()->createElement ( "redirectURLSuccess", Mage::getUrl ( 'postpay/response/success', $params ) );
|
| 76 |
+
$shoppingCartNode->appendChild ( $redirectURLSuccessNode );
|
| 77 |
+
|
| 78 |
+
$redirectURLErrorNode = $this->getDocument ()->createElement ( "redirectURLError", Mage::getUrl ( 'postpay/response/error', $params ) );
|
| 79 |
+
$shoppingCartNode->appendChild ( $redirectURLErrorNode );
|
| 80 |
+
|
| 81 |
+
$redirectURLBackNode = $this->getDocument ()->createElement ( "redirectURLBack", Mage::getUrl ( 'postpay/response/back', $params ) );
|
| 82 |
+
$shoppingCartNode->appendChild ( $redirectURLBackNode );
|
| 83 |
+
|
| 84 |
+
$notificationIdNode = $this->getDocument ()->createElement ( "notificationId", $cart->getNotificationId () );
|
| 85 |
+
$shoppingCartNode->appendChild ( $notificationIdNode );
|
| 86 |
+
|
| 87 |
+
$this->getDocumentElement ()->appendChild ( $shoppingCartNode );
|
| 88 |
+
|
| 89 |
+
return $cart->getNotificationId ();
|
| 90 |
+
}
|
| 91 |
+
protected function addCartItem(DOMElement $shoppingCartNode, Mage_Sales_Model_Order_Item $item) {
|
| 92 |
+
if (! Mage::helper ( 'meinpaketcommon/data' )->checkItem ( $item )) {
|
| 93 |
+
return;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
$shoppingCartItemNode = $this->getDocument ()->createElement ( 'shoppingCartItem' );
|
| 97 |
+
$productIdNode = $this->getDocument ()->createElement ( 'productId', $item->getProductId () );
|
| 98 |
+
$shoppingCartItemNode->appendChild ( $productIdNode );
|
| 99 |
+
|
| 100 |
+
$shoppingCartItemNode->appendChild ( $this->getCDATANode ( 'name', $item->getName () ) );
|
| 101 |
+
$basePriceNode = $this->getDocument ()->createElement ( 'basePrice', $item->getBasePriceInclTax () );
|
| 102 |
+
$shoppingCartItemNode->appendChild ( $basePriceNode );
|
| 103 |
+
$taxNode = $this->getDocument ()->createElement ( 'tax' );
|
| 104 |
+
if ($item->getTaxPercent () <= 0) {
|
| 105 |
+
$taxNode->nodeValue = self::POSTPAY_TAX_FREE;
|
| 106 |
+
} else if ($item->getTaxPercent () >= self::EU_MIN_STANDARD_TAX) {
|
| 107 |
+
$taxNode->nodeValue = self::POSTPAY_TAX_STANDARD;
|
| 108 |
+
} else {
|
| 109 |
+
$taxNode->nodeValue = self::POSTPAY_TAX_REDUCED;
|
| 110 |
+
}
|
| 111 |
+
$shoppingCartItemNode->appendChild ( $taxNode );
|
| 112 |
+
$quantityNode = $this->getDocument ()->createElement ( 'quantity', $item->getQty () ? $item->getQty () : $item->getQtyOrdered () );
|
| 113 |
+
$shoppingCartItemNode->appendChild ( $quantityNode );
|
| 114 |
+
|
| 115 |
+
$shoppingCartNode->appendChild ( $shoppingCartItemNode );
|
| 116 |
+
$this->setHasData ( true );
|
| 117 |
+
}
|
| 118 |
+
protected function addCustomerData(DOMElement $shoppingCartNode, Mage_Sales_Model_Order $order) {
|
| 119 |
+
$customerDataNode = $this->getDocument ()->createElement ( 'customerData' );
|
| 120 |
+
|
| 121 |
+
$emailNode = $this->getDocument ()->createElement ( 'email', $this->getCDATANode ( 'email', $order->getCustomerEmail () ) );
|
| 122 |
+
|
| 123 |
+
if ($order->getShippingAddressId () != $order->getBillingAddressId ()) {
|
| 124 |
+
$deliveryAddressNode = $this->getDocument ()->createElement ( 'deliveryAddress' );
|
| 125 |
+
$this->addCustomerAddressFields ( $deliveryAddressNode, $order->getShippingAddress () );
|
| 126 |
+
$customerDataNode->appendChild ( $deliveryAddressNode );
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
$billingAddressNode = $this->getDocument ()->createElement ( 'billingAddress' );
|
| 130 |
+
$this->addCustomerAddressFields ( $billingAddressNode, $order->getBillingAddress () );
|
| 131 |
+
$customerDataNode->appendChild ( $billingAddressNode );
|
| 132 |
+
|
| 133 |
+
$shoppingCartNode->appendChild ( $customerDataNode );
|
| 134 |
+
}
|
| 135 |
+
protected function addCustomerAddressFields(DOMElement $addressNode, Mage_Sales_Model_Order_Address $address) {
|
| 136 |
+
$streetHouseNumber = Mage::helper ( 'meinpaketcommon/address' )->parseStreetHouseNumber ( $address->getStreet1 () );
|
| 137 |
+
|
| 138 |
+
// The salutation if provided, i.e .Herr/Frau or Mr./Mrs
|
| 139 |
+
switch ($address->getPrefix ()) {
|
| 140 |
+
case 'Frau' :
|
| 141 |
+
$salutation = 'Frau';
|
| 142 |
+
break;
|
| 143 |
+
case 'Mrs' :
|
| 144 |
+
$salutation = 'Mrs';
|
| 145 |
+
break;
|
| 146 |
+
case 'Mr' :
|
| 147 |
+
case 'Mr.' :
|
| 148 |
+
$salutation = 'Mr.';
|
| 149 |
+
break;
|
| 150 |
+
default :
|
| 151 |
+
$salutation = 'Herr';
|
| 152 |
+
break;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'salutation', $salutation ) );
|
| 156 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'firstName', $address->getFirstname () ) );
|
| 157 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'lastName', $address->getLastname () ) );
|
| 158 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'street', $streetHouseNumber ["street"] ) );
|
| 159 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'houseNumber', $streetHouseNumber ["houseNumber"] ) );
|
| 160 |
+
if (strlen ( $address->getStreet2 () )) {
|
| 161 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'addressAddition', $address->getStreet2 () ) );
|
| 162 |
+
if (strlen ( $address->getStreet3 () )) {
|
| 163 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'addressAddition', $address->getStreet3 () ) );
|
| 164 |
+
if (strlen ( $address->getStreet4 () )) {
|
| 165 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'addressAddition', $address->getStreet4 () ) );
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'zipCode', $address->getPostcode () ) );
|
| 170 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'city', $address->getCity () ) );
|
| 171 |
+
$addressNode->appendChild ( $this->getCDATANode ( 'country', $address->getCountry () ) );
|
| 172 |
+
}
|
| 173 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Request/UploadRequest.php
RENAMED
|
@@ -6,9 +6,9 @@
|
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
-
* @subpackage
|
| 10 |
*/
|
| 11 |
-
class
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var DOMNode
|
|
@@ -42,7 +42,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 42 |
|
| 43 |
/**
|
| 44 |
*
|
| 45 |
-
* @var
|
| 46 |
*/
|
| 47 |
protected $productHelper = null;
|
| 48 |
|
|
@@ -69,7 +69,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 69 |
|
| 70 |
/**
|
| 71 |
*
|
| 72 |
-
* @param Mage_Catalog_Model_Product $product
|
| 73 |
* @return DOMNode|Ambigous <boolean, DOMElement>
|
| 74 |
*/
|
| 75 |
public function addProductDescription(Mage_Catalog_Model_Product $product) {
|
|
@@ -91,6 +91,11 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 91 |
public function addOffer(Mage_Catalog_Model_Product $product) {
|
| 92 |
$offer = $this->getDocument ()->createElement ( 'productOffer' );
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
// product id
|
| 95 |
$offer->appendChild ( $this->getDocument ()->createElement ( 'common:productId', $product->getId () ) );
|
| 96 |
|
|
@@ -107,7 +112,10 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 107 |
}
|
| 108 |
|
| 109 |
// price
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
// tax group
|
| 113 |
$taxGroup = $this->productHelper->getMeinPaketTaxGroup ( $product );
|
|
@@ -139,15 +147,15 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 139 |
$this->getDeletions ()->appendChild ( $productDeletionNode );
|
| 140 |
$productIdNode = $this->getDocument ()->createElement ( 'common:productId', $product->getId () );
|
| 141 |
$productDeletionNode->appendChild ( $productIdNode );
|
|
|
|
|
|
|
| 142 |
}
|
| 143 |
}
|
| 144 |
public function addCategory(Mage_Catalog_Model_Product $product) {
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
/* @var $offers Dhl_MeinPaket_Model_Xml_Partial_Offers */
|
| 148 |
-
$offers = Mage::getModel ( 'meinpaket/xml_partial_offers' );
|
| 149 |
}
|
| 150 |
public function removeCategory(Mage_Catalog_Model_Product $product) {
|
|
|
|
| 151 |
}
|
| 152 |
protected function getProductDescriptions() {
|
| 153 |
if ($this->productDescriptions == null) {
|
|
@@ -224,8 +232,8 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 224 |
* to be exported
|
| 225 |
* @param string $variantGroup
|
| 226 |
* the product belongs to if available
|
| 227 |
-
* @throws
|
| 228 |
-
* @throws
|
| 229 |
* @return DOMNode
|
| 230 |
*/
|
| 231 |
protected function handleSimpleProduct(Mage_Catalog_Model_Product $product, Mage_Catalog_Model_Product $configurableProduct = null) {
|
|
@@ -238,7 +246,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 238 |
}
|
| 239 |
|
| 240 |
if (! $product->getData ( 'sync_with_dhl_mein_paket' ) && $configurableProduct == null) {
|
| 241 |
-
$this->removeProduct($product);
|
| 242 |
return false;
|
| 243 |
}
|
| 244 |
|
|
@@ -272,7 +280,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 272 |
if (strlen ( $product->getName () ) > 0) {
|
| 273 |
$productDescription->appendChild ( $this->getCDATANode ( 'name', $product->getName () ) );
|
| 274 |
} else {
|
| 275 |
-
throw new
|
| 276 |
}
|
| 277 |
|
| 278 |
// shortdescription
|
|
@@ -280,7 +288,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 280 |
$shortDescription = $this->escapeStringForMeinPaket ( $product->getShortDescription () );
|
| 281 |
$productDescription->appendChild ( $this->getCDATANode ( 'shortDescription', $shortDescription ) );
|
| 282 |
} else {
|
| 283 |
-
throw new
|
| 284 |
}
|
| 285 |
|
| 286 |
// long description (optional) && (strlen > 0)
|
|
@@ -317,7 +325,7 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 317 |
$mNode->setAttribute ( 'code', $meinpaketCategory );
|
| 318 |
$productDescription->appendChild ( $mNode );
|
| 319 |
} else {
|
| 320 |
-
throw new
|
| 321 |
}
|
| 322 |
|
| 323 |
$this->exportAttributes ( $product, $productDescription, $configurableProduct );
|
|
@@ -398,6 +406,11 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 398 |
return false;
|
| 399 |
}
|
| 400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 401 |
if ($product->getTypeId () != Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
|
| 402 |
return false;
|
| 403 |
}
|
|
@@ -418,6 +431,8 @@ class Dhl_MeinPaket_Model_Xml_Request_UploadRequest extends Dhl_MeinPaket_Model_
|
|
| 418 |
$variantGroupNode->appendChild ( $titleNode );
|
| 419 |
$titleNode->appendChild ( $this->getDocument ()->createTextNode ( $product->getName () ) );
|
| 420 |
|
|
|
|
|
|
|
| 421 |
$simpleCollection = $configurableType->getUsedProductCollection ()->addAttributeToSelect ( '*' )->addFilterByRequiredOptions ();
|
| 422 |
foreach ( $simpleCollection as $simpleProduct ) {
|
| 423 |
$this->handleSimpleProduct ( $simpleProduct, $product );
|
| 6 |
* @category Dhl
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml_Partial
|
| 9 |
+
* @subpackage Dhl_MeinPaketCommon_Model_Xml_Partial
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_Request_UploadRequest extends Dhl_MeinPaketCommon_Model_Xml_AbstractXmlRequest {
|
| 12 |
/**
|
| 13 |
*
|
| 14 |
* @var DOMNode
|
| 42 |
|
| 43 |
/**
|
| 44 |
*
|
| 45 |
+
* @var Dhl_MeinPaketCommon_Helper_Product
|
| 46 |
*/
|
| 47 |
protected $productHelper = null;
|
| 48 |
|
| 69 |
|
| 70 |
/**
|
| 71 |
*
|
| 72 |
+
* @param Mage_Catalog_Model_Product $product
|
| 73 |
* @return DOMNode|Ambigous <boolean, DOMElement>
|
| 74 |
*/
|
| 75 |
public function addProductDescription(Mage_Catalog_Model_Product $product) {
|
| 91 |
public function addOffer(Mage_Catalog_Model_Product $product) {
|
| 92 |
$offer = $this->getDocument ()->createElement ( 'productOffer' );
|
| 93 |
|
| 94 |
+
if (! $product->getData ( 'sync_with_dhl_mein_paket' )) {
|
| 95 |
+
$this->removeProduct ( $product );
|
| 96 |
+
return false;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
// product id
|
| 100 |
$offer->appendChild ( $this->getDocument ()->createElement ( 'common:productId', $product->getId () ) );
|
| 101 |
|
| 112 |
}
|
| 113 |
|
| 114 |
// price
|
| 115 |
+
// Use final price to use timing
|
| 116 |
+
$price = Mage::getStoreConfigFlag ( 'meinpaket/product_attributes/use_available_special_price' ) && $product->getFinalPrice () > 0 ? $product->getFinalPrice () : $product->getPrice ();
|
| 117 |
+
$priceWithTax = Mage::helper ( 'tax' )->getPrice ( $product, $price );
|
| 118 |
+
$offer->appendChild ( $this->getDocument ()->createElement ( 'price', $priceWithTax ) );
|
| 119 |
|
| 120 |
// tax group
|
| 121 |
$taxGroup = $this->productHelper->getMeinPaketTaxGroup ( $product );
|
| 147 |
$this->getDeletions ()->appendChild ( $productDeletionNode );
|
| 148 |
$productIdNode = $this->getDocument ()->createElement ( 'common:productId', $product->getId () );
|
| 149 |
$productDeletionNode->appendChild ( $productIdNode );
|
| 150 |
+
|
| 151 |
+
$this->setHasData ();
|
| 152 |
}
|
| 153 |
}
|
| 154 |
public function addCategory(Mage_Catalog_Model_Product $product) {
|
| 155 |
+
// TODO:
|
|
|
|
|
|
|
|
|
|
| 156 |
}
|
| 157 |
public function removeCategory(Mage_Catalog_Model_Product $product) {
|
| 158 |
+
// TODO:
|
| 159 |
}
|
| 160 |
protected function getProductDescriptions() {
|
| 161 |
if ($this->productDescriptions == null) {
|
| 232 |
* to be exported
|
| 233 |
* @param string $variantGroup
|
| 234 |
* the product belongs to if available
|
| 235 |
+
* @throws Dhl_MeinPaketCommon_Model_Exception_InvalidDataException
|
| 236 |
+
* @throws Dhl_MeinPaketCommon_Model_Exception_MissingDataException
|
| 237 |
* @return DOMNode
|
| 238 |
*/
|
| 239 |
protected function handleSimpleProduct(Mage_Catalog_Model_Product $product, Mage_Catalog_Model_Product $configurableProduct = null) {
|
| 246 |
}
|
| 247 |
|
| 248 |
if (! $product->getData ( 'sync_with_dhl_mein_paket' ) && $configurableProduct == null) {
|
| 249 |
+
$this->removeProduct ( $product );
|
| 250 |
return false;
|
| 251 |
}
|
| 252 |
|
| 280 |
if (strlen ( $product->getName () ) > 0) {
|
| 281 |
$productDescription->appendChild ( $this->getCDATANode ( 'name', $product->getName () ) );
|
| 282 |
} else {
|
| 283 |
+
throw new Dhl_MeinPaketCommon_Model_Exception_InvalidDataException ( $product->getId (), 'name' );
|
| 284 |
}
|
| 285 |
|
| 286 |
// shortdescription
|
| 288 |
$shortDescription = $this->escapeStringForMeinPaket ( $product->getShortDescription () );
|
| 289 |
$productDescription->appendChild ( $this->getCDATANode ( 'shortDescription', $shortDescription ) );
|
| 290 |
} else {
|
| 291 |
+
throw new Dhl_MeinPaketCommon_Model_Exception_MissingDataException ( $product->getId (), 'shortDescription' );
|
| 292 |
}
|
| 293 |
|
| 294 |
// long description (optional) && (strlen > 0)
|
| 325 |
$mNode->setAttribute ( 'code', $meinpaketCategory );
|
| 326 |
$productDescription->appendChild ( $mNode );
|
| 327 |
} else {
|
| 328 |
+
throw new Dhl_MeinPaketCommon_Model_Exception_MissingDataException ( $product->getId (), 'dhl_marketplace_category_id' );
|
| 329 |
}
|
| 330 |
|
| 331 |
$this->exportAttributes ( $product, $productDescription, $configurableProduct );
|
| 406 |
return false;
|
| 407 |
}
|
| 408 |
|
| 409 |
+
if (! $product->getData ( 'sync_with_dhl_mein_paket' )) {
|
| 410 |
+
$this->removeProduct ( $product );
|
| 411 |
+
return false;
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
if ($product->getTypeId () != Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
|
| 415 |
return false;
|
| 416 |
}
|
| 431 |
$variantGroupNode->appendChild ( $titleNode );
|
| 432 |
$titleNode->appendChild ( $this->getDocument ()->createTextNode ( $product->getName () ) );
|
| 433 |
|
| 434 |
+
$this->setHasData ();
|
| 435 |
+
|
| 436 |
$simpleCollection = $configurableType->getUsedProductCollection ()->addAttributeToSelect ( '*' )->addFilterByRequiredOptions ();
|
| 437 |
foreach ( $simpleCollection as $simpleProduct ) {
|
| 438 |
$this->handleSimpleProduct ( $simpleProduct, $product );
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Abstract.php
RENAMED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
* @subpackage Model_Service
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
-
abstract class
|
| 12 |
|
| 13 |
/**
|
| 14 |
*
|
|
@@ -43,7 +43,7 @@ abstract class Dhl_MeinPaket_Model_Xml_Response_Abstract {
|
|
| 43 |
case 'productDeletion' :
|
| 44 |
case 'productDescription' :
|
| 45 |
case 'productOffer' :
|
| 46 |
-
$object = new
|
| 47 |
break;
|
| 48 |
case 'internationalPrice' :
|
| 49 |
case 'internationalPriceDeletion' :
|
| 8 |
* @subpackage Model_Service
|
| 9 |
* @version $Id$
|
| 10 |
*/
|
| 11 |
+
abstract class Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 12 |
|
| 13 |
/**
|
| 14 |
*
|
| 43 |
case 'productDeletion' :
|
| 44 |
case 'productDescription' :
|
| 45 |
case 'productOffer' :
|
| 46 |
+
$object = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId ( $errorChild );
|
| 47 |
break;
|
| 48 |
case 'internationalPrice' :
|
| 49 |
case 'internationalPriceDeletion' :
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/AsynchronousStatusResponse.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $requestId;
|
| 4 |
private $status;
|
| 5 |
public function __construct(DOMElement $domElement) {
|
|
@@ -39,25 +39,26 @@ class Dhl_MeinPaket_Model_Xml_Response_AsynchronousStatusResponse extends Dhl_Me
|
|
| 39 |
/**
|
| 40 |
* Parses the response of a sync request
|
| 41 |
*
|
| 42 |
-
* @return
|
| 43 |
*/
|
| 44 |
public function createOrUpdateAsync() {
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
| 53 |
return $this;
|
| 54 |
}
|
| 55 |
-
|
| 56 |
/**
|
| 57 |
* Process response
|
| 58 |
*/
|
| 59 |
public function process() {
|
| 60 |
-
$this->createOrUpdateAsync();
|
| 61 |
}
|
| 62 |
-
|
| 63 |
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $requestId;
|
| 4 |
private $status;
|
| 5 |
public function __construct(DOMElement $domElement) {
|
| 39 |
/**
|
| 40 |
* Parses the response of a sync request
|
| 41 |
*
|
| 42 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse
|
| 43 |
*/
|
| 44 |
public function createOrUpdateAsync() {
|
| 45 |
+
if (strlen ( $this->requestId ) > 0) {
|
| 46 |
+
/* @var $request Dhl_MeinPaketCommon_Model_Async */
|
| 47 |
+
$request = Mage::getModel ( 'meinpaketcommon/async' )->load ( $this->requestId, 'request_id' );
|
| 48 |
+
$request->setCreatedAt ( Varien_Date::now () );
|
| 49 |
+
$request->setUpdatedAt ( Varien_Date::now () );
|
| 50 |
+
$request->setRequestId ( $this->requestId );
|
| 51 |
+
$request->setStatus ( $this->status );
|
| 52 |
+
$request->save ();
|
| 53 |
+
}
|
| 54 |
|
| 55 |
return $this;
|
| 56 |
}
|
| 57 |
+
|
| 58 |
/**
|
| 59 |
* Process response
|
| 60 |
*/
|
| 61 |
public function process() {
|
| 62 |
+
$this->createOrUpdateAsync ();
|
| 63 |
}
|
|
|
|
| 64 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/DataResponse.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $confirmations = array ();
|
| 4 |
private $bestPrices = array ();
|
| 5 |
private $productData = array ();
|
|
@@ -18,19 +18,19 @@ class Dhl_MeinPaket_Model_Xml_Response_DataResponse extends Dhl_MeinPaket_Model_
|
|
| 18 |
foreach ( $domElement->childNodes as $downloadResponseEntries ) {
|
| 19 |
switch ($downloadResponseEntries->localName) {
|
| 20 |
case 'confirmation' :
|
| 21 |
-
$this->confirmations [] = new
|
| 22 |
break;
|
| 23 |
case 'bestPrice' :
|
| 24 |
-
$this->bestPrices [] = new
|
| 25 |
break;
|
| 26 |
case 'productData' :
|
| 27 |
-
$this->productData [] = new
|
| 28 |
break;
|
| 29 |
case 'merchantData' :
|
| 30 |
-
$this->merchantData [] = new
|
| 31 |
break;
|
| 32 |
case 'quotaData' :
|
| 33 |
-
$this->quotaData [] = new
|
| 34 |
break;
|
| 35 |
}
|
| 36 |
}
|
|
@@ -80,7 +80,7 @@ class Dhl_MeinPaket_Model_Xml_Response_DataResponse extends Dhl_MeinPaket_Model_
|
|
| 80 |
|
| 81 |
try {
|
| 82 |
$transaction->beginTransaction ();
|
| 83 |
-
/* @var $bestPrice
|
| 84 |
|
| 85 |
foreach ( $this->bestPrices as $bestPrice ) {
|
| 86 |
if (count ( $bestPrice->getCommonErrors () )) {
|
|
@@ -92,7 +92,7 @@ class Dhl_MeinPaket_Model_Xml_Response_DataResponse extends Dhl_MeinPaket_Model_
|
|
| 92 |
$price->delete ();
|
| 93 |
}
|
| 94 |
|
| 95 |
-
/* @var $bestPriceModel
|
| 96 |
$bestPriceModel = Mage::getModel ( 'meinpaket/bestPrice' );
|
| 97 |
$bestPriceModel->setProductId ( $bestPrice->getProductId () );
|
| 98 |
$bestPriceModel->setPrice ( $bestPrice->getPrice () );
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_DataResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $confirmations = array ();
|
| 4 |
private $bestPrices = array ();
|
| 5 |
private $productData = array ();
|
| 18 |
foreach ( $domElement->childNodes as $downloadResponseEntries ) {
|
| 19 |
switch ($downloadResponseEntries->localName) {
|
| 20 |
case 'confirmation' :
|
| 21 |
+
$this->confirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_Confirmation ( $downloadResponseEntries );
|
| 22 |
break;
|
| 23 |
case 'bestPrice' :
|
| 24 |
+
$this->bestPrices [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_BestPrice ( $downloadResponseEntries );
|
| 25 |
break;
|
| 26 |
case 'productData' :
|
| 27 |
+
$this->productData [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_ProductData ( $downloadResponseEntries );
|
| 28 |
break;
|
| 29 |
case 'merchantData' :
|
| 30 |
+
$this->merchantData [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_MerchantData ( $downloadResponseEntries );
|
| 31 |
break;
|
| 32 |
case 'quotaData' :
|
| 33 |
+
$this->quotaData [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_QuotaData ( $downloadResponseEntries );
|
| 34 |
break;
|
| 35 |
}
|
| 36 |
}
|
| 80 |
|
| 81 |
try {
|
| 82 |
$transaction->beginTransaction ();
|
| 83 |
+
/* @var $bestPrice Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_BestPrice */
|
| 84 |
|
| 85 |
foreach ( $this->bestPrices as $bestPrice ) {
|
| 86 |
if (count ( $bestPrice->getCommonErrors () )) {
|
| 92 |
$price->delete ();
|
| 93 |
}
|
| 94 |
|
| 95 |
+
/* @var $bestPriceModel Dhl_MeinPaketCommon_Model_BestPrice */
|
| 96 |
$bestPriceModel = Mage::getModel ( 'meinpaket/bestPrice' );
|
| 97 |
$bestPriceModel->setProductId ( $bestPrice->getProductId () );
|
| 98 |
$bestPriceModel->setPrice ( $bestPrice->getPrice () );
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/DownloadResponse.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $categories = array ();
|
| 4 |
private $productOffers = array ();
|
| 5 |
private $variantConfigurations = array ();
|
|
@@ -10,13 +10,13 @@ class Dhl_MeinPaket_Model_Xml_Response_DownloadResponse extends Dhl_MeinPaket_Mo
|
|
| 10 |
foreach ( $domElement->childNodes as $downloadResponseEntries ) {
|
| 11 |
switch ($downloadResponseEntries->localName) {
|
| 12 |
case 'category' :
|
| 13 |
-
$this->categories [] = new
|
| 14 |
break;
|
| 15 |
case 'productOffers' :
|
| 16 |
-
// $this->productOfferConfirmations [] = new
|
| 17 |
break;
|
| 18 |
case 'variantConfiguration' :
|
| 19 |
-
$this->variantConfigurations [] = new
|
| 20 |
break;
|
| 21 |
}
|
| 22 |
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_DownloadResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $categories = array ();
|
| 4 |
private $productOffers = array ();
|
| 5 |
private $variantConfigurations = array ();
|
| 10 |
foreach ( $domElement->childNodes as $downloadResponseEntries ) {
|
| 11 |
switch ($downloadResponseEntries->localName) {
|
| 12 |
case 'category' :
|
| 13 |
+
$this->categories [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Category ( $downloadResponseEntries );
|
| 14 |
break;
|
| 15 |
case 'productOffers' :
|
| 16 |
+
// $this->productOfferConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId ( $downloadResponseEntries );
|
| 17 |
break;
|
| 18 |
case 'variantConfiguration' :
|
| 19 |
+
$this->variantConfigurations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_VariantConfiguration ( $downloadResponseEntries );
|
| 20 |
break;
|
| 21 |
}
|
| 22 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/NotificationResponse.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $confirmations = array ();
|
| 4 |
|
| 5 |
/**
|
|
@@ -14,7 +14,7 @@ class Dhl_MeinPaket_Model_Xml_Response_NotificationResponse extends Dhl_MeinPake
|
|
| 14 |
foreach ( $domElement->childNodes as $notificationResponseEntries ) {
|
| 15 |
switch ($notificationResponseEntries->localName) {
|
| 16 |
case 'confirmation' :
|
| 17 |
-
$this->confirmations [] = new
|
| 18 |
break;
|
| 19 |
}
|
| 20 |
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_NotificationResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $confirmations = array ();
|
| 4 |
|
| 5 |
/**
|
| 14 |
foreach ( $domElement->childNodes as $notificationResponseEntries ) {
|
| 15 |
switch ($notificationResponseEntries->localName) {
|
| 16 |
case 'confirmation' :
|
| 17 |
+
$this->confirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Confirmation ( $notificationResponseEntries );
|
| 18 |
break;
|
| 19 |
}
|
| 20 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Address.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
* Salutation.
|
| 5 |
*
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
/**
|
| 4 |
* Salutation.
|
| 5 |
*
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Attribute.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $code;
|
| 4 |
private $name;
|
| 5 |
private $variantAtributeValues = array ();
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Attribute extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $code;
|
| 4 |
private $name;
|
| 5 |
private $variantAtributeValues = array ();
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Category.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $code;
|
| 4 |
private $name;
|
| 5 |
private $shortDescription;
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Category extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $code;
|
| 4 |
private $name;
|
| 5 |
private $shortDescription;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/CategoryId.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $categoryCode;
|
| 4 |
public function __construct(DOMElement $domElement) {
|
| 5 |
parent::__construct ( $domElement );
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_CategoryId extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $categoryCode;
|
| 4 |
public function __construct(DOMElement $domElement) {
|
| 5 |
parent::__construct ( $domElement );
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/BestPrice.php
RENAMED
|
@@ -2,10 +2,8 @@
|
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
const OwNERSHIP_OWN = "OWN";
|
| 10 |
const OwNERSHIP_FOREIGN = "FOREIGN";
|
| 11 |
private $productId;
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
*/
|
| 6 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_BestPrice extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 7 |
const OwNERSHIP_OWN = "OWN";
|
| 8 |
const OwNERSHIP_FOREIGN = "FOREIGN";
|
| 9 |
private $productId;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/Confirmation.php
RENAMED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* @author stephan
|
| 6 |
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
| 5 |
* @author stephan
|
| 6 |
*
|
| 7 |
*/
|
| 8 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_Confirmation extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/MerchantData.php
RENAMED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* @author stephan
|
| 6 |
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
| 5 |
* @author stephan
|
| 6 |
*
|
| 7 |
*/
|
| 8 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_MerchantData extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/ProductData.php
RENAMED
|
@@ -2,10 +2,8 @@
|
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $entryId;
|
| 10 |
private $type;
|
| 11 |
private $marketplaceCategory;
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
*/
|
| 6 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_ProductData extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 7 |
private $entryId;
|
| 8 |
private $type;
|
| 9 |
private $marketplaceCategory;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/DataResponse/QuotaData.php
RENAMED
|
@@ -2,10 +2,8 @@
|
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
| 2 |
|
| 3 |
/**
|
| 4 |
*
|
|
|
|
|
|
|
| 5 |
*/
|
| 6 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_DataResponse_QuotaData extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 7 |
private $customerId;
|
| 8 |
private $email;
|
| 9 |
public function __construct(DOMElement $domElement) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Confirmation.php
RENAMED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $cancellationConfirmation = array ();
|
| 10 |
private $consignmentConfirmation = array ();
|
| 11 |
private $trackingNumberConfirmation = array ();
|
|
@@ -23,19 +20,19 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_NotificationResponse_Confirmation
|
|
| 23 |
foreach ( $domElement->childNodes as $childNode ) {
|
| 24 |
switch ($childNode->localName) {
|
| 25 |
case 'cancellation' :
|
| 26 |
-
$this->cancellationConfirmation [] = new
|
| 27 |
break;
|
| 28 |
case 'consignment' :
|
| 29 |
-
$this->consignmentConfirmation [] = new
|
| 30 |
break;
|
| 31 |
case 'trackingNumber' :
|
| 32 |
-
$this->trackingNumberConfirmation [] = new
|
| 33 |
break;
|
| 34 |
case 'return' :
|
| 35 |
-
$this->returnConfirmation [] = new
|
| 36 |
break;
|
| 37 |
case 'creditMemo' :
|
| 38 |
-
$this->creditMemoConfirmation [] = new
|
| 39 |
break;
|
| 40 |
}
|
| 41 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
|
|
|
|
|
|
|
|
|
| 4 |
*/
|
| 5 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Confirmation extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 6 |
private $cancellationConfirmation = array ();
|
| 7 |
private $consignmentConfirmation = array ();
|
| 8 |
private $trackingNumberConfirmation = array ();
|
| 20 |
foreach ( $domElement->childNodes as $childNode ) {
|
| 21 |
switch ($childNode->localName) {
|
| 22 |
case 'cancellation' :
|
| 23 |
+
$this->cancellationConfirmation [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Consignment ( $childNode );
|
| 24 |
break;
|
| 25 |
case 'consignment' :
|
| 26 |
+
$this->consignmentConfirmation [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Consignment ( $childNode );
|
| 27 |
break;
|
| 28 |
case 'trackingNumber' :
|
| 29 |
+
$this->trackingNumberConfirmation [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Consignment ( $childNode );
|
| 30 |
break;
|
| 31 |
case 'return' :
|
| 32 |
+
$this->returnConfirmation [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Return ( $childNode );
|
| 33 |
break;
|
| 34 |
case 'creditMemo' :
|
| 35 |
+
$this->creditMemoConfirmation [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Credit ( $childNode );
|
| 36 |
break;
|
| 37 |
}
|
| 38 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Consignment.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
|
@@ -34,4 +34,4 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_NotificationResponse_Consignment
|
|
| 34 |
public function __toString() {
|
| 35 |
return $this->consignmentId;
|
| 36 |
}
|
| 37 |
-
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Consignment extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
| 34 |
public function __toString() {
|
| 35 |
return $this->consignmentId;
|
| 36 |
}
|
| 37 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Credit.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
|
@@ -33,4 +33,4 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_NotificationResponse_Credit exten
|
|
| 33 |
public function __toString() {
|
| 34 |
return $this->returnId;
|
| 35 |
}
|
| 36 |
-
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Credit extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
| 33 |
public function __toString() {
|
| 34 |
return $this->returnId;
|
| 35 |
}
|
| 36 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/NotificationResponse/Return.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
|
@@ -33,4 +33,4 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_NotificationResponse_Return exten
|
|
| 33 |
public function __toString() {
|
| 34 |
return $this->returnId;
|
| 35 |
}
|
| 36 |
-
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_NotificationResponse_Return extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
* @var string
|
| 33 |
public function __toString() {
|
| 34 |
return $this->returnId;
|
| 35 |
}
|
| 36 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order.php
RENAMED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $orderId;
|
| 10 |
private $orderDate;
|
| 11 |
private $lastModificationDate;
|
|
@@ -16,17 +13,17 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_Order extends Dhl_MeinPaket_Model
|
|
| 16 |
private $deliveryMethod;
|
| 17 |
/**
|
| 18 |
*
|
| 19 |
-
* @var
|
| 20 |
*/
|
| 21 |
private $contactData; // ?
|
| 22 |
/**
|
| 23 |
*
|
| 24 |
-
* @var
|
| 25 |
*/
|
| 26 |
private $deliveryAddress;
|
| 27 |
/**
|
| 28 |
*
|
| 29 |
-
* @var
|
| 30 |
*/
|
| 31 |
private $billingAddress;
|
| 32 |
/**
|
|
@@ -37,7 +34,7 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_Order extends Dhl_MeinPaket_Model
|
|
| 37 |
|
| 38 |
/**
|
| 39 |
* Default constructor.
|
| 40 |
-
*
|
| 41 |
* @param DOMElement $domElement
|
| 42 |
*/
|
| 43 |
public function __construct(DOMElement $domElement) {
|
|
@@ -67,16 +64,16 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_Order extends Dhl_MeinPaket_Model
|
|
| 67 |
$this->deliveryMethod = $childNode->nodeValue;
|
| 68 |
break;
|
| 69 |
case 'contactData' :
|
| 70 |
-
$this->contactData = new
|
| 71 |
break;
|
| 72 |
case 'deliveryAddress' :
|
| 73 |
-
$this->deliveryAddress = new
|
| 74 |
break;
|
| 75 |
case 'billingAddress' :
|
| 76 |
-
$this->billingAddress = new
|
| 77 |
break;
|
| 78 |
case 'orderEntry' :
|
| 79 |
-
$this->entries [] = new
|
| 80 |
}
|
| 81 |
}
|
| 82 |
}
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
|
|
|
|
|
|
|
|
|
| 4 |
*/
|
| 5 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 6 |
private $orderId;
|
| 7 |
private $orderDate;
|
| 8 |
private $lastModificationDate;
|
| 13 |
private $deliveryMethod;
|
| 14 |
/**
|
| 15 |
*
|
| 16 |
+
* @var Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_ContactData
|
| 17 |
*/
|
| 18 |
private $contactData; // ?
|
| 19 |
/**
|
| 20 |
*
|
| 21 |
+
* @var Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address
|
| 22 |
*/
|
| 23 |
private $deliveryAddress;
|
| 24 |
/**
|
| 25 |
*
|
| 26 |
+
* @var Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address
|
| 27 |
*/
|
| 28 |
private $billingAddress;
|
| 29 |
/**
|
| 34 |
|
| 35 |
/**
|
| 36 |
* Default constructor.
|
| 37 |
+
*
|
| 38 |
* @param DOMElement $domElement
|
| 39 |
*/
|
| 40 |
public function __construct(DOMElement $domElement) {
|
| 64 |
$this->deliveryMethod = $childNode->nodeValue;
|
| 65 |
break;
|
| 66 |
case 'contactData' :
|
| 67 |
+
$this->contactData = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_ContactData ( $childNode );
|
| 68 |
break;
|
| 69 |
case 'deliveryAddress' :
|
| 70 |
+
$this->deliveryAddress = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address ( $childNode );
|
| 71 |
break;
|
| 72 |
case 'billingAddress' :
|
| 73 |
+
$this->billingAddress = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Address ( $childNode );
|
| 74 |
break;
|
| 75 |
case 'orderEntry' :
|
| 76 |
+
$this->entries [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_Entry ( $childNode );
|
| 77 |
}
|
| 78 |
}
|
| 79 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order/ContactData.php
RENAMED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $customerId;
|
| 10 |
private $email;
|
| 11 |
public function __construct(DOMElement $domElement) {
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
|
|
|
|
|
|
|
|
|
| 4 |
*/
|
| 5 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_ContactData extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 6 |
private $customerId;
|
| 7 |
private $email;
|
| 8 |
public function __construct(DOMElement $domElement) {
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/Order/Entry.php
RENAMED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
-
*
|
| 5 |
-
* @author stephan
|
| 6 |
-
*
|
| 7 |
*/
|
| 8 |
-
class
|
| 9 |
private $productId;
|
| 10 |
private $meinPaketId;
|
| 11 |
private $ean;
|
| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
|
|
|
|
|
|
|
|
|
| 4 |
*/
|
| 5 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order_Entry extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 6 |
private $productId;
|
| 7 |
private $meinPaketId;
|
| 8 |
private $ean;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/ProductId.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $productId;
|
| 4 |
private $meinPaketId;
|
| 5 |
private $ean;
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $productId;
|
| 4 |
private $meinPaketId;
|
| 5 |
private $ean;
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/Partial/VariantConfiguration.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $code;
|
| 4 |
private $indexAsGroup;
|
| 5 |
private $variantSelectionRule;
|
|
@@ -21,7 +21,7 @@ class Dhl_MeinPaket_Model_Xml_Response_Partial_VariantConfiguration extends Dhl_
|
|
| 21 |
$this->description = $childNode->nodeValue;
|
| 22 |
break;
|
| 23 |
case 'requiredAttribute' :
|
| 24 |
-
$this->requiredAttributes [] = new
|
| 25 |
break;
|
| 26 |
}
|
| 27 |
}
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_Partial_VariantConfiguration extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $code;
|
| 4 |
private $indexAsGroup;
|
| 5 |
private $variantSelectionRule;
|
| 21 |
$this->description = $childNode->nodeValue;
|
| 22 |
break;
|
| 23 |
case 'requiredAttribute' :
|
| 24 |
+
$this->requiredAttributes [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Attribute ( $childNode );
|
| 25 |
break;
|
| 26 |
}
|
| 27 |
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Xml/Response/QueryResponse.php
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* @var $orders array
|
| 6 |
+
*/
|
| 7 |
+
private $orders = array ();
|
| 8 |
+
|
| 9 |
+
/**
|
| 10 |
+
*
|
| 11 |
+
* @var $shoppingCartStatusResponses array
|
| 12 |
+
*/
|
| 13 |
+
private $shoppingCartStatusResponses = array ();
|
| 14 |
+
|
| 15 |
+
/**
|
| 16 |
+
* Constructor
|
| 17 |
+
*
|
| 18 |
+
* @param unknown $domElement
|
| 19 |
+
*/
|
| 20 |
+
public function __construct(DOMElement $domElement) {
|
| 21 |
+
parent::__construct ( $domElement );
|
| 22 |
+
assert ( $domElement->localName == 'queryResponse' );
|
| 23 |
+
|
| 24 |
+
foreach ( $domElement->childNodes as $queryResponseEntries ) {
|
| 25 |
+
switch ($queryResponseEntries->localName) {
|
| 26 |
+
case 'order' :
|
| 27 |
+
$this->orders [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order ( $queryResponseEntries );
|
| 28 |
+
break;
|
| 29 |
+
case 'shoppingCartStatusResponse' :
|
| 30 |
+
$this->parseShoppingCartStatusResponse ( $queryResponseEntries );
|
| 31 |
+
break;
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Parse cart status.
|
| 38 |
+
*
|
| 39 |
+
* <cartStatus>
|
| 40 |
+
*
|
| 41 |
+
* @param DOMElement $domElement
|
| 42 |
+
*/
|
| 43 |
+
protected function parseShoppingCartStatusResponse(DOMElement $domElement) {
|
| 44 |
+
assert ( $domElement->localName == 'shoppingCartStatusResponse' );
|
| 45 |
+
|
| 46 |
+
foreach ( $domElement->childNodes as $childNode ) {
|
| 47 |
+
switch ($childNode->localName) {
|
| 48 |
+
case 'cartStatus' :
|
| 49 |
+
$this->parseShoppingCartStatusResponseCartStatus ( $childNode );
|
| 50 |
+
break;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* Parse cart status elements.
|
| 57 |
+
*
|
| 58 |
+
* <externalId>0001</externalId>
|
| 59 |
+
* <shoppingCartStatusValue>Pending</shoppingCartStatusValue>
|
| 60 |
+
*
|
| 61 |
+
* @param DOMElement $domElement
|
| 62 |
+
*/
|
| 63 |
+
protected function parseShoppingCartStatusResponseCartStatus(DOMElement $domElement) {
|
| 64 |
+
assert ( $domElement->localName == 'cartStatus' );
|
| 65 |
+
|
| 66 |
+
$cartId = null;
|
| 67 |
+
|
| 68 |
+
foreach ( $domElement->childNodes as $childNode ) {
|
| 69 |
+
switch ($childNode->localName) {
|
| 70 |
+
case 'externalId' :
|
| 71 |
+
$cartId = $childNode->nodeValue;
|
| 72 |
+
break;
|
| 73 |
+
case 'shoppingCartStatusValue' :
|
| 74 |
+
if ($cartId != null) {
|
| 75 |
+
$this->shoppingCartStatusResponses [$cartId] = $childNode->nodeValue;
|
| 76 |
+
$cartId = null;
|
| 77 |
+
}
|
| 78 |
+
break;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
*
|
| 85 |
+
* @return $orders
|
| 86 |
+
*/
|
| 87 |
+
public function getOrders() {
|
| 88 |
+
return $this->orders;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/**
|
| 92 |
+
*
|
| 93 |
+
* @return $shoppingCartStatusResponses
|
| 94 |
+
*/
|
| 95 |
+
public function getShoppingCartStatusResponses() {
|
| 96 |
+
return $this->shoppingCartStatusResponses;
|
| 97 |
+
}
|
| 98 |
+
}
|
app/code/community/Dhl/MeinPaketCommon/Model/Xml/Response/SubmitCartResponse.php
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_SubmitCartResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
+
private $cartId;
|
| 4 |
+
private $redirectURL;
|
| 5 |
+
public function __construct(DOMElement $domElement) {
|
| 6 |
+
parent::__construct ( $domElement );
|
| 7 |
+
assert ( $domElement->localName == 'submitCartResponse' );
|
| 8 |
+
|
| 9 |
+
foreach ( $domElement->childNodes as $submitCartResponseChildNode ) {
|
| 10 |
+
switch ($submitCartResponseChildNode->localName) {
|
| 11 |
+
case 'cartId' :
|
| 12 |
+
$this->cartId = $submitCartResponseChildNode->nodeValue;
|
| 13 |
+
break;
|
| 14 |
+
case 'redirectURL' :
|
| 15 |
+
$this->redirectURL = $submitCartResponseChildNode->nodeValue;
|
| 16 |
+
break;
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
public function getCartId() {
|
| 21 |
+
return $this->cartId;
|
| 22 |
+
}
|
| 23 |
+
public function getRedirectURL() {
|
| 24 |
+
return $this->redirectURL;
|
| 25 |
+
}
|
| 26 |
+
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/Response/UploadResponse.php
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<?php
|
| 2 |
-
class
|
| 3 |
private $warnings = array ();
|
| 4 |
private $categoryDeletionConfirmations = array ();
|
| 5 |
private $categoryConfirmations = array ();
|
|
@@ -22,19 +22,19 @@ class Dhl_MeinPaket_Model_Xml_Response_UploadResponse extends Dhl_MeinPaket_Mode
|
|
| 22 |
foreach ( $uploadResponseEntries->childNodes as $confirmationEntries ) {
|
| 23 |
switch ($confirmationEntries->localName) {
|
| 24 |
case 'categoryDeletion' :
|
| 25 |
-
$this->categoryDeletionConfirmations [] = new
|
| 26 |
break;
|
| 27 |
case 'category' :
|
| 28 |
-
$this->categoryConfirmations [] = new
|
| 29 |
break;
|
| 30 |
case 'productDeletion' :
|
| 31 |
-
$this->productDeletionConfirmations [] = new
|
| 32 |
break;
|
| 33 |
case 'productDescription' :
|
| 34 |
-
$this->productDescriptionConfirmations [] = new
|
| 35 |
break;
|
| 36 |
case 'productOffer' :
|
| 37 |
-
$this->productOfferConfirmations [] = new
|
| 38 |
break;
|
| 39 |
case 'variantGroup' :
|
| 40 |
break;
|
|
@@ -73,7 +73,7 @@ class Dhl_MeinPaket_Model_Xml_Response_UploadResponse extends Dhl_MeinPaket_Mode
|
|
| 73 |
/**
|
| 74 |
*/
|
| 75 |
public function deleteMeinPaketIds() {
|
| 76 |
-
/* @var $conf
|
| 77 |
foreach ( $this->productDeletionConfirmations as $conf ) {
|
| 78 |
/* @var $product Mage_Catalog_Model_Product */
|
| 79 |
$product = Mage::getModel ( 'catalog/product' )->load ( $conf->getProductId () );
|
| 1 |
<?php
|
| 2 |
+
class Dhl_MeinPaketCommon_Model_Xml_Response_UploadResponse extends Dhl_MeinPaketCommon_Model_Xml_Response_Abstract {
|
| 3 |
private $warnings = array ();
|
| 4 |
private $categoryDeletionConfirmations = array ();
|
| 5 |
private $categoryConfirmations = array ();
|
| 22 |
foreach ( $uploadResponseEntries->childNodes as $confirmationEntries ) {
|
| 23 |
switch ($confirmationEntries->localName) {
|
| 24 |
case 'categoryDeletion' :
|
| 25 |
+
$this->categoryDeletionConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_CategoryId ( $confirmationEntries );
|
| 26 |
break;
|
| 27 |
case 'category' :
|
| 28 |
+
$this->categoryConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_CategoryId ( $confirmationEntries );
|
| 29 |
break;
|
| 30 |
case 'productDeletion' :
|
| 31 |
+
$this->productDeletionConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId ( $confirmationEntries );
|
| 32 |
break;
|
| 33 |
case 'productDescription' :
|
| 34 |
+
$this->productDescriptionConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId ( $confirmationEntries );
|
| 35 |
break;
|
| 36 |
case 'productOffer' :
|
| 37 |
+
$this->productOfferConfirmations [] = new Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId ( $confirmationEntries );
|
| 38 |
break;
|
| 39 |
case 'variantGroup' :
|
| 40 |
break;
|
| 73 |
/**
|
| 74 |
*/
|
| 75 |
public function deleteMeinPaketIds() {
|
| 76 |
+
/* @var $conf Dhl_MeinPaketCommon_Model_Xml_Response_Partial_ProductId */
|
| 77 |
foreach ( $this->productDeletionConfirmations as $conf ) {
|
| 78 |
/* @var $product Mage_Catalog_Model_Product */
|
| 79 |
$product = Mage::getModel ( 'catalog/product' )->load ( $conf->getProductId () );
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/Model/Xml/XmlBuildException.php
RENAMED
|
@@ -7,8 +7,7 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 11 |
*/
|
| 12 |
-
class
|
| 13 |
}
|
| 14 |
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Model_Xml
|
| 9 |
* @version $Id$
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_XmlBuildException extends Varien_Exception {
|
| 12 |
}
|
| 13 |
|
app/code/community/Dhl/MeinPaketCommon/Model/Xml/XmlResponseParser.php
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Parses raw XML responses returned by the MeinPaket webservice.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Xml
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Model_Xml_XmlResponseParser extends Varien_Object {
|
| 12 |
+
/**
|
| 13 |
+
*
|
| 14 |
+
* @param DOMDocument $dom
|
| 15 |
+
* @return Dhl_MeinPaketCommon_Model_Xml_Response_Abstract
|
| 16 |
+
*/
|
| 17 |
+
public function parseResponse(DOMDocument $dom) {
|
| 18 |
+
if (! isset ( $dom->documentElement )) {
|
| 19 |
+
return null;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
$documentElement = $dom->documentElement;
|
| 23 |
+
|
| 24 |
+
/* @var $result Dhl_MeinPaketCommon_Model_Xml_Response_Abstract */
|
| 25 |
+
$result = null;
|
| 26 |
+
|
| 27 |
+
switch ($documentElement->localName) {
|
| 28 |
+
case 'asynchronousStatusResponse' :
|
| 29 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_AsynchronousStatusResponse ( $documentElement );
|
| 30 |
+
break;
|
| 31 |
+
case 'downloadResponse' :
|
| 32 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_DownloadResponse ( $documentElement );
|
| 33 |
+
break;
|
| 34 |
+
case 'uploadResponse' :
|
| 35 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_UploadResponse ( $documentElement );
|
| 36 |
+
break;
|
| 37 |
+
case 'dataResponse' :
|
| 38 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_DataResponse ( $documentElement );
|
| 39 |
+
break;
|
| 40 |
+
case 'notificationResponse' :
|
| 41 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_NotificationResponse ( $documentElement );
|
| 42 |
+
break;
|
| 43 |
+
case 'queryResponse' :
|
| 44 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse ( $documentElement );
|
| 45 |
+
break;
|
| 46 |
+
case 'submitCartResponse' :
|
| 47 |
+
$result = new Dhl_MeinPaketCommon_Model_Xml_Response_SubmitCartResponse ( $documentElement );
|
| 48 |
+
break;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
if ($result != null) {
|
| 52 |
+
$result->process ();
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
return $result;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/AsyncController.php
RENAMED
|
@@ -3,9 +3,9 @@
|
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
*/
|
| 6 |
-
class
|
| 7 |
protected function _initAction() {
|
| 8 |
-
$this->loadLayout ()->_setActiveMenu ( '
|
| 9 |
return $this;
|
| 10 |
}
|
| 11 |
public function indexAction() {
|
|
@@ -13,12 +13,12 @@ class Dhl_MeinPaket_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_
|
|
| 13 |
}
|
| 14 |
public function exportCsvAction() {
|
| 15 |
$fileName = 'async.csv';
|
| 16 |
-
$grid = $this->getLayout ()->createBlock ( '
|
| 17 |
$this->_prepareDownloadResponse ( $fileName, $grid->getCsvFile () );
|
| 18 |
}
|
| 19 |
public function exportExcelAction() {
|
| 20 |
$fileName = 'async.xml';
|
| 21 |
-
$grid = $this->getLayout ()->createBlock ( '
|
| 22 |
$this->_prepareDownloadResponse ( $fileName, $grid->getExcelFile ( $fileName ) );
|
| 23 |
}
|
| 24 |
public function massDeleteAction() {
|
|
@@ -27,7 +27,7 @@ class Dhl_MeinPaket_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_
|
|
| 27 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'meinpaket' )->__ ( 'Please select async entries.' ) );
|
| 28 |
} else {
|
| 29 |
try {
|
| 30 |
-
$asyncModel = Mage::getModel ( '
|
| 31 |
foreach ( $asyncIds as $asyncId ) {
|
| 32 |
$asyncModel->load ( $asyncId )->delete ();
|
| 33 |
}
|
|
@@ -46,7 +46,7 @@ class Dhl_MeinPaket_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_
|
|
| 46 |
*/
|
| 47 |
public function scheduleAction() {
|
| 48 |
$cronjobs = $this->getCronjobs ();
|
| 49 |
-
Mage::helper ( '
|
| 50 |
$this->_redirect ( '*/*/index' );
|
| 51 |
}
|
| 52 |
|
|
@@ -57,7 +57,7 @@ class Dhl_MeinPaket_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_
|
|
| 57 |
*/
|
| 58 |
public function runAction() {
|
| 59 |
$cronjobs = $this->getCronjobs ();
|
| 60 |
-
Mage::helper ( '
|
| 61 |
$this->_redirect ( '*/*/index' );
|
| 62 |
}
|
| 63 |
|
|
@@ -84,6 +84,6 @@ class Dhl_MeinPaket_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_
|
|
| 84 |
*/
|
| 85 |
public function gridAction() {
|
| 86 |
$this->loadLayout ();
|
| 87 |
-
$this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( '
|
| 88 |
}
|
| 89 |
}
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
*/
|
| 6 |
+
class Dhl_MeinPaketCommon_Adminhtml_AsyncController extends Mage_Adminhtml_Controller_Action {
|
| 7 |
protected function _initAction() {
|
| 8 |
+
$this->loadLayout ()->_setActiveMenu ( 'meinpaketcommon/async' )->_addBreadcrumb ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Async' ), Mage::helper ( 'meinpaketcommon' )->__ ( 'Async' ) );
|
| 9 |
return $this;
|
| 10 |
}
|
| 11 |
public function indexAction() {
|
| 13 |
}
|
| 14 |
public function exportCsvAction() {
|
| 15 |
$fileName = 'async.csv';
|
| 16 |
+
$grid = $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_async_grid' );
|
| 17 |
$this->_prepareDownloadResponse ( $fileName, $grid->getCsvFile () );
|
| 18 |
}
|
| 19 |
public function exportExcelAction() {
|
| 20 |
$fileName = 'async.xml';
|
| 21 |
+
$grid = $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_async_grid' );
|
| 22 |
$this->_prepareDownloadResponse ( $fileName, $grid->getExcelFile ( $fileName ) );
|
| 23 |
}
|
| 24 |
public function massDeleteAction() {
|
| 27 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'meinpaket' )->__ ( 'Please select async entries.' ) );
|
| 28 |
} else {
|
| 29 |
try {
|
| 30 |
+
$asyncModel = Mage::getModel ( 'meinpaketcommon/async' );
|
| 31 |
foreach ( $asyncIds as $asyncId ) {
|
| 32 |
$asyncModel->load ( $asyncId )->delete ();
|
| 33 |
}
|
| 46 |
*/
|
| 47 |
public function scheduleAction() {
|
| 48 |
$cronjobs = $this->getCronjobs ();
|
| 49 |
+
Mage::helper ( 'meinpaketcommon/cron' )->scheduleJobs ( $cronjobs, true );
|
| 50 |
$this->_redirect ( '*/*/index' );
|
| 51 |
}
|
| 52 |
|
| 57 |
*/
|
| 58 |
public function runAction() {
|
| 59 |
$cronjobs = $this->getCronjobs ();
|
| 60 |
+
Mage::helper ( 'meinpaketcommon/cron' )->runJobs ( $cronjobs, true );
|
| 61 |
$this->_redirect ( '*/*/index' );
|
| 62 |
}
|
| 63 |
|
| 84 |
*/
|
| 85 |
public function gridAction() {
|
| 86 |
$this->loadLayout ();
|
| 87 |
+
$this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_async_grid' )->toHtml () );
|
| 88 |
}
|
| 89 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/LogController.php
RENAMED
|
@@ -3,9 +3,9 @@
|
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
*/
|
| 6 |
-
class
|
| 7 |
protected function _initAction() {
|
| 8 |
-
$this->loadLayout ()->_setActiveMenu ( '
|
| 9 |
return $this;
|
| 10 |
}
|
| 11 |
public function indexAction() {
|
|
@@ -13,25 +13,25 @@ class Dhl_MeinPaket_Adminhtml_LogController extends Mage_Adminhtml_Controller_Ac
|
|
| 13 |
}
|
| 14 |
public function exportCsvAction() {
|
| 15 |
$fileName = 'log.csv';
|
| 16 |
-
$grid = $this->getLayout ()->createBlock ( '
|
| 17 |
$this->_prepareDownloadResponse ( $fileName, $grid->getCsvFile () );
|
| 18 |
}
|
| 19 |
public function exportExcelAction() {
|
| 20 |
$fileName = 'log.xml';
|
| 21 |
-
$grid = $this->getLayout ()->createBlock ( '
|
| 22 |
$this->_prepareDownloadResponse ( $fileName, $grid->getExcelFile ( $fileName ) );
|
| 23 |
}
|
| 24 |
public function massDeleteAction() {
|
| 25 |
$logIds = $this->getRequest ()->getParam ( 'logIds' );
|
| 26 |
if (! is_array ( $logIds )) {
|
| 27 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( '
|
| 28 |
} else {
|
| 29 |
try {
|
| 30 |
-
$logModel = Mage::getModel ( '
|
| 31 |
foreach ( $logIds as $logId ) {
|
| 32 |
$logModel->load ( $logId )->delete ();
|
| 33 |
}
|
| 34 |
-
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( '
|
| 35 |
} catch ( Exception $e ) {
|
| 36 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
|
| 37 |
}
|
|
@@ -41,17 +41,17 @@ class Dhl_MeinPaket_Adminhtml_LogController extends Mage_Adminhtml_Controller_Ac
|
|
| 41 |
public function massProcessAction() {
|
| 42 |
$logIds = $this->getRequest ()->getParam ( 'logIds' );
|
| 43 |
if (! is_array ( $logIds )) {
|
| 44 |
-
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( '
|
| 45 |
} else {
|
| 46 |
try {
|
| 47 |
-
$logModel = Mage::getModel ( '
|
| 48 |
foreach ( $logIds as $logId ) {
|
| 49 |
$logModel->load ( $logId );
|
| 50 |
-
$xmlDocument = new DOMDocument();
|
| 51 |
-
$xmlDocument->loadXML($logModel->getReceived());
|
| 52 |
-
Mage::getModel('
|
| 53 |
}
|
| 54 |
-
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( '
|
| 55 |
} catch ( Exception $e ) {
|
| 56 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
|
| 57 |
}
|
|
@@ -59,13 +59,12 @@ class Dhl_MeinPaket_Adminhtml_LogController extends Mage_Adminhtml_Controller_Ac
|
|
| 59 |
$this->_redirect ( '*/*/index' );
|
| 60 |
}
|
| 61 |
|
| 62 |
-
|
| 63 |
/**
|
| 64 |
* Product grid for AJAX request.
|
| 65 |
* Sort and filter result for example.
|
| 66 |
*/
|
| 67 |
public function gridAction() {
|
| 68 |
$this->loadLayout ();
|
| 69 |
-
$this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( '
|
| 70 |
}
|
| 71 |
}
|
| 3 |
/**
|
| 4 |
*
|
| 5 |
*/
|
| 6 |
+
class Dhl_MeinPaketCommon_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action {
|
| 7 |
protected function _initAction() {
|
| 8 |
+
$this->loadLayout ()->_setActiveMenu ( 'meinpaketcommon/log' )->_addBreadcrumb ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Log' ), Mage::helper ( 'meinpaketcommon' )->__ ( 'Log' ) );
|
| 9 |
return $this;
|
| 10 |
}
|
| 11 |
public function indexAction() {
|
| 13 |
}
|
| 14 |
public function exportCsvAction() {
|
| 15 |
$fileName = 'log.csv';
|
| 16 |
+
$grid = $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_log_grid' );
|
| 17 |
$this->_prepareDownloadResponse ( $fileName, $grid->getCsvFile () );
|
| 18 |
}
|
| 19 |
public function exportExcelAction() {
|
| 20 |
$fileName = 'log.xml';
|
| 21 |
+
$grid = $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_log_grid' );
|
| 22 |
$this->_prepareDownloadResponse ( $fileName, $grid->getExcelFile ( $fileName ) );
|
| 23 |
}
|
| 24 |
public function massDeleteAction() {
|
| 25 |
$logIds = $this->getRequest ()->getParam ( 'logIds' );
|
| 26 |
if (! is_array ( $logIds )) {
|
| 27 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Please select log entries.' ) );
|
| 28 |
} else {
|
| 29 |
try {
|
| 30 |
+
$logModel = Mage::getModel ( 'meinpaketcommon/log' );
|
| 31 |
foreach ( $logIds as $logId ) {
|
| 32 |
$logModel->load ( $logId )->delete ();
|
| 33 |
}
|
| 34 |
+
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Total of %d record(s) were deleted.', count ( $logIds ) ) );
|
| 35 |
} catch ( Exception $e ) {
|
| 36 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
|
| 37 |
}
|
| 41 |
public function massProcessAction() {
|
| 42 |
$logIds = $this->getRequest ()->getParam ( 'logIds' );
|
| 43 |
if (! is_array ( $logIds )) {
|
| 44 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Please select log entries.' ) );
|
| 45 |
} else {
|
| 46 |
try {
|
| 47 |
+
$logModel = Mage::getModel ( 'meinpaketcommon/log' );
|
| 48 |
foreach ( $logIds as $logId ) {
|
| 49 |
$logModel->load ( $logId );
|
| 50 |
+
$xmlDocument = new DOMDocument ();
|
| 51 |
+
$xmlDocument->loadXML ( $logModel->getReceived () );
|
| 52 |
+
Mage::getModel ( 'meinpaketcommon/xml_xmlResponseParser' )->parseResponse ( $xmlDocument );
|
| 53 |
}
|
| 54 |
+
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( Mage::helper ( 'meinpaketcommon' )->__ ( 'Total of %d record(s) were deleted.', count ( $logIds ) ) );
|
| 55 |
} catch ( Exception $e ) {
|
| 56 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );
|
| 57 |
}
|
| 59 |
$this->_redirect ( '*/*/index' );
|
| 60 |
}
|
| 61 |
|
|
|
|
| 62 |
/**
|
| 63 |
* Product grid for AJAX request.
|
| 64 |
* Sort and filter result for example.
|
| 65 |
*/
|
| 66 |
public function gridAction() {
|
| 67 |
$this->loadLayout ();
|
| 68 |
+
$this->getResponse ()->setBody ( $this->getLayout ()->createBlock ( 'meinpaketcommon/adminhtml_log_grid' )->toHtml () );
|
| 69 |
}
|
| 70 |
}
|
app/code/community/Dhl/{MeinPaket → MeinPaketCommon}/controllers/Adminhtml/OrderImportController.php
RENAMED
|
@@ -7,10 +7,8 @@
|
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
| 10 |
-
* @author Daniel Pötzinger <daniel.poetzinger@aoemedia.de>
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
-
class
|
| 14 |
/**
|
| 15 |
* Initialized the controller.
|
| 16 |
*
|
|
@@ -39,7 +37,7 @@ class Dhl_MeinPaket_Adminhtml_OrderImportController extends Mage_Adminhtml_Contr
|
|
| 39 |
*/
|
| 40 |
public function importAction() {
|
| 41 |
/* @var $OrderImportService Dhl_MeinPaket_Model_Order_ImportService */
|
| 42 |
-
$OrderImportService = Mage::getModel ( '
|
| 43 |
$startdate = $this->getRequest ()->getParam ( 'startdate', 0 );
|
| 44 |
$enddate = $this->getRequest ()->getParam ( 'enddate', 0 );
|
| 45 |
|
|
@@ -93,6 +91,11 @@ class Dhl_MeinPaket_Adminhtml_OrderImportController extends Mage_Adminhtml_Contr
|
|
| 93 |
$disabledDhlOrderIds = implode ( ', ', $OrderImportService->getDisabledProductOrders () );
|
| 94 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $message . " " . $disabledDhlOrderIds );
|
| 95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
|
| 98 |
$this->_initAction ();
|
| 7 |
* @package Dhl_MeinPaket
|
| 8 |
* @subpackage Adminhtml
|
| 9 |
* @version $Id$
|
|
|
|
|
|
|
| 10 |
*/
|
| 11 |
+
class Dhl_MeinPaketCommon_Adminhtml_OrderImportController extends Mage_Adminhtml_Controller_Action {
|
| 12 |
/**
|
| 13 |
* Initialized the controller.
|
| 14 |
*
|
| 37 |
*/
|
| 38 |
public function importAction() {
|
| 39 |
/* @var $OrderImportService Dhl_MeinPaket_Model_Order_ImportService */
|
| 40 |
+
$OrderImportService = Mage::getModel ( 'meinpaketcommon/Order_ImportService' );
|
| 41 |
$startdate = $this->getRequest ()->getParam ( 'startdate', 0 );
|
| 42 |
$enddate = $this->getRequest ()->getParam ( 'enddate', 0 );
|
| 43 |
|
| 91 |
$disabledDhlOrderIds = implode ( ', ', $OrderImportService->getDisabledProductOrders () );
|
| 92 |
Mage::getSingleton ( 'adminhtml/session' )->addError ( $message . " " . $disabledDhlOrderIds );
|
| 93 |
}
|
| 94 |
+
|
| 95 |
+
if ($orderCount ['invalid'] > 0) {
|
| 96 |
+
$message = sprintf ( __ ( 'Skipped %s order(s) because: some or all of the included products were invalid for import. Please process the following order(s) at your MeinPaket.de dealer area:' ), $orderCount ['invalid'] );
|
| 97 |
+
Mage::getSingleton ( 'adminhtml/session' )->addError ( $message );
|
| 98 |
+
}
|
| 99 |
}
|
| 100 |
|
| 101 |
$this->_initAction ();
|
app/code/community/Dhl/MeinPaketCommon/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<menu>
|
| 4 |
+
<meinpaket>
|
| 5 |
+
<title>MeinPaket.de</title>
|
| 6 |
+
<children>
|
| 7 |
+
<meinpaket_log translate="title" module="meinpaketcommon">
|
| 8 |
+
<title>Log</title>
|
| 9 |
+
<action>meinpaketcommon/adminhtml_log</action>
|
| 10 |
+
</meinpaket_log>
|
| 11 |
+
<meinpaket_async translate="title" module="meinpaketcommon">
|
| 12 |
+
<title>Async</title>
|
| 13 |
+
<action>meinpaketcommon/adminhtml_async</action>
|
| 14 |
+
</meinpaket_async>
|
| 15 |
+
</children>
|
| 16 |
+
<sort_order>90</sort_order>
|
| 17 |
+
<class>meinpaket</class>
|
| 18 |
+
</meinpaket>
|
| 19 |
+
</menu>
|
| 20 |
+
<acl>
|
| 21 |
+
<resources>
|
| 22 |
+
<admin>
|
| 23 |
+
<children>
|
| 24 |
+
<system>
|
| 25 |
+
<children>
|
| 26 |
+
<config>
|
| 27 |
+
<children>
|
| 28 |
+
<meinpaket translate="title" module="meinpaketcommon">
|
| 29 |
+
<title>MeinPaket.de</title>
|
| 30 |
+
<sort_order>100</sort_order>
|
| 31 |
+
</meinpaket>
|
| 32 |
+
</children>
|
| 33 |
+
</config>
|
| 34 |
+
</children>
|
| 35 |
+
</system>
|
| 36 |
+
</children>
|
| 37 |
+
</admin>
|
| 38 |
+
</resources>
|
| 39 |
+
</acl>
|
| 40 |
+
</config>
|
app/code/community/Dhl/MeinPaketCommon/etc/config.xml
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Dhl_MeinPaketCommon>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Dhl_MeinPaketCommon>
|
| 7 |
+
</modules>
|
| 8 |
+
<admin>
|
| 9 |
+
<routers>
|
| 10 |
+
<meinpaketcommon>
|
| 11 |
+
<use>admin</use>
|
| 12 |
+
<args>
|
| 13 |
+
<module>Dhl_MeinPaketCommon</module>
|
| 14 |
+
<frontName>meinpaketcommon</frontName>
|
| 15 |
+
</args>
|
| 16 |
+
</meinpaketcommon>
|
| 17 |
+
</routers>
|
| 18 |
+
</admin>
|
| 19 |
+
<adminhtml>
|
| 20 |
+
<translate>
|
| 21 |
+
<modules>
|
| 22 |
+
<meinpaketcommon>
|
| 23 |
+
<files>
|
| 24 |
+
<default>Dhl_MeinPaketCommon.csv</default>
|
| 25 |
+
</files>
|
| 26 |
+
</meinpaketcommon>
|
| 27 |
+
</modules>
|
| 28 |
+
</translate>
|
| 29 |
+
<layout>
|
| 30 |
+
<updates>
|
| 31 |
+
<meinpaketcommon>
|
| 32 |
+
<file>meinpaketcommon.xml</file>
|
| 33 |
+
</meinpaketcommon>
|
| 34 |
+
</updates>
|
| 35 |
+
</layout>
|
| 36 |
+
</adminhtml>
|
| 37 |
+
<crontab>
|
| 38 |
+
<jobs>
|
| 39 |
+
<meinpaket_processAsyncTasks>
|
| 40 |
+
<schedule>
|
| 41 |
+
<config_path>meinpaket/cron/async</config_path>
|
| 42 |
+
</schedule>
|
| 43 |
+
<run>
|
| 44 |
+
<model>meinpaketcommon/cron::processAsyncTasks</model>
|
| 45 |
+
</run>
|
| 46 |
+
</meinpaket_processAsyncTasks>
|
| 47 |
+
<meinpaket_importOrders>
|
| 48 |
+
<schedule>
|
| 49 |
+
<config_path>meinpaket/cron/order</config_path>
|
| 50 |
+
</schedule>
|
| 51 |
+
<run>
|
| 52 |
+
<model>meinpaketcommon/cron::importOrders</model>
|
| 53 |
+
</run>
|
| 54 |
+
</meinpaket_importOrders>
|
| 55 |
+
<meinpaketcommon_cleanup>
|
| 56 |
+
<schedule>
|
| 57 |
+
<config_path>meinpaketcommon/cron/cleanup</config_path>
|
| 58 |
+
</schedule>
|
| 59 |
+
<run>
|
| 60 |
+
<model>meinpaketcommon/cron::cleanup</model>
|
| 61 |
+
</run>
|
| 62 |
+
</meinpaketcommon_cleanup>
|
| 63 |
+
</jobs>
|
| 64 |
+
</crontab>
|
| 65 |
+
<default>
|
| 66 |
+
<payment>
|
| 67 |
+
<meinpaket>
|
| 68 |
+
<active>1</active>
|
| 69 |
+
<model>meinpaketcommon/payment_method_meinpaket</model>
|
| 70 |
+
<order_status>pending</order_status>
|
| 71 |
+
<title>MeinPaket</title>
|
| 72 |
+
<allowspecific>0</allowspecific>
|
| 73 |
+
<group>offline</group>
|
| 74 |
+
</meinpaket>
|
| 75 |
+
</payment>
|
| 76 |
+
<carriers>
|
| 77 |
+
<meinpaket>
|
| 78 |
+
<active>1</active>
|
| 79 |
+
<sallowspecific>0</sallowspecific>
|
| 80 |
+
<title>MeinPaket.de</title>
|
| 81 |
+
<name>MeinPaket</name>
|
| 82 |
+
<model>meinpaketcommon/carrier_meinpaket</model>
|
| 83 |
+
</meinpaket>
|
| 84 |
+
</carriers>
|
| 85 |
+
<meinpaket>
|
| 86 |
+
<endpoint>
|
| 87 |
+
<sandbox>0</sandbox>
|
| 88 |
+
<https>1</https>
|
| 89 |
+
<proxy></proxy>
|
| 90 |
+
<proxy_host></proxy_host>
|
| 91 |
+
<proxy_port></proxy_port>
|
| 92 |
+
</endpoint>
|
| 93 |
+
<shipment>
|
| 94 |
+
<default_shipment_method>flatrate_flatrate</default_shipment_method>
|
| 95 |
+
</shipment>
|
| 96 |
+
<cron>
|
| 97 |
+
<async>*/10 * * * *</async>
|
| 98 |
+
<cleanup>0 6 * * *</cleanup>
|
| 99 |
+
</cron>
|
| 100 |
+
</meinpaket>
|
| 101 |
+
</default>
|
| 102 |
+
<frontend>
|
| 103 |
+
<translate>
|
| 104 |
+
<modules>
|
| 105 |
+
<meinpaketcommon>
|
| 106 |
+
<files>
|
| 107 |
+
<default>Dhl_MeinPaket.csv</default>
|
| 108 |
+
</files>
|
| 109 |
+
</meinpaketcommon>
|
| 110 |
+
</modules>
|
| 111 |
+
</translate>
|
| 112 |
+
<routers>
|
| 113 |
+
<meinpaketcommon>
|
| 114 |
+
<use>standard</use>
|
| 115 |
+
<args>
|
| 116 |
+
<module>Dhl_MeinPaketCommon</module>
|
| 117 |
+
<frontName>meinpaketcommon</frontName>
|
| 118 |
+
</args>
|
| 119 |
+
</meinpaketcommon>
|
| 120 |
+
</routers>
|
| 121 |
+
<layout>
|
| 122 |
+
<updates>
|
| 123 |
+
<meinpaketcommon>
|
| 124 |
+
<file>meinpaketcommon.xml</file>
|
| 125 |
+
</meinpaketcommon>
|
| 126 |
+
</updates>
|
| 127 |
+
</layout>
|
| 128 |
+
</frontend>
|
| 129 |
+
<global>
|
| 130 |
+
<resources>
|
| 131 |
+
<meinpaketcommon_setup>
|
| 132 |
+
<setup>
|
| 133 |
+
<module>Dhl_MeinPaketCommon</module>
|
| 134 |
+
<class>Dhl_MeinPaketCommon_Model_Resource_Eav_Mysql4_Setup</class>
|
| 135 |
+
</setup>
|
| 136 |
+
<connection>
|
| 137 |
+
<use>core_setup</use>
|
| 138 |
+
</connection>
|
| 139 |
+
</meinpaketcommon_setup>
|
| 140 |
+
</resources>
|
| 141 |
+
<models>
|
| 142 |
+
<meinpaketcommon>
|
| 143 |
+
<class>Dhl_MeinPaketCommon_Model</class>
|
| 144 |
+
<resourceModel>meinpaketcommon_mysql4</resourceModel>
|
| 145 |
+
</meinpaketcommon>
|
| 146 |
+
<meinpaketcommon_mysql4>
|
| 147 |
+
<class>Dhl_MeinPaketCommon_Model_Mysql4</class>
|
| 148 |
+
<entities>
|
| 149 |
+
<async>
|
| 150 |
+
<table>meinpaket_async</table>
|
| 151 |
+
</async>
|
| 152 |
+
<log>
|
| 153 |
+
<table>meinpaket_log</table>
|
| 154 |
+
</log>
|
| 155 |
+
</entities>
|
| 156 |
+
</meinpaketcommon_mysql4>
|
| 157 |
+
</models>
|
| 158 |
+
<blocks>
|
| 159 |
+
<meinpaketcommon>
|
| 160 |
+
<class>Dhl_MeinPaketCommon_Block</class>
|
| 161 |
+
</meinpaketcommon>
|
| 162 |
+
</blocks>
|
| 163 |
+
<helpers>
|
| 164 |
+
<meinpaketcommon>
|
| 165 |
+
<class>Dhl_MeinPaketCommon_Helper</class>
|
| 166 |
+
</meinpaketcommon>
|
| 167 |
+
</helpers>
|
| 168 |
+
<events>
|
| 169 |
+
<sales_order_save_after>
|
| 170 |
+
<observers>
|
| 171 |
+
<meinpaket_cancel_order>
|
| 172 |
+
<type>singleton</type>
|
| 173 |
+
<class>meinpaketcommon/observer</class>
|
| 174 |
+
<method>salesOrderSaveAfter</method>
|
| 175 |
+
</meinpaket_cancel_order>
|
| 176 |
+
</observers>
|
| 177 |
+
</sales_order_save_after>
|
| 178 |
+
<sales_order_shipment_save_after>
|
| 179 |
+
<observers>
|
| 180 |
+
<meinpaket_save_sales_order_shipment>
|
| 181 |
+
<type>singleton</type>
|
| 182 |
+
<class>meinpaketcommon/observer</class>
|
| 183 |
+
<method>salesOrderShipmentSaveAfter</method>
|
| 184 |
+
</meinpaket_save_sales_order_shipment>
|
| 185 |
+
</observers>
|
| 186 |
+
</sales_order_shipment_save_after>
|
| 187 |
+
<sales_order_shipment_save_commit_after>
|
| 188 |
+
<observers>
|
| 189 |
+
<meinpaket_commit_sales_order_shipment>
|
| 190 |
+
<type>singleton</type>
|
| 191 |
+
<class>meinpaketcommon/observer</class>
|
| 192 |
+
<method>salesOrderShipmentSaveCommitAfter</method>
|
| 193 |
+
</meinpaket_commit_sales_order_shipment>
|
| 194 |
+
</observers>
|
| 195 |
+
</sales_order_shipment_save_commit_after>
|
| 196 |
+
<sales_order_shipment_track_save_after>
|
| 197 |
+
<observers>
|
| 198 |
+
<meinpaket_save_sales_order_shipment_track>
|
| 199 |
+
<type>singleton</type>
|
| 200 |
+
<class>meinpaketcommon/observer</class>
|
| 201 |
+
<method>salesOrderShipmentTrackSaveAfter</method>
|
| 202 |
+
</meinpaket_save_sales_order_shipment_track>
|
| 203 |
+
</observers>
|
| 204 |
+
</sales_order_shipment_track_save_after>
|
| 205 |
+
<sales_order_creditmemo_save_after>
|
| 206 |
+
<observers>
|
| 207 |
+
<meinpaket_save_creditmemo>
|
| 208 |
+
<type>singleton</type>
|
| 209 |
+
<class>meinpaketcommon/observer</class>
|
| 210 |
+
<method>salesOrderCreditmemoSaveAfter</method>
|
| 211 |
+
</meinpaket_save_creditmemo>
|
| 212 |
+
</observers>
|
| 213 |
+
</sales_order_creditmemo_save_after>
|
| 214 |
+
<core_block_abstract_prepare_layout_before>
|
| 215 |
+
<observers>
|
| 216 |
+
<meinpaket_grid_column_append>
|
| 217 |
+
<type>singleton</type>
|
| 218 |
+
<class>meinpaketcommon/observer</class>
|
| 219 |
+
<method>gridAddAttributes</method>
|
| 220 |
+
</meinpaket_grid_column_append>
|
| 221 |
+
</observers>
|
| 222 |
+
</core_block_abstract_prepare_layout_before>
|
| 223 |
+
</events>
|
| 224 |
+
</global>
|
| 225 |
+
</config>
|
app/code/community/Dhl/MeinPaketCommon/etc/system.xml
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<meinpaket module="core" translate="label">
|
| 5 |
+
<comment>Test</comment>
|
| 6 |
+
<label>DHL MeinPaket/Postpay</label>
|
| 7 |
+
<tab>general</tab>
|
| 8 |
+
<frontend_type>text</frontend_type>
|
| 9 |
+
<sort_order>1000</sort_order>
|
| 10 |
+
<show_in_default>1</show_in_default>
|
| 11 |
+
<show_in_website>1</show_in_website>
|
| 12 |
+
<show_in_store>1</show_in_store>
|
| 13 |
+
<class>meinpaket</class>
|
| 14 |
+
<groups>
|
| 15 |
+
<store>
|
| 16 |
+
<label>Store</label>
|
| 17 |
+
<frontend_type>text</frontend_type>
|
| 18 |
+
<sort_order>1</sort_order>
|
| 19 |
+
<show_in_default>1</show_in_default>
|
| 20 |
+
<show_in_website>1</show_in_website>
|
| 21 |
+
<show_in_store>1</show_in_store>
|
| 22 |
+
<frontend_class>meinpaket</frontend_class>
|
| 23 |
+
<fields translate="label">
|
| 24 |
+
<view translate="label">
|
| 25 |
+
<label>Store View</label>
|
| 26 |
+
<frontend_type>select</frontend_type>
|
| 27 |
+
<source_model>adminhtml/system_config_source_store</source_model>
|
| 28 |
+
<sort_order>1</sort_order>
|
| 29 |
+
<show_in_default>1</show_in_default>
|
| 30 |
+
<show_in_website>0</show_in_website>
|
| 31 |
+
<show_in_store>0</show_in_store>
|
| 32 |
+
</view>
|
| 33 |
+
</fields>
|
| 34 |
+
</store>
|
| 35 |
+
<credentials translate="label">
|
| 36 |
+
<label>Credentials</label>
|
| 37 |
+
<frontend_type>text</frontend_type>
|
| 38 |
+
<sort_order>3</sort_order>
|
| 39 |
+
<show_in_default>1</show_in_default>
|
| 40 |
+
<show_in_website>1</show_in_website>
|
| 41 |
+
<show_in_store>0</show_in_store>
|
| 42 |
+
<frontend_class>meinpaket</frontend_class>
|
| 43 |
+
<fields>
|
| 44 |
+
<username translate="label comment">
|
| 45 |
+
<label>DHL Username</label>
|
| 46 |
+
<comment><![CDATA[This is the username that was given to you by DHL, mostly your email address.]]></comment>
|
| 47 |
+
<frontend_type>text</frontend_type>
|
| 48 |
+
<sort_order>10</sort_order>
|
| 49 |
+
<show_in_default>1</show_in_default>
|
| 50 |
+
<show_in_website>1</show_in_website>
|
| 51 |
+
<show_in_store>0</show_in_store>
|
| 52 |
+
</username>
|
| 53 |
+
<password translate="label comment">
|
| 54 |
+
<label>DHL Password</label>
|
| 55 |
+
<comment><![CDATA[This is the password that was given to you by DHL.]]></comment>
|
| 56 |
+
<frontend_type>password</frontend_type>
|
| 57 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
| 58 |
+
<sort_order>20</sort_order>
|
| 59 |
+
<show_in_default>1</show_in_default>
|
| 60 |
+
<show_in_website>1</show_in_website>
|
| 61 |
+
<show_in_store>0</show_in_store>
|
| 62 |
+
</password>
|
| 63 |
+
</fields>
|
| 64 |
+
</credentials>
|
| 65 |
+
<endpoint translate="label">
|
| 66 |
+
<label>Remote system</label>
|
| 67 |
+
<frontend_type>text</frontend_type>
|
| 68 |
+
<sort_order>2</sort_order>
|
| 69 |
+
<show_in_default>1</show_in_default>
|
| 70 |
+
<show_in_website>1</show_in_website>
|
| 71 |
+
<show_in_store>1</show_in_store>
|
| 72 |
+
<frontend_class>meinpaket</frontend_class>
|
| 73 |
+
<fields>
|
| 74 |
+
<https translate="label comment">
|
| 75 |
+
<label>Use HTTPs</label>
|
| 76 |
+
<comment><![CDATA[Use https:// to connect to DHL MeinPaket]]></comment>
|
| 77 |
+
<frontend_type>select</frontend_type>
|
| 78 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 79 |
+
<sort_order>10</sort_order>
|
| 80 |
+
<show_in_default>1</show_in_default>
|
| 81 |
+
<show_in_website>0</show_in_website>
|
| 82 |
+
<show_in_store>0</show_in_store>
|
| 83 |
+
</https>
|
| 84 |
+
<sandbox translate="label comment">
|
| 85 |
+
<label>Use Sandbox</label>
|
| 86 |
+
<comment><![CDATA[Use DHL MeinPaket sandbox]]></comment>
|
| 87 |
+
<frontend_type>select</frontend_type>
|
| 88 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 89 |
+
<sort_order>11</sort_order>
|
| 90 |
+
<show_in_default>1</show_in_default>
|
| 91 |
+
<show_in_website>0</show_in_website>
|
| 92 |
+
<show_in_store>0</show_in_store>
|
| 93 |
+
</sandbox>
|
| 94 |
+
<proxy translate="label comment">
|
| 95 |
+
<label>Use Proxy</label>
|
| 96 |
+
<comment><![CDATA[Use proxy to connect to DHL MeinPaket]]></comment>
|
| 97 |
+
<frontend_type>select</frontend_type>
|
| 98 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 99 |
+
<sort_order>20</sort_order>
|
| 100 |
+
<show_in_default>1</show_in_default>
|
| 101 |
+
<show_in_website>0</show_in_website>
|
| 102 |
+
<show_in_store>0</show_in_store>
|
| 103 |
+
</proxy>
|
| 104 |
+
<proxy_host translate="label comment">
|
| 105 |
+
<label>Proxy Host</label>
|
| 106 |
+
<comment><![CDATA[Used proxy host to connect to DHL MeinPaket. Disabled when empty]]></comment>
|
| 107 |
+
<frontend_type>text</frontend_type>
|
| 108 |
+
<sort_order>21</sort_order>
|
| 109 |
+
<show_in_default>1</show_in_default>
|
| 110 |
+
<show_in_website>0</show_in_website>
|
| 111 |
+
<show_in_store>0</show_in_store>
|
| 112 |
+
<depends>
|
| 113 |
+
<proxy>1</proxy>
|
| 114 |
+
</depends>
|
| 115 |
+
</proxy_host>
|
| 116 |
+
<proxy_port translate="label comment">
|
| 117 |
+
<label>Proxy Port</label>
|
| 118 |
+
<comment><![CDATA[Use proxy port to connect to DHL MeinPaket. Disabled when empty]]></comment>
|
| 119 |
+
<frontend_type>text</frontend_type>
|
| 120 |
+
<sort_order>22</sort_order>
|
| 121 |
+
<show_in_default>1</show_in_default>
|
| 122 |
+
<show_in_website>0</show_in_website>
|
| 123 |
+
<show_in_store>0</show_in_store>
|
| 124 |
+
<depends>
|
| 125 |
+
<proxy>1</proxy>
|
| 126 |
+
</depends>
|
| 127 |
+
</proxy_port>
|
| 128 |
+
</fields>
|
| 129 |
+
</endpoint>
|
| 130 |
+
<shipment translate="label">
|
| 131 |
+
<label>Shipment</label>
|
| 132 |
+
<frontend_type>text</frontend_type>
|
| 133 |
+
<sort_order>15</sort_order>
|
| 134 |
+
<show_in_default>1</show_in_default>
|
| 135 |
+
<show_in_website>1</show_in_website>
|
| 136 |
+
<show_in_store>1</show_in_store>
|
| 137 |
+
<frontend_class>meinpaket</frontend_class>
|
| 138 |
+
<fields>
|
| 139 |
+
<default_shipment_method translate="label comment">
|
| 140 |
+
<label>Default Shipment Method</label>
|
| 141 |
+
<comment><![CDATA[Shipment method which is used for order import and POSTPAY.]]></comment>
|
| 142 |
+
<frontend_type>select</frontend_type>
|
| 143 |
+
<type>text</type>
|
| 144 |
+
<source_model>meinpaketcommon/entity_attribute_source_carrier</source_model>
|
| 145 |
+
<sort_order>20</sort_order>
|
| 146 |
+
<show_in_default>1</show_in_default>
|
| 147 |
+
<show_in_website>1</show_in_website>
|
| 148 |
+
<show_in_store>0</show_in_store>
|
| 149 |
+
</default_shipment_method>
|
| 150 |
+
</fields>
|
| 151 |
+
</shipment>
|
| 152 |
+
<customer translate="label">
|
| 153 |
+
<label>Customer</label>
|
| 154 |
+
<frontend_type>text</frontend_type>
|
| 155 |
+
<sort_order>50</sort_order>
|
| 156 |
+
<show_in_default>1</show_in_default>
|
| 157 |
+
<show_in_website>1</show_in_website>
|
| 158 |
+
<show_in_store>0</show_in_store>
|
| 159 |
+
<frontend_class>meinpaket</frontend_class>
|
| 160 |
+
<fields>
|
| 161 |
+
<default_email translate="label comment">
|
| 162 |
+
<label>Default customer email</label>
|
| 163 |
+
<comment><![CDATA[This eMail address is used as the default one for orders that do not include one.]]></comment>
|
| 164 |
+
<frontend_type>text</frontend_type>
|
| 165 |
+
<validate>validate-email</validate>
|
| 166 |
+
<sort_order>10</sort_order>
|
| 167 |
+
<show_in_default>1</show_in_default>
|
| 168 |
+
<show_in_website>1</show_in_website>
|
| 169 |
+
<show_in_store>0</show_in_store>
|
| 170 |
+
</default_email>
|
| 171 |
+
</fields>
|
| 172 |
+
</customer>
|
| 173 |
+
<cron translate="label">
|
| 174 |
+
<label>Cron</label>
|
| 175 |
+
<frontend_type>text</frontend_type>
|
| 176 |
+
<sort_order>100</sort_order>
|
| 177 |
+
<show_in_default>1</show_in_default>
|
| 178 |
+
<show_in_website>1</show_in_website>
|
| 179 |
+
<show_in_store>0</show_in_store>
|
| 180 |
+
<frontend_class>meinpaket</frontend_class>
|
| 181 |
+
<fields>
|
| 182 |
+
<async translate="label comment">
|
| 183 |
+
<label>Async Request</label>
|
| 184 |
+
<comment><![CDATA[Async request check interval]]></comment>
|
| 185 |
+
<frontend_type>text</frontend_type>
|
| 186 |
+
<sort_order>10</sort_order>
|
| 187 |
+
<show_in_default>1</show_in_default>
|
| 188 |
+
<show_in_website>1</show_in_website>
|
| 189 |
+
<show_in_store>0</show_in_store>
|
| 190 |
+
</async>
|
| 191 |
+
<product translate="label comment">
|
| 192 |
+
<label>Product Export</label>
|
| 193 |
+
<comment><![CDATA[Product export interval]]></comment>
|
| 194 |
+
<frontend_type>text</frontend_type>
|
| 195 |
+
<sort_order>20</sort_order>
|
| 196 |
+
<show_in_default>1</show_in_default>
|
| 197 |
+
<show_in_website>1</show_in_website>
|
| 198 |
+
<show_in_store>0</show_in_store>
|
| 199 |
+
</product>
|
| 200 |
+
<order translate="label comment">
|
| 201 |
+
<label>Order Import</label>
|
| 202 |
+
<comment><![CDATA[Order import interval.]]></comment>
|
| 203 |
+
<frontend_type>text</frontend_type>
|
| 204 |
+
<sort_order>30</sort_order>
|
| 205 |
+
<show_in_default>1</show_in_default>
|
| 206 |
+
<show_in_website>1</show_in_website>
|
| 207 |
+
<show_in_store>0</show_in_store>
|
| 208 |
+
</order>
|
| 209 |
+
<bestprice translate="label comment">
|
| 210 |
+
<label>BestPrice Interval</label>
|
| 211 |
+
<comment><![CDATA[BestPrice refresh interval.]]></comment>
|
| 212 |
+
<frontend_type>text</frontend_type>
|
| 213 |
+
<sort_order>40</sort_order>
|
| 214 |
+
<show_in_default>1</show_in_default>
|
| 215 |
+
<show_in_website>1</show_in_website>
|
| 216 |
+
<show_in_store>0</show_in_store>
|
| 217 |
+
</bestprice>
|
| 218 |
+
<cleanup translate="label comment">
|
| 219 |
+
<label>Cleanup Interval</label>
|
| 220 |
+
<comment><![CDATA[Interval to run cleanups.]]></comment>
|
| 221 |
+
<frontend_type>text</frontend_type>
|
| 222 |
+
<sort_order>50</sort_order>
|
| 223 |
+
<show_in_default>1</show_in_default>
|
| 224 |
+
<show_in_website>1</show_in_website>
|
| 225 |
+
<show_in_store>0</show_in_store>
|
| 226 |
+
</cleanup>
|
| 227 |
+
</fields>
|
| 228 |
+
</cron>
|
| 229 |
+
<advanced translate="label">
|
| 230 |
+
<label>Advanced</label>
|
| 231 |
+
<frontend_type>text</frontend_type>
|
| 232 |
+
<sort_order>150</sort_order>
|
| 233 |
+
<show_in_default>1</show_in_default>
|
| 234 |
+
<show_in_website>1</show_in_website>
|
| 235 |
+
<show_in_store>0</show_in_store>
|
| 236 |
+
<frontend_class>meinpaket</frontend_class>
|
| 237 |
+
<fields>
|
| 238 |
+
<cycle_product_count translate="label comment">
|
| 239 |
+
<label>Cycle product count</label>
|
| 240 |
+
<comment><![CDATA[Count of products transfered during a single cycle]]></comment>
|
| 241 |
+
<frontend_type>text</frontend_type>
|
| 242 |
+
<validate>validate-digits</validate>
|
| 243 |
+
<sort_order>15</sort_order>
|
| 244 |
+
<show_in_default>1</show_in_default>
|
| 245 |
+
<show_in_website>1</show_in_website>
|
| 246 |
+
<show_in_store>0</show_in_store>
|
| 247 |
+
</cycle_product_count>
|
| 248 |
+
</fields>
|
| 249 |
+
</advanced>
|
| 250 |
+
</groups>
|
| 251 |
+
</meinpaket>
|
| 252 |
+
<carriers>
|
| 253 |
+
<groups>
|
| 254 |
+
<meinpaket translate="label" module="meinpaket">
|
| 255 |
+
<label>MeinPaket Versand Modul</label>
|
| 256 |
+
<frontend_type>text</frontend_type>
|
| 257 |
+
<sort_order>20</sort_order>
|
| 258 |
+
<show_in_default>1</show_in_default>
|
| 259 |
+
<show_in_website>1</show_in_website>
|
| 260 |
+
<show_in_store>1</show_in_store>
|
| 261 |
+
<fields>
|
| 262 |
+
<active translate="label">
|
| 263 |
+
<label>Enabled</label>
|
| 264 |
+
<frontend_type>select</frontend_type>
|
| 265 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 266 |
+
<sort_order>10</sort_order>
|
| 267 |
+
<show_in_default>1</show_in_default>
|
| 268 |
+
<show_in_website>1</show_in_website>
|
| 269 |
+
<show_in_store>1</show_in_store>
|
| 270 |
+
</active>
|
| 271 |
+
</fields>
|
| 272 |
+
</meinpaket>
|
| 273 |
+
</groups>
|
| 274 |
+
</carriers>
|
| 275 |
+
</sections>
|
| 276 |
+
</config>
|
| 277 |
+
|
app/code/community/Dhl/MeinPaketCommon/sql/meinpaketcommon_setup/mysql4-install-1.0.0.php
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Setup-Script fuer Dhl_MeinPaket
|
| 4 |
+
*
|
| 5 |
+
* Uninstall MeinPaket:
|
| 6 |
+
* delete from core_resource where code = 'meinpaket_setup';
|
| 7 |
+
* delete from eav_attribute where attribute_code = "is_dhl_mein_paket_root";
|
| 8 |
+
* delete from eav_attribute where attribute_code = "is_dhl_marketplace_root";
|
| 9 |
+
* delete from eav_attribute where attribute_code = "dhl_marketplace_category_id";
|
| 10 |
+
* delete from eav_attribute where attribute_code = "sync_with_dhl_mein_paket";
|
| 11 |
+
* delete from eav_attribute where attribute_code = "max_stock_for_dhl_mein_paket";
|
| 12 |
+
* delete from eav_attribute where attribute_code = "shipment_was_exported_for_dhl_mein_paket";
|
| 13 |
+
* delete from eav_attribute where attribute_code = "dhl_mein_paket_order_id";
|
| 14 |
+
* delete from eav_attribute_group where attribute_group_name = "MeinPaket.de";
|
| 15 |
+
* alter table sales_flat_order drop column dhl_mein_paket_order_id;
|
| 16 |
+
* alter table sales_flat_order_grid drop column dhl_mein_paket_order_id;
|
| 17 |
+
*
|
| 18 |
+
* drop table meinpaket_log
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
/* @var $installer Dhl_MeinPaketCommon_Model_Resource_Eav_Mysql4_Setup */
|
| 22 |
+
$installer = $this;
|
| 23 |
+
$installer->startSetup ();
|
| 24 |
+
|
| 25 |
+
// get DB connectiondelete from core_resource where code = 'meinpaket_setup';
|
| 26 |
+
$db = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
|
| 27 |
+
$table_prefix = Mage::getConfig ()->getTablePrefix ();
|
| 28 |
+
|
| 29 |
+
// ############### create dhl_mein_paket_order_id attribute #################
|
| 30 |
+
|
| 31 |
+
// check wether dhl_mein_paket_order_id column exists for orders
|
| 32 |
+
$orderIdFieldExists = false;
|
| 33 |
+
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_order" );
|
| 34 |
+
|
| 35 |
+
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 36 |
+
if ($resultset ['Field'] == 'dhl_mein_paket_order_id')
|
| 37 |
+
$orderIdFieldExists = true;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
if (! $orderIdFieldExists) {
|
| 41 |
+
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_order' ), 'dhl_mein_paket_order_id', 'varchar(255) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 42 |
+
|
| 43 |
+
$installer->addAttribute ( 'order', 'dhl_mein_paket_order_id', array (
|
| 44 |
+
'type' => 'static'
|
| 45 |
+
) );
|
| 46 |
+
// 'visible' => false
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
// check wether dhl_mein_paket_order_id column exists for orders grid
|
| 50 |
+
$orderIdFieldExists = false;
|
| 51 |
+
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_order_grid" );
|
| 52 |
+
|
| 53 |
+
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 54 |
+
if ($resultset ['Field'] == 'dhl_mein_paket_order_id')
|
| 55 |
+
$orderIdFieldExists = true;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
if (! $orderIdFieldExists) {
|
| 59 |
+
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_order_grid' ), 'dhl_mein_paket_order_id', 'varchar(255) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
// ############### create shipment_was_exported_for_dhl_mein_paket attribute #################
|
| 63 |
+
|
| 64 |
+
$orderIdFieldExists = false;
|
| 65 |
+
$result = $db->query ( "EXPLAIN {$table_prefix}sales_flat_shipment" );
|
| 66 |
+
|
| 67 |
+
while ( $resultset = $result->fetch ( PDO::FETCH_ASSOC ) ) {
|
| 68 |
+
if ($resultset ['Field'] == 'shipment_was_exported_for_dhl_mein_paket')
|
| 69 |
+
$orderIdFieldExists = true;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
if (! $orderIdFieldExists) {
|
| 73 |
+
$installer->getConnection ()->addColumn ( $installer->getTable ( 'sales_flat_shipment' ), 'shipment_was_exported_for_dhl_mein_paket', 'int(1) NULL DEFAULT NULL AFTER `entity_id`' );
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
Mage::getSingleton ( 'adminhtml/session' )->addSuccess ( 'DHL MeinPaket.de extension was successfully installed!' );
|
| 77 |
+
|
| 78 |
+
$installer->installEntities ();
|
| 79 |
+
|
| 80 |
+
$installer->run ( "
|
| 81 |
+
DROP TABLE IF EXISTS {$this->getTable('meinpaketcommon/async')};
|
| 82 |
+
CREATE TABLE {$this->getTable('meinpaketcommon/async')} (
|
| 83 |
+
`async_id` int(11) unsigned NOT NULL auto_increment,
|
| 84 |
+
`request_id` varchar(255),
|
| 85 |
+
`status` varchar(255),
|
| 86 |
+
`created_at` datetime default '0000-00-00 00:00:00',
|
| 87 |
+
`updated_at` datetime default '0000-00-00 00:00:00',
|
| 88 |
+
PRIMARY KEY(`async_id`)
|
| 89 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Async Requests';
|
| 90 |
+
" );
|
| 91 |
+
|
| 92 |
+
$installer->run ( "
|
| 93 |
+
DROP TABLE IF EXISTS {$this->getTable('meinpaketcommon/log')};
|
| 94 |
+
CREATE TABLE {$this->getTable('meinpaketcommon/log')} (
|
| 95 |
+
`log_id` int(11) unsigned NOT NULL auto_increment,
|
| 96 |
+
`request_id` varchar(255),
|
| 97 |
+
`status` varchar(255),
|
| 98 |
+
`send` text default '',
|
| 99 |
+
`received` text default '',
|
| 100 |
+
`error` text default '',
|
| 101 |
+
`created_at` datetime default '0000-00-00 00:00:00',
|
| 102 |
+
PRIMARY KEY(`log_id`)
|
| 103 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Sync';
|
| 104 |
+
" );
|
| 105 |
+
|
| 106 |
+
$installer->endSetup ();
|
app/code/community/Dhl/Postpay/Block/Checkout.php
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Paypal expess checkout shortcut link
|
| 4 |
+
*/
|
| 5 |
+
class Dhl_Postpay_Block_Checkout extends Mage_Core_Block_Template {
|
| 6 |
+
/**
|
| 7 |
+
* Position of "OR" label against shortcut
|
| 8 |
+
*/
|
| 9 |
+
const POSITION_BEFORE = 'before';
|
| 10 |
+
const POSITION_AFTER = 'after';
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* Whether the block should be eventually rendered
|
| 14 |
+
*
|
| 15 |
+
* @var bool
|
| 16 |
+
*/
|
| 17 |
+
protected $_shouldRender = true;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
*
|
| 21 |
+
* @return Mage_Core_Block_Abstract
|
| 22 |
+
*/
|
| 23 |
+
protected function _beforeToHtml() {
|
| 24 |
+
$result = parent::_beforeToHtml ();
|
| 25 |
+
$quote = Mage::helper ( 'meinpaketcommon/data' )->getQuoteFiltered ();
|
| 26 |
+
|
| 27 |
+
// validate minimum quote amount and validate quote for zero grandtotal
|
| 28 |
+
if (null == $quote || ! $quote->validateMinimumAmount ()) {
|
| 29 |
+
$this->_shouldRender = false;
|
| 30 |
+
return $result;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
return $result;
|
| 34 |
+
}
|
| 35 |
+
public function getCheckoutUrl() {
|
| 36 |
+
return Mage::getUrl ( 'postpay/checkout' );
|
| 37 |
+
}
|
| 38 |
+
public function getImageUrl() {
|
| 39 |
+
return $this->getSkinUrl ( 'images/postpay/button.png' );
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Render the block if needed
|
| 44 |
+
*
|
| 45 |
+
* @return string
|
| 46 |
+
*/
|
| 47 |
+
protected function _toHtml() {
|
| 48 |
+
if (! $this->_shouldRender) {
|
| 49 |
+
return '';
|
| 50 |
+
}
|
| 51 |
+
return parent::_toHtml ();
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Check is "OR" label position before checkout
|
| 56 |
+
*
|
| 57 |
+
* @return bool
|
| 58 |
+
*/
|
| 59 |
+
public function isOrPositionBefore() {
|
| 60 |
+
return $this->getShowOrPosition () && $this->getShowOrPosition () == self::POSITION_BEFORE;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* Check is "OR" label position after checkout
|
| 65 |
+
*
|
| 66 |
+
* @return bool
|
| 67 |
+
*/
|
| 68 |
+
public function isOrPositionAfter() {
|
| 69 |
+
return $this->getShowOrPosition () && $this->getShowOrPosition () == self::POSITION_AFTER;
|
| 70 |
+
}
|
| 71 |
+
}
|
app/code/community/Dhl/Postpay/Block/Payment/Form/Standard.php
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* PayPal Standard payment "form"
|
| 4 |
+
*/
|
| 5 |
+
class Dhl_Postpay_Block_Payment_Form_Standard extends Mage_Payment_Block_Form {
|
| 6 |
+
public function __construct() {
|
| 7 |
+
parent::__construct ();
|
| 8 |
+
|
| 9 |
+
$image = Mage::getConfig ()->getBlockClassName ( 'core/template' );
|
| 10 |
+
$image = new $image ();
|
| 11 |
+
$image->setTemplate ( 'postpay/checkout/image.phtml' );
|
| 12 |
+
|
| 13 |
+
$this->setTemplate ( 'postpay/payment/redirect.phtml' )->setRedirectMessage ( Mage::helper ( 'postpay' )->__ ( 'You will be redirected to the Postpay website when you place an order.' ) )->setMethodTitle ( '' )->setMethodLabelAfterHtml ( $image->toHtml () );
|
| 14 |
+
}
|
| 15 |
+
}
|
app/code/community/Dhl/Postpay/Block/Payment/Info/Standard.php
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Paypal expess checkout shortcut link
|
| 4 |
+
*/
|
| 5 |
+
class Dhl_Postpay_Block_Payment_Info_Standard extends Mage_Payment_Block_Info {
|
| 6 |
+
}
|
app/code/community/Dhl/Postpay/Helper/Cron.php
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_Helper_Cron extends Mage_Core_Helper_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Schedule jobs for next cron run.
|
| 5 |
+
*
|
| 6 |
+
* @param array $cronjobs
|
| 7 |
+
* to schedule
|
| 8 |
+
* @param string $addMessage
|
| 9 |
+
* add messages to session
|
| 10 |
+
*/
|
| 11 |
+
public function scheduleJobs(array $cronjobs, $addMessage = true) {
|
| 12 |
+
$session = Mage::getSingleton ( 'adminhtml/session' );
|
| 13 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 14 |
+
|
| 15 |
+
$time = time ();
|
| 16 |
+
$timeString = strftime ( '%Y-%m-%d %H:%M:%S', $time );
|
| 17 |
+
foreach ( $cronjobs as $code ) {
|
| 18 |
+
$schedule = Mage::getModel ( 'cron/schedule' );
|
| 19 |
+
$schedule->setJobCode ( $code );
|
| 20 |
+
$schedule->setStatus ( Mage_Cron_Model_Schedule::STATUS_PENDING );
|
| 21 |
+
$schedule->setCreatedAt ( $timeString );
|
| 22 |
+
$schedule->setScheduledAt ( $timeString );
|
| 23 |
+
$schedule->save ();
|
| 24 |
+
if ($addMessage) {
|
| 25 |
+
$session->addSuccess ( $this->__ ( 'Scheduled "%s" at %s', $code, $timeString ) );
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
/**
|
| 30 |
+
* Run jobs now.
|
| 31 |
+
*
|
| 32 |
+
* @param array $cronjobs
|
| 33 |
+
* to run
|
| 34 |
+
* @param string $addMessage
|
| 35 |
+
* add messages to session
|
| 36 |
+
*/
|
| 37 |
+
public function runJobs(array $cronjobs, $addMessage = true) {
|
| 38 |
+
/* @var $session Mage_Adminhtml_Model_Session */
|
| 39 |
+
$session = Mage::getSingleton ( 'adminhtml/session' );
|
| 40 |
+
|
| 41 |
+
foreach ( $cronjobs as $code ) {
|
| 42 |
+
try {
|
| 43 |
+
switch ($code) {
|
| 44 |
+
case Dhl_Postpay_Model_Cron::SYNC_CATALOG :
|
| 45 |
+
$res = Mage::getSingleton ( 'meinpaket/service_product_export' )->exportProducts ();
|
| 46 |
+
break;
|
| 47 |
+
case Dhl_Postpay_Model_Cron::SYNC_ORDERS :
|
| 48 |
+
$res = Mage::getSingleton ( 'meinpaket/service_order_importService' )->importOrders ();
|
| 49 |
+
break;
|
| 50 |
+
case Dhl_Postpay_Model_Cron::SYNC_ASYNC :
|
| 51 |
+
$res = Mage::getSingleton ( 'meinpaket/service_async' )->process ();
|
| 52 |
+
break;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
$message = is_string($res) ? $res : Zend_Debug::dump ( $res, null, false );
|
| 56 |
+
|
| 57 |
+
if ($addMessage && strlen ( $message ) > 0) {
|
| 58 |
+
$session->addSuccess ( $this->__ ( 'Ran "%s":<pre>%s</pre>', $code, $message ) );
|
| 59 |
+
}
|
| 60 |
+
} catch ( Exception $e ) {
|
| 61 |
+
if ($addMessage) {
|
| 62 |
+
$session->addError ( $this->__ ( 'Error while running "%s":<pre>%s</pre>', $code, $e->getMessage () ) );
|
| 63 |
+
}
|
| 64 |
+
Mage::logException ( $e );
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
}
|
app/code/community/Dhl/Postpay/Helper/Data.php
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Default helper for the Dhl_Postpay package.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_Postpay
|
| 8 |
+
* @subpackage Helper
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_Postpay_Helper_Data extends Mage_Core_Helper_Abstract {
|
| 11 |
+
public function getExtensionVersion() {
|
| 12 |
+
return ( string ) Mage::getConfig ()->getModuleConfig ( 'Dhl_Postpay' )->version;
|
| 13 |
+
}
|
| 14 |
+
}
|
app/code/community/Dhl/Postpay/Model/Cart.php
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_Model_Cart extends Mage_Core_Model_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* (non-PHPdoc)
|
| 5 |
+
*
|
| 6 |
+
* @see Varien_Object::_construct()
|
| 7 |
+
*/
|
| 8 |
+
public function _construct() {
|
| 9 |
+
parent::_construct ();
|
| 10 |
+
$this->_init ( 'postpay/cart' );
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
*/
|
| 15 |
+
public function generateNotificationId() {
|
| 16 |
+
$this->setNotificationId ( $this->generateRandomString () );
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
*
|
| 21 |
+
* @param number $length
|
| 22 |
+
* @return string
|
| 23 |
+
*/
|
| 24 |
+
public function generateRandomString($length = 10) {
|
| 25 |
+
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
| 26 |
+
$charactersLength = strlen ( $characters );
|
| 27 |
+
$randomString = '';
|
| 28 |
+
for($i = 0; $i < $length; $i ++) {
|
| 29 |
+
$randomString .= $characters [rand ( 0, $charactersLength - 1 )];
|
| 30 |
+
}
|
| 31 |
+
return $randomString;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Processing object before save data
|
| 36 |
+
*
|
| 37 |
+
* @return Mage_Core_Model_Abstract
|
| 38 |
+
*/
|
| 39 |
+
protected function _beforeSave() {
|
| 40 |
+
if (strlen ( $this->getNotificationId () ) <= 0) {
|
| 41 |
+
$this->generateNotificationId ();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
if (! $this->getCreatedAt ()) {
|
| 45 |
+
$this->setCreatedAt ( time () );
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
return parent::_beforeSave ();
|
| 49 |
+
}
|
| 50 |
+
}
|
app/code/community/Dhl/Postpay/Model/Cron.php
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Cron handler for Dhl MeinPaket.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_Postpay_Model_Cron {
|
| 11 |
+
const SYNC_ORDERS = 'meinpaket_sync_orders';
|
| 12 |
+
public static $CRONJOBS = array (
|
| 13 |
+
self::SYNC_CATALOG
|
| 14 |
+
);
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Called to download orders.
|
| 18 |
+
*
|
| 19 |
+
* @return NULL
|
| 20 |
+
*/
|
| 21 |
+
public function importOrders() {
|
| 22 |
+
try {
|
| 23 |
+
return Mage::getSingleton ( 'postpay/service_order_importService' )->importOrders ();
|
| 24 |
+
} catch ( Exception $e ) {
|
| 25 |
+
Mage::logException ( $e );
|
| 26 |
+
}
|
| 27 |
+
return null;
|
| 28 |
+
}
|
| 29 |
+
}
|
app/code/community/Dhl/Postpay/Model/Mysql4/Cart.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_Model_Mysql4_Cart extends Mage_Core_Model_Mysql4_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model and set primary key
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'postpay/cart', 'cart_id' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/Postpay/Model/Mysql4/Cart/Collection.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_Model_Mysql4_Cart_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
| 3 |
+
/**
|
| 4 |
+
* Initialize domain model
|
| 5 |
+
*
|
| 6 |
+
* @return void
|
| 7 |
+
*/
|
| 8 |
+
protected function _construct() {
|
| 9 |
+
$this->_init ( 'postpay/cart' );
|
| 10 |
+
}
|
| 11 |
+
}
|
app/code/community/Dhl/Postpay/Model/Observer.php
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Observer for all events the DHL MeinPaket extension has to catch.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_Postpay_Model_Observer {
|
| 12 |
+
}
|
app/code/community/Dhl/Postpay/Model/Payment/Method/Express.php
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Postpay payment method for imported orders.
|
| 5 |
+
*
|
| 6 |
+
* @category Mage
|
| 7 |
+
* @package Dhl_Postpay
|
| 8 |
+
* @subpackage Payment_Method
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_Postpay_Model_Payment_Method_Express extends Mage_Payment_Model_Method_Abstract {
|
| 11 |
+
/**
|
| 12 |
+
*
|
| 13 |
+
* @var string
|
| 14 |
+
*/
|
| 15 |
+
protected $_code = 'postpay_express';
|
| 16 |
+
|
| 17 |
+
/**
|
| 18 |
+
* Is this payment method a gateway (online auth/charge) ?
|
| 19 |
+
*/
|
| 20 |
+
protected $_isGateway = true;
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Can authorize online?
|
| 24 |
+
*/
|
| 25 |
+
protected $_canAuthorize = true;
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Can capture funds online?
|
| 29 |
+
*/
|
| 30 |
+
protected $_canCapture = true;
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* Can capture partial amounts online?
|
| 34 |
+
*/
|
| 35 |
+
protected $_canCapturePartial = false;
|
| 36 |
+
|
| 37 |
+
/**
|
| 38 |
+
* Can refund online?
|
| 39 |
+
*/
|
| 40 |
+
protected $_canRefund = false;
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Can void transactions online?
|
| 44 |
+
*/
|
| 45 |
+
protected $_canVoid = true;
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* Can use this payment method in administration panel?
|
| 49 |
+
*/
|
| 50 |
+
protected $_canUseInternal = false;
|
| 51 |
+
|
| 52 |
+
/**
|
| 53 |
+
* Can show this payment method as an option on checkout payment page?
|
| 54 |
+
*/
|
| 55 |
+
protected $_canUseCheckout = false;
|
| 56 |
+
|
| 57 |
+
/**
|
| 58 |
+
* Is this payment method suitable for multi-shipping checkout?
|
| 59 |
+
*/
|
| 60 |
+
protected $_canUseForMultishipping = false;
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Can save credit card information for future processing?
|
| 64 |
+
*/
|
| 65 |
+
protected $_canSaveCc = false;
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* Is this method already authorized for the current order.
|
| 69 |
+
*
|
| 70 |
+
* @var unknown
|
| 71 |
+
*/
|
| 72 |
+
protected $_isAuthorized = false;
|
| 73 |
+
}
|
app/code/community/Dhl/Postpay/Model/Payment/Method/Standard.php
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Postpay payment method for imported orders.
|
| 5 |
+
*
|
| 6 |
+
* @category Mage
|
| 7 |
+
* @package Dhl_Postpay
|
| 8 |
+
* @subpackage Payment_Method
|
| 9 |
+
*/
|
| 10 |
+
class Dhl_Postpay_Model_Payment_Method_Standard extends Mage_Payment_Model_Method_Abstract {
|
| 11 |
+
/**
|
| 12 |
+
*
|
| 13 |
+
* @var string
|
| 14 |
+
*/
|
| 15 |
+
protected $_code = 'postpay_standard';
|
| 16 |
+
protected $_infoBlockType = 'postpay/payment_info_standard';
|
| 17 |
+
protected $_formBlockType = 'postpay/payment_form_standard';
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Is this payment method a gateway (online auth/charge) ?
|
| 21 |
+
*/
|
| 22 |
+
protected $_isGateway = true;
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Can authorize online?
|
| 26 |
+
*/
|
| 27 |
+
protected $_canAuthorize = true;
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Can capture funds online?
|
| 31 |
+
*/
|
| 32 |
+
protected $_canCapture = true;
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Can capture partial amounts online?
|
| 36 |
+
*/
|
| 37 |
+
protected $_canCapturePartial = false;
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* Can refund online?
|
| 41 |
+
*/
|
| 42 |
+
protected $_canRefund = false;
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* Can void transactions online?
|
| 46 |
+
*/
|
| 47 |
+
protected $_canVoid = true;
|
| 48 |
+
|
| 49 |
+
/**
|
| 50 |
+
* Can use this payment method in administration panel?
|
| 51 |
+
*/
|
| 52 |
+
protected $_canUseInternal = false;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Can show this payment method as an option on checkout payment page?
|
| 56 |
+
*/
|
| 57 |
+
protected $_canUseCheckout = true;
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* Is this payment method suitable for multi-shipping checkout?
|
| 61 |
+
*/
|
| 62 |
+
protected $_canUseForMultishipping = false;
|
| 63 |
+
|
| 64 |
+
/**
|
| 65 |
+
* Can save credit card information for future processing?
|
| 66 |
+
*/
|
| 67 |
+
protected $_canSaveCc = false;
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* Is this method already authorized for the current order.
|
| 71 |
+
*
|
| 72 |
+
* @var unknown
|
| 73 |
+
*/
|
| 74 |
+
protected $_isAuthorized = false;
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Here you will need to implement authorize, capture and void public methods
|
| 78 |
+
*
|
| 79 |
+
* @see examples of transaction specific public methods such as
|
| 80 |
+
* authorize, capture and void in Mage_Paygate_Model_Authorizenet
|
| 81 |
+
*/
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Return URL to redirect the customer to.
|
| 85 |
+
* Called after 'place order' button is clicked.
|
| 86 |
+
* Called after order is created and saved.
|
| 87 |
+
*
|
| 88 |
+
* @return string
|
| 89 |
+
*/
|
| 90 |
+
public function getOrderPlaceRedirectUrl() {
|
| 91 |
+
// Get and clear value from session
|
| 92 |
+
$url = Mage::getSingleton ( 'checkout/session' )->getData ( 'postpay_redirect_url', true );
|
| 93 |
+
return $url;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* Send authorize request to gateway
|
| 98 |
+
*
|
| 99 |
+
* @param Mage_Payment_Model_Info $payment
|
| 100 |
+
* @param decimal $amount
|
| 101 |
+
* @return Mage_Paygate_Model_Authorizenet
|
| 102 |
+
*/
|
| 103 |
+
public function authorize(Varien_Object $payment, $amount) {
|
| 104 |
+
if ($this->_isAuthorized) {
|
| 105 |
+
return $this;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
if ($amount <= 0) {
|
| 109 |
+
Mage::throwException ( Mage::helper ( 'postpay' )->__ ( 'Invalid amount for authorization.' ) );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
$request = new Dhl_MeinPaketCommon_Model_Xml_Request_SubmitCartRequest ();
|
| 113 |
+
|
| 114 |
+
$cart = Mage::getModel ( 'postpay/cart' );
|
| 115 |
+
$cart->generateNotificationId ();
|
| 116 |
+
$cart->setOrderId ( $payment->getOrder ()->getId () );
|
| 117 |
+
$cart->save ();
|
| 118 |
+
|
| 119 |
+
$notificationId = $request->addCart ( $payment->getOrder (), $cart );
|
| 120 |
+
|
| 121 |
+
$this->getInfoInstance ()->setData ( 'postpay_notification_id', $cart->getNotificationId () );
|
| 122 |
+
|
| 123 |
+
if ($request->isHasData ()) {
|
| 124 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 125 |
+
/* @var $client Dhl_Postpay_Model_Client_XmlOverHttp */
|
| 126 |
+
|
| 127 |
+
$response = $client->send ( $request );
|
| 128 |
+
/* @var $response Dhl_Postpay_Model_Xml_Response_SubmitCartResponse */
|
| 129 |
+
|
| 130 |
+
$this->getInfoInstance ()->setData ( 'postpay_cart_id', $response->getCartId () );
|
| 131 |
+
|
| 132 |
+
Mage::getSingleton ( 'checkout/session' )->setData ( 'postpay_redirect_url', $response->getRedirectURL () );
|
| 133 |
+
} else {
|
| 134 |
+
throw new Exception ( 'Cannot authorize order' );
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
return $this;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/**
|
| 141 |
+
* Send capture request to gateway
|
| 142 |
+
*
|
| 143 |
+
* @param Mage_Payment_Model_Info $payment
|
| 144 |
+
* @param decimal $amount
|
| 145 |
+
* @return Mage_Paygate_Model_Authorizenet
|
| 146 |
+
*/
|
| 147 |
+
public function capture(Varien_Object $payment, $amount) {
|
| 148 |
+
/*
|
| 149 |
+
* if ($amount <= 0) {
|
| 150 |
+
* Mage::throwException ( Mage::helper ( 'postpay' )->__ ( 'Invalid amount for capture.' ) );
|
| 151 |
+
* }
|
| 152 |
+
*/
|
| 153 |
+
return $this;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
/**
|
| 157 |
+
* Void the payment through gateway
|
| 158 |
+
*
|
| 159 |
+
* @param Mage_Payment_Model_Info $payment
|
| 160 |
+
* @return Mage_Paygate_Model_Authorizenet
|
| 161 |
+
*/
|
| 162 |
+
public function void(Varien_Object $payment) {
|
| 163 |
+
return $this;
|
| 164 |
+
}
|
| 165 |
+
}
|
app/code/community/Dhl/Postpay/Model/Resource/Eav/Mysql4/Setup.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_Model_Resource_Eav_Mysql4_Setup extends Mage_Catalog_Model_Resource_Setup {
|
| 3 |
+
/**
|
| 4 |
+
*
|
| 5 |
+
* @return array
|
| 6 |
+
*/
|
| 7 |
+
public function getDefaultEntities() {
|
| 8 |
+
return array ();
|
| 9 |
+
}
|
| 10 |
+
}
|
| 11 |
+
|
app/code/community/Dhl/Postpay/Model/Service/Order/ImportService.php
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Service class which imports orders from MeinPaket.
|
| 5 |
+
*
|
| 6 |
+
* @category Dhl
|
| 7 |
+
* @package Dhl_MeinPaket
|
| 8 |
+
* @subpackage Model_Order
|
| 9 |
+
* @version $Id$
|
| 10 |
+
*/
|
| 11 |
+
class Dhl_Postpay_Model_Service_Order_ImportService extends Dhl_MeinPaketCommon_Model_Service_Order_ImportService {
|
| 12 |
+
|
| 13 |
+
/**
|
| 14 |
+
*
|
| 15 |
+
* @var string
|
| 16 |
+
*/
|
| 17 |
+
const POSTPAY_IMPORT_PAYMENT_METHOD = 'postpay_express';
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Constructor.
|
| 21 |
+
*
|
| 22 |
+
* @return void
|
| 23 |
+
*/
|
| 24 |
+
public function __construct() {
|
| 25 |
+
parent::__construct ();
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Imports Order from meinPaket
|
| 30 |
+
* //TODO make a simple result object containing: countnew / countexisting / warnings (e.g.
|
| 31 |
+
* if price missmatch)
|
| 32 |
+
*
|
| 33 |
+
* @param integer $start
|
| 34 |
+
* @param integer $stop
|
| 35 |
+
* @return void
|
| 36 |
+
*/
|
| 37 |
+
public function importOrders($start = null, $stop = null) {
|
| 38 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 39 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 40 |
+
|
| 41 |
+
$cartCollection = Mage::getModel ( 'postpay/cart' )->getCollection ()->addFilter ( 'state', 'PENDING' );
|
| 42 |
+
|
| 43 |
+
foreach ( $cartCollection as $cart ) {
|
| 44 |
+
$queryRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_QueryRequest ();
|
| 45 |
+
$queryRequest->addShoppingCartStatus ( $cart->getCartId () );
|
| 46 |
+
|
| 47 |
+
if ($queryRequest->isHasData ()) {
|
| 48 |
+
$connection = Mage::getSingleton ( 'core/resource' )->getConnection ( 'core_write' );
|
| 49 |
+
try {
|
| 50 |
+
$connection->beginTransaction ();
|
| 51 |
+
|
| 52 |
+
// Make saves and other actions that affect the database
|
| 53 |
+
$queryResult = $client->send ( $queryRequest );
|
| 54 |
+
|
| 55 |
+
if ($queryResult != null && $queryResult instanceof Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse) {
|
| 56 |
+
$this->processQueryResponse ( $cart, $queryResult );
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
$connection->commit ();
|
| 60 |
+
} catch ( Exception $e ) {
|
| 61 |
+
$connection->rollback ();
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
return parent::importOrders ( $start, $stop );
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* process status infos.
|
| 71 |
+
*
|
| 72 |
+
* @param Dhl_Postpay_Model_Cart $cart
|
| 73 |
+
* @param Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse $queryResult
|
| 74 |
+
*/
|
| 75 |
+
protected function processQueryResponse(Dhl_Postpay_Model_Cart $cart, Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse $queryResult) {
|
| 76 |
+
$statusResponses = $queryResult->getShoppingCartStatusResponses ();
|
| 77 |
+
|
| 78 |
+
reset ( $statusResponses );
|
| 79 |
+
$key = key ( $statusResponses );
|
| 80 |
+
$status = strtoupper ( $statusResponses [$key] );
|
| 81 |
+
|
| 82 |
+
$orderModel = null;
|
| 83 |
+
/* @var $order Mage_Sales_Model_Order */
|
| 84 |
+
if ($cart->getOrderId () != null) {
|
| 85 |
+
$orderModel = Mage::getModel ( 'sales/order' )->load ( $cart->getOrderId () );
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
switch ($status) {
|
| 89 |
+
case 'PENDING' :
|
| 90 |
+
break;
|
| 91 |
+
case 'CREATEDORDER' :
|
| 92 |
+
$queryRequest = new Dhl_MeinPaketCommon_Model_Xml_Request_QueryRequest ();
|
| 93 |
+
$queryRequest->addOrderExternalId ( $cart->getCartId () );
|
| 94 |
+
|
| 95 |
+
if ($queryRequest->isHasData ()) {
|
| 96 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 97 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 98 |
+
|
| 99 |
+
$queryResult = $client->send ( $queryRequest );
|
| 100 |
+
|
| 101 |
+
if ($queryResult != null && $queryResult instanceof Dhl_MeinPaketCommon_Model_Xml_Response_QueryResponse) {
|
| 102 |
+
foreach ( $queryResult->getOrders () as $order ) {
|
| 103 |
+
/* @var $order Dhl_MeinPaketCommon_Model_Xml_Response_Partial_Order */
|
| 104 |
+
if ($orderModel != null && $orderModel->getId ()) {
|
| 105 |
+
$this->_orderCount ['imported'] ++;
|
| 106 |
+
$orderModel->setData ( 'dhl_mein_paket_order_id', $order->getOrderId () );
|
| 107 |
+
$this->createInvoice ( $orderModel );
|
| 108 |
+
|
| 109 |
+
$cart->setState ( $status );
|
| 110 |
+
$cart->save ();
|
| 111 |
+
} else {
|
| 112 |
+
$successCode = $this->_importOrder ( $order, self::POSTPAY_IMPORT_PAYMENT_METHOD );
|
| 113 |
+
switch ($successCode) {
|
| 114 |
+
case self::IMPORTED_ORDER_STATUS :
|
| 115 |
+
$this->_orderCount ['imported'] ++;
|
| 116 |
+
|
| 117 |
+
$cart->setState ( $status );
|
| 118 |
+
$cart->save ();
|
| 119 |
+
|
| 120 |
+
break;
|
| 121 |
+
case self::DUPLICATE_ORDER_STATUS :
|
| 122 |
+
$this->_orderCount ['duplicates'] ++;
|
| 123 |
+
|
| 124 |
+
$cart->setState ( $status );
|
| 125 |
+
$cart->save ();
|
| 126 |
+
|
| 127 |
+
break;
|
| 128 |
+
case self::OUT_OF_STOCK_ORDER_STATUS :
|
| 129 |
+
$this->_orderCount ['outOfStock'] ++;
|
| 130 |
+
break;
|
| 131 |
+
case self::INVALID_PRODUCT_STATUS :
|
| 132 |
+
$this->_orderCount ['invalid'] ++;
|
| 133 |
+
break;
|
| 134 |
+
case self::DISABLED_ORDER_STATUS :
|
| 135 |
+
$this->_orderCount ['disabled'] ++;
|
| 136 |
+
break;
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
break;
|
| 144 |
+
case 'CANCELED' :
|
| 145 |
+
if ($order != null) {
|
| 146 |
+
$order->cancel ();
|
| 147 |
+
$order->save ();
|
| 148 |
+
}
|
| 149 |
+
$cart->setState ( $status );
|
| 150 |
+
$cart->save ();
|
| 151 |
+
break;
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
}
|
app/code/community/Dhl/Postpay/controllers/CheckoutController.php
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_CheckoutController extends Mage_Core_Controller_Front_Action {
|
| 3 |
+
|
| 4 |
+
/**
|
| 5 |
+
* Forward to postpay.
|
| 6 |
+
*/
|
| 7 |
+
public function indexAction() {
|
| 8 |
+
Mage::log ( 'Called custom ' . __METHOD__ );
|
| 9 |
+
|
| 10 |
+
$quote = Mage::helper ( 'meinpaketcommon/data' )->getQuoteFiltered ();
|
| 11 |
+
|
| 12 |
+
if ($quote == null) {
|
| 13 |
+
$this->_redirect ( 'checkout/cart' );
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
$request = new Dhl_MeinPaketCommon_Model_Xml_Request_SubmitCartRequest ();
|
| 17 |
+
|
| 18 |
+
$cart = Mage::getModel ( 'postpay/cart' );
|
| 19 |
+
$cart->generateNotificationId ();
|
| 20 |
+
$cart->save ();
|
| 21 |
+
|
| 22 |
+
$notificationId = $request->addCart ( $quote, $cart );
|
| 23 |
+
|
| 24 |
+
if ($request->isHasData ()) {
|
| 25 |
+
|
| 26 |
+
// $this->getInfoInstance ()->setData ( 'postpay_notification_id' );
|
| 27 |
+
|
| 28 |
+
$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );
|
| 29 |
+
/* @var $client Dhl_MeinPaketCommon_Model_Client_XmlOverHttp */
|
| 30 |
+
|
| 31 |
+
try {
|
| 32 |
+
$response = $client->send ( $request );
|
| 33 |
+
/* @var $response Dhl_MeinPaketCommon_Model_Xml_Response_SubmitCartResponse */
|
| 34 |
+
|
| 35 |
+
// $this->getInfoInstance ()->setData ( 'postpay_cart_id', $response->getCartId () );
|
| 36 |
+
|
| 37 |
+
$quote->delete ();
|
| 38 |
+
$this->_redirectUrl ( $response->getRedirectURL () );
|
| 39 |
+
return;
|
| 40 |
+
} catch ( Exception $e ) {
|
| 41 |
+
Mage::logException ( $e );
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
$this->_redirect ( 'checkout/cart' );
|
| 45 |
+
}
|
| 46 |
+
}
|
app/code/community/Dhl/Postpay/controllers/NotificationController.php
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_ResponseController extends Mage_Core_Controller_Front_Action {
|
| 3 |
+
public function pushAction() {
|
| 4 |
+
// externalCartId=[CartId]&ordered=[ordered]&status=[Status]¬ificationId=[notificationId]
|
| 5 |
+
$cart = $Mage::getModel ( 'postpay/cart' )->load ( $this->getRequest ()->getParam ( 'externalCartId' ) );
|
| 6 |
+
|
| 7 |
+
if (! $cart->getId () && $cart->getOrderId () != null) {
|
| 8 |
+
return;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
$order = Mage::getModel ( 'sales/order' )->load ( $cart->getOrderId () );
|
| 12 |
+
/* @var $order Mage_Sales_Model_Order */
|
| 13 |
+
|
| 14 |
+
if ($order && $order->getPayment ()->getMethodInstance ()->getCode () == 'postpay' && $order->getPayment ()->getMethodInstance ()->getInfoInstance ()->getData ( 'postpay_order_id' ) == $this->getRequest ()->getParam ( 'orderId' ) && $order->getPayment ()->getMethodInstance ()->getInfoInstance ()->getData ( 'postpay_notification_id' ) == $this->getRequest ()->getParam ( 'notificationId' )) {
|
| 15 |
+
$status = $this->getRequest ()->getParam ( 'status', 'Pending' );
|
| 16 |
+
$order->getPayment ()->getMethodInstance ()->getInfoInstance ()->setData ( 'postpay_status', $status );
|
| 17 |
+
|
| 18 |
+
switch ($status) {
|
| 19 |
+
case 'CreatedOrder' :
|
| 20 |
+
if ($order->canInvoice ()) {
|
| 21 |
+
$invoice = $order->prepareInvoice ();
|
| 22 |
+
|
| 23 |
+
$invoice->setRequestedCaptureCase ( Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE );
|
| 24 |
+
$invoice->register ();
|
| 25 |
+
$transactionSave = Mage::getModel ( 'core/resource_transaction' )->addObject ( $invoice )->addObject ( $invoice->getOrder () );
|
| 26 |
+
$transactionSave->save ();
|
| 27 |
+
}
|
| 28 |
+
break;
|
| 29 |
+
case 'Canceled' :
|
| 30 |
+
if ($order->canCancel ()) {
|
| 31 |
+
$order->cancel ();
|
| 32 |
+
$order->save ();
|
| 33 |
+
}
|
| 34 |
+
break;
|
| 35 |
+
default :
|
| 36 |
+
// Nothing to do
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}
|
app/code/community/Dhl/Postpay/controllers/ResponseController.php
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Dhl_Postpay_ResponseController extends Mage_Core_Controller_Front_Action {
|
| 3 |
+
|
| 4 |
+
/**
|
| 5 |
+
* When paypal returns
|
| 6 |
+
* The order information at this point is in POST
|
| 7 |
+
* variables.
|
| 8 |
+
* However, you don't want to "process" the order until you
|
| 9 |
+
* get validation from the api.
|
| 10 |
+
*/
|
| 11 |
+
public function successAction() {
|
| 12 |
+
Mage::log ( 'Called custom ' . __METHOD__ );
|
| 13 |
+
// if (! $this->_isValidToken ()) {
|
| 14 |
+
// Mage::Log ( 'Token is invalid.' );
|
| 15 |
+
// $this->_redirect ( 'checkout/cart' );
|
| 16 |
+
// }
|
| 17 |
+
|
| 18 |
+
$this->_redirect ( 'checkout/onepage/success', array (
|
| 19 |
+
'_secure' => true
|
| 20 |
+
) );
|
| 21 |
+
}
|
| 22 |
+
/**
|
| 23 |
+
* Handles 'falures' from api
|
| 24 |
+
* Failure could occur if api system failure, insufficent funds, or system error.
|
| 25 |
+
*
|
| 26 |
+
* @throws Exception
|
| 27 |
+
*/
|
| 28 |
+
public function errorAction() {
|
| 29 |
+
Mage::Log ( 'Called ' . __METHOD__ );
|
| 30 |
+
$this->_cancelAction ();
|
| 31 |
+
}
|
| 32 |
+
public function backAction() {
|
| 33 |
+
Mage::Log ( 'Called ' . __METHOD__ );
|
| 34 |
+
$this->_cancelAction ();
|
| 35 |
+
}
|
| 36 |
+
protected function _cancelAction() {
|
| 37 |
+
$orderId = $this->getRequest ()->getParam ( 'order' );
|
| 38 |
+
|
| 39 |
+
if ($orderId != null) {
|
| 40 |
+
$order = Mage::getModel ( 'sales/order' )->load ( $orderId );
|
| 41 |
+
/* @var $order Mage_Sales_Model_Order */
|
| 42 |
+
if ($order->canCancel ()) {
|
| 43 |
+
$order->cancel ();
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
$this->_redirect ( 'checkout/onepage/failure', array (
|
| 48 |
+
'_secure' => true
|
| 49 |
+
) );
|
| 50 |
+
}
|
| 51 |
+
}
|
app/code/community/Dhl/Postpay/etc/config.xml
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Dhl_Postpay>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Dhl_Postpay>
|
| 7 |
+
</modules>
|
| 8 |
+
<admin>
|
| 9 |
+
<routers>
|
| 10 |
+
<postpay>
|
| 11 |
+
<use>admin</use>
|
| 12 |
+
<args>
|
| 13 |
+
<module>Dhl_Postpay</module>
|
| 14 |
+
<frontName>postpay</frontName>
|
| 15 |
+
</args>
|
| 16 |
+
</postpay>
|
| 17 |
+
</routers>
|
| 18 |
+
</admin>
|
| 19 |
+
<adminhtml>
|
| 20 |
+
<translate>
|
| 21 |
+
<modules>
|
| 22 |
+
<postpay>
|
| 23 |
+
<files>
|
| 24 |
+
<default>Dhl_Postpay.csv</default>
|
| 25 |
+
</files>
|
| 26 |
+
</postpay>
|
| 27 |
+
</modules>
|
| 28 |
+
</translate>
|
| 29 |
+
<layout>
|
| 30 |
+
<updates>
|
| 31 |
+
<postpay>
|
| 32 |
+
<file>postpay.xml</file>
|
| 33 |
+
</postpay>
|
| 34 |
+
</updates>
|
| 35 |
+
</layout>
|
| 36 |
+
</adminhtml>
|
| 37 |
+
<default>
|
| 38 |
+
<payment>
|
| 39 |
+
<postpay_standard>
|
| 40 |
+
<active>1</active>
|
| 41 |
+
<model>postpay/payment_method_standard</model>
|
| 42 |
+
<order_status>pending</order_status>
|
| 43 |
+
<title>Postpay Standard</title>
|
| 44 |
+
<allowspecific>0</allowspecific>
|
| 45 |
+
<payment_action>authorize</payment_action>
|
| 46 |
+
<!-- <group>offline</group> -->
|
| 47 |
+
</postpay_standard>
|
| 48 |
+
<postpay_express>
|
| 49 |
+
<active>1</active>
|
| 50 |
+
<model>postpay/payment_method_express</model>
|
| 51 |
+
<order_status>pending</order_status>
|
| 52 |
+
<title>Postpay Express</title>
|
| 53 |
+
<allowspecific>0</allowspecific>
|
| 54 |
+
<payment_action>authorize</payment_action>
|
| 55 |
+
<!-- <group>offline</group> -->
|
| 56 |
+
</postpay_express>
|
| 57 |
+
</payment>
|
| 58 |
+
</default>
|
| 59 |
+
<frontend>
|
| 60 |
+
<translate>
|
| 61 |
+
<modules>
|
| 62 |
+
<postpay>
|
| 63 |
+
<files>
|
| 64 |
+
<default>Dhl_Postpay.csv</default>
|
| 65 |
+
</files>
|
| 66 |
+
</postpay>
|
| 67 |
+
</modules>
|
| 68 |
+
</translate>
|
| 69 |
+
<routers>
|
| 70 |
+
<postpay>
|
| 71 |
+
<use>standard</use>
|
| 72 |
+
<args>
|
| 73 |
+
<module>Dhl_Postpay</module>
|
| 74 |
+
<frontName>postpay</frontName>
|
| 75 |
+
</args>
|
| 76 |
+
</postpay>
|
| 77 |
+
</routers>
|
| 78 |
+
<layout>
|
| 79 |
+
<updates>
|
| 80 |
+
<postpay>
|
| 81 |
+
<file>postpay.xml</file>
|
| 82 |
+
</postpay>
|
| 83 |
+
</updates>
|
| 84 |
+
</layout>
|
| 85 |
+
</frontend>
|
| 86 |
+
<global>
|
| 87 |
+
<resources>
|
| 88 |
+
<postpay_setup>
|
| 89 |
+
<setup>
|
| 90 |
+
<module>Dhl_Postpay</module>
|
| 91 |
+
<class>Dhl_Postpay_Model_Resource_Eav_Mysql4_Setup</class>
|
| 92 |
+
</setup>
|
| 93 |
+
<connection>
|
| 94 |
+
<use>core_setup</use>
|
| 95 |
+
</connection>
|
| 96 |
+
</postpay_setup>
|
| 97 |
+
</resources>
|
| 98 |
+
<models>
|
| 99 |
+
<postpay>
|
| 100 |
+
<class>Dhl_Postpay_Model</class>
|
| 101 |
+
<resourceModel>postpay_mysql4</resourceModel>
|
| 102 |
+
</postpay>
|
| 103 |
+
<postpay_mysql4>
|
| 104 |
+
<class>Dhl_Postpay_Model_Mysql4</class>
|
| 105 |
+
<entities>
|
| 106 |
+
<cart>
|
| 107 |
+
<table>postpay_cart</table>
|
| 108 |
+
</cart>
|
| 109 |
+
</entities>
|
| 110 |
+
</postpay_mysql4>
|
| 111 |
+
<meinpaketcommon>
|
| 112 |
+
<rewrite>
|
| 113 |
+
<service_order_importService>Dhl_Postpay_Model_Service_Order_ImportService</service_order_importService>
|
| 114 |
+
</rewrite>
|
| 115 |
+
</meinpaketcommon>
|
| 116 |
+
</models>
|
| 117 |
+
<blocks>
|
| 118 |
+
<postpay>
|
| 119 |
+
<class>Dhl_Postpay_Block</class>
|
| 120 |
+
</postpay>
|
| 121 |
+
</blocks>
|
| 122 |
+
<helpers>
|
| 123 |
+
<postpay>
|
| 124 |
+
<class>Dhl_Postpay_Helper</class>
|
| 125 |
+
</postpay>
|
| 126 |
+
</helpers>
|
| 127 |
+
</global>
|
| 128 |
+
</config>
|
app/code/community/Dhl/Postpay/etc/system.xml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<sections>
|
| 4 |
+
<payment>
|
| 5 |
+
<groups>
|
| 6 |
+
<postpay translate="label" module="postpay">
|
| 7 |
+
<label>Postpay Payment Module</label>
|
| 8 |
+
<sort_order>999</sort_order>
|
| 9 |
+
<show_in_default>1</show_in_default>
|
| 10 |
+
<show_in_website>1</show_in_website>
|
| 11 |
+
<show_in_store>0</show_in_store>
|
| 12 |
+
<fields>
|
| 13 |
+
<order_status translate="label">
|
| 14 |
+
<label>New order status</label>
|
| 15 |
+
<frontend_type>select</frontend_type>
|
| 16 |
+
<source_model>adminhtml/system_config_source_order_status_processing</source_model>
|
| 17 |
+
<sort_order>2</sort_order>
|
| 18 |
+
<show_in_default>1</show_in_default>
|
| 19 |
+
<show_in_website>1</show_in_website>
|
| 20 |
+
<show_in_store>0</show_in_store>
|
| 21 |
+
</order_status>
|
| 22 |
+
<title translate="label">
|
| 23 |
+
<label>Title</label>
|
| 24 |
+
<frontend_type>text</frontend_type>
|
| 25 |
+
<sort_order>3</sort_order>
|
| 26 |
+
<show_in_default>1</show_in_default>
|
| 27 |
+
<show_in_website>1</show_in_website>
|
| 28 |
+
<show_in_store>0</show_in_store>
|
| 29 |
+
</title>
|
| 30 |
+
<address translate="label comment">
|
| 31 |
+
<label>Send Customer Address</label>
|
| 32 |
+
<comment><![CDATA[Send Customer Address to POSTPAY]]></comment>
|
| 33 |
+
<frontend_type>select</frontend_type>
|
| 34 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 35 |
+
<sort_order>30</sort_order>
|
| 36 |
+
<show_in_default>1</show_in_default>
|
| 37 |
+
<show_in_website>0</show_in_website>
|
| 38 |
+
<show_in_store>0</show_in_store>
|
| 39 |
+
</address>
|
| 40 |
+
</fields>
|
| 41 |
+
</postpay>
|
| 42 |
+
</groups>
|
| 43 |
+
</payment>
|
| 44 |
+
</sections>
|
| 45 |
+
</config>
|
| 46 |
+
|
app/code/community/Dhl/Postpay/sql/postpay_setup/mysql4-install-1.0.0.php
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Setup-Script fuer Dhl_Postpay
|
| 4 |
+
*/
|
| 5 |
+
|
| 6 |
+
/* @var $installer Dhl_Postpay_Model_Resource_Eav_Mysql4_Setup */
|
| 7 |
+
$installer = $this;
|
| 8 |
+
$installer->startSetup ();
|
| 9 |
+
|
| 10 |
+
$installer->installEntities ();
|
| 11 |
+
|
| 12 |
+
$installer->run ( "
|
| 13 |
+
DROP TABLE IF EXISTS {$this->getTable('postpay/cart')};
|
| 14 |
+
CREATE TABLE {$this->getTable('postpay/cart')} (
|
| 15 |
+
`cart_id` int(11) unsigned NOT NULL auto_increment,
|
| 16 |
+
`order_id` int(11) unsigned,
|
| 17 |
+
`notification_id` varchar(255),
|
| 18 |
+
`state` varchar(255) DEFAULT 'PENDING',
|
| 19 |
+
`created_at` timestamp default CURRENT_TIMESTAMP(),
|
| 20 |
+
PRIMARY KEY(`cart_id`)
|
| 21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MeinPaket Sync';
|
| 22 |
+
" );
|
| 23 |
+
|
| 24 |
+
$installer->endSetup ();
|
app/design/adminhtml/default/default/layout/meinpaket.xml
CHANGED
|
@@ -1,20 +1,5 @@
|
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<layout version="0.1.0">
|
| 3 |
-
<meinpaket_head_imports>
|
| 4 |
-
<reference name="head">
|
| 5 |
-
<action method="addItem">
|
| 6 |
-
<type>skin_js</type>
|
| 7 |
-
<name>meinpaket/module.js</name>
|
| 8 |
-
<params />
|
| 9 |
-
</action>
|
| 10 |
-
<action method="addItem">
|
| 11 |
-
<type>skin_css</type>
|
| 12 |
-
<name>meinpaket/module.css</name>
|
| 13 |
-
<params />
|
| 14 |
-
</action>
|
| 15 |
-
</reference>
|
| 16 |
-
</meinpaket_head_imports>
|
| 17 |
-
|
| 18 |
<meinpaket_adminhtml_categoryimport_index>
|
| 19 |
<update handle="meinpaket_head_imports" />
|
| 20 |
<reference name="content">
|
|
@@ -38,20 +23,6 @@
|
|
| 38 |
</reference>
|
| 39 |
</meinpaket_adminhtml_backlog_product_index>
|
| 40 |
|
| 41 |
-
<meinpaket_adminhtml_log_index translate="label" module="meinpaket">
|
| 42 |
-
<update handle="meinpaket_head_imports" />
|
| 43 |
-
<reference name="content">
|
| 44 |
-
<block type="meinpaket/adminhtml_log" name="meinpaket_admin_log_grid" />
|
| 45 |
-
</reference>
|
| 46 |
-
</meinpaket_adminhtml_log_index>
|
| 47 |
-
|
| 48 |
-
<meinpaket_adminhtml_async_index translate="label" module="meinpaket">
|
| 49 |
-
<update handle="meinpaket_head_imports" />
|
| 50 |
-
<reference name="content">
|
| 51 |
-
<block type="meinpaket/adminhtml_async" name="meinpaket_admin_async_grid" />
|
| 52 |
-
</reference>
|
| 53 |
-
</meinpaket_adminhtml_async_index>
|
| 54 |
-
|
| 55 |
<meinpaket_adminhtml_matching_index>
|
| 56 |
<update handle="meinpaket_head_imports" />
|
| 57 |
<block type="core/text_list" name="root" output="toHtml">
|
|
@@ -76,10 +47,4 @@
|
|
| 76 |
</action>
|
| 77 |
</reference>
|
| 78 |
</adminhtml_catalog_product_edit>
|
| 79 |
-
|
| 80 |
-
<adminhtml_system_config_edit>
|
| 81 |
-
<update handle="meinpaket_head_imports" />
|
| 82 |
-
<reference name="head">
|
| 83 |
-
</reference>
|
| 84 |
-
</adminhtml_system_config_edit>
|
| 85 |
</layout>
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<layout version="0.1.0">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
<meinpaket_adminhtml_categoryimport_index>
|
| 4 |
<update handle="meinpaket_head_imports" />
|
| 5 |
<reference name="content">
|
| 23 |
</reference>
|
| 24 |
</meinpaket_adminhtml_backlog_product_index>
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
<meinpaket_adminhtml_matching_index>
|
| 27 |
<update handle="meinpaket_head_imports" />
|
| 28 |
<block type="core/text_list" name="root" output="toHtml">
|
| 47 |
</action>
|
| 48 |
</reference>
|
| 49 |
</adminhtml_catalog_product_edit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
</layout>
|
app/design/adminhtml/default/default/layout/meinpaketcommon.xml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
<meinpaket_head_imports>
|
| 4 |
+
<reference name="head">
|
| 5 |
+
<action method="addItem">
|
| 6 |
+
<type>skin_js</type>
|
| 7 |
+
<name>meinpaketcommon/module.js</name>
|
| 8 |
+
<params />
|
| 9 |
+
</action>
|
| 10 |
+
<action method="addItem">
|
| 11 |
+
<type>skin_css</type>
|
| 12 |
+
<name>meinpaketcommon/module.css</name>
|
| 13 |
+
<params />
|
| 14 |
+
</action>
|
| 15 |
+
</reference>
|
| 16 |
+
</meinpaket_head_imports>
|
| 17 |
+
|
| 18 |
+
<meinpaketcommon_adminhtml_log_index translate="label"
|
| 19 |
+
module="meinpaketcommon">
|
| 20 |
+
<update handle="meinpaket_head_imports" />
|
| 21 |
+
<reference name="content">
|
| 22 |
+
<block type="meinpaketcommon/adminhtml_log" name="meinpaketcommon_admin_log_grid" />
|
| 23 |
+
</reference>
|
| 24 |
+
</meinpaketcommon_adminhtml_log_index>
|
| 25 |
+
|
| 26 |
+
<meinpaketcommon_adminhtml_async_index translate="label"
|
| 27 |
+
module="meinpaketcommon">
|
| 28 |
+
<update handle="meinpaket_head_imports" />
|
| 29 |
+
<reference name="content">
|
| 30 |
+
<block type="meinpaketcommon/adminhtml_async" name="meinpaket_admin_async_grid" />
|
| 31 |
+
</reference>
|
| 32 |
+
</meinpaketcommon_adminhtml_async_index>
|
| 33 |
+
|
| 34 |
+
<adminhtml_system_config_edit>
|
| 35 |
+
<update handle="meinpaket_head_imports" />
|
| 36 |
+
<reference name="head"></reference>
|
| 37 |
+
</adminhtml_system_config_edit>
|
| 38 |
+
</layout>
|
app/design/adminhtml/default/default/layout/postpay.xml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
</layout>
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit.phtml
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/* @var $block Dhl_MeinPaket_Block_Adminhtml_Attributemapping_Edit */
|
| 3 |
-
$block = $this;
|
| 4 |
-
?>
|
| 5 |
-
<div class="content-header">
|
| 6 |
-
<table cellspacing="0" class="grid-header">
|
| 7 |
-
<tr>
|
| 8 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Attribute Mappings'); ?></h3></td>
|
| 9 |
-
<td class="a-right">
|
| 10 |
-
<button onclick="addAttributeMapping()" class="scalable add"
|
| 11 |
-
type="button" id="startButton">
|
| 12 |
-
<span><?php echo $this->__('Add Attribute Mapping'); ?></span>
|
| 13 |
-
</button> <input type="hidden" name="mapping_id" id="mapping_id"
|
| 14 |
-
value="<?php echo $block->getMappingId(); ?>" /> <input
|
| 15 |
-
type="hidden" name="variant_id" id="variant_id"
|
| 16 |
-
value="<?php echo $block->getVariantId(); ?>" /> <input
|
| 17 |
-
type="hidden" name="attribute_set_id" id="attribute_set_id"
|
| 18 |
-
value="<?php echo $block->getAttributeSetId(); ?>" />
|
| 19 |
-
</td>
|
| 20 |
-
</tr>
|
| 21 |
-
</table>
|
| 22 |
-
</div>
|
| 23 |
-
todo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/attributes.phtml
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
<?php if(!$this->getMappingExists()) : ?>
|
| 2 |
-
<script type="text/javascript">
|
| 3 |
-
MeinPaket.magentoAttributes = <?php echo $this->getAvailableMagentoAttributes(); ?>;
|
| 4 |
-
MeinPaket.meinpaketAttributes = <?php echo $this->getAvailableMeinPaketAttributes(); ?>;
|
| 5 |
-
MeinPaket.url = {};
|
| 6 |
-
MeinPaket.url.editAttributeValues = "<?php echo $this->getUrl('*/*/loadAttributeValues'); ?>";
|
| 7 |
-
</script>
|
| 8 |
-
<div class="entry-edit custom-options bundle"
|
| 9 |
-
id="meinpaket_attributes_container">
|
| 10 |
-
<div class="entry-edit-head">
|
| 11 |
-
<h4><?php echo $this->__('Attributes') ?></h4>
|
| 12 |
-
<div class="right"><?php echo $this->getAddButtonHtml() ?></div>
|
| 13 |
-
</div>
|
| 14 |
-
|
| 15 |
-
<div id="meinpaket_attribute" class="box">
|
| 16 |
-
<div id="meinpaket_attribute_top"></div>
|
| 17 |
-
</div>
|
| 18 |
-
</div>
|
| 19 |
-
<?php else : ?>
|
| 20 |
-
<div><?php echo $this->__('A mapping for the Magento attribute set already exists.'); ?></div>
|
| 21 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/mapping.phtml
DELETED
|
@@ -1,36 +0,0 @@
|
|
| 1 |
-
<div
|
| 2 |
-
id="attribute_mapping_container_<?php echo $this->getCurrentIndex(); ?>"
|
| 3 |
-
class="option-box attribute-mapping-container">
|
| 4 |
-
<table class="option-header" cellpadding="0" cellspacing="0">
|
| 5 |
-
<thead>
|
| 6 |
-
<tr>
|
| 7 |
-
<th class="opt-type"><?php echo $this->__('Magento Attribute'); ?></th>
|
| 8 |
-
<th class="opt-req"><?php echo $this->__('MeinPaket Attribute'); ?></th>
|
| 9 |
-
<th> </th>
|
| 10 |
-
<th> </th>
|
| 11 |
-
</tr>
|
| 12 |
-
</thead>
|
| 13 |
-
<tbody id="attribute_table_<?php echo $this->getCurrentIndex(); ?>">
|
| 14 |
-
<tr>
|
| 15 |
-
<td><?php echo $this->getAttributeSetAttributesSelectElement()->toHtml(); ?></td>
|
| 16 |
-
<td><?php echo $this->getVariantAttributesSelectElement()->toHtml(); ?></td>
|
| 17 |
-
<td>
|
| 18 |
-
<button type="button" value="" class="scalable add"
|
| 19 |
-
onclick="MeinPaket.loadValueMapping(<?php echo $this->getCurrentIndex(); ?>);">
|
| 20 |
-
<span><?php echo $this->__('Edit Value Mapping'); ?></span>
|
| 21 |
-
</button>
|
| 22 |
-
</td>
|
| 23 |
-
<td>
|
| 24 |
-
<button type="button" value="" class="scalable delete"
|
| 25 |
-
onclick="MeinPaket.deleteAttributeMapping(<?php echo $this->getCurrentIndex(); ?>);">
|
| 26 |
-
<span><?php echo $this->__('Delete Mapping'); ?></span>
|
| 27 |
-
</button>
|
| 28 |
-
</td>
|
| 29 |
-
</tr>
|
| 30 |
-
<tr id="values_row_<?php echo $this->getCurrentIndex(); ?>">
|
| 31 |
-
<td colspan="4"></td>
|
| 32 |
-
</tr>
|
| 33 |
-
</tbody>
|
| 34 |
-
</table>
|
| 35 |
-
<div id="values_container_<?php echo $this->getCurrentIndex(); ?>"></div>
|
| 36 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/edit/valuemapping.phtml
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/* @var $block Dhl_MeinPaket_Block_Adminhtml_Attributemapping_Edit_Valuemapping */
|
| 3 |
-
$block = $this;
|
| 4 |
-
$mpValues = $block->getMeinpaketOptions ();
|
| 5 |
-
$mageValues = $block->getMagentoOptions ();
|
| 6 |
-
$mappingId = $block->getMappingIndex ();
|
| 7 |
-
?>
|
| 8 |
-
<?php if(sizeof($mpValues) > 0) : ?>
|
| 9 |
-
<tr>
|
| 10 |
-
<th><?php echo Mage::helper('meinpaket')->__('Magento Value'); ?></th>
|
| 11 |
-
<th><?php echo Mage::helper('meinpaket')->__('MeinPaket Value'); ?></th>
|
| 12 |
-
<th> </th>
|
| 13 |
-
<th> </th>
|
| 14 |
-
</tr>
|
| 15 |
-
<?php foreach($mageValues as $mageValue): ?>
|
| 16 |
-
<?php
|
| 17 |
-
$mpSelect = '<select id="attribute_value_id_' . $mageValue ['id'] . '" name="attribute_value_mapping[' . $mappingId . '][' . $mageValue ['id'] . ']">';
|
| 18 |
-
$mpSelect .= '<option value="">' . Mage::helper ( 'meinpaket' )->__ ( 'not assigned' ) . '</option>';
|
| 19 |
-
foreach ( $mpValues as $mpValue ) {
|
| 20 |
-
$mpSelect .= '<option value="' . $mpValue ['id'] . '" ';
|
| 21 |
-
if ($mpValue ['assigned'] !== null && $mpValue ['assigned'] == $mageValue ['id']) {
|
| 22 |
-
// if($mageValue['name'] == $mpValue['name']) {
|
| 23 |
-
$mpSelect .= 'selected="selected"';
|
| 24 |
-
}
|
| 25 |
-
$mpSelect .= '>' . $mpValue ['name'] . '</option>';
|
| 26 |
-
}
|
| 27 |
-
?>
|
| 28 |
-
<tr>
|
| 29 |
-
<td><?php echo $mageValue['name']; ?></td>
|
| 30 |
-
<td><?php echo $mpSelect; ?></td>
|
| 31 |
-
<td> </td>
|
| 32 |
-
<td> </td>
|
| 33 |
-
</tr>
|
| 34 |
-
<?php endforeach; ?>
|
| 35 |
-
<?php else : ?>
|
| 36 |
-
<tr>
|
| 37 |
-
<td colspan="4">
|
| 38 |
-
<?php echo $this->__('No mapable attribute values available for the selected MeinPaket attribute.'); ?><br /><?php echo $this->__('Magento attribute values will be used instead.'); ?>
|
| 39 |
-
</td>
|
| 40 |
-
</tr>
|
| 41 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/editform.phtml
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Attribute Mappings'); ?></h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<button onclick="addAttributeMapping()" class="scalable add"
|
| 8 |
-
type="button" id="startButton">
|
| 9 |
-
<span><?php echo $this->__('Add Attribute Mapping'); ?></span>
|
| 10 |
-
</button>
|
| 11 |
-
</td>
|
| 12 |
-
</tr>
|
| 13 |
-
</table>
|
| 14 |
-
</div>
|
| 15 |
-
todo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/Attributemapping/index.phtml
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<div class="content-header">
|
| 2 |
-
<table cellspacing="0" class="grid-header">
|
| 3 |
-
<tr>
|
| 4 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Attribute Mappings'); ?></h3></td>
|
| 5 |
-
<td class="a-right">
|
| 6 |
-
<button
|
| 7 |
-
onclick="variantconfigurationsImport('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>')"
|
| 8 |
-
class="scalable add" type="button">
|
| 9 |
-
<span><?php echo $this->__('import Variantconfigurations'); ?></span>
|
| 10 |
-
</button>
|
| 11 |
-
<button
|
| 12 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_attributeMapping/edit') ?>')"
|
| 13 |
-
class="scalable add" type="button" id="startButton">
|
| 14 |
-
<span><?php echo $this->__('Add Attribute Mapping'); ?></span>
|
| 15 |
-
</button>
|
| 16 |
-
</td>
|
| 17 |
-
</tr>
|
| 18 |
-
</table>
|
| 19 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/CategoryImport/import.phtml
DELETED
|
@@ -1,121 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/* @var $this Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Import */
|
| 3 |
-
/* @var $result Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_Result */
|
| 4 |
-
$result = $this->getResult ();
|
| 5 |
-
?>
|
| 6 |
-
<div class="content-header">
|
| 7 |
-
<table class="grid-header">
|
| 8 |
-
<tr>
|
| 9 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Import Categories'); ?></h3></td>
|
| 10 |
-
<td class="a-right">
|
| 11 |
-
<button
|
| 12 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/index/') ?>')"
|
| 13 |
-
class="scalable back" type="button">
|
| 14 |
-
<span><?php echo $this->__('start again'); ?></span>
|
| 15 |
-
</button>
|
| 16 |
-
</td>
|
| 17 |
-
</tr>
|
| 18 |
-
</table>
|
| 19 |
-
</div>
|
| 20 |
-
<div class="dashboard-container meinpaket-content">
|
| 21 |
-
<ul class="meinpaket-steps">
|
| 22 |
-
<li class="nr1"><p><?php echo __('Overview'); ?></p></li>
|
| 23 |
-
<li class="nr2"><p><?php echo __('Import'); ?></p></li>
|
| 24 |
-
<li class="nr3 active"><p><?php echo __('Result'); ?></p></li>
|
| 25 |
-
</ul>
|
| 26 |
-
<div class="cc">
|
| 27 |
-
<!-- -->
|
| 28 |
-
</div>
|
| 29 |
-
|
| 30 |
-
<div id="meinpaket-results" class="scrollablebox grid entry-edit">
|
| 31 |
-
<?php if($result !== null && $result->getNewCategoriesCount() + $result->getDeletedCategoriesCount() + $result->getUpdatedCategoriesCount() > 0) : ?>
|
| 32 |
-
<table id="meinpaket-results">
|
| 33 |
-
<tbody>
|
| 34 |
-
|
| 35 |
-
<?php /*** NEW CATEGORIES **********************************************/ ?>
|
| 36 |
-
<?php if($result->getNewCategoriesCount() > 0) : ?>
|
| 37 |
-
<tr>
|
| 38 |
-
<td colspan="4" class="row-subheader"><?php echo __('New categories'); ?> | <span
|
| 39 |
-
class="resultCount"><?php echo $result->getNewCategoriesCount().' '.__('total'); ?></span></td>
|
| 40 |
-
</tr>
|
| 41 |
-
<tr class="headings">
|
| 42 |
-
<th class="header-center">#</th>
|
| 43 |
-
<th class="col-product" colspan="2"><?php echo __('Category'); ?></th>
|
| 44 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 45 |
-
</tr>
|
| 46 |
-
<?php
|
| 47 |
-
$newCategories = $result->getNewCategories ();
|
| 48 |
-
$currentIndex = 0;
|
| 49 |
-
$stripeClass = 'odd';
|
| 50 |
-
?>
|
| 51 |
-
<?php foreach($newCategories as $category) : ?>
|
| 52 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 53 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 54 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 55 |
-
<td colspan="2"><?php echo $category->getName(); ?> </td>
|
| 56 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 57 |
-
</tr>
|
| 58 |
-
<?php endforeach; ?>
|
| 59 |
-
<?php endif; ?>
|
| 60 |
-
|
| 61 |
-
<?php /*** UPDATED CATEGORIES ******************************************/ ?>
|
| 62 |
-
<?php if($result->getUpdatedCategoriesCount() > 0) : ?>
|
| 63 |
-
<tr>
|
| 64 |
-
<td colspan="4" class="row-subheader"><?php echo __('Updated categories'); ?> | <span
|
| 65 |
-
class="resultCount"><?php echo $result->getUpdatedCategoriesCount().' '.__('total'); ?></span></td>
|
| 66 |
-
</tr>
|
| 67 |
-
<tr class="headings">
|
| 68 |
-
<th class="header-center">#</th>
|
| 69 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 70 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 71 |
-
</tr>
|
| 72 |
-
<?php
|
| 73 |
-
$updatedCategories = $result->getUpdatedCategories ();
|
| 74 |
-
$currentIndex = 0;
|
| 75 |
-
$stripeClass = 'odd';
|
| 76 |
-
?>
|
| 77 |
-
<?php foreach($updatedCategories as $category) : ?>
|
| 78 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 79 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 80 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 81 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 82 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 83 |
-
</tr>
|
| 84 |
-
<?php endforeach; ?>
|
| 85 |
-
<?php endif; ?>
|
| 86 |
-
|
| 87 |
-
<?php /*** DELETED CATEGORIES ******************************************/ ?>
|
| 88 |
-
<?php if($result->getDeletedCategoriesCount() > 0) : ?>
|
| 89 |
-
<tr>
|
| 90 |
-
<td colspan="4" class="row-subheader"><?php echo __('Deleted categories'); ?> | <span
|
| 91 |
-
class="resultCount"><?php echo $result->getDeletedCategoriesCount().' '.__('total'); ?></span></td>
|
| 92 |
-
</tr>
|
| 93 |
-
<tr class="headings">
|
| 94 |
-
<th class="header-center">#</th>
|
| 95 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 96 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 97 |
-
</tr>
|
| 98 |
-
<?php
|
| 99 |
-
$deletedCategories = $result->getDeletedCategories ();
|
| 100 |
-
$currentIndex = 0;
|
| 101 |
-
$stripeClass = 'odd';
|
| 102 |
-
?>
|
| 103 |
-
<?php foreach($deletedCategories as $category) : ?>
|
| 104 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 105 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 106 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 107 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 108 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 109 |
-
</tr>
|
| 110 |
-
<?php endforeach; ?>
|
| 111 |
-
<?php endif; ?>
|
| 112 |
-
</tbody>
|
| 113 |
-
</table>
|
| 114 |
-
<?php else : ?>
|
| 115 |
-
<div class="meinpaket-description">
|
| 116 |
-
<p><?php echo __('Marketplace category structure was up to date. There have been no changes.'); ?></p>
|
| 117 |
-
</div>
|
| 118 |
-
<?php endif; ?>
|
| 119 |
-
</div>
|
| 120 |
-
</div>
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/CategoryImport/index.phtml
DELETED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Import Categories'); ?></h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<!-- <button onclick="setLocationWithWait('<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/import/') ?>')" class="scalable" type="button"><span><?php echo $this->__('import categories'); ?></span></button> -->
|
| 8 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 9 |
-
id="startButton">
|
| 10 |
-
<span><?php echo $this->__('import categories'); ?></span>
|
| 11 |
-
</button>
|
| 12 |
-
</td>
|
| 13 |
-
</tr>
|
| 14 |
-
</table>
|
| 15 |
-
</div>
|
| 16 |
-
<div class="dashboard-container meinpaket-content">
|
| 17 |
-
|
| 18 |
-
<ul class="meinpaket-steps">
|
| 19 |
-
<li class="active nr1"><p><?php echo __('Overview'); ?></p></li>
|
| 20 |
-
<li class="nr2"><p><?php echo __('Import'); ?></p></li>
|
| 21 |
-
<li class="nr3"><p><?php echo __('Result'); ?></p></li>
|
| 22 |
-
</ul>
|
| 23 |
-
<div class="cc">
|
| 24 |
-
<!-- -->
|
| 25 |
-
</div>
|
| 26 |
-
|
| 27 |
-
<div id="meinpaket-description">
|
| 28 |
-
<p><?php echo __('Textual introduction into category import goes here...'); ?></p>
|
| 29 |
-
</div>
|
| 30 |
-
|
| 31 |
-
<div id="disabled-till-export" class="meinpaket-waitbox"
|
| 32 |
-
style="display: none">
|
| 33 |
-
<img src="/skin/adminhtml/default/default/meinpaket/images/loader.gif" /><br />
|
| 34 |
-
<small><?php echo $this->__('please wait'); ?></small>
|
| 35 |
-
</div>
|
| 36 |
-
|
| 37 |
-
<form id="meinpaket_form" name="meinpaket_form" method="get"
|
| 38 |
-
action="<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/import/') ?>">
|
| 39 |
-
<fieldset>
|
| 40 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 41 |
-
id="startButton">
|
| 42 |
-
<span><?php echo $this->__('import categories'); ?></span>
|
| 43 |
-
</button>
|
| 44 |
-
</fieldset>
|
| 45 |
-
</form>
|
| 46 |
-
</div>
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/OrderImport/import.phtml
DELETED
|
@@ -1,38 +0,0 @@
|
|
| 1 |
-
<div class="content-header">
|
| 2 |
-
<table cellspacing="0" class="grid-header">
|
| 3 |
-
<tr>
|
| 4 |
-
<td><h3 class="icon-head meinpaket">Importiere Bestellungen</h3></td>
|
| 5 |
-
<td class="a-right">
|
| 6 |
-
<button
|
| 7 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_orderImport/index/') ?>')"
|
| 8 |
-
class="scalable back" type="button">
|
| 9 |
-
<span><?php echo $this->__('start again'); ?></span>
|
| 10 |
-
</button>
|
| 11 |
-
<button
|
| 12 |
-
onclick="setLocation('<?php echo $this->getUrl('adminhtml/sales_order/index/') ?>')"
|
| 13 |
-
class="scalable" type="button">
|
| 14 |
-
<span><?php echo $this->__('view orders'); ?></span>
|
| 15 |
-
</button>
|
| 16 |
-
</td>
|
| 17 |
-
</tr>
|
| 18 |
-
</table>
|
| 19 |
-
</div>
|
| 20 |
-
<div class="dashboard-container meinpaket-content">
|
| 21 |
-
<?php echo $this->getChildHtml('steps'); ?>
|
| 22 |
-
<div class="cc">
|
| 23 |
-
<!-- -->
|
| 24 |
-
</div>
|
| 25 |
-
<div class="meinpaket-description">
|
| 26 |
-
<p>Bestellungen importiert</p>
|
| 27 |
-
<button
|
| 28 |
-
onclick="setLocation('<?php echo $this->getUrl('adminhtml/sales_order/index/') ?>')"
|
| 29 |
-
class="scalable" type="button">
|
| 30 |
-
<span><?php echo $this->__('view orders'); ?></span>
|
| 31 |
-
</button>
|
| 32 |
-
|
| 33 |
-
</div>
|
| 34 |
-
|
| 35 |
-
<br />
|
| 36 |
-
|
| 37 |
-
</div>
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/OrderImport/index.phtml
DELETED
|
@@ -1,76 +0,0 @@
|
|
| 1 |
-
<div class="content-header">
|
| 2 |
-
<table cellspacing="0" class="grid-header">
|
| 3 |
-
<tr>
|
| 4 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Import Products'); ?></h3></td>
|
| 5 |
-
<td class="a-right">
|
| 6 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 7 |
-
id="startButton">
|
| 8 |
-
<span><?php echo $this->__('import orders'); ?></span>
|
| 9 |
-
</button>
|
| 10 |
-
|
| 11 |
-
</td>
|
| 12 |
-
</tr>
|
| 13 |
-
</table>
|
| 14 |
-
</div>
|
| 15 |
-
<div class="dashboard-container meinpaket-content">
|
| 16 |
-
<?php echo $this->getChildHtml('steps'); ?>
|
| 17 |
-
<div class="cc">
|
| 18 |
-
<!-- -->
|
| 19 |
-
</div>
|
| 20 |
-
<div id="meinpaket-description">
|
| 21 |
-
<p><?php echo __('Textual guide for importing orders follows here'); ?></p>
|
| 22 |
-
</div>
|
| 23 |
-
<div id="disabled-till-export" class="meinpaket-waitbox"
|
| 24 |
-
style="display: none">
|
| 25 |
-
<img src="/skin/adminhtml/default/default/meinpaket/images/loader.gif" /><br />
|
| 26 |
-
<small><?php echo $this->__('please wait'); ?></small>
|
| 27 |
-
</div>
|
| 28 |
-
<form id="meinpaket_form" name="meinpaket_form" method="get"
|
| 29 |
-
action="<?php echo $this->getUrl('meinpaket/adminhtml_orderImport/import/') ?>">
|
| 30 |
-
<fieldset>
|
| 31 |
-
<label><?php echo $this->__('start date'); ?></label><input
|
| 32 |
-
name="startdate" id="startdate"
|
| 33 |
-
value="<?php echo strftime('%m/%e/%y',strtotime('-1 week')); ?>"
|
| 34 |
-
class=" input-text" style="width: 110px ! important;" type="text"> <img
|
| 35 |
-
src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" alt=""
|
| 36 |
-
class="v-middle" id="startdate_trig" title="Select Date" style="">
|
| 37 |
-
<script type="text/javascript">
|
| 38 |
-
//<![CDATA[
|
| 39 |
-
Calendar.setup({
|
| 40 |
-
inputField: "startdate",
|
| 41 |
-
ifFormat: "%m/%e/%y",
|
| 42 |
-
showsTime: false,
|
| 43 |
-
button: "startdate_trig",
|
| 44 |
-
align: "Bl",
|
| 45 |
-
singleClick : true
|
| 46 |
-
});
|
| 47 |
-
//]]>
|
| 48 |
-
</script>
|
| 49 |
-
<br /> <label><?php echo $this->__('end date'); ?></label> <input
|
| 50 |
-
name="enddate" id="enddate" value="" class=" input-text"
|
| 51 |
-
style="width: 110px ! important;" type="text"> <img
|
| 52 |
-
src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" alt=""
|
| 53 |
-
class="v-middle" id="enddate_trig" title="Select Date" style="">
|
| 54 |
-
<!-- <small><?php echo $this->__('leave empty to load all till now'); ?></small> -->
|
| 55 |
-
<script type="text/javascript">
|
| 56 |
-
//<![CDATA[
|
| 57 |
-
Calendar.setup({
|
| 58 |
-
inputField: "enddate",
|
| 59 |
-
ifFormat: "%m/%e/%y",
|
| 60 |
-
showsTime: false,
|
| 61 |
-
button: "enddate_trig",
|
| 62 |
-
align: "Bl",
|
| 63 |
-
singleClick : true
|
| 64 |
-
});
|
| 65 |
-
//]]>
|
| 66 |
-
</script>
|
| 67 |
-
</fieldset>
|
| 68 |
-
<br />
|
| 69 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 70 |
-
id="startButton">
|
| 71 |
-
<span><?php echo $this->__('import orders'); ?></span>
|
| 72 |
-
</button>
|
| 73 |
-
</form>
|
| 74 |
-
<br />
|
| 75 |
-
</div>
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/ProductExport/empty.phtml
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket">Export Products</h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<button
|
| 8 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_productExport/index/') ?>')"
|
| 9 |
-
class="scalable back" type="button">
|
| 10 |
-
<span><?php echo $this->__('start again'); ?></span>
|
| 11 |
-
</button>
|
| 12 |
-
</td>
|
| 13 |
-
</tr>
|
| 14 |
-
</table>
|
| 15 |
-
</div>
|
| 16 |
-
<div class="dashboard-container meinpaket-content">
|
| 17 |
-
|
| 18 |
-
<div class="cc">
|
| 19 |
-
<!-- -->
|
| 20 |
-
</div>
|
| 21 |
-
|
| 22 |
-
<p>Es gibt keine Produkte zum exportieren. Lernen Sie hier wie Sie neue
|
| 23 |
-
Produkte zum exportieren auswählen:</p>
|
| 24 |
-
<ul>
|
| 25 |
-
<li>Ist Ihr Shop-Root korrekt gestetzt (Anchor und Shop-Root
|
| 26 |
-
Eigenschaft)</li>
|
| 27 |
-
<li>Wollen Sie alle Produkte unterhalb einer Kategorie exportieren?
|
| 28 |
-
Wählöen Sie einfach "alle" aus</li>
|
| 29 |
-
<li>Wollen Sie nur einzelne Produkte exportieren, so müssen Sie die
|
| 30 |
-
Produkte als "zu meinPaket exportieren" markieren.</li>
|
| 31 |
-
</ul>
|
| 32 |
-
<br />
|
| 33 |
-
|
| 34 |
-
</div>
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/ProductExport/export.phtml
DELETED
|
@@ -1,213 +0,0 @@
|
|
| 1 |
-
<style type="text/css">
|
| 2 |
-
.hidden-mouseover {
|
| 3 |
-
display: block;
|
| 4 |
-
font-size: 0.9em;
|
| 5 |
-
color: #a1a1a1;
|
| 6 |
-
}
|
| 7 |
-
</style>
|
| 8 |
-
<div class="content-header">
|
| 9 |
-
<table cellspacing="0" class="grid-header">
|
| 10 |
-
<tr>
|
| 11 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('export products'); ?> > <?php echo __('Result'); ?></h3></td>
|
| 12 |
-
<td class="a-right">
|
| 13 |
-
<button
|
| 14 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_productExport/index/') ?>')"
|
| 15 |
-
class="scalable back" type="button">
|
| 16 |
-
<span><?php echo $this->__('start again'); ?></span>
|
| 17 |
-
</button>
|
| 18 |
-
</td>
|
| 19 |
-
</tr>
|
| 20 |
-
</table>
|
| 21 |
-
</div>
|
| 22 |
-
<div class="dashboard-container meinpaket-content">
|
| 23 |
-
|
| 24 |
-
<ul class="meinpaket-steps">
|
| 25 |
-
<li class="nr1"><p><?php echo __('Selection'); ?></p></li>
|
| 26 |
-
<li class="nr2"><p><?php echo __('Upload'); ?></p></li>
|
| 27 |
-
<li class="nr3 active"><p><?php echo __('Result'); ?></p></li>
|
| 28 |
-
</ul>
|
| 29 |
-
<div class="cc">
|
| 30 |
-
<!-- -->
|
| 31 |
-
</div>
|
| 32 |
-
|
| 33 |
-
<?php
|
| 34 |
-
if (is_object ( $this->results ) && get_class ( $this->results ) === 'Dhl_MeinPaket_Model_Service_Product_Export_Result') :
|
| 35 |
-
?>
|
| 36 |
-
<div id="meinpaket-results" class="scrollablebox grid entry-edit">
|
| 37 |
-
<table id="meinpaket-results">
|
| 38 |
-
<tbody>
|
| 39 |
-
<?php
|
| 40 |
-
/* @var $results Dhl_MeinPaket_Model_Service_Product_Export_Result */
|
| 41 |
-
$results = $this->results;
|
| 42 |
-
// if ($results->hasErrors()) :
|
| 43 |
-
$confirmedProducts = $results->getFullyConfirmedProductIds ();
|
| 44 |
-
$offeredOnlyProducts = $results->getProductsWhichCouldOnlyBeOffered ();
|
| 45 |
-
$notExportedProducts = $results->getProductsWhichCouldNotBeOfferedOrDescribed ();
|
| 46 |
-
$commonErrors = $results->getCommonErrors ();
|
| 47 |
-
$stripeClass = 'odd';
|
| 48 |
-
$currentIndex = 0;
|
| 49 |
-
?>
|
| 50 |
-
|
| 51 |
-
<?php if(sizeof($confirmedProducts) > 0) : ?>
|
| 52 |
-
<tr>
|
| 53 |
-
<td colspan="4" class="row-subheader"><?php echo __('Successfully Exported Products'); ?> | <span
|
| 54 |
-
class="resultCount"><?php echo sizeof($confirmedProducts).' '.__('total'); ?></span></td>
|
| 55 |
-
</tr>
|
| 56 |
-
<tr class="headings">
|
| 57 |
-
<th class="header-center">#</th>
|
| 58 |
-
<th class="col-product"><?php echo __('Product'); ?></th>
|
| 59 |
-
<th colspan="2"><?php echo __('Edit Product'); ?></th>
|
| 60 |
-
</tr>
|
| 61 |
-
<?php $stripeClass = 'odd'; ?>
|
| 62 |
-
<?php $currentIndex = 0; ?>
|
| 63 |
-
<?php foreach($confirmedProducts as $confirmedProductId) : ?>
|
| 64 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 65 |
-
<?php $product = Mage::getModel('catalog/product')->load($confirmedProductId); ?>
|
| 66 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 67 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 68 |
-
<td><?php echo $product->getName(); ?> </td>
|
| 69 |
-
<td colspan="2"><?php echo $this->getEditLink($product); ?></td>
|
| 70 |
-
</tr>
|
| 71 |
-
<?php endforeach; ?>
|
| 72 |
-
<?php endif; ?>
|
| 73 |
-
|
| 74 |
-
<?php if(sizeof($commonErrors) > 0) : ?>
|
| 75 |
-
<tr>
|
| 76 |
-
<td colspan="4" class="row-subheader"><?php echo __('Common Errors'); ?> | <span
|
| 77 |
-
class="resultCount"><?php echo sizeof($commonErrors).' '.__('total'); ?></span></td>
|
| 78 |
-
</tr>
|
| 79 |
-
<?php foreach ($commonErrors as $error) : ?>
|
| 80 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 81 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 82 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 83 |
-
<td colspan="3"><?php echo $error['code']; ?> <?php echo $error['message']; ?>+</td>
|
| 84 |
-
</tr>
|
| 85 |
-
<?php endforeach; ?>
|
| 86 |
-
<?php endif; ?>
|
| 87 |
-
|
| 88 |
-
<?php if(sizeof($notExportedProducts) > 0) : ?>
|
| 89 |
-
<?php $stripeClass = 'odd'; ?>
|
| 90 |
-
<?php $currentIndex = 0; ?>
|
| 91 |
-
<tr>
|
| 92 |
-
<td colspan="4" class="row-subheader"><?php echo __('These products could not be exported'); ?> | <span
|
| 93 |
-
class="resultCount"><?php echo sizeof($notExportedProducts).' '.__('total'); ?></span></td>
|
| 94 |
-
</tr>
|
| 95 |
-
<tr class="headings">
|
| 96 |
-
<th class="header-center" style="width: 1px">#</th>
|
| 97 |
-
<th class="col-product"><?php echo __('Product'); ?></th>
|
| 98 |
-
<th><?php echo __('Edit Product'); ?></th>
|
| 99 |
-
<th class="col-result"><?php echo __('Error Description'); ?></th>
|
| 100 |
-
</tr>
|
| 101 |
-
<?php foreach ($notExportedProducts as $notExportedProduct) : ?>
|
| 102 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 103 |
-
<?php $product = Mage::getModel('catalog/product')->load($notExportedProduct['id']); ?>
|
| 104 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 105 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 106 |
-
<td><?php echo $product->getName(); ?> </td>
|
| 107 |
-
<td><?php echo $this->getEditLink($product); ?></td>
|
| 108 |
-
<td>
|
| 109 |
-
<?php
|
| 110 |
-
$errorMsg = '';
|
| 111 |
-
$offerErrorMsg = '';
|
| 112 |
-
if (! $notExportedProduct ['description'] ['confirmed']) {
|
| 113 |
-
foreach ( $notExportedProduct ['description'] ['errors'] as $error ) {
|
| 114 |
-
$tmpErrorMsg = $this->getErrorDescription ( $error ['code'], $error ['type'] ) . '<span class="hidden-mouseover">' . $error ['type'] . '</span>';
|
| 115 |
-
if (strlen ( $errorMsg ) > 0) {
|
| 116 |
-
$errorMsg .= '<br/>';
|
| 117 |
-
}
|
| 118 |
-
$errorMsg .= $tmpErrorMsg;
|
| 119 |
-
}
|
| 120 |
-
echo $errorMsg;
|
| 121 |
-
}
|
| 122 |
-
if (! $notExportedProduct ['offer'] ['confirmed']) {
|
| 123 |
-
foreach ( $notExportedProduct ['offer'] ['errors'] as $error ) {
|
| 124 |
-
$tmpOfferErrorMsg = $this->getErrorDescription ( $error ['code'], $error ['type'] ) . '<span class="hidden-mouseover">' . $error ['type'] . '</span>';
|
| 125 |
-
if (strlen ( $offerErrorMsg ) > 0) {
|
| 126 |
-
$offerErrorMsg .= '<br/>';
|
| 127 |
-
}
|
| 128 |
-
$offerErrorMsg .= $tmpOfferErrorMsg;
|
| 129 |
-
}
|
| 130 |
-
echo $offerErrorMsg;
|
| 131 |
-
}
|
| 132 |
-
?>
|
| 133 |
-
</td>
|
| 134 |
-
</tr>
|
| 135 |
-
<?php endforeach; ?>
|
| 136 |
-
<?php endif; ?>
|
| 137 |
-
|
| 138 |
-
<?php if(sizeof($offeredOnlyProducts) > 0) : ?>
|
| 139 |
-
<tr>
|
| 140 |
-
<td colspan="4" class="row-subheader"><?php echo __('The following products could only be exported as description'); ?> | <span
|
| 141 |
-
class="resultCount"><?php echo sizeof($offeredOnlyProducts).' '.__('total'); ?></span></td>
|
| 142 |
-
</tr>
|
| 143 |
-
<tr class="headings">
|
| 144 |
-
<th class="header-center">#</th>
|
| 145 |
-
<th class="col-product"><?php echo __('Product'); ?></th>
|
| 146 |
-
<th><?php echo __('Edit Product'); ?></th>
|
| 147 |
-
<th class="col-result"><?php echo __('Error Description'); ?></th>
|
| 148 |
-
</tr>
|
| 149 |
-
<?php $stripeClass = 'odd'; ?>
|
| 150 |
-
<?php $currentIndex = 0; ?>
|
| 151 |
-
<?php foreach($offeredOnlyProducts as $onlyOfferedProduct) : ?>
|
| 152 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 153 |
-
<?php $product = Mage::getModel('catalog/product')->load($onlyOfferedProduct['id']); ?>
|
| 154 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 155 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 156 |
-
<td><?php echo $product->getName(); ?> </td>
|
| 157 |
-
<td><?php echo $this->getEditLink($product); ?></td>
|
| 158 |
-
<td>
|
| 159 |
-
<?php $errorMsg = ''; ?>
|
| 160 |
-
<?php foreach($onlyOfferedProduct['description']['errors'] as $error) : ?>
|
| 161 |
-
<?php
|
| 162 |
-
$tmpErrorMsg = $this->getErrorDescription ( $error ['code'], $error ['type'] ) . '<span class="hidden-mouseover">' . $error ['type'] . '</span>';
|
| 163 |
-
if (strlen ( $errorMsg ) > 0) {
|
| 164 |
-
$errorMsg .= '<br/>';
|
| 165 |
-
}
|
| 166 |
-
$errorMsg .= $tmpErrorMsg;
|
| 167 |
-
?>
|
| 168 |
-
<?php endforeach; ?>
|
| 169 |
-
<?php
|
| 170 |
-
if (strlen ( $errorMsg ) < 1) {
|
| 171 |
-
$errorMsg = $this->__ ( 'Not available.' );
|
| 172 |
-
}
|
| 173 |
-
?>
|
| 174 |
-
<?php echo $errorMsg; ?>
|
| 175 |
-
</td>
|
| 176 |
-
</tr>
|
| 177 |
-
<?php endforeach; ?>
|
| 178 |
-
<?php endif; ?>
|
| 179 |
-
|
| 180 |
-
<?php if($results->hasFailedVariantGroups()) : ?>
|
| 181 |
-
<tr>
|
| 182 |
-
<td colspan="4" class="row-subheader"><?php echo __('The following configurable products could not be exported'); ?> | <span
|
| 183 |
-
class="resultCount"><?php echo sizeof($results->getFailedVariantGroupIds()).' '.__('total'); ?></span></td>
|
| 184 |
-
</tr>
|
| 185 |
-
<tr class="headings">
|
| 186 |
-
<th class="header-center">#</th>
|
| 187 |
-
<th class="col-product"><?php echo __('Product'); ?></th>
|
| 188 |
-
<th><?php echo __('Edit Product'); ?></th>
|
| 189 |
-
<th class="col-result"><?php echo __('Error Description'); ?></th>
|
| 190 |
-
</tr>
|
| 191 |
-
<?php $stripeClass = 'odd'; ?>
|
| 192 |
-
<?php $currentIndex = 0; ?>
|
| 193 |
-
<?php foreach($results->getFailedVariantGroups() as $variantId => $variant) : ?>
|
| 194 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 195 |
-
<?php $product = Mage::getModel('catalog/product')->load($variantId); ?>
|
| 196 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 197 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 198 |
-
<td><?php echo $product->getName(); ?> </td>
|
| 199 |
-
<td><?php echo $this->getEditLink($product); ?></td>
|
| 200 |
-
<td>
|
| 201 |
-
<?php echo $this->getErrorDescription($variant['code'], ''); ?>
|
| 202 |
-
<span class="hidden-mouseover"><?php echo $variant['message']; ?></span>
|
| 203 |
-
</td>
|
| 204 |
-
</tr>
|
| 205 |
-
<?php endforeach; ?>
|
| 206 |
-
<?php endif; ?>
|
| 207 |
-
|
| 208 |
-
</tbody>
|
| 209 |
-
</table>
|
| 210 |
-
</div>
|
| 211 |
-
<?php endif; ?>
|
| 212 |
-
</div>
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/ProductExport/index.phtml
DELETED
|
@@ -1,52 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('export products'); ?></h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 8 |
-
id="startButton">
|
| 9 |
-
<span><?php echo $this->__('export products'); ?></span>
|
| 10 |
-
</button>
|
| 11 |
-
</td>
|
| 12 |
-
</tr>
|
| 13 |
-
</table>
|
| 14 |
-
</div>
|
| 15 |
-
<div class="dashboard-container meinpaket-content">
|
| 16 |
-
<ul class="meinpaket-steps">
|
| 17 |
-
<li class="active nr1"><p><?php echo __('Selection'); ?></p></li>
|
| 18 |
-
<li class="nr2"><p><?php echo __('Upload'); ?></p></li>
|
| 19 |
-
<li class="nr3"><p><?php echo __('Result'); ?></p></li>
|
| 20 |
-
</ul>
|
| 21 |
-
<div class="cc">
|
| 22 |
-
<!-- -->
|
| 23 |
-
</div>
|
| 24 |
-
|
| 25 |
-
<div id="meinpaket-description">
|
| 26 |
-
<p><?php echo __('At this place you can choose which products you want to export and start the process.'); ?></p>
|
| 27 |
-
</div>
|
| 28 |
-
|
| 29 |
-
<div id="disabled-till-export" class="meinpaket-waitbox"
|
| 30 |
-
style="display: none">
|
| 31 |
-
<img src="/skin/adminhtml/default/default/meinpaket/images/loader.gif" /><br />
|
| 32 |
-
<small><?php echo $this->__('please wait'); ?></small>
|
| 33 |
-
</div>
|
| 34 |
-
|
| 35 |
-
<form id="meinpaket_form" name="meinpaket_form" method="get"
|
| 36 |
-
action="<?php echo $this->getUrl('meinpaket/adminhtml_productExport/export/') ?>">
|
| 37 |
-
|
| 38 |
-
<fieldset>
|
| 39 |
-
<label><?php echo $this->__('select products'); ?></label><select
|
| 40 |
-
name="productselection"><option value="1"><?php echo $this->__('only marked products'); ?></option>
|
| 41 |
-
<option value="2"><?php echo $this->__('all'); ?></option></select>
|
| 42 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 43 |
-
id="startButton">
|
| 44 |
-
<span><?php echo $this->__('export products'); ?></span>
|
| 45 |
-
</button>
|
| 46 |
-
<!-- <button onclick="submitForm('<?php echo $this->getUrl('meinpaket/adminhtml_productExport/list/') ?>')" class="scalable" type="button"><span><?php echo $this->__('list products'); ?></span></button> -->
|
| 47 |
-
</fieldset>
|
| 48 |
-
</form>
|
| 49 |
-
<br />
|
| 50 |
-
|
| 51 |
-
</div>
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/ProductExport/list.phtml
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket">Export Products</h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<button
|
| 8 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_productExport/index/') ?>')"
|
| 9 |
-
class="scalable" type="button">
|
| 10 |
-
<span><?php echo $this->__('start'); ?></span>
|
| 11 |
-
</button>
|
| 12 |
-
</td>
|
| 13 |
-
</tr>
|
| 14 |
-
</table>
|
| 15 |
-
</div>
|
| 16 |
-
<div class="dashboard-container meinpaket-content">
|
| 17 |
-
|
| 18 |
-
<div class="cc">
|
| 19 |
-
<!-- -->
|
| 20 |
-
</div>
|
| 21 |
-
<div id="meinpaket-results" class="scrollablebox">
|
| 22 |
-
<?php
|
| 23 |
-
|
| 24 |
-
foreach ( $productCollection as $product ) {
|
| 25 |
-
print_r ( $product->debug () );
|
| 26 |
-
echo '<hr />';
|
| 27 |
-
}
|
| 28 |
-
|
| 29 |
-
?>
|
| 30 |
-
</div>
|
| 31 |
-
</div>
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/category/import/import.phtml
CHANGED
|
@@ -66,7 +66,7 @@
|
|
| 66 |
</tr>
|
| 67 |
<tr class="headings">
|
| 68 |
<th class="header-center">#</th>
|
| 69 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 70 |
<th><?php echo __('Category Code'); ?></th>
|
| 71 |
</tr>
|
| 72 |
<?php
|
|
@@ -78,7 +78,7 @@
|
|
| 78 |
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 79 |
<tr class="<?php echo $stripeClass; ?>">
|
| 80 |
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 81 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 82 |
<td><?php echo $category->getCode(); ?></td>
|
| 83 |
</tr>
|
| 84 |
<?php endforeach; ?>
|
|
@@ -92,7 +92,7 @@
|
|
| 92 |
</tr>
|
| 93 |
<tr class="headings">
|
| 94 |
<th class="header-center">#</th>
|
| 95 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 96 |
<th><?php echo __('Category Code'); ?></th>
|
| 97 |
</tr>
|
| 98 |
<?php
|
|
@@ -104,7 +104,7 @@
|
|
| 104 |
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 105 |
<tr class="<?php echo $stripeClass; ?>">
|
| 106 |
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 107 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 108 |
<td><?php echo $category->getCode(); ?></td>
|
| 109 |
</tr>
|
| 110 |
<?php endforeach; ?>
|
| 66 |
</tr>
|
| 67 |
<tr class="headings">
|
| 68 |
<th class="header-center">#</th>
|
| 69 |
+
<th class="col-product" colspan="2"><?php echo __('Category'); ?></th>
|
| 70 |
<th><?php echo __('Category Code'); ?></th>
|
| 71 |
</tr>
|
| 72 |
<?php
|
| 78 |
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 79 |
<tr class="<?php echo $stripeClass; ?>">
|
| 80 |
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 81 |
+
<td colspan="2"><?php echo $category->getName(); ?> </td>
|
| 82 |
<td><?php echo $category->getCode(); ?></td>
|
| 83 |
</tr>
|
| 84 |
<?php endforeach; ?>
|
| 92 |
</tr>
|
| 93 |
<tr class="headings">
|
| 94 |
<th class="header-center">#</th>
|
| 95 |
+
<th class="col-product" colspan="2"><?php echo __('Category'); ?></th>
|
| 96 |
<th><?php echo __('Category Code'); ?></th>
|
| 97 |
</tr>
|
| 98 |
<?php
|
| 104 |
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 105 |
<tr class="<?php echo $stripeClass; ?>">
|
| 106 |
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 107 |
+
<td colspan="2"><?php echo $category->getName(); ?> </td>
|
| 108 |
<td><?php echo $category->getCode(); ?></td>
|
| 109 |
</tr>
|
| 110 |
<?php endforeach; ?>
|
app/design/adminhtml/default/default/template/meinpaket/category_import/import.phtml
DELETED
|
@@ -1,121 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/* @var $this Dhl_MeinPaket_Block_Adminhtml_CategoryImport_Import */
|
| 3 |
-
/* @var $result Dhl_MeinPaket_Model_Service_MarketplaceCategoryImport_Result */
|
| 4 |
-
$result = $this->getResult ();
|
| 5 |
-
?>
|
| 6 |
-
<div class="content-header">
|
| 7 |
-
<table class="grid-header">
|
| 8 |
-
<tr>
|
| 9 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Import Categories'); ?></h3></td>
|
| 10 |
-
<td class="a-right">
|
| 11 |
-
<button
|
| 12 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/index/') ?>')"
|
| 13 |
-
class="scalable back" type="button">
|
| 14 |
-
<span><?php echo $this->__('start again'); ?></span>
|
| 15 |
-
</button>
|
| 16 |
-
</td>
|
| 17 |
-
</tr>
|
| 18 |
-
</table>
|
| 19 |
-
</div>
|
| 20 |
-
<div class="dashboard-container meinpaket-content">
|
| 21 |
-
<ul class="meinpaket-steps">
|
| 22 |
-
<li class="nr1"><p><?php echo __('Overview'); ?></p></li>
|
| 23 |
-
<li class="nr2"><p><?php echo __('Import'); ?></p></li>
|
| 24 |
-
<li class="nr3 active"><p><?php echo __('Result'); ?></p></li>
|
| 25 |
-
</ul>
|
| 26 |
-
<div class="cc">
|
| 27 |
-
<!-- -->
|
| 28 |
-
</div>
|
| 29 |
-
|
| 30 |
-
<div id="meinpaket-results" class="scrollablebox grid entry-edit">
|
| 31 |
-
<?php if($result !== null && $result->getNewCategoriesCount() + $result->getDeletedCategoriesCount() + $result->getUpdatedCategoriesCount() > 0) : ?>
|
| 32 |
-
<table id="meinpaket-results">
|
| 33 |
-
<tbody>
|
| 34 |
-
|
| 35 |
-
<?php /*** NEW CATEGORIES **********************************************/ ?>
|
| 36 |
-
<?php if($result->getNewCategoriesCount() > 0) : ?>
|
| 37 |
-
<tr>
|
| 38 |
-
<td colspan="4" class="row-subheader"><?php echo __('New categories'); ?> | <span
|
| 39 |
-
class="resultCount"><?php echo $result->getNewCategoriesCount().' '.__('total'); ?></span></td>
|
| 40 |
-
</tr>
|
| 41 |
-
<tr class="headings">
|
| 42 |
-
<th class="header-center">#</th>
|
| 43 |
-
<th class="col-product" colspan="2"><?php echo __('Category'); ?></th>
|
| 44 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 45 |
-
</tr>
|
| 46 |
-
<?php
|
| 47 |
-
$newCategories = $result->getNewCategories ();
|
| 48 |
-
$currentIndex = 0;
|
| 49 |
-
$stripeClass = 'odd';
|
| 50 |
-
?>
|
| 51 |
-
<?php foreach($newCategories as $category) : ?>
|
| 52 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 53 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 54 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 55 |
-
<td colspan="2"><?php echo $category->getName(); ?> </td>
|
| 56 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 57 |
-
</tr>
|
| 58 |
-
<?php endforeach; ?>
|
| 59 |
-
<?php endif; ?>
|
| 60 |
-
|
| 61 |
-
<?php /*** UPDATED CATEGORIES ******************************************/ ?>
|
| 62 |
-
<?php if($result->getUpdatedCategoriesCount() > 0) : ?>
|
| 63 |
-
<tr>
|
| 64 |
-
<td colspan="4" class="row-subheader"><?php echo __('Updated categories'); ?> | <span
|
| 65 |
-
class="resultCount"><?php echo $result->getUpdatedCategoriesCount().' '.__('total'); ?></span></td>
|
| 66 |
-
</tr>
|
| 67 |
-
<tr class="headings">
|
| 68 |
-
<th class="header-center">#</th>
|
| 69 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 70 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 71 |
-
</tr>
|
| 72 |
-
<?php
|
| 73 |
-
$updatedCategories = $result->getUpdatedCategories ();
|
| 74 |
-
$currentIndex = 0;
|
| 75 |
-
$stripeClass = 'odd';
|
| 76 |
-
?>
|
| 77 |
-
<?php foreach($updatedCategories as $category) : ?>
|
| 78 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 79 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 80 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 81 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 82 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 83 |
-
</tr>
|
| 84 |
-
<?php endforeach; ?>
|
| 85 |
-
<?php endif; ?>
|
| 86 |
-
|
| 87 |
-
<?php /*** DELETED CATEGORIES ******************************************/ ?>
|
| 88 |
-
<?php if($result->getDeletedCategoriesCount() > 0) : ?>
|
| 89 |
-
<tr>
|
| 90 |
-
<td colspan="4" class="row-subheader"><?php echo __('Deleted categories'); ?> | <span
|
| 91 |
-
class="resultCount"><?php echo $result->getDeletedCategoriesCount().' '.__('total'); ?></span></td>
|
| 92 |
-
</tr>
|
| 93 |
-
<tr class="headings">
|
| 94 |
-
<th class="header-center">#</th>
|
| 95 |
-
<th class="col-product"><?php echo __('Category'); ?></th>
|
| 96 |
-
<th><?php echo __('Category Code'); ?></th>
|
| 97 |
-
</tr>
|
| 98 |
-
<?php
|
| 99 |
-
$deletedCategories = $result->getDeletedCategories ();
|
| 100 |
-
$currentIndex = 0;
|
| 101 |
-
$stripeClass = 'odd';
|
| 102 |
-
?>
|
| 103 |
-
<?php foreach($deletedCategories as $category) : ?>
|
| 104 |
-
<?php $stripeClass = ($stripeClass === 'even') ? 'odd' : 'even'; ?>
|
| 105 |
-
<tr class="<?php echo $stripeClass; ?>">
|
| 106 |
-
<td class="row-num"><?php echo ++$currentIndex; ?></td>
|
| 107 |
-
<td><?php echo $category->getName(); ?> </td>
|
| 108 |
-
<td><?php echo $category->getCode(); ?></td>
|
| 109 |
-
</tr>
|
| 110 |
-
<?php endforeach; ?>
|
| 111 |
-
<?php endif; ?>
|
| 112 |
-
</tbody>
|
| 113 |
-
</table>
|
| 114 |
-
<?php else : ?>
|
| 115 |
-
<div class="meinpaket-description">
|
| 116 |
-
<p><?php echo __('Marketplace category structure was up to date. There have been no changes.'); ?></p>
|
| 117 |
-
</div>
|
| 118 |
-
<?php endif; ?>
|
| 119 |
-
</div>
|
| 120 |
-
</div>
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/category_import/index.phtml
DELETED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
<div class="content-header">
|
| 3 |
-
<table cellspacing="0" class="grid-header">
|
| 4 |
-
<tr>
|
| 5 |
-
<td><h3 class="icon-head meinpaket"><?php echo __('Import Categories'); ?></h3></td>
|
| 6 |
-
<td class="a-right">
|
| 7 |
-
<!-- <button onclick="setLocationWithWait('<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/import/') ?>')" class="scalable" type="button"><span><?php echo $this->__('import categories'); ?></span></button> -->
|
| 8 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 9 |
-
id="startButton">
|
| 10 |
-
<span><?php echo $this->__('import categories'); ?></span>
|
| 11 |
-
</button>
|
| 12 |
-
</td>
|
| 13 |
-
</tr>
|
| 14 |
-
</table>
|
| 15 |
-
</div>
|
| 16 |
-
<div class="dashboard-container meinpaket-content">
|
| 17 |
-
|
| 18 |
-
<ul class="meinpaket-steps">
|
| 19 |
-
<li class="active nr1"><p><?php echo __('Overview'); ?></p></li>
|
| 20 |
-
<li class="nr2"><p><?php echo __('Import'); ?></p></li>
|
| 21 |
-
<li class="nr3"><p><?php echo __('Result'); ?></p></li>
|
| 22 |
-
</ul>
|
| 23 |
-
<div class="cc">
|
| 24 |
-
<!-- -->
|
| 25 |
-
</div>
|
| 26 |
-
|
| 27 |
-
<div id="meinpaket-description">
|
| 28 |
-
<p><?php echo __('Textual introduction into category import goes here...'); ?></p>
|
| 29 |
-
</div>
|
| 30 |
-
|
| 31 |
-
<div id="disabled-till-export" class="meinpaket-waitbox"
|
| 32 |
-
style="display: none">
|
| 33 |
-
<img src="/skin/adminhtml/default/default/meinpaket/images/loader.gif" /><br />
|
| 34 |
-
<small><?php echo $this->__('please wait'); ?></small>
|
| 35 |
-
</div>
|
| 36 |
-
|
| 37 |
-
<form id="meinpaket_form" name="meinpaket_form" method="get"
|
| 38 |
-
action="<?php echo $this->getUrl('meinpaket/adminhtml_categoryImport/import/') ?>">
|
| 39 |
-
<fieldset>
|
| 40 |
-
<button onclick="startProcessing()" class="scalable" type="button"
|
| 41 |
-
id="startButton">
|
| 42 |
-
<span><?php echo $this->__('import categories'); ?></span>
|
| 43 |
-
</button>
|
| 44 |
-
</fieldset>
|
| 45 |
-
</form>
|
| 46 |
-
</div>
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/meinpaket/productexport.phtml
DELETED
|
@@ -1,29 +0,0 @@
|
|
| 1 |
-
<link rel="stylesheet" type="text/css"
|
| 2 |
-
href="/skin/adminhtml/default/dhl_meinpaket/module.css" />
|
| 3 |
-
<div class="content-header">
|
| 4 |
-
<table cellspacing="0" class="grid-header">
|
| 5 |
-
<tr>
|
| 6 |
-
<td><h3 class="icon-head meinpaket">Export Products</h3></td>
|
| 7 |
-
<td class="a-right">
|
| 8 |
-
<button
|
| 9 |
-
onclick="setLocation('<?php echo $this->getUrl('meinpaket/adminhtml_productExport/export/') ?>')"
|
| 10 |
-
class="scalable save" type="button">
|
| 11 |
-
<span><?php echo $exportLabel; ?></span>
|
| 12 |
-
</button>
|
| 13 |
-
</td>
|
| 14 |
-
</tr>
|
| 15 |
-
</table>
|
| 16 |
-
</div>
|
| 17 |
-
<div class="dashboard-container">
|
| 18 |
-
<form id="myform" name="myform" method="post"
|
| 19 |
-
action="<?php echo $this->getUrl('web/adminhtml_myform/post/') ?>">
|
| 20 |
-
|
| 21 |
-
<ul class="meinpaket-steps">
|
| 22 |
-
<li class="active nr1"><p>Wählen Sie aus welche Produkte hochgeladen
|
| 23 |
-
werden sollen</p></li>
|
| 24 |
-
<li class="nr2"><p>Upload</p></li>
|
| 25 |
-
<li class="nr3"><p>Results</p></li>
|
| 26 |
-
</ul>
|
| 27 |
-
|
| 28 |
-
</div>
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/meinpaketcommon.xml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
</layout>
|
app/design/frontend/base/default/layout/postpay.xml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<layout version="0.1.0">
|
| 3 |
+
<checkout_cart_index>
|
| 4 |
+
<reference name="checkout.cart.top_methods">
|
| 5 |
+
<block type="postpay/checkout" name="checkout.cart.methods.postpay.top" before="-"
|
| 6 |
+
template="postpay/checkout.phtml">
|
| 7 |
+
<action method="setShowOrPosition">
|
| 8 |
+
<value>after</value>
|
| 9 |
+
</action>
|
| 10 |
+
</block>
|
| 11 |
+
</reference>
|
| 12 |
+
<reference name="checkout.cart.methods">
|
| 13 |
+
<block type="postpay/checkout" name="checkout.cart.methods.postpay.bottom" before="-"
|
| 14 |
+
template="postpay/checkout.phtml">
|
| 15 |
+
<action method="setShowOrPosition">
|
| 16 |
+
<value>after</value>
|
| 17 |
+
</action>
|
| 18 |
+
</block>
|
| 19 |
+
</reference>
|
| 20 |
+
</checkout_cart_index>
|
| 21 |
+
</layout>
|
app/design/frontend/base/default/template/dhl/meinpaket/checkout/abort.phtml
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
<h2><?php echo $title ?></h2>
|
| 2 |
-
<?php echo $content?>
|
| 3 |
-
<p> </p>
|
| 4 |
-
<p>
|
| 5 |
-
<a href="<?php echo Mage::app()->getStore()->getUrl() ?>"><?php echo __('Continue shopping') ?></a>
|
| 6 |
-
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/dhl/meinpaket/checkout/cartbutton.phtml
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<?php if ($this->isPossibleOnepageCheckout()):?>
|
| 2 |
-
<button type="button"
|
| 3 |
-
title="<?php echo $this->__('Proceed to Checkout') ?>"
|
| 4 |
-
class="button btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"
|
| 5 |
-
<?php if ($this->isDisabled()):?> disabled="disabled" <?php endif; ?>
|
| 6 |
-
onclick="window.location='<?php echo $this->getCheckoutUrl() ?>';">
|
| 7 |
-
<span><span><?php echo $this->__('Proceed to Checkout') ?></span></span>
|
| 8 |
-
</button>
|
| 9 |
-
<?php if ( (bool)Mage::getStoreConfig('meinpaket/checkout/available') ) { ?>
|
| 10 |
-
<p style="margin-top: 10px;">
|
| 11 |
-
<a
|
| 12 |
-
href="<?php echo Mage::app()->getStore()->getUrl() ?>meinpaket/checkout/redirect">
|
| 13 |
-
<img
|
| 14 |
-
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>skin/frontend/default/default/meinpaket/images/dhl_checkout_button.png"
|
| 15 |
-
alt="POSTPAY" title="POSTPAY" />
|
| 16 |
-
</a>
|
| 17 |
-
</p>
|
| 18 |
-
<?php } ?>
|
| 19 |
-
<?php endif?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/dhl/meinpaket/checkout/error.phtml
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
<h2><?php echo $title ?></h2>
|
| 2 |
-
<?php echo $content ?>
|
|
|
|
|
|
app/design/frontend/base/default/template/dhl/meinpaket/checkout/sidebarbutton.phtml
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
$checkoutIsPossible = false;
|
| 3 |
-
|
| 4 |
-
foreach ( Mage::getSingleton ( 'checkout/session' )->getQuote ()->getItemsCollection () as $item ) {
|
| 5 |
-
$checkoutIsPossible = true;
|
| 6 |
-
}
|
| 7 |
-
?>
|
| 8 |
-
<?php if ($checkoutIsPossible) { ?>
|
| 9 |
-
<?php if ( (bool)Mage::getStoreConfig('meinpaket/checkout/available') ) { ?>
|
| 10 |
-
<div class="block">
|
| 11 |
-
<div class="block-content">
|
| 12 |
-
<a
|
| 13 |
-
href="<?php echo Mage::app()->getStore()->getUrl() ?>meinpaket/checkout/redirect"
|
| 14 |
-
style="display: block; text-align: center; margin-bottom: 5px;"> <img
|
| 15 |
-
src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>skin/frontend/default/default/meinpaket/images/dhl_checkout_button.png"
|
| 16 |
-
alt="POSTPAY" title="POSTPAY" />
|
| 17 |
-
</a>
|
| 18 |
-
</div>
|
| 19 |
-
</div>
|
| 20 |
-
<?php } ?>
|
| 21 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/dhl/meinpaket/checkout/success.phtml
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
<h2><?php echo $title ?></h2>
|
| 2 |
-
<?php echo $content ?>
|
|
|
|
|
|
app/design/frontend/base/default/template/postpay/checkout.phtml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p class="postpay-button">
|
| 2 |
+
<?php $shortcutHtmlId = $this->getShortcutHtmlId()?>
|
| 3 |
+
<?php if ($this->isOrPositionBefore()): ?>
|
| 4 |
+
<span class="paypal-or"><?php echo $this->__('-OR-');?></span>
|
| 5 |
+
<?php endif; ?>
|
| 6 |
+
<a data-action="checkout-form-submit"
|
| 7 |
+
href="<?php echo $this->getCheckoutUrl()?>"> <img
|
| 8 |
+
src="<?php echo $this->getImageUrl()?>"
|
| 9 |
+
alt="<?php echo Mage::helper('postpay')->__('Checkout with Postpay');?>"
|
| 10 |
+
title="<?php echo Mage::helper('postpay')->__('Checkout with Postpay');?>" />
|
| 11 |
+
</a>
|
| 12 |
+
<?php if ($this->isOrPositionAfter()): ?>
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
<li>
|
| 16 |
+
<p class="postpay-logo">
|
| 17 |
+
<span class="postpay-or"><?php echo $this->__('-OR-');?></span>
|
| 18 |
+
</p>
|
| 19 |
+
</li>
|
| 20 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/postpay/checkout/image.phtml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
<img alt="Postpay"
|
| 3 |
+
src="<?php echo $this->getSkinUrl ( 'images/postpay/button.png' ) ?>">
|
app/design/frontend/base/default/template/postpay/payment/redirect.phtml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* @see Dhl_Postpay_Block_Payment_Form_Standard
|
| 4 |
+
*/
|
| 5 |
+
?>
|
| 6 |
+
<ul class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display: none;">
|
| 7 |
+
<li class="form-alt"><?php echo $this->getRedirectMessage() ?></li>
|
| 8 |
+
</ul>
|
app/etc/modules/Dhl_MeinPaket.xml
CHANGED
|
@@ -4,6 +4,9 @@
|
|
| 4 |
<Dhl_MeinPaket>
|
| 5 |
<active>true</active>
|
| 6 |
<codePool>community</codePool>
|
|
|
|
|
|
|
|
|
|
| 7 |
</Dhl_MeinPaket>
|
| 8 |
</modules>
|
| 9 |
</config>
|
| 4 |
<Dhl_MeinPaket>
|
| 5 |
<active>true</active>
|
| 6 |
<codePool>community</codePool>
|
| 7 |
+
<depends>
|
| 8 |
+
<Dhl_MeinPaketCommon />
|
| 9 |
+
</depends>
|
| 10 |
</Dhl_MeinPaket>
|
| 11 |
</modules>
|
| 12 |
</config>
|
app/etc/modules/Dhl_MeinPaketCommon.xml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Dhl_MeinPaketCommon>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
<depends>
|
| 8 |
+
<Mage_Shipping />
|
| 9 |
+
<Mage_Payment />
|
| 10 |
+
</depends>
|
| 11 |
+
<Mage_Shipping />
|
| 12 |
+
</Dhl_MeinPaketCommon>
|
| 13 |
+
</modules>
|
| 14 |
+
</config>
|
app/etc/modules/Dhl_Postpay.xml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Dhl_Postpay>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
<depends>
|
| 8 |
+
<Mage_Payment />
|
| 9 |
+
<Dhl_MeinPaketCommon />
|
| 10 |
+
</depends>
|
| 11 |
+
</Dhl_Postpay>
|
| 12 |
+
</modules>
|
| 13 |
+
</config>
|
app/locale/de_DE/Dhl_MeinPaketCommon.csv
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"import Variantconfigurations","Variantenkonfigurationen importieren"
|
| 2 |
+
"Credentials","Zugangsdaten"
|
| 3 |
+
"export products","Produkte exportieren"
|
| 4 |
+
"import orders","Bestellungen importieren"
|
| 5 |
+
"import categories","Kategorien importieren"
|
| 6 |
+
"list products","Produkte anzeigen"
|
| 7 |
+
"select products","Produktauswahl angeben"
|
| 8 |
+
"edit product","Produkt bearbeiten"
|
| 9 |
+
"only marked products", "Nur ausgewählte Produkte"
|
| 10 |
+
"all","Alle"
|
| 11 |
+
"start again","nochmal starten"
|
| 12 |
+
"best prices","Beste Preise"
|
| 13 |
+
"DHL Username","Benutzername"
|
| 14 |
+
"This is the username that was given to you by DHL, mostly your email address.","Dies ist der Benutzername, der Ihnen von DHL mitgeteilt wurde. Meisst ist dies Ihre E-Mail Adresse."
|
| 15 |
+
"DHL Password","Passwort"
|
| 16 |
+
"This is the password that was given to you by DHL.","Dies ist das Passwort, das Ihnen von DHL mitgeteilt wurde."
|
| 17 |
+
"Remote system","Entferntes System"
|
| 18 |
+
"This is the address of the remote API.","Dies ist die Adresse der entfernten API."
|
| 19 |
+
"Tax rates","Steuersätze"
|
| 20 |
+
"Default tax rate","Standard-Steuersatz"
|
| 21 |
+
"The default tax rate applies to most products","Dieser Steuersatz gilt für die meissten Produkte."
|
| 22 |
+
"Reduced tax rate","reduzierter Steuersatz"
|
| 23 |
+
"The reduced tax rate applies to special products, such as aliments","Der reduzierte Steuersatz, der für spezielle Produkte - etwa Nahrungsmittel - gilt."
|
| 24 |
+
"Shop tree root","Shop Hauptkategorie"
|
| 25 |
+
"Marketplace tree root","Marktplatz Hauptkategorie"
|
| 26 |
+
"Sync with MeinPaket.de","mit MeinPaket.de abgleichen"
|
| 27 |
+
"Maximum stock qty. for MeinPaket.de","maximale Stückzahl für MeinPaket.de"
|
| 28 |
+
"Product attributes","Produkteigenschaften"
|
| 29 |
+
"Delivery time","Lieferzeit (in Tagen)"
|
| 30 |
+
"Please select the product attribute which represents the approx. delivery time","Bitte wählen Sie die Produkteigenschaft, welche die Lieferzeit angibt."
|
| 31 |
+
"Default delivery time","Standard-Lieferzeit"
|
| 32 |
+
"Delivery time in days if no other delivery time applies","Lieferzeit in Tagen, wenn keine andere Lieferzeit angegeben."
|
| 33 |
+
"Marketplace category ID","Marktplatz-Kategorie"
|
| 34 |
+
"These products could not be exported","Die folgenden Produkte konnten aufgrund von Fehlern nicht exportiert werden"
|
| 35 |
+
"Result","Ergebnis"
|
| 36 |
+
"Selection","Auswahl"
|
| 37 |
+
"Upload","Upload"
|
| 38 |
+
"Common Errors","Allgemeine Fehler"
|
| 39 |
+
"Product","Produkt"
|
| 40 |
+
"Edit Product","Produkt bearbeiten"
|
| 41 |
+
"Error Description","Fehlerbeschreibung"
|
| 42 |
+
"Invalid value for field","Ungültiger Wert für Feld"
|
| 43 |
+
"Missing value for field","Fehlender Wert für Feld"
|
| 44 |
+
"The following products could only be exported as description","Für die folgenden Produkte konnten nur Angebote eingestellt werden"
|
| 45 |
+
"Unknown Error","Unbekannter Fehler"
|
| 46 |
+
"Product is unknown in MeinPaket marketplace","Produkt ist im MeinPaket Marktplatz nicht bekannt"
|
| 47 |
+
"Successfully Exported Products","Erfolgreich exportierte Produkte"
|
| 48 |
+
"total","gesamt"
|
| 49 |
+
"of","von"
|
| 50 |
+
"%s of %s products were successfully exported","%s von %s Produkten wurden erfolgreich exportiert"
|
| 51 |
+
"At this place you can choose which products you want to export and start the process.","<b>Hier können Sie Produkte Ihres Magento-Shops nach MeinPaket.de exportieren.</b><p>Wählen Sie in der Auswahlliste unten den Punkt „<i>Nur ausgewählte Produkte</i>”, um nur die Produkte zu exportieren, deren „<i>mit MeinPaket.de abgleichen</i>”-Attribut explizit auf „<i>Ja</i>” gesetzt wurde. Dieses Attribut können Sie in den Produktinformationen im Reiter „<i>Allgemein</i>” bearbeiten.</p><p>Um alle Produkte Ihres Magento-Shops nach MeinPaket.de zu exportieren, wählen Sie „<i>Alle</i>” in der unten stehenden Auswahlliste. Berücksichtigt werden hierbei nur Produkte, die einer MeinPaket.de-Marktplatzkategorie zugeordnet sind.</p><p>Sie starten den Vorgang durch Betätigen des „<i>Produkte exportieren</i>”-Buttons. Dadurch springt der Export in den Upload-Modus. Unterbrechen Sie den Prozess während dessen nicht.</p><p>Wenn alle ausgewählten Produkte an MeinPaket übermittelt wurden, sehen Sie eine Übersicht aller exportierter Produkte sowie eine detaillierte Auflistung aller während des Vorgangs aufgetretenen Fehler.</p>"
|
| 52 |
+
"Skipped %s duplicate orders that were already imported previously.","%s Bestellungen übersprungen, die bereits zu einem früheren Zeitpunkt importiert wurden."
|
| 53 |
+
"Skipped %s duplicate order that was already imported previously.","%s Bestellung übersprungen, die bereits zu einem früheren Zeitpunkt importiert wurde."
|
| 54 |
+
"%s order(s) sucessfully imported.","%s Bestellung(en) erfolgreich importiert."
|
| 55 |
+
"start date","Startdatum"
|
| 56 |
+
"end date","Enddatum"
|
| 57 |
+
"Textual guide for importing orders follows here","<b>Hier können Sie Bestellungen importieren, die Käufer auf MeinPaket.de getätigt haben.</b><p>Legen Sie mit Hilfe der Felder „<i>Startdatum</i>” und „<i>Enddatum</i>” einen Zeitraum fest, für den Sie Bestellungen von MeinPaket.de importieren möchten. Sie können das Feld „<i>Enddatum</i>” leer lassen, um alle Bestellungen vom „<i>Startdatum</i>” bis zum jetzigen Zeitpunkt zu importieren.</p><p>Starten Sie den Vorgang durch Betätigen des „<i>Bestellungen importieren</i>”-Buttons. Warten Sie, bis der Vorgang abgeschlossen ist. Sie sehen im Anschluss einen Statusbericht über die importierten Bestellungen.</p>"
|
| 58 |
+
"leave empty to load all till now","leer lassen, um alles bis jetzt zu laden"
|
| 59 |
+
"please wait","Bitte warten...",
|
| 60 |
+
"view orders","Bestellungen ansehen"
|
| 61 |
+
"Finished","Abgeschlossen"
|
| 62 |
+
"Import Products","Bestellungen importieren"
|
| 63 |
+
"Import Categories","MeinPaket.de Kategorien importieren"
|
| 64 |
+
"Category import completed.","Der Import der MeinPaket.de Marktplatz-Kategorien wurde abgeschlossen."
|
| 65 |
+
"Textual introduction into category import goes here...","<b>Hier können Sie die Marktplatzkategorien von MeinPaket.de importieren. Die Kategorien finden Sie im Anschluss unter der Kategorie „<i>MeinPaket.de marketplace</i>” auf der obersten Ebene Ihres Magento-Kategoriebaumes.</b><p>Wenn Sie die MeinPaket.de-Marktplatzkategorien schon einmal importiert haben, werden diese nicht überschrieben, sondern nur mögliche Änderungen und Ergänzungen vorgenommen. Produkte, die Sie bereits MeinPaket.de-Marktplatzkategorien zugeordnet haben, bleiben weiterhin diesen Kategorien zugeordnet.</p><p>Starten Sie den Importvorgang durch Betätigen des „<i>Kategorien importieren</i>”-Buttons. Der Vorgang kann einige Minuten dauern. Brechen Sie den Vorgang nicht ab.</p>"
|
| 66 |
+
"Product export failed. Failed connecting to MeinPaket server.","Produktexport fehlgeschlagen: Konnte keine Verbindung zu MeinPaket.de aufgebaut werden."
|
| 67 |
+
"No new orders found.","Es wurden keine neuen Bestellungen gefunden."
|
| 68 |
+
"Skipped %s order(s) because: out of stock. Please process the following order(s) at your MeinPaket.de dealer area:","%s Bestellung(en) übersprungen, da nicht auf Lager. Bitte bearbeiten Sie die folgende(n) Bestellung(en) in Ihrem MeinPaket Händlerbereich:"
|
| 69 |
+
"Skipped %s order(s) because: some or all of the included products were disabled in Magento after the export to MeinPaket.de . Please process the following order(s) at your MeinPaket.de dealer area:","%s Bestellung(en) übersprungen, da sie Produkte enthielten, die nachträglich zum Export nach MeinPaket.de in Magento deaktiviert wurden. Bitte bearbeiten Sie die folgende(n) Bestellung(en) in Ihrem MeinPaket Händlerbereich:"
|
| 70 |
+
"%s was ordered with a different price (%s instead of current price %s). Was the price changed after exporting to MeinPaket.de?","%s wurde zu einem anderen Preis bestellt (%s statt aktuellem Preis %s). Wurde der Preis nachträglich nach dem Export zu MeinPaket.de geändert?"
|
| 71 |
+
"Internal error on MeinPaket server","Interner Fehler auf MeinPaket-Server",
|
| 72 |
+
"Product stock is lower than zero.","Der Lagerbestand für dieses Produkt ist im negativen Bereich."
|
| 73 |
+
"Overview","Übersicht"
|
| 74 |
+
"Category","Kategorie"
|
| 75 |
+
"Old name","Alter Name"
|
| 76 |
+
"Edit Category","Kategorie bearbeiten"
|
| 77 |
+
"New categories","Neue Kategorien"
|
| 78 |
+
"Renamed categories","Umbenannte Kategorien"
|
| 79 |
+
"Deleted categories","Gelöschte Kategorien"
|
| 80 |
+
"Successfully imported marketplace categories.","Die Marktplatz-Kategorien wurden erfolgreich mit MeinPaket.de abgeglichen."
|
| 81 |
+
"Connecting to MeinPaket.de server failed.","Die Verbindung zum MeinPaket.de-Server konnte nicht aufgebaut werden."
|
| 82 |
+
"Connection to MeinPaket.de server timed out.","Der MeinPaket.de-Server antwortet nicht."
|
| 83 |
+
"Unknown error","Es ist ein unbekannter Fehler aufgetreten"
|
| 84 |
+
"Error","Fehler"
|
| 85 |
+
"Added %s new categories.","Es wurden %s neue Kategorien angelegt."
|
| 86 |
+
"Renamed %s categories.","Es wurden %s Kategorien umbenannt."
|
| 87 |
+
"Deleted %s categories.","Es wurden %s Kategorien gelöscht, die im MeinPaket.de-Marktplatz nicht mehr verfügbar sind."
|
| 88 |
+
"Marketplace category structure was up to date. There have been no changes.","Markplatz-Kategoriestruktur ist auf dem neuesten Stand."
|
| 89 |
+
"Imported from DHL MeinPaket.de","Importiert von MeinPaket.de"
|
| 90 |
+
"MeinPaket.de Order No.","MeinPaket.de Best.Nr."
|
| 91 |
+
"Request could not be built.","Die Anfrage konnte nicht generiert werden."
|
| 92 |
+
"MeinPaket.de server returned HTPP code %s.","Der MeinPaket.de-Server hat den HTTP-Fehlercode %s zurückgeliefert."
|
| 93 |
+
"Connection to MeinPaket.de server timed out.","Zeitüberschreitung beim Verbindungsaufbau zu MeinPaket.de-Server."
|
| 94 |
+
"Invalid response from MeinPaket.de server.","Ungültige Antwort von MeinPaket.de-Server erhalten."
|
| 95 |
+
"Error on tranfering cancelled items to MeinPaket.de.","Bei der Stornierung der Bestellpositionen bei MeinPaket.de ist ein Fehler aufgetreten."
|
| 96 |
+
"MeinPaket.de server returned error code %s.","Der MeinPaket.de-Server hat den Fehlercode %s zurückgegeben."
|
| 97 |
+
"Shipment has not been accepted by MeinPaket.de.","Die Lieferung wurde von MeinPaket.de nicht akzeptiert."
|
| 98 |
+
"Error on transfering shipment to MeinPaket.de.","Fehler beim Senden der Lieferinformationen zu MeinPaket.de."
|
| 99 |
+
"Refund has not been accepted by MeinPaket.de.","Die Gutschrift wurde nicht von MeinPaket.de akzeptiert."
|
| 100 |
+
"Error on transfering refund to MeinPaket.de.","Fehler beim Senden der Gutschrift an MeinPaket.de."
|
| 101 |
+
"Tracking code has not been accepted by MeinPaket.de.","Der gesendete Tracking-Code für diese Lieferung wurde von MeinPaket.de nicht akzeptiert."
|
| 102 |
+
"MeinPaket.de returned error code %s.","MeinPaket.de lieferte den Fehler-Code %s zurück."
|
| 103 |
+
"Error on transfering tracking code to MeinPaket.de.","Fehler beim Senden des Tracking-Codes am MeinPaket.de."
|
| 104 |
+
"There were no products that could be exported.","Es konnten keine Produkte exportiert werden."
|
| 105 |
+
"Product information has not been accepted by MeinPaket.de.","Die Produktinformationen wurden von MeinPaket.de nicht akzeptiert."
|
| 106 |
+
"Error on transfering product information to MeinPaket.de.","Fehler beim Exportieren des Produktes nach MeinPaket.de."
|
| 107 |
+
"Thank you for your order!","Vielen Dank für Ihre Bestellung!"
|
| 108 |
+
"Your order was successfully processed at MeinPaket.de. We will recieve your order shortly.","Ihre Bestellung wurde bei MeinPaket.de erfogreich bearbeitet. Wir werden Ihre Bestellung in Kürze erhalten."
|
| 109 |
+
"Ooops!","Uuups!"
|
| 110 |
+
"Something has gone terribly wrong while processing your order at MeinPaket.de! Please contact our customer service.","Etwas ist schiefgelaufen, während Ihre Bestellung bei MeinPaket.de bearbeitet wurde. Bitte kontaktieren Sie unseren Kundenservice!"
|
| 111 |
+
"Checkout aborted!","Bestellvorgang abgebrochen!"
|
| 112 |
+
"You decided to abort the external checkout at DHL MeinPaket. Your order has NOT been processed yet. Feel free to continue shopping and use our own checkout.","Sie haben den POSTPAY abgebrochen. Ihre Bestellung wurde noch NICHT verabeitet. Gerne können Sie Ihren Einkauf fortsetzen und unseren Checkout nutzen."
|
| 113 |
+
"Continue shopping","Einkauf fortsetzen"
|
| 114 |
+
"Checkout","Checkout"
|
| 115 |
+
"POSTPAY available","POSTPAY anbieten"
|
| 116 |
+
"This defines wether the external Checkout with DHL is available for customers.","Dies legt fest, ob der POSTPAY für Ihre Kunden verfügbar ist."
|
| 117 |
+
"The MeinPaket server did not deliver a valid response. Have a look at the system log for more information.","Der MeinPaket-Server hat keine gültige Antwort für die Bestellungsabfrage geliefert. Für mehr Informationen zu diesem Problem, schauen Sie bitte im System-Log nach."
|
| 118 |
+
"You are not authorized to execute the requested functionality on MeinPaket","Sie sind nicht berechtigt diese Funktionalität der MeinPaket-Plattform zu nutzen"
|
| 119 |
+
"The provided data was incorrect","MeinPaket konnte die gegebenen Daten nicht akzeptieren"
|
| 120 |
+
"The requested modification is not allowed. Please contact the MeinPaket support team","Diese Modifikation ist nicht erlaubt. Bitte kontaktieren Sie das MeinPaket Support Team"
|
| 121 |
+
"The product is not mapped to neither a marketplace nor a shop category","Dieses Produkt ist weder einer Markplatzkategorie noch einer Shopkategorie zugewiesen"
|
| 122 |
+
"The referenced product cannot be sold","Das Produkt kann nicht auf MeinPaket verkauft werden"
|
| 123 |
+
"The referenced marketplace category could not be found at MeinPaket","Die angegebene Marktplatzkategorie kann auf MeinPaket nicht gefunden werden. Bitte importieren Sie die Marktplatzkategorien erneut, um auf dem aktuellen Stand zu arbeiten"
|
| 124 |
+
"The referenced shop category could not be found at MeinPaket","Die angegebene Shop-Kategorie konnte bei MeinPaket nicht gefunden werden"
|
| 125 |
+
"Default Shipment Method","Standard Versandmethode"
|
| 126 |
+
"Shipment method which is used for order import and POSTPAY.","Versandmethode, die beim Import von MeinPaket-Bestellungen und für POSTPAY verwendet wird."
|
| 127 |
+
"Submit shipping costs for POSTPAY","Versandkosten übertragen"
|
| 128 |
+
"If set to yes, the shippingscosts for the POSTPAY will be calculated based on the default shipment method.","Legt fest, ob die Versandkosten basierend auf der eingestellten Standard Liefermethode mit übertragen werden."
|
| 129 |
+
"Error on POSTPAY","Fehler bei POSTPAY"
|
| 130 |
+
"The current version of POSTPAY does not support configurable products.","POSTPAY unterstützt in der aktuellen Version keine konfigurierbaren Produkte."
|
| 131 |
+
"attribute mapping","Attribut-Mapping"
|
| 132 |
+
"Attribute Mapping","Attribut-Mapping"
|
| 133 |
+
"Attribute mappings","Attribut-Mappings"
|
| 134 |
+
"Attribute Mappings","Attribut-Mappings"
|
| 135 |
+
"Add Attribute Mapping","Neues Attribut-Mapping"
|
| 136 |
+
"Save Mapping","Mapping speichern"
|
| 137 |
+
"Create Attribute Mapping","Neues Attribut-Mapping anlegen"
|
| 138 |
+
"Edit Attribute Mapping","Attribut-Mapping bearbeiten"
|
| 139 |
+
"Magento Attribute Set","Magento Attribut-Set"
|
| 140 |
+
"Please select attribute set and variant.","Bitte wählen Sie ein Attribut-Set und eine Varianten-Konfiguration aus."
|
| 141 |
+
"MeinPaket Variant Configuration","MeinPaket Varianten-Konfiguration"
|
| 142 |
+
"_Custom_","_Benutzerdefiniert_"
|
| 143 |
+
"not assigned","nicht zugewiesen"
|
| 144 |
+
"Magento Attribute","Magento-Attribut"
|
| 145 |
+
"MeinPaket Attribute","MeinPaket-Attribut"
|
| 146 |
+
"Magento Value","Magento-Wert"
|
| 147 |
+
"MeinPaket Value","MeinPaket-Wert"
|
| 148 |
+
"Edit Value Mapping","bearbeiten"
|
| 149 |
+
"Delete Mapping","löschen"
|
| 150 |
+
"No mapable attribute values available for the selected MeinPaket attribute.","Für das ausgewählte MeinPaket-Attribut existieren keine zuweisbaren Attribut-Werte."
|
| 151 |
+
"Magento attribute values will be used instead.","Es werden direkt die Werte des Magento-Attributes verwendet."
|
| 152 |
+
"_Auto_","_Automatisch_"
|
| 153 |
+
"Apply a mapping for the following MeinPaket attributes","Bitte legen Sie für folgenden MeinPaket-Attribute ein Attribut-Mapping fest"
|
| 154 |
+
"A mapping for the Magento attribute set already exists.","Ein Mapping für das ausgewählte Attribut-Set existiert bereits."
|
| 155 |
+
"Your shopping cart contains product types that can not be handled by POSTPAY.","Ihr Einkaufswagen enthält Produkttypen, die von POSTPAY nich verarbeitet werden können."
|
| 156 |
+
"Not available.","Nicht verfügbar."
|
| 157 |
+
"Product export failed for unknown reason.","Der Produktexport ist aus einem unbekannten Grund fehlgeschlagen."
|
| 158 |
+
"Missing value mapping for attribute","Fehlende Wertezuweisung für Attribut"
|
| 159 |
+
"Default customer email","Standard Kunden-E-Mail-Adresse"
|
| 160 |
+
"Customer","Kunde"
|
| 161 |
+
"This eMail address is used as the default one for orders that do not include one.","Diese E-Mail-Adresse wird als Standard-Adresse für Bestellungen verwendet, für die keine Kunden-E-Mail-Adresse geliefert wird."
|
| 162 |
+
"The following configurable products could not be exported","Die folgenden konfigurierbaren Produkte konnten nicht exportiert werden"
|
| 163 |
+
"Ivalid modification of element","Unerlaubte Modifikation des Elementes"
|
| 164 |
+
"Variant group does not exist on MeinPaket","Die verwendeten Produktattribute sind als MeinPaket-Variantenkonfiguration nicht bekannt."
|
| 165 |
+
"Color","Farbe"
|
| 166 |
+
"Size","Größe"
|
| 167 |
+
"Dimension","Abmessung"
|
| 168 |
+
"Quantity","Anzahl"
|
| 169 |
+
"Width","Breite"
|
| 170 |
+
"Format","Format"
|
| 171 |
+
"Material","Material"
|
| 172 |
+
"Length","Länge"
|
| 173 |
+
"Flavor","Geschmacksrichtung"
|
| 174 |
+
"Inscription","Beschriftung"
|
| 175 |
+
"Model","Modell"
|
| 176 |
+
"Platform","Plattform"
|
| 177 |
+
"Radius","Radius"
|
| 178 |
+
"Strength","Stärke"
|
| 179 |
+
"Diameter","Durchmesser"
|
| 180 |
+
"Cylinder","Zylinder"
|
| 181 |
+
"Axis","Achse"
|
| 182 |
+
"Bust Measurement",Brustumfang
|
| 183 |
+
"Cup","Cup"
|
app/locale/de_DE/Dhl_Postpay.csv
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"import Variantconfigurations","Variantenkonfigurationen importieren"
|
| 2 |
+
"Credentials","Zugangsdaten"
|
| 3 |
+
"export products","Produkte exportieren"
|
| 4 |
+
"import orders","Bestellungen importieren"
|
| 5 |
+
"import categories","Kategorien importieren"
|
| 6 |
+
"list products","Produkte anzeigen"
|
| 7 |
+
"select products","Produktauswahl angeben"
|
| 8 |
+
"edit product","Produkt bearbeiten"
|
| 9 |
+
"only marked products", "Nur ausgewählte Produkte"
|
| 10 |
+
"all","Alle"
|
| 11 |
+
"start again","nochmal starten"
|
| 12 |
+
"best prices","Beste Preise"
|
| 13 |
+
"DHL Username","Benutzername"
|
| 14 |
+
"This is the username that was given to you by DHL, mostly your email address.","Dies ist der Benutzername, der Ihnen von DHL mitgeteilt wurde. Meisst ist dies Ihre E-Mail Adresse."
|
| 15 |
+
"DHL Password","Passwort"
|
| 16 |
+
"This is the password that was given to you by DHL.","Dies ist das Passwort, das Ihnen von DHL mitgeteilt wurde."
|
| 17 |
+
"Remote system","Entferntes System"
|
| 18 |
+
"This is the address of the remote API.","Dies ist die Adresse der entfernten API."
|
| 19 |
+
"Tax rates","Steuersätze"
|
| 20 |
+
"Default tax rate","Standard-Steuersatz"
|
| 21 |
+
"The default tax rate applies to most products","Dieser Steuersatz gilt für die meissten Produkte."
|
| 22 |
+
"Reduced tax rate","reduzierter Steuersatz"
|
| 23 |
+
"The reduced tax rate applies to special products, such as aliments","Der reduzierte Steuersatz, der für spezielle Produkte - etwa Nahrungsmittel - gilt."
|
| 24 |
+
"Shop tree root","Shop Hauptkategorie"
|
| 25 |
+
"Marketplace tree root","Marktplatz Hauptkategorie"
|
| 26 |
+
"Sync with MeinPaket.de","mit MeinPaket.de abgleichen"
|
| 27 |
+
"Maximum stock qty. for MeinPaket.de","maximale Stückzahl für MeinPaket.de"
|
| 28 |
+
"Product attributes","Produkteigenschaften"
|
| 29 |
+
"Delivery time","Lieferzeit (in Tagen)"
|
| 30 |
+
"Please select the product attribute which represents the approx. delivery time","Bitte wählen Sie die Produkteigenschaft, welche die Lieferzeit angibt."
|
| 31 |
+
"Default delivery time","Standard-Lieferzeit"
|
| 32 |
+
"Delivery time in days if no other delivery time applies","Lieferzeit in Tagen, wenn keine andere Lieferzeit angegeben."
|
| 33 |
+
"Marketplace category ID","Marktplatz-Kategorie"
|
| 34 |
+
"These products could not be exported","Die folgenden Produkte konnten aufgrund von Fehlern nicht exportiert werden"
|
| 35 |
+
"Result","Ergebnis"
|
| 36 |
+
"Selection","Auswahl"
|
| 37 |
+
"Upload","Upload"
|
| 38 |
+
"Common Errors","Allgemeine Fehler"
|
| 39 |
+
"Product","Produkt"
|
| 40 |
+
"Edit Product","Produkt bearbeiten"
|
| 41 |
+
"Error Description","Fehlerbeschreibung"
|
| 42 |
+
"Invalid value for field","Ungültiger Wert für Feld"
|
| 43 |
+
"Missing value for field","Fehlender Wert für Feld"
|
| 44 |
+
"The following products could only be exported as description","Für die folgenden Produkte konnten nur Angebote eingestellt werden"
|
| 45 |
+
"Unknown Error","Unbekannter Fehler"
|
| 46 |
+
"Product is unknown in MeinPaket marketplace","Produkt ist im MeinPaket Marktplatz nicht bekannt"
|
| 47 |
+
"Successfully Exported Products","Erfolgreich exportierte Produkte"
|
| 48 |
+
"total","gesamt"
|
| 49 |
+
"of","von"
|
| 50 |
+
"%s of %s products were successfully exported","%s von %s Produkten wurden erfolgreich exportiert"
|
| 51 |
+
"At this place you can choose which products you want to export and start the process.","<b>Hier können Sie Produkte Ihres Magento-Shops nach MeinPaket.de exportieren.</b><p>Wählen Sie in der Auswahlliste unten den Punkt „<i>Nur ausgewählte Produkte</i>”, um nur die Produkte zu exportieren, deren „<i>mit MeinPaket.de abgleichen</i>”-Attribut explizit auf „<i>Ja</i>” gesetzt wurde. Dieses Attribut können Sie in den Produktinformationen im Reiter „<i>Allgemein</i>” bearbeiten.</p><p>Um alle Produkte Ihres Magento-Shops nach MeinPaket.de zu exportieren, wählen Sie „<i>Alle</i>” in der unten stehenden Auswahlliste. Berücksichtigt werden hierbei nur Produkte, die einer MeinPaket.de-Marktplatzkategorie zugeordnet sind.</p><p>Sie starten den Vorgang durch Betätigen des „<i>Produkte exportieren</i>”-Buttons. Dadurch springt der Export in den Upload-Modus. Unterbrechen Sie den Prozess während dessen nicht.</p><p>Wenn alle ausgewählten Produkte an MeinPaket übermittelt wurden, sehen Sie eine Übersicht aller exportierter Produkte sowie eine detaillierte Auflistung aller während des Vorgangs aufgetretenen Fehler.</p>"
|
| 52 |
+
"Skipped %s duplicate orders that were already imported previously.","%s Bestellungen übersprungen, die bereits zu einem früheren Zeitpunkt importiert wurden."
|
| 53 |
+
"Skipped %s duplicate order that was already imported previously.","%s Bestellung übersprungen, die bereits zu einem früheren Zeitpunkt importiert wurde."
|
| 54 |
+
"%s order(s) sucessfully imported.","%s Bestellung(en) erfolgreich importiert."
|
| 55 |
+
"start date","Startdatum"
|
| 56 |
+
"end date","Enddatum"
|
| 57 |
+
"Textual guide for importing orders follows here","<b>Hier können Sie Bestellungen importieren, die Käufer auf MeinPaket.de getätigt haben.</b><p>Legen Sie mit Hilfe der Felder „<i>Startdatum</i>” und „<i>Enddatum</i>” einen Zeitraum fest, für den Sie Bestellungen von MeinPaket.de importieren möchten. Sie können das Feld „<i>Enddatum</i>” leer lassen, um alle Bestellungen vom „<i>Startdatum</i>” bis zum jetzigen Zeitpunkt zu importieren.</p><p>Starten Sie den Vorgang durch Betätigen des „<i>Bestellungen importieren</i>”-Buttons. Warten Sie, bis der Vorgang abgeschlossen ist. Sie sehen im Anschluss einen Statusbericht über die importierten Bestellungen.</p>"
|
| 58 |
+
"leave empty to load all till now","leer lassen, um alles bis jetzt zu laden"
|
| 59 |
+
"please wait","Bitte warten...",
|
| 60 |
+
"view orders","Bestellungen ansehen"
|
| 61 |
+
"Finished","Abgeschlossen"
|
| 62 |
+
"Import Products","Bestellungen importieren"
|
| 63 |
+
"Import Categories","MeinPaket.de Kategorien importieren"
|
| 64 |
+
"Category import completed.","Der Import der MeinPaket.de Marktplatz-Kategorien wurde abgeschlossen."
|
| 65 |
+
"Textual introduction into category import goes here...","<b>Hier können Sie die Marktplatzkategorien von MeinPaket.de importieren. Die Kategorien finden Sie im Anschluss unter der Kategorie „<i>MeinPaket.de marketplace</i>” auf der obersten Ebene Ihres Magento-Kategoriebaumes.</b><p>Wenn Sie die MeinPaket.de-Marktplatzkategorien schon einmal importiert haben, werden diese nicht überschrieben, sondern nur mögliche Änderungen und Ergänzungen vorgenommen. Produkte, die Sie bereits MeinPaket.de-Marktplatzkategorien zugeordnet haben, bleiben weiterhin diesen Kategorien zugeordnet.</p><p>Starten Sie den Importvorgang durch Betätigen des „<i>Kategorien importieren</i>”-Buttons. Der Vorgang kann einige Minuten dauern. Brechen Sie den Vorgang nicht ab.</p>"
|
| 66 |
+
"Product export failed. Failed connecting to MeinPaket server.","Produktexport fehlgeschlagen: Konnte keine Verbindung zu MeinPaket.de aufgebaut werden."
|
| 67 |
+
"No new orders found.","Es wurden keine neuen Bestellungen gefunden."
|
| 68 |
+
"Skipped %s order(s) because: out of stock. Please process the following order(s) at your MeinPaket.de dealer area:","%s Bestellung(en) übersprungen, da nicht auf Lager. Bitte bearbeiten Sie die folgende(n) Bestellung(en) in Ihrem MeinPaket Händlerbereich:"
|
| 69 |
+
"Skipped %s order(s) because: some or all of the included products were disabled in Magento after the export to MeinPaket.de . Please process the following order(s) at your MeinPaket.de dealer area:","%s Bestellung(en) übersprungen, da sie Produkte enthielten, die nachträglich zum Export nach MeinPaket.de in Magento deaktiviert wurden. Bitte bearbeiten Sie die folgende(n) Bestellung(en) in Ihrem MeinPaket Händlerbereich:"
|
| 70 |
+
"%s was ordered with a different price (%s instead of current price %s). Was the price changed after exporting to MeinPaket.de?","%s wurde zu einem anderen Preis bestellt (%s statt aktuellem Preis %s). Wurde der Preis nachträglich nach dem Export zu MeinPaket.de geändert?"
|
| 71 |
+
"Internal error on MeinPaket server","Interner Fehler auf MeinPaket-Server",
|
| 72 |
+
"Product stock is lower than zero.","Der Lagerbestand für dieses Produkt ist im negativen Bereich."
|
| 73 |
+
"Overview","Übersicht"
|
| 74 |
+
"Category","Kategorie"
|
| 75 |
+
"Old name","Alter Name"
|
| 76 |
+
"Edit Category","Kategorie bearbeiten"
|
| 77 |
+
"New categories","Neue Kategorien"
|
| 78 |
+
"Renamed categories","Umbenannte Kategorien"
|
| 79 |
+
"Deleted categories","Gelöschte Kategorien"
|
| 80 |
+
"Successfully imported marketplace categories.","Die Marktplatz-Kategorien wurden erfolgreich mit MeinPaket.de abgeglichen."
|
| 81 |
+
"Connecting to MeinPaket.de server failed.","Die Verbindung zum MeinPaket.de-Server konnte nicht aufgebaut werden."
|
| 82 |
+
"Connection to MeinPaket.de server timed out.","Der MeinPaket.de-Server antwortet nicht."
|
| 83 |
+
"Unknown error","Es ist ein unbekannter Fehler aufgetreten"
|
| 84 |
+
"Error","Fehler"
|
| 85 |
+
"Added %s new categories.","Es wurden %s neue Kategorien angelegt."
|
| 86 |
+
"Renamed %s categories.","Es wurden %s Kategorien umbenannt."
|
| 87 |
+
"Deleted %s categories.","Es wurden %s Kategorien gelöscht, die im MeinPaket.de-Marktplatz nicht mehr verfügbar sind."
|
| 88 |
+
"Marketplace category structure was up to date. There have been no changes.","Markplatz-Kategoriestruktur ist auf dem neuesten Stand."
|
| 89 |
+
"Imported from DHL MeinPaket.de","Importiert von MeinPaket.de"
|
| 90 |
+
"MeinPaket.de Order No.","MeinPaket.de Best.Nr."
|
| 91 |
+
"Request could not be built.","Die Anfrage konnte nicht generiert werden."
|
| 92 |
+
"MeinPaket.de server returned HTPP code %s.","Der MeinPaket.de-Server hat den HTTP-Fehlercode %s zurückgeliefert."
|
| 93 |
+
"Connection to MeinPaket.de server timed out.","Zeitüberschreitung beim Verbindungsaufbau zu MeinPaket.de-Server."
|
| 94 |
+
"Invalid response from MeinPaket.de server.","Ungültige Antwort von MeinPaket.de-Server erhalten."
|
| 95 |
+
"Error on tranfering cancelled items to MeinPaket.de.","Bei der Stornierung der Bestellpositionen bei MeinPaket.de ist ein Fehler aufgetreten."
|
| 96 |
+
"MeinPaket.de server returned error code %s.","Der MeinPaket.de-Server hat den Fehlercode %s zurückgegeben."
|
| 97 |
+
"Shipment has not been accepted by MeinPaket.de.","Die Lieferung wurde von MeinPaket.de nicht akzeptiert."
|
| 98 |
+
"Error on transfering shipment to MeinPaket.de.","Fehler beim Senden der Lieferinformationen zu MeinPaket.de."
|
| 99 |
+
"Refund has not been accepted by MeinPaket.de.","Die Gutschrift wurde nicht von MeinPaket.de akzeptiert."
|
| 100 |
+
"Error on transfering refund to MeinPaket.de.","Fehler beim Senden der Gutschrift an MeinPaket.de."
|
| 101 |
+
"Tracking code has not been accepted by MeinPaket.de.","Der gesendete Tracking-Code für diese Lieferung wurde von MeinPaket.de nicht akzeptiert."
|
| 102 |
+
"MeinPaket.de returned error code %s.","MeinPaket.de lieferte den Fehler-Code %s zurück."
|
| 103 |
+
"Error on transfering tracking code to MeinPaket.de.","Fehler beim Senden des Tracking-Codes am MeinPaket.de."
|
| 104 |
+
"There were no products that could be exported.","Es konnten keine Produkte exportiert werden."
|
| 105 |
+
"Product information has not been accepted by MeinPaket.de.","Die Produktinformationen wurden von MeinPaket.de nicht akzeptiert."
|
| 106 |
+
"Error on transfering product information to MeinPaket.de.","Fehler beim Exportieren des Produktes nach MeinPaket.de."
|
| 107 |
+
"Thank you for your order!","Vielen Dank für Ihre Bestellung!"
|
| 108 |
+
"Your order was successfully processed at MeinPaket.de. We will recieve your order shortly.","Ihre Bestellung wurde bei MeinPaket.de erfogreich bearbeitet. Wir werden Ihre Bestellung in Kürze erhalten."
|
| 109 |
+
"Ooops!","Uuups!"
|
| 110 |
+
"Something has gone terribly wrong while processing your order at MeinPaket.de! Please contact our customer service.","Etwas ist schiefgelaufen, während Ihre Bestellung bei MeinPaket.de bearbeitet wurde. Bitte kontaktieren Sie unseren Kundenservice!"
|
| 111 |
+
"Checkout aborted!","Bestellvorgang abgebrochen!"
|
| 112 |
+
"You decided to abort the external checkout at DHL MeinPaket. Your order has NOT been processed yet. Feel free to continue shopping and use our own checkout.","Sie haben den POSTPAY abgebrochen. Ihre Bestellung wurde noch NICHT verabeitet. Gerne können Sie Ihren Einkauf fortsetzen und unseren Checkout nutzen."
|
| 113 |
+
"Continue shopping","Einkauf fortsetzen"
|
| 114 |
+
"Checkout","Checkout"
|
| 115 |
+
"POSTPAY available","POSTPAY anbieten"
|
| 116 |
+
"This defines wether the external Checkout with DHL is available for customers.","Dies legt fest, ob der POSTPAY für Ihre Kunden verfügbar ist."
|
| 117 |
+
"The MeinPaket server did not deliver a valid response. Have a look at the system log for more information.","Der MeinPaket-Server hat keine gültige Antwort für die Bestellungsabfrage geliefert. Für mehr Informationen zu diesem Problem, schauen Sie bitte im System-Log nach."
|
| 118 |
+
"You are not authorized to execute the requested functionality on MeinPaket","Sie sind nicht berechtigt diese Funktionalität der MeinPaket-Plattform zu nutzen"
|
| 119 |
+
"The provided data was incorrect","MeinPaket konnte die gegebenen Daten nicht akzeptieren"
|
| 120 |
+
"The requested modification is not allowed. Please contact the MeinPaket support team","Diese Modifikation ist nicht erlaubt. Bitte kontaktieren Sie das MeinPaket Support Team"
|
| 121 |
+
"The product is not mapped to neither a marketplace nor a shop category","Dieses Produkt ist weder einer Markplatzkategorie noch einer Shopkategorie zugewiesen"
|
| 122 |
+
"The referenced product cannot be sold","Das Produkt kann nicht auf MeinPaket verkauft werden"
|
| 123 |
+
"The referenced marketplace category could not be found at MeinPaket","Die angegebene Marktplatzkategorie kann auf MeinPaket nicht gefunden werden. Bitte importieren Sie die Marktplatzkategorien erneut, um auf dem aktuellen Stand zu arbeiten"
|
| 124 |
+
"The referenced shop category could not be found at MeinPaket","Die angegebene Shop-Kategorie konnte bei MeinPaket nicht gefunden werden"
|
| 125 |
+
"Default Shipment Method","Standard Versandmethode"
|
| 126 |
+
"Shipment method which is used for order import and POSTPAY.","Versandmethode, die beim Import von MeinPaket-Bestellungen und für POSTPAY verwendet wird."
|
| 127 |
+
"Submit shipping costs for POSTPAY","Versandkosten übertragen"
|
| 128 |
+
"If set to yes, the shippingscosts for the POSTPAY will be calculated based on the default shipment method.","Legt fest, ob die Versandkosten basierend auf der eingestellten Standard Liefermethode mit übertragen werden."
|
| 129 |
+
"Error on POSTPAY","Fehler bei POSTPAY"
|
| 130 |
+
"The current version of POSTPAY does not support configurable products.","POSTPAY unterstützt in der aktuellen Version keine konfigurierbaren Produkte."
|
| 131 |
+
"attribute mapping","Attribut-Mapping"
|
| 132 |
+
"Attribute Mapping","Attribut-Mapping"
|
| 133 |
+
"Attribute mappings","Attribut-Mappings"
|
| 134 |
+
"Attribute Mappings","Attribut-Mappings"
|
| 135 |
+
"Add Attribute Mapping","Neues Attribut-Mapping"
|
| 136 |
+
"Save Mapping","Mapping speichern"
|
| 137 |
+
"Create Attribute Mapping","Neues Attribut-Mapping anlegen"
|
| 138 |
+
"Edit Attribute Mapping","Attribut-Mapping bearbeiten"
|
| 139 |
+
"Magento Attribute Set","Magento Attribut-Set"
|
| 140 |
+
"Please select attribute set and variant.","Bitte wählen Sie ein Attribut-Set und eine Varianten-Konfiguration aus."
|
| 141 |
+
"MeinPaket Variant Configuration","MeinPaket Varianten-Konfiguration"
|
| 142 |
+
"_Custom_","_Benutzerdefiniert_"
|
| 143 |
+
"not assigned","nicht zugewiesen"
|
| 144 |
+
"Magento Attribute","Magento-Attribut"
|
| 145 |
+
"MeinPaket Attribute","MeinPaket-Attribut"
|
| 146 |
+
"Magento Value","Magento-Wert"
|
| 147 |
+
"MeinPaket Value","MeinPaket-Wert"
|
| 148 |
+
"Edit Value Mapping","bearbeiten"
|
| 149 |
+
"Delete Mapping","löschen"
|
| 150 |
+
"No mapable attribute values available for the selected MeinPaket attribute.","Für das ausgewählte MeinPaket-Attribut existieren keine zuweisbaren Attribut-Werte."
|
| 151 |
+
"Magento attribute values will be used instead.","Es werden direkt die Werte des Magento-Attributes verwendet."
|
| 152 |
+
"_Auto_","_Automatisch_"
|
| 153 |
+
"Apply a mapping for the following MeinPaket attributes","Bitte legen Sie für folgenden MeinPaket-Attribute ein Attribut-Mapping fest"
|
| 154 |
+
"A mapping for the Magento attribute set already exists.","Ein Mapping für das ausgewählte Attribut-Set existiert bereits."
|
| 155 |
+
"Your shopping cart contains product types that can not be handled by POSTPAY.","Ihr Einkaufswagen enthält Produkttypen, die von POSTPAY nich verarbeitet werden können."
|
| 156 |
+
"Not available.","Nicht verfügbar."
|
| 157 |
+
"Product export failed for unknown reason.","Der Produktexport ist aus einem unbekannten Grund fehlgeschlagen."
|
| 158 |
+
"Missing value mapping for attribute","Fehlende Wertezuweisung für Attribut"
|
| 159 |
+
"Default customer email","Standard Kunden-E-Mail-Adresse"
|
| 160 |
+
"Customer","Kunde"
|
| 161 |
+
"This eMail address is used as the default one for orders that do not include one.","Diese E-Mail-Adresse wird als Standard-Adresse für Bestellungen verwendet, für die keine Kunden-E-Mail-Adresse geliefert wird."
|
| 162 |
+
"The following configurable products could not be exported","Die folgenden konfigurierbaren Produkte konnten nicht exportiert werden"
|
| 163 |
+
"Ivalid modification of element","Unerlaubte Modifikation des Elementes"
|
| 164 |
+
"Variant group does not exist on MeinPaket","Die verwendeten Produktattribute sind als MeinPaket-Variantenkonfiguration nicht bekannt."
|
| 165 |
+
"Color","Farbe"
|
| 166 |
+
"Size","Größe"
|
| 167 |
+
"Dimension","Abmessung"
|
| 168 |
+
"Quantity","Anzahl"
|
| 169 |
+
"Width","Breite"
|
| 170 |
+
"Format","Format"
|
| 171 |
+
"Material","Material"
|
| 172 |
+
"Length","Länge"
|
| 173 |
+
"Flavor","Geschmacksrichtung"
|
| 174 |
+
"Inscription","Beschriftung"
|
| 175 |
+
"Model","Modell"
|
| 176 |
+
"Platform","Plattform"
|
| 177 |
+
"Radius","Radius"
|
| 178 |
+
"Strength","Stärke"
|
| 179 |
+
"Diameter","Durchmesser"
|
| 180 |
+
"Cylinder","Zylinder"
|
| 181 |
+
"Axis","Achse"
|
| 182 |
+
"Bust Measurement",Brustumfang
|
| 183 |
+
"Cup","Cup"
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>DHL_MeinPaket2</name>
|
| 4 |
-
<version>2.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>--</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -10,9 +10,9 @@
|
|
| 10 |
<description>The Extension connects your magento shop with DHL MeinPaket.</description>
|
| 11 |
<notes>--</notes>
|
| 12 |
<authors><author><name>DHL Vertriebs GmbH</name><user>--</user><email>support@meinpaket.de</email></author></authors>
|
| 13 |
-
<date>
|
| 14 |
-
<time>12:
|
| 15 |
-
<contents><target name="magecommunity"><dir><dir name="Dhl"><dir name="MeinPaket"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Async"><file name="Grid.php" hash="4b82203f22583909829d6e8ac0db3b48"/></dir><file name="Async.php" hash="ef4f9e97c51e89e0500c1716f78f137d"/><dir name="Backlog"><dir name="Product"><file name="Grid.php" hash="1e174969ba66fee012f821537c3ebcfe"/></dir><file name="Product.php" hash="d0fa6e92c7a2349cb2ef578eb1dad702"/></dir><dir name="BestPrice"><file name="Grid.php" hash="adb8a1085e086f3d1dc57a489619ff5d"/></dir><file name="BestPrice.php" hash="b4f9912d464830a48fd5154c45b0c040"/><dir name="Catalog"><dir name="Product"><dir name="Matching"><file name="Result.php" hash="135446bcf25b60bb017e29b15881daa8"/><file name="Tab.php" hash="6f27e6fb28ee96e9202361e7d6c43768"/></dir></dir></dir><dir name="CategoryImport"><file name="Import.php" hash="ff3d5bd990c083a3b301176c24362913"/><file name="Index.php" hash="4c5a08ddbb0690b1cfa0761d946d0438"/></dir><file name="LeftMenu.php" hash="841b0491f1c19c07448e112badba8931"/><dir name="Log"><file name="Grid.php" hash="bf9c49ad316749ef39f580a24dae0de0"/></dir><file name="Log.php" hash="8b8483b85d3fde61e1311735e259ff83"/><dir name="OrderImport"><file name="Index.php" hash="93fdf0e300f87fdf85dc41e6b881bb10"/></dir><dir name="ProductExport"><file name="Export.php" hash="e12ef6d9b52a9607820fbcd5e58e76ca"/><file name="Index.php" hash="7495cd0332c5ca82060ceba2e6113c87"/><file name="List.php" hash="4a32ced740d35ebb7a10d0fffa782223"/></dir><file name="Steps.php" hash="93a8cac6f58eba2d32b116b725099f1f"/></dir><dir name="Checkout"><file name="Abort.php" hash="0d26a20ad1bc999d4b77ac8a7fbb9d2e"/><file name="Error.php" hash="43852fdbf5efc3764258fb1984a15d2b"/><file name="Success.php" hash="0a5519df124dd0894634b59e41d6a4ef"/></dir></dir><dir name="Helper"><file name="Attribute.php" hash="36cf44cf54204426e3f50864381a6443"/><file name="Backlog.php" hash="51c08b4ef137799d0e7dbf900543ab3e"/><file name="Cron.php" hash="f9fadece6ceb35c90568bd68b5ee0ccd"/><file name="Data.php" hash="17b2ff0eaf887b371ab40b0bbb2ca439"/><file name="Order.php" hash="4d14caabf6a94f15a94ce570dfba82da"/><file name="Product.php" hash="42495296ac652656def68db51a966813"/><file name="Shipment.php" hash="9301fede718b839f2c0c2677e2fb3bf9"/></dir><dir name="Model"><file name="Async.php" hash="0a28e792075d101a619e49265f843fe1"/><dir name="Attribute"><file name="Mapping.php" hash="7d8a8d9e18f7c6019ae71a7032061ab7"/></dir><dir name="Backlog"><file name="Product.php" hash="a2d547dcfba28c80819155a73ff5cff4"/></dir><file name="BestPrice.php" hash="b75de965445df6125e115d0d89add52c"/><dir name="Carrier"><file name="Meinpaket.php" hash="ef4c1115bf11a3584896743e7dd8a8bf"/></dir><file name="Category.php" hash="6c809b62cf4688ac62b39c0aae224422"/><dir name="Client"><file name="BadHttpReturnCodeException.php" hash="9377dbcc046ab1465c70caa4ef3a5706"/><file name="HttpException.php" hash="e525b48fb4f7be4dac59058e64947319"/><file name="HttpTimeoutException.php" hash="4835db459423c36607cabfc0b63245ad"/><file name="XmlOverHttp.php" hash="8f1f26f8a39a2a87fc00f1e1b4e23413"/></dir><file name="Cron.php" hash="ccf8a1dd23a035caaf40bc4e98f059ac"/><dir name="Entity"><dir name="Attribute"><dir name="Frontend"><file name="LabelTranslation.php" hash="e46ff6aca592cbb643a64ecfe1042422"/></dir><dir name="Source"><file name="Carrier.php" hash="65770c58617deb2dce75d8e83e055d79"/><file name="MeinPaketCategory.php" hash="17f784c2d79bfd847dd6472dca661334"/><file name="ProductAttribute.php" hash="aba17fe2a9acb85d0483926c3d5ba9a8"/><file name="ProductSyncMode.php" hash="39db6c156e9100ab59384756ec9ac2c5"/><file name="Taxclass.php" hash="e54c0dcb118a1308d572a8c0e53b5853"/><file name="Taxrate.php" hash="a45e4f6a4bf33eb5b39a0cdc4d847868"/></dir></dir></dir><dir name="Exception"><file name="InvalidDataException.php" hash="e1b7bf3f0a4d3743ee42cbf4ce379ddb"/><file name="MissingDataException.php" hash="351f85425c276f434551caf3eafdc7db"/></dir><file name="Log.php" hash="5b2bb2ee0b779db8ddf8c90855012d13"/><dir name="Mysql4"><dir name="Async"><file name="Collection.php" hash="a6583bdf6b8276a95af5b81f5ff2dd8e"/></dir><file name="Async.php" hash="7182fca1fbb6bcf9ada0f9c53c2fc45c"/><dir name="Backlog"><dir name="Product"><file name="Collection.php" hash="2711f602d90e22ea72b773003cf38ef4"/></dir><file name="Product.php" hash="d46057bf2e8b93b32b23653222599316"/></dir><dir name="BestPrice"><file name="Collection.php" hash="fedcad4595269a646ff1c452bed87b00"/></dir><file name="BestPrice.php" hash="79399000e407b6a22489d0dbfedd6f34"/><dir name="Category"><file name="Collection.php" hash="d68d50e74632b2c664d3013dc936470a"/></dir><file name="Category.php" hash="e240b146ddfafa4aed1922f5f51dc877"/><dir name="Log"><file name="Collection.php" hash="7d42d5b7a3075b823a88b6e74c473e35"/></dir><file name="Log.php" hash="7d153ffb060adf03d92c178c40cf269f"/></dir><file name="Observer.php" hash="bea9ef0f0b11394bb09d2bd1f686f4e8"/><dir name="Payment"><dir name="Method"><file name="Meinpaket.php" hash="4d20cbcb9a017abcd068fc9099827525"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="b56c5cdf5ff7b19d7454c1c91d8eacdb"/></dir></dir></dir><dir name="Service"><file name="Abstract.php" hash="4776e034ff665b32dee0d74e3f0a25f5"/><file name="Async.php" hash="875339ec7c1161981dc880ae7b4fe79c"/><dir name="MarketplaceCategoryImport"><file name="ImportService.php" hash="c1fdf1ca621edfce001e04964d1d031d"/><file name="Result.php" hash="b2124bf2744a2c899cf4dd57b135937f"/></dir><dir name="Order"><dir name="CancellationService"><file name="Result.php" hash="13336bcccbd384487a7b36fb731825b2"/></dir><file name="CancellationService.php" hash="083d6cef1b1ba32f714ca1603575cba8"/><file name="ImportService.php" hash="b05477219c7ef58b133aeab1e706c74f"/><dir name="RefundExportService"><file name="Result.php" hash="799ca2f107c97fad3c9b1ff9e3c89c30"/></dir><file name="RefundExportService.php" hash="6d9039f6bac8c8b6237118082e0b88c5"/><dir name="ShipmentExportService"><file name="Result.php" hash="c11445ba185f598c338a55515c67b07b"/></dir><file name="ShipmentExportService.php" hash="017ec3ccd4776d7a09005f4ead97bb6c"/></dir><dir name="Product"><dir name="Export"><dir name="Exception"><file name="InvalidEan.php" hash="1a2a297dff79e2b563c135b5b5999ca9"/></dir></dir><file name="Export.php" hash="83ec9147e672d6bcc836c98021b8fe6f"/></dir><dir name="ProductData"><file name="RequestService.php" hash="c126a7ec932871340cf93b25bfab2912"/></dir><dir name="Result"><file name="Abstract.php" hash="5f828d781f44b20ff5db9abef0a2c9f8"/><file name="Upload.php" hash="aab1a35b3bdb3d1a02ae9f92250f8c90"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="e6cd11540ebf6bc87f4d949d81285703"/></dir></dir><file name="MemoryLimiter.php" hash="522bdd80d5e76e7c6fe7ae21a1c36436"/></dir><dir name="Validation"><file name="ValidationInterface.php" hash="ad30a76f3bf48ea8024ed0aa4d914608"/><dir name="Validator"><file name="CDATAContent.php" hash="5b87759291e6212352789cab04683c97"/><file name="Ean.php" hash="1bf0b2816803b34967064996b8cabd5c"/><file name="IntGreaterZero.php" hash="cba7eb6b0e55fbb95adb0adb170314f1"/><file name="NonEmptyString.php" hash="84d6f55c1cb4a7204ca0f9554dcb9444"/><file name="StringMaxLength.php" hash="f385739383b78a635d7aea934a56efe6"/><file name="Url.php" hash="77e55a2b1a49c16fb66a74e47314afad"/></dir><file name="ValidatorChain.php" hash="9abf53fa93ceb7580eee33dc0390048f"/><file name="ValidatorFactory.php" hash="efd64d609fbad93b33649973902c0a03"/><file name="ValidatorInterface.php" hash="952fd149292edfca02202dc05a5b9eca"/></dir><dir name="Xml"><file name="AbstractXmlPartial.php" hash="26714a23984fd17d2aeeadccf87315f6"/><file name="AbstractXmlRequest.php" hash="bcd0e4b3c1f0c5b772c3e9a30bc83191"/><file name="InvalidXmlException.php" hash="0ef6e07ea095b14f48f41cd2398e011c"/><dir name="Request"><file name="AsynchronousStatusRequest.php" hash="fd2a31247b41e490293c1cf23fdd0d55"/><file name="DataRequest.php" hash="2e4060aff376b619f6a1adce526dcf19"/><file name="DownloadRequest.php" hash="00c6d26edbe92e16b1a16f958a6ae45d"/><file name="NotificationRequest.php" hash="fa9d0839e6bd608bcc0b0fe957517e91"/><file name="QueryRequest.php" hash="a67a0d8ba1aafa76e14b1218f38066b2"/><file name="SubmitCartRequest.php" hash="0ec103744d136310e4ab8ec2ba7c65ee"/><file name="UploadRequest.php" hash="8692efa0170ce9bd8d7a8ddc361cb9b4"/></dir><dir name="Response"><file name="Abstract.php" hash="1645ed875ccd91dc6c7dc72aa0dbc7ef"/><file name="AsynchronousStatusResponse.php" hash="db49a17b1e9553626394a9d45841e3a0"/><file name="DataResponse.php" hash="2b7a4fb49939925e55c2f5d6a1a2bc09"/><file name="DownloadResponse.php" hash="48f724a3ccb54be8e360c49286d9c60f"/><file name="NotificationResponse.php" hash="b36f19e5eb85bcb182ca4ee1b3d2688d"/><dir name="Partial"><file name="Address.php" hash="acf4e17a370cdea81258b738d325988b"/><file name="Attribute.php" hash="6ea2780f911a9693044d24712fe75087"/><file name="Category.php" hash="02d29f2659be87cda96e10e1a125f4c6"/><file name="CategoryId.php" hash="d5218f01be4974e21782b3866a1dcdfb"/><dir name="DataResponse"><file name="BestPrice.php" hash="22d91bab5e172b2a388560af7bd24799"/><file name="Confirmation.php" hash="93ea4d622a9f2cf616f6fa0be344a9b4"/><file name="MerchantData.php" hash="58967d0a3d4cd8621055b421335eb02e"/><file name="ProductData.php" hash="ecd56a23225216a26688e37df13844e1"/><file name="QuotaData.php" hash="76280d3c657ab0f922b38234b9cebee8"/></dir><dir name="NotificationResponse"><file name="Confirmation.php" hash="288f9fa00b63d24934d473a9fddf0441"/><file name="Consignment.php" hash="2beda1a5785fc957edd3bdbf76181e8a"/><file name="Credit.php" hash="3d9541e0ce1a3afd5c8409b092929a8b"/><file name="Return.php" hash="6e3e83db65ac3d79d36996418e8eebb6"/></dir><dir name="Order"><file name="ContactData.php" hash="4669122c22318099d01c90423a48115b"/><file name="Entry.php" hash="e4a1ccc9b49a6312668bf05d450e2723"/></dir><file name="Order.php" hash="53c032abb427608fc729a2e9796df94c"/><file name="ProductId.php" hash="014f284435b3ea6469f2b0f445ee5495"/><file name="VariantConfiguration.php" hash="5686dac51ea5553336d6bfd983c05265"/></dir><file name="QueryResponse.php" hash="33b4e739ee7992602c345e8a0eb12255"/><file name="UploadResponse.php" hash="cb3c1aa7d8e1ef39596c2c0b99d716cb"/></dir><file name="XmlBuildException.php" hash="ece8e4ad0e6f139768cd2b42bfd81c88"/><file name="XmlRequestFactory.php" hash="dc4405748853a5504294df5664fc9db8"/><file name="XmlResponseParser.php" hash="1835f430af6dddd176f7ab429195e70c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AsyncController.php" hash="01c2d45ca561e8c73e0589da11bb1104"/><dir name="Backlog"><file name="ProductController.php" hash="bb1f8850442ff1950549b21a2dcf74c5"/></dir><file name="BestPriceController.php" hash="a0eafd1b7ec08351bf3c02bbf66509c6"/><file name="CategoryImportController.php" hash="b5ceff8ed7b87db06edf5dc6db020979"/><file name="LogController.php" hash="05bfc6f1d349f4545309040d5a0f34d6"/><file name="MatchingController.php" hash="f568a8a7d331264944d1586aa567e6ee"/><file name="OrderImportController.php" hash="5ccdb9bd5a81fda7bba4d9652d76e8ed"/><file name="ProductExportController.php" hash="43f09694db508d52a3065eb305fd23e0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="22b7908e21fc75eaa58bbb8c2d353c6e"/><file name="config.xml" hash="d1ee5ef1eb3ce2fb6aff34da5d829670"/><file name="system.xml" hash="2d3d0f7bf87975c7090c6bd018b862c6"/></dir><dir name="sql"><dir name="meinpaket_setup"><file name="mysql4-install-1.0.0.php" hash="cf38e941731f2ccff85616aad45da252"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="98bf889d49c11c90ab53242be6fadc0d"/><file name="mysql4-upgrade-1.1.0-2.0.0.php" hash="ff60a264f8dc415dba8cee70832df69b"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Dhl_MeinPaket.xml" hash="cc761a0416eaf0808b4ed169e48da755"/></dir></dir></target><target name="mage"><dir><dir name="shell"><file name="dhlmeinpaket-category-import.php" hash="e1f1154494d78b9abba765e6fbea32a4"/><file name="dhlmeinpaket-order-import.php" hash="bc77461787366c328308cb2bf54778a1"/><file name="dhlmeinpaket-product-export.php" hash="c2d93a0d578d9f09deb0d44f7f3cd535"/><file name="dhlmeinpaket-request-bestprice.php" hash="5b7ff1e8762d1cf6146f1487ea8fe6f4"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="meinpaket.xml" hash="3854556688b7e27a8e7eda0cdf2b6610"/></dir><dir name="template"><dir name="dhl"><dir name="meinpaket"><dir name="checkout"><file name="abort.phtml" hash="b5c16625c1e2dcadf215ebe151dc81a2"/><file name="cartbutton.phtml" hash="a010510f79971d3317cd85e97ce8cc50"/><file name="error.phtml" hash="c831e14959f51118bd71fc25ca88ac53"/><file name="sidebarbutton.phtml" hash="a34f589280b8811163e5b1d1a96c03a4"/><file name="success.phtml" hash="c831e14959f51118bd71fc25ca88ac53"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="meinpaket.xml" hash="5b2c84737d953d5456efbd58b6f618fc"/></dir><dir name="template"><dir name="meinpaket"><dir><dir name="Attributemapping"><dir name="edit"><file name="attributes.phtml" hash="ba984f55c900ff0134236b8b89b9a2d1"/><file name="mapping.phtml" hash="7fd78e80c370cc8452b3e056949a4346"/><file name="valuemapping.phtml" hash="2f46ca0709dd318e1363b24689d4e9c4"/></dir><file name="edit.phtml" hash="d35789adf1fd828ac04cf26258d06fb0"/><file name="editform.phtml" hash="e689674c059bef3d5011e8b63b5d51f2"/><file name="index.phtml" hash="ac7f238e2ab37816647f11808c8a2fa4"/></dir><dir name="CategoryImport"><file name="import.phtml" hash="b5c85d896808a7595b530661c19a38fd"/><file name="index.phtml" hash="d315bbae053b89300c8b04a1adb661cb"/></dir><dir name="OrderImport"><file name="import.phtml" hash="edc25fa4eb5fdcc2b3e49cfee18590c1"/><file name="index.phtml" hash="f6bc797fc058db8199f03f7c2733cb57"/></dir><dir name="ProductExport"><file name="empty.phtml" hash="2b62d4c5dcd9d6784a7ba55aa99cfa0e"/><file name="export.phtml" hash="698442f3c05acaab870331b0177c3e16"/><file name="index.phtml" hash="0cb13ff868cba8f23aeb7bf51b7f8733"/><file name="list.phtml" hash="df123aeda1752fd313b6c4024f5ec0b2"/></dir><dir name="catalog"><dir name="product"><dir name="matching"><file name="result.phtml" hash="fcc1b10a90944f5657e7c39bda175d44"/><file name="tab.phtml" hash="bfa9945e79b7ebbf841b95ef99c1fc5d"/></dir></dir></dir><dir name="category"><dir name="import"><file name="import.phtml" hash="b5c85d896808a7595b530661c19a38fd"/><file name="index.phtml" hash="d315bbae053b89300c8b04a1adb661cb"/></dir></dir><dir name="category_import"><file name="import.phtml" hash="b5c85d896808a7595b530661c19a38fd"/><file name="index.phtml" hash="d315bbae053b89300c8b04a1adb661cb"/></dir></dir><file name="leftmenu.phtml" hash="4afb8d200ed8ceddf2f682c5911c565c"/><file name="productexport.phtml" hash="1c7ec782dcd405fd6a5a360f23bf0913"/><file name="steps.phtml" hash="8fcd5c06f70a00c18e325cf9b94693e6"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir><dir name="de_DE"><file name="Dhl_MeinPaket.csv" hash="9d562e495b66d92a1a6f3600a72b23e5"/></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="meinpaket"><dir name="images"><file name="dhl_checkout_button.png" hash="cd33e91292c35a7056736813c43afe90"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="meinpaket"><file name="attributemapping.js" hash="1a4bde24fd6e7347372a3cd77de4389c"/><file name="common.css" hash="90ee229c9b60ea9450b05cec7769bd8b"/><file name="common.js" hash="68b329da9893e34099c7d8ad5cb9c940"/><dir name="images"><file name="1.png" hash="42488db618cc9b25226dc43fe8f24eec"/><file name="2.png" hash="0ca63d439b4a0e6f1578c155ed893fe7"/><file name="3.png" hash="813d4d0fd2051695785ac976b751143c"/><file name="Thumbs.db" hash="a40a4912cd54321346eb8113cd658277"/><file name="dhl_logo_kl.gif" hash="a8ca13c020d033cc487e7c5e7b30807d"/><file name="loader.gif" hash="466e0414bdf21d89645d169669b827ce"/><file name="meinpaket_logo.png" hash="0f7c7ac45b8606ea076dc1d06ea5e057"/><file name="shadowtopbg.png" hash="d8b88f456ebc93a6d11658f5ab14d590"/></dir><file name="module.css" hash="c0ad44ad9719ae396f9becbd183f5033"/><file name="module.js" hash="0ace146549dd0befdd83d23a3149f140"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
-
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>DHL_MeinPaket2</name>
|
| 4 |
+
<version>2.0.15</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>--</license>
|
| 7 |
<channel>community</channel>
|
| 10 |
<description>The Extension connects your magento shop with DHL MeinPaket.</description>
|
| 11 |
<notes>--</notes>
|
| 12 |
<authors><author><name>DHL Vertriebs GmbH</name><user>--</user><email>support@meinpaket.de</email></author></authors>
|
| 13 |
+
<date>2015-02-12</date>
|
| 14 |
+
<time>12:28:02</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir><dir name="Dhl"><dir name="MeinPaket"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Backlog"><dir name="Product"><file name="Grid.php" hash="7541700fffd1811943ce7d1d5f1ecdaf"/></dir><file name="Product.php" hash="d0fa6e92c7a2349cb2ef578eb1dad702"/></dir><dir name="BestPrice"><file name="Grid.php" hash="adb8a1085e086f3d1dc57a489619ff5d"/></dir><file name="BestPrice.php" hash="b4f9912d464830a48fd5154c45b0c040"/><dir name="Catalog"><dir name="Product"><dir name="Matching"><file name="Result.php" hash="135446bcf25b60bb017e29b15881daa8"/><file name="Tab.php" hash="6f27e6fb28ee96e9202361e7d6c43768"/></dir></dir></dir><dir name="CategoryImport"><file name="Import.php" hash="47f0969b175e1480efe8a97480c169da"/><file name="Index.php" hash="745b3c71e101599fbba7a7fd275362c9"/></dir><file name="LeftMenu.php" hash="b60dea4f9e9a39b663cab89be8e32b97"/><dir name="OrderImport"><file name="Index.php" hash="b45724d6ff1fcda6102b3147f3a66a94"/></dir><dir name="ProductExport"><file name="Export.php" hash="e12ef6d9b52a9607820fbcd5e58e76ca"/><file name="Index.php" hash="65cf2306ad93f387f525ec66cec1abee"/><file name="List.php" hash="4a32ced740d35ebb7a10d0fffa782223"/></dir><file name="Steps.php" hash="ffb3f688b43cd0c1f457b89c84e68b7f"/></dir></dir><dir name="Helper"><file name="Attribute.php" hash="36cf44cf54204426e3f50864381a6443"/><file name="Backlog.php" hash="51c08b4ef137799d0e7dbf900543ab3e"/><file name="Cron.php" hash="b320de066adaec731a4ce5d77397a1e8"/><file name="Data.php" hash="f195ae885607cae202a100aef8091c09"/><file name="Order.php" hash="82c24fb8790c629c200ce18645ea5a25"/><file name="Product.php" hash="8471fd7dc30ae6e749abf8dd9be69a8a"/><file name="Shipment.php" hash="420dfdb45b0f6f8f97ca4e18dd1d1078"/></dir><dir name="Model"><dir name="Attribute"><file name="Mapping.php" hash="7d8a8d9e18f7c6019ae71a7032061ab7"/></dir><dir name="Backlog"><file name="Product.php" hash="a2d547dcfba28c80819155a73ff5cff4"/></dir><file name="BestPrice.php" hash="b75de965445df6125e115d0d89add52c"/><file name="Category.php" hash="d0f5804e7900915f1c03364b079a7dc5"/><file name="Cron.php" hash="624ea118bc73c7dd3cae69d3828d9083"/><dir name="Entity"><dir name="Attribute"><dir name="Frontend"><file name="LabelTranslation.php" hash="7f4b3b49b6e12dadd768aee95e041579"/></dir><dir name="Source"><file name="Carrier.php" hash="65770c58617deb2dce75d8e83e055d79"/><file name="MeinPaketCategory.php" hash="17f784c2d79bfd847dd6472dca661334"/><file name="ProductAttribute.php" hash="aba17fe2a9acb85d0483926c3d5ba9a8"/><file name="ProductSyncMode.php" hash="39db6c156e9100ab59384756ec9ac2c5"/><file name="Taxclass.php" hash="696e7dda6d0bd21eeceb61adc0121cd6"/><file name="Taxrate.php" hash="40bbb2336441fa02916ab992279961e8"/></dir></dir></dir><dir name="Exception"><file name="InvalidDataException.php" hash="dcbfbe06f3d0190d5f4a9f0b47973bf2"/><file name="MissingDataException.php" hash="377d6cc783aa6e8973728a77e1e5b8a9"/></dir><dir name="Mysql4"><dir name="Backlog"><dir name="Product"><file name="Collection.php" hash="2711f602d90e22ea72b773003cf38ef4"/></dir><file name="Product.php" hash="d46057bf2e8b93b32b23653222599316"/></dir><dir name="BestPrice"><file name="Collection.php" hash="fedcad4595269a646ff1c452bed87b00"/></dir><file name="BestPrice.php" hash="79399000e407b6a22489d0dbfedd6f34"/><dir name="Category"><file name="Collection.php" hash="3caf8e3ae7e5cf3ac8e734cc6fa60919"/></dir><file name="Category.php" hash="3f1ee3b59040b5947a4fb8878d02dbf6"/></dir><file name="Observer.php" hash="c0d04ae77ecfa2f6fb3731918f252b5f"/><dir name="Payment"><dir name="Method"><file name="Meinpaket.php" hash="3f89a67bbda6b63d8d25be1fd9845110"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="f82c4f1fd2d359cd60976ff4242a7255"/></dir></dir></dir><dir name="Service"><dir name="MarketplaceCategoryImport"><file name="ImportService.php" hash="bf0c889ce83b0afe084c20f97288370e"/><file name="Result.php" hash="a8a2d4d726651237fb41c3595b223c22"/></dir><dir name="Product"><dir name="Export"><dir name="Exception"><file name="InvalidEan.php" hash="bc88e3bc48a8a96e45079054290ae68c"/></dir></dir><file name="Export.php" hash="8ddbc7b823c7e57143c2ab7fce51d4f6"/></dir><dir name="ProductData"><file name="RequestService.php" hash="99b61b8f9dbd30a64b070ab51437fc91"/></dir><dir name="Result"><file name="Abstract.php" hash="c7d84905431b651779dc1011f246983b"/><file name="Upload.php" hash="4ddf194a126ce18938610f61fcc1260d"/></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Attributes.php" hash="e6cd11540ebf6bc87f4d949d81285703"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Backlog"><file name="ProductController.php" hash="bb1f8850442ff1950549b21a2dcf74c5"/></dir><file name="BestPriceController.php" hash="a0eafd1b7ec08351bf3c02bbf66509c6"/><file name="CategoryImportController.php" hash="ce946545c10b691876bb8331132f6eaa"/><file name="MatchingController.php" hash="f568a8a7d331264944d1586aa567e6ee"/><file name="ProductExportController.php" hash="68a327e432eafa49d0a50cd46fad9029"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="4f34469f48bece3aa1621ad209a49011"/><file name="config.xml" hash="2f96ce726a122c88675fd0782cf1260b"/><file name="system.xml" hash="d9c056f602400eaebaaa11d69b3683c9"/></dir><dir name="sql"><dir name="meinpaket_setup"><file name="mysql4-install-1.0.0.php" hash="2a2e411ddfdc1a0867d6beb627d6ee8c"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="bdb2ac11cd070e409c97aa3978c42f7e"/><file name="mysql4-upgrade-1.1.0-2.0.0.php" hash="53ede6255c31a300743174ac0192d2bc"/></dir></dir></dir></dir><dir name="Postpay"><dir><dir name="Block"><file name="Checkout.php" hash="f8c9a03b83069f4d6c9aaee2e4c922d9"/><dir name="Payment"><dir name="Form"><file name="Standard.php" hash="6aca4f231c317c45ac1556d39639d84f"/></dir><dir name="Info"><file name="Standard.php" hash="45252ddc1f9ebb332ef75efa5f868432"/></dir></dir></dir><dir name="Helper"><file name="Cron.php" hash="c2391d5d085c31f2650655e8acdbfb97"/><file name="Data.php" hash="7c9ac65cda4648c4077d57ca12348687"/></dir><dir name="Model"><file name="Cart.php" hash="e599a64fec791a587552a020b563b426"/><file name="Cron.php" hash="171458225daa6c432defcfed1cffaac9"/><dir name="Mysql4"><dir name="Cart"><file name="Collection.php" hash="3b5150eb69a37a738e3f8494db0f4af1"/></dir><file name="Cart.php" hash="74042698f6fb9f2c7ca054d17f1ff0a2"/></dir><file name="Observer.php" hash="ec7e8db01d7d7c81f35797e1009f72db"/><dir name="Payment"><dir name="Method"><file name="Express.php" hash="91259cee6e39f7c993a823edbaab4817"/><file name="Standard.php" hash="30d139303e4f80c1ed8c03397666c890"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="e75165ec2772e0174d8bdb62adcdd50b"/></dir></dir></dir><dir name="Service"><dir name="Order"><file name="ImportService.php" hash="32023a8ef0852221da0c11a7b533eaad"/></dir></dir></dir><dir name="controllers"><file name="CheckoutController.php" hash="7a0801e7c03be05beb8c38004dea1464"/><file name="NotificationController.php" hash="41a608eddf5b891ca0b26b1ef1323691"/><file name="ResponseController.php" hash="79cb81c28fe2460fac0be802a8b598b2"/></dir><dir name="etc"><file name="config.xml" hash="8faac9d2ddba7b3cec2f2dc469156a4d"/><file name="system.xml" hash="a0095aec53015890f3f73cf8a7d905a2"/></dir><dir name="sql"><dir name="postpay_setup"><file name="mysql4-install-1.0.0.php" hash="036e483e03bf55a4f40bfca3d8e71eb4"/></dir></dir></dir></dir><dir name="MeinPaketCommon"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Async"><file name="Grid.php" hash="dbf8ebeac3b98728c3cef8785c83c897"/></dir><file name="Async.php" hash="7169a4ea405f54ae1d6da4c56c302fcc"/><dir name="Log"><file name="Grid.php" hash="d371551816e9335e062424e648362ce5"/></dir><file name="Log.php" hash="36a68e5de0cf7dfb87e3b090c05c1e9c"/></dir></dir><dir name="Helper"><file name="Address.php" hash="def05195630f6f98802481d228b4f25e"/><file name="Attribute.php" hash="905db640dbe49889e273aeb7415b2441"/><file name="Cron.php" hash="023eb7080558ebd43af77c1846a44534"/><file name="Data.php" hash="8edcee18eaca83942f5d30bfb65f7ff9"/><file name="Order.php" hash="4f931b155ba3069a76b1dc8ef26c3e15"/><file name="Product.php" hash="704fa60b29af41a61c2422b23fa28b26"/><file name="Shipment.php" hash="13d9db3d96059e4d63cf8ad367a6a0a7"/></dir><dir name="Model"><file name="Async.php" hash="3112120abd4ff2773dbcf19dedfd4044"/><dir name="Carrier"><file name="Meinpaket.php" hash="104937bd9c3961ef5b0d7939141d7865"/></dir><dir name="Client"><file name="BadHttpReturnCodeException.php" hash="3f3d67278be542e42bb882f387c04b67"/><file name="HttpException.php" hash="963bc4b8d30d2996a2a08b4c8aaa6b8f"/><file name="HttpTimeoutException.php" hash="d633742d26c8c5438543c1bbdf5c09bd"/><file name="XmlOverHttp.php" hash="4780d0dcd467410643d1156fc5787608"/></dir><file name="Cron.php" hash="aa707519b312693b5021036ec6dcaee3"/><dir name="Entity"><dir name="Attribute"><dir name="Source"><file name="Carrier.php" hash="437c70fc9b4e8fa719bdd19676bbbacf"/></dir></dir></dir><dir name="Exception"><file name="InvalidDataException.php" hash="808caf989c24f1146d47fc610be6e131"/><file name="MissingDataException.php" hash="67a06069dcb66c02235f636b6790a62d"/></dir><file name="Log.php" hash="516fc34067f4573d160100d7a975a66c"/><dir name="Mysql4"><dir name="Async"><file name="Collection.php" hash="d5f6fbe4a4be75181844eddfbbd557cf"/></dir><file name="Async.php" hash="2120d8c0411c8773853cee4c5925467a"/><dir name="Log"><file name="Collection.php" hash="9bba87a636029d675e1ceda42f96dbc4"/></dir><file name="Log.php" hash="a09be611512f4dc95880e6e00dab93ca"/></dir><file name="Observer.php" hash="ebf0911ae42d31fcb09941068a6a6b23"/><dir name="Payment"><dir name="Method"><file name="Meinpaket.php" hash="fdbc24e8330ecbb71243e1f4b5b83bc3"/></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="7efbaf9ad4ffc63468c99e90a1d337ad"/></dir></dir></dir><dir name="Service"><file name="Abstract.php" hash="406fb92c370df8e93aaffacbad56937b"/><file name="Async.php" hash="5dba3892bc2b78846f2ca7593385a1bc"/><dir name="Order"><dir name="CancellationService"><file name="Result.php" hash="ffec58bd614f33a911a3288c9ca81ba5"/></dir><file name="CancellationService.php" hash="a6806a3531b596a729a418688ba51dcc"/><file name="ImportService.php" hash="9ede62d801351696ed6487bd7a8392b1"/><dir name="RefundExportService"><file name="Result.php" hash="79389a6ef79a900d1a1d94ec071847bc"/></dir><file name="RefundExportService.php" hash="96f68022c2b21572e4fb7c6f8373247b"/><dir name="ShipmentExportService"><file name="Result.php" hash="887f1ec6991790b995388c43a8e99a60"/></dir><file name="ShipmentExportService.php" hash="325fcab2d42a9bfe5969a984504dbb7f"/></dir><dir name="Result"><file name="Abstract.php" hash="c7d84905431b651779dc1011f246983b"/><file name="Upload.php" hash="51438929f66a7efe3541511b6966ea09"/></dir></dir><dir name="System"><file name="MemoryLimiter.php" hash="813d89b8c21834fb911acc8e59be950c"/></dir><dir name="Validation"><file name="ValidationInterface.php" hash="d11950e6d4a7b52e3784867e8d8d2230"/><dir name="Validator"><file name="CDATAContent.php" hash="425678e9cf44efee9d884c20e4db1f14"/><file name="Ean.php" hash="7bab4c07ebcbdf3ce9e087ff20976d1a"/><file name="IntGreaterZero.php" hash="682c11f5cf24cafcef61350194a65be1"/><file name="NonEmptyString.php" hash="7075a72eace8e1f8c5bc5b61a5a25231"/><file name="StringMaxLength.php" hash="c19f729ff39b5b6b438635fe9bd9c6bf"/><file name="Url.php" hash="7b1f83a803fd8788ad4b22aaa982d04f"/></dir><file name="ValidatorChain.php" hash="72148d630805652276c446ebef817f47"/><file name="ValidatorInterface.php" hash="df41d71f7970d758b18bf36c2e49f6f1"/></dir><dir name="Xml"><file name="AbstractXmlPartial.php" hash="303a1e75e4ba719683f09ea9a5cc2743"/><file name="AbstractXmlRequest.php" hash="1b191b6c7e771043ce76f140f8a638b6"/><file name="InvalidXmlException.php" hash="22c021f43b7df35045814cd1ca714968"/><dir name="Request"><file name="AsynchronousStatusRequest.php" hash="4b17665dfef64f23d366f671a06634e3"/><file name="DataRequest.php" hash="af14f72b8c11013cfed42a0b1cbd22bc"/><file name="DownloadRequest.php" hash="05e941a0db71e679d5e3bce00bd5da8d"/><file name="NotificationRequest.php" hash="2902af863aaa33df93cc6e8cfdbf4b8c"/><file name="QueryRequest.php" hash="31746798830da6d1a5909e9f6761e5e1"/><file name="SubmitCartRequest.php" hash="bda8ba8a1662b59e49ddb974219cacf4"/><file name="UploadRequest.php" hash="93f15776fbc75435c417d7fc1963e4c4"/></dir><dir name="Response"><file name="Abstract.php" hash="f7e963bf5586d26347c4d1a6887a4b79"/><file name="AsynchronousStatusResponse.php" hash="6571d1b3093cd73e7eda7ff940df4453"/><file name="DataResponse.php" hash="672c55dd8e770219eac74214726cb5ef"/><file name="DownloadResponse.php" hash="831f43cece257d44fe65d02304362a8c"/><file name="NotificationResponse.php" hash="be7626da7ef2f744f183228110aabbea"/><dir name="Partial"><file name="Address.php" hash="d9ea71d56eb49fe3a512edd412293922"/><file name="Attribute.php" hash="4c27a169c0c773afde7502d6704ee372"/><file name="Category.php" hash="2b040bd3b89121ba28fef0ae07915915"/><file name="CategoryId.php" hash="09f6b3ecf29c4d3a16d37978efd53b4a"/><dir name="DataResponse"><file name="BestPrice.php" hash="e545a040a9201c3c8a71d4b410dcfc4d"/><file name="Confirmation.php" hash="b93b06d18277c10899535d91c1b71829"/><file name="MerchantData.php" hash="f03d2b35691c4356c43251e3c1c1fd20"/><file name="ProductData.php" hash="ab11140f6a0c4556a558d317651db82b"/><file name="QuotaData.php" hash="feb7180ff8c332decc938c1394ab8018"/></dir><dir name="NotificationResponse"><file name="Confirmation.php" hash="62225a96f3c9ce1047afc3f2c04b44ea"/><file name="Consignment.php" hash="20cb98f68cb94033d7abc5cb29ba47a4"/><file name="Credit.php" hash="7dfa1b551c938bbdbcab3e7f5ca4a86e"/><file name="Return.php" hash="d2538c678241727e3fe996d800da75b1"/></dir><dir name="Order"><file name="ContactData.php" hash="27cd1f6a5f8125352f3c383ab40e18af"/><file name="Entry.php" hash="f925387971c3a4e90bf3a66735f78025"/></dir><file name="Order.php" hash="470ed2a1671600318de784fedc34dbb9"/><file name="ProductId.php" hash="098e038cb611d92a65aa8a305567a2d0"/><file name="VariantConfiguration.php" hash="c3840d3e11cc2cc2c50d1f4f03bca963"/></dir><file name="QueryResponse.php" hash="300bfcfdb7f52380b207b45fede50e8e"/><file name="SubmitCartResponse.php" hash="82743d5832c4a12675796bbbde6f72e0"/><file name="UploadResponse.php" hash="36ac43b1e83c64be86307a6c1b7faf3d"/></dir><file name="XmlBuildException.php" hash="72ee8a17dab2c457bb821cd36bbff689"/><file name="XmlResponseParser.php" hash="94502547e6f7495e708652f72155c020"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AsyncController.php" hash="480e99dbe107a07d88e60950e25479eb"/><file name="LogController.php" hash="b8a5edb6c275746515b553faa6472687"/><file name="OrderImportController.php" hash="057c1f82c20cf7997c3841560db7cbc6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="a406f2625c59af13362056b1df70e0d8"/><file name="config.xml" hash="cd9f1275a39467ca94e1c7e12020cfcf"/><file name="system.xml" hash="3968527a048499e0640086443a40c805"/></dir><dir name="sql"><dir name="meinpaketcommon_setup"><file name="mysql4-install-1.0.0.php" hash="be354c17f96ffeecb74837974099f8c7"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Dhl_MeinPaket.xml" hash="b2ab0b71945c9849bbabe9cac0280beb"/><file name="Dhl_Postpay.xml" hash="26852f055604828ffca341f7437db998"/><file name="Dhl_MeinPaketCommon.xml" hash="b926a30bca6162be2a951f9fb0f62e00"/></dir></dir></target><target name="mage"><dir><dir name="shell"><file name="dhlmeinpaket-category-import.php" hash="2993d81e175d8e3ebdfe8fd7297f2ef6"/><file name="dhlmeinpaket-product-export.php" hash="8effb502150d794d67f508d926993a17"/><file name="dhlmeinpaket-request-bestprice.php" hash="cd546b61204de3f62206f2aec03f3c91"/><file name="dhlmeinpaket-order-import.php" hash="179e57d2fa37e0a3407bcbe222fe711e"/></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="meinpaket.xml" hash="3854556688b7e27a8e7eda0cdf2b6610"/><file name="postpay.xml" hash="890708f41152cb5326040006a0d13bf1"/><file name="meinpaketcommon.xml" hash="3854556688b7e27a8e7eda0cdf2b6610"/></dir><dir name="template"><dir name="postpay"><dir><dir name="checkout"><file name="image.phtml" hash="9283259a1e502907c0ba1c659f4ffe1b"/></dir><dir name="payment"><file name="redirect.phtml" hash="4d6e571020670c2069a2323b54f707ea"/></dir></dir><file name="checkout.phtml" hash="424e3ad9ab6f20dba21412ed9de315e6"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="meinpaket.xml" hash="973b9b6f616f8da3528ab68cc379819c"/><file name="postpay.xml" hash="5bef4c0511b6e60ed9abf1503849809e"/><file name="meinpaketcommon.xml" hash="4563e3cf8fc469dcecf1c8ff88e26cf7"/></dir><dir name="template"><dir name="meinpaket"><dir><dir name="catalog"><dir name="product"><dir name="matching"><file name="result.phtml" hash="fcc1b10a90944f5657e7c39bda175d44"/><file name="tab.phtml" hash="bfa9945e79b7ebbf841b95ef99c1fc5d"/></dir></dir></dir><dir name="category"><dir name="import"><file name="import.phtml" hash="6db7b74dd7ab8f3108510a5ef58aabf3"/><file name="index.phtml" hash="d315bbae053b89300c8b04a1adb661cb"/></dir></dir></dir><file name="leftmenu.phtml" hash="4afb8d200ed8ceddf2f682c5911c565c"/><file name="steps.phtml" hash="8fcd5c06f70a00c18e325cf9b94693e6"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir><dir name="de_DE"><file name="Dhl_MeinPaket.csv" hash="9d562e495b66d92a1a6f3600a72b23e5"/><file name="Dhl_Postpay.csv" hash="9d562e495b66d92a1a6f3600a72b23e5"/><file name="Dhl_MeinPaketCommon.csv" hash="9d562e495b66d92a1a6f3600a72b23e5"/></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="meinpaket"><dir name="images"><file name="dhl_checkout_button.png" hash="0b896fdfbd23d33a029f9c3e60757f1c"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="meinpaketcommon"><dir name="images"><file name="1.png" hash="3c2c9a82eb1ba846ba83fff02a7fb89d"/><file name="2.png" hash="ebbbb39b16a74905e9089014dadf27bb"/><file name="3.png" hash="4db863bc8404ba77b12b318d7932ca3d"/><file name="dhl_logo_kl.gif" hash="43fdd8c3b923355fdd27070feca49dc7"/><file name="loader.gif" hash="823d2e0f3345c88e9463a38a9c360817"/><file name="meinpaket_logo.png" hash="e5fc2c6d23da15893e81ae53704e49c9"/><file name="shadowtopbg.png" hash="9e274a269dcbe50256d1be49a192a9cd"/></dir><file name="module.css" hash="c0ad44ad9719ae396f9becbd183f5033"/><file name="module.js" hash="0ace146549dd0befdd83d23a3149f140"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>DHL_MeinPaketCommon</name><channel>community</channel><min>1.0.0</min><max>2.0.0</max></package></required></dependencies>
|
| 18 |
</package>
|
shell/dhlmeinpaket-category-import.php
CHANGED
|
@@ -8,7 +8,6 @@ require_once 'abstract.php';
|
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Shell_CategoryImport extends Mage_Shell_Abstract {
|
| 14 |
/**
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
|
|
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Shell_CategoryImport extends Mage_Shell_Abstract {
|
| 13 |
/**
|
shell/dhlmeinpaket-order-import.php
CHANGED
|
@@ -8,9 +8,8 @@ require_once 'abstract.php';
|
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
-
class
|
| 14 |
/**
|
| 15 |
*
|
| 16 |
* @var integer
|
|
@@ -26,7 +25,7 @@ class Dhl_MeinPaket_Shell_OrderImport extends Mage_Shell_Abstract {
|
|
| 26 |
echo "Starting order import (" . $this->getFormattedDate () . ")\n";
|
| 27 |
|
| 28 |
/* @var $service Dhl_MeinPaket_Model_Service_Order_ImportService */
|
| 29 |
-
$service = Mage::getModel ( "
|
| 30 |
$hours = self::DEFAULT_HOURS;
|
| 31 |
$startTime = 0;
|
| 32 |
$endTime = 0;
|
|
@@ -40,7 +39,7 @@ class Dhl_MeinPaket_Shell_OrderImport extends Mage_Shell_Abstract {
|
|
| 40 |
$hours = $passedHours;
|
| 41 |
}
|
| 42 |
|
| 43 |
-
$endTime =
|
| 44 |
$startTime = $endTime - ($hours * 3600);
|
| 45 |
|
| 46 |
echo "Time range: " . $this->getFormattedDate ( $startTime ) . " GMT - " . $this->getFormattedDate ( $endTime ) . " GMT\n";
|
|
@@ -53,7 +52,7 @@ class Dhl_MeinPaket_Shell_OrderImport extends Mage_Shell_Abstract {
|
|
| 53 |
}
|
| 54 |
|
| 55 |
echo "Import finished (" . $this->getFormattedDate () . ")\n";
|
| 56 |
-
echo "Imported " .
|
| 57 |
|
| 58 |
return $this;
|
| 59 |
}
|
|
@@ -92,5 +91,5 @@ USAGE;
|
|
| 92 |
}
|
| 93 |
}
|
| 94 |
|
| 95 |
-
$orderImporter = new
|
| 96 |
$orderImporter->run ();
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
|
|
|
| 11 |
*/
|
| 12 |
+
class Dhl_MeinPaketCommon_Shell_OrderImport extends Mage_Shell_Abstract {
|
| 13 |
/**
|
| 14 |
*
|
| 15 |
* @var integer
|
| 25 |
echo "Starting order import (" . $this->getFormattedDate () . ")\n";
|
| 26 |
|
| 27 |
/* @var $service Dhl_MeinPaket_Model_Service_Order_ImportService */
|
| 28 |
+
$service = Mage::getModel ( "meinpaketcommon/service_order_importService" );
|
| 29 |
$hours = self::DEFAULT_HOURS;
|
| 30 |
$startTime = 0;
|
| 31 |
$endTime = 0;
|
| 39 |
$hours = $passedHours;
|
| 40 |
}
|
| 41 |
|
| 42 |
+
$endTime = time ();
|
| 43 |
$startTime = $endTime - ($hours * 3600);
|
| 44 |
|
| 45 |
echo "Time range: " . $this->getFormattedDate ( $startTime ) . " GMT - " . $this->getFormattedDate ( $endTime ) . " GMT\n";
|
| 52 |
}
|
| 53 |
|
| 54 |
echo "Import finished (" . $this->getFormattedDate () . ")\n";
|
| 55 |
+
echo "Imported " . $service->getOrderCount ()['imported'] . " orders.\n";
|
| 56 |
|
| 57 |
return $this;
|
| 58 |
}
|
| 91 |
}
|
| 92 |
}
|
| 93 |
|
| 94 |
+
$orderImporter = new Dhl_MeinPaketCommon_Shell_OrderImport ();
|
| 95 |
$orderImporter->run ();
|
shell/dhlmeinpaket-product-export.php
CHANGED
|
@@ -8,7 +8,6 @@ require_once 'abstract.php';
|
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Shell_ProductExport extends Mage_Shell_Abstract {
|
| 14 |
/**
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
|
|
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Shell_ProductExport extends Mage_Shell_Abstract {
|
| 13 |
/**
|
shell/dhlmeinpaket-request-bestprice.php
CHANGED
|
@@ -8,7 +8,6 @@ require_once 'abstract.php';
|
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
| 11 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 12 |
*/
|
| 13 |
class Dhl_MeinPaket_Shell_RequestBestPrice extends Mage_Shell_Abstract {
|
| 14 |
/**
|
| 8 |
* @package Dhl_MeinPaket
|
| 9 |
* @subpackage Dhl_MeinPaket_Shell
|
| 10 |
* @version $Id$
|
|
|
|
| 11 |
*/
|
| 12 |
class Dhl_MeinPaket_Shell_RequestBestPrice extends Mage_Shell_Abstract {
|
| 13 |
/**
|
skin/adminhtml/default/default/meinpaket/attributemapping.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
| 1 |
-
/**
|
| 2 |
-
* JavaScript attribute mapping helpers.
|
| 3 |
-
*
|
| 4 |
-
* @category skin
|
| 5 |
-
* @package Dhl_MeinPaket
|
| 6 |
-
* @author Timo Fuchs <timo.fuchs@aoemedia.de>
|
| 7 |
-
*/
|
| 8 |
-
|
| 9 |
-
// setup namespace object
|
| 10 |
-
if (typeof MeinPaket === 'undefined') {
|
| 11 |
-
var MeinPaket = {};
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
/**
|
| 15 |
-
* Attribute helper class.
|
| 16 |
-
*/
|
| 17 |
-
MeinPaket.Attribute = Class.create();
|
| 18 |
-
MeinPaket.Attribute.prototype = {
|
| 19 |
-
|
| 20 |
-
/**
|
| 21 |
-
* Number of attribute mappings.
|
| 22 |
-
*
|
| 23 |
-
* @var integer
|
| 24 |
-
*/
|
| 25 |
-
numItems : 0,
|
| 26 |
-
|
| 27 |
-
/**
|
| 28 |
-
* Prefix.
|
| 29 |
-
*
|
| 30 |
-
* @var string
|
| 31 |
-
*/
|
| 32 |
-
attributeMappingIndexPrefix : 'meinpaket_attribute_mapping_',
|
| 33 |
-
|
| 34 |
-
/**
|
| 35 |
-
* Constructor.
|
| 36 |
-
*
|
| 37 |
-
* @return void
|
| 38 |
-
*/
|
| 39 |
-
initialize : function() {
|
| 40 |
-
},
|
| 41 |
-
|
| 42 |
-
/**
|
| 43 |
-
* Adds a attribute mapping interface.
|
| 44 |
-
*
|
| 45 |
-
* @return void
|
| 46 |
-
*/
|
| 47 |
-
add : function() {
|
| 48 |
-
var index = this.numItems;
|
| 49 |
-
var tpl = new Template(this.template);
|
| 50 |
-
var data = {
|
| 51 |
-
index : index,
|
| 52 |
-
prefix : this.attributeMappingIndexPrefix,
|
| 53 |
-
magentoAttributesSelect : this.renderMagentoAttributeSelect(
|
| 54 |
-
MeinPaket.magentoAttributes, index),
|
| 55 |
-
meinpaketAttributesSelect : this.renderMeinpaketAttributeSelect(
|
| 56 |
-
MeinPaket.meinpaketAttributes, index),
|
| 57 |
-
labelMagentoAttribute : MeinPaket.locale.magentoAttribute,
|
| 58 |
-
labelMeinPaketAttribute : MeinPaket.locale.meinpaketAttribute,
|
| 59 |
-
labelMagentoValue : MeinPaket.locale.magentoValue,
|
| 60 |
-
labelMeinPaketValue : MeinPaket.locale.meinpaketValue,
|
| 61 |
-
labelEditValueMapping : MeinPaket.locale.editValueMapping,
|
| 62 |
-
labelDeleteValueMapping : MeinPaket.locale.deleteValueMapping
|
| 63 |
-
};
|
| 64 |
-
|
| 65 |
-
this.top = $('meinpaket_attribute_top');
|
| 66 |
-
|
| 67 |
-
Element.insert(this.top, {
|
| 68 |
-
'after' : tpl.evaluate(data)
|
| 69 |
-
});
|
| 70 |
-
// this.top = $(this.idLabel + '_' + index);
|
| 71 |
-
this.numItems++;
|
| 72 |
-
},
|
| 73 |
-
|
| 74 |
-
deleteAttributeMapping : function(index) {
|
| 75 |
-
$(this.attributeMappingIndexPrefix + index).remove();
|
| 76 |
-
},
|
| 77 |
-
|
| 78 |
-
/**
|
| 79 |
-
* Template html for attribute mappings.
|
| 80 |
-
*
|
| 81 |
-
* @var string
|
| 82 |
-
*/
|
| 83 |
-
template : '<div id="#{prefix}#{index}" class="option-box"> '
|
| 84 |
-
+ '<table class="option-header" cellpadding="0" cellspacing="0">'
|
| 85 |
-
+ '<thead>'
|
| 86 |
-
+ '<tr>'
|
| 87 |
-
+ '<th class="opt-type">#{labelMagentoAttribute}</th>'
|
| 88 |
-
+ '<th class="opt-req">#{labelMeinPaketAttribute}</th>'
|
| 89 |
-
+ '<th> </th>'
|
| 90 |
-
+ '<th> </th>'
|
| 91 |
-
+ '</tr>'
|
| 92 |
-
+ '</thead>'
|
| 93 |
-
+ '<tbody id="attribute_table_#{index}">'
|
| 94 |
-
+ '<tr>'
|
| 95 |
-
+
|
| 96 |
-
|
| 97 |
-
'<td>#{magentoAttributesSelect}</td>'
|
| 98 |
-
+ '<td>#{meinpaketAttributesSelect}</td>'
|
| 99 |
-
+ '<td>'
|
| 100 |
-
+ '<button type="button" value="" class="scalable add" onclick="meinPaketAttribute.editValueMapping(#{index});"><span>#{labelEditValueMapping}</span></button>'
|
| 101 |
-
+ '</td>'
|
| 102 |
-
+ '<td>'
|
| 103 |
-
+ '<button type="button" value="" class="scalable delete" onclick="meinPaketAttribute.deleteAttributeMapping(#{index});"><span>#{labelDeleteValueMapping}</span></button>'
|
| 104 |
-
+ '</td>' + '</tr>'
|
| 105 |
-
+ '<tr id="values_row_#{index}"><td colspan="4"></td></tr>'
|
| 106 |
-
+ '</tbody>' + '</table>'
|
| 107 |
-
+ '<div id="values_container_#{index}"></div>' + '</div>',
|
| 108 |
-
|
| 109 |
-
/**
|
| 110 |
-
* Renders an attribute select box.
|
| 111 |
-
*
|
| 112 |
-
* @param Array
|
| 113 |
-
* attributes An Array of objects which have "id" and "name"
|
| 114 |
-
* properties.
|
| 115 |
-
* @param string
|
| 116 |
-
* type Must be "magento" or "meinpaket".
|
| 117 |
-
* @param integer
|
| 118 |
-
* id Index of the current mapping.
|
| 119 |
-
* @return String
|
| 120 |
-
*/
|
| 121 |
-
renderAttributeSelect : function(attributes, type, id) {
|
| 122 |
-
var html = '<select id="select_' + type + '_attribute_' + id
|
| 123 |
-
+ '" name="' + type + '_attribute_id[' + id + ']">';
|
| 124 |
-
for (var i = 0; i < attributes.length; i++) {
|
| 125 |
-
html += '<option value="' + attributes[i].id + '">'
|
| 126 |
-
+ attributes[i].name + '</option>';
|
| 127 |
-
}
|
| 128 |
-
html += '</select>';
|
| 129 |
-
return html;
|
| 130 |
-
},
|
| 131 |
-
|
| 132 |
-
/**
|
| 133 |
-
* Renders a Magento attribute select box.
|
| 134 |
-
*
|
| 135 |
-
* @see MeinPaket.Attribute.renderAttributeSelect()
|
| 136 |
-
* @param Array
|
| 137 |
-
* attributes
|
| 138 |
-
* @param integer
|
| 139 |
-
* id
|
| 140 |
-
* @return String
|
| 141 |
-
*/
|
| 142 |
-
renderMagentoAttributeSelect : function(attributes, id) {
|
| 143 |
-
return this.renderAttributeSelect(attributes, 'magento', id);
|
| 144 |
-
},
|
| 145 |
-
|
| 146 |
-
/**
|
| 147 |
-
* Renders a MeinPaket attribute select box.
|
| 148 |
-
*
|
| 149 |
-
* @see MeinPaket.Attribute.renderAttributeSelect()
|
| 150 |
-
* @param Array
|
| 151 |
-
* attributes
|
| 152 |
-
* @param integer
|
| 153 |
-
* id
|
| 154 |
-
* @return String
|
| 155 |
-
*/
|
| 156 |
-
renderMeinpaketAttributeSelect : function(attributes, id) {
|
| 157 |
-
return this.renderAttributeSelect(attributes, 'meinpaket', id);
|
| 158 |
-
},
|
| 159 |
-
|
| 160 |
-
/**
|
| 161 |
-
* Creates a mapping table for the attribute mapping with the given id.
|
| 162 |
-
*
|
| 163 |
-
* @param integer
|
| 164 |
-
* index
|
| 165 |
-
* @return void
|
| 166 |
-
*/
|
| 167 |
-
editValueMapping : function(index) {
|
| 168 |
-
var container = $(this.attributeMappingIndexPrefix + index);
|
| 169 |
-
var elements = [ $("select_attribute_set"), $("select_variant"),
|
| 170 |
-
$("select_magento_attribute_" + index),
|
| 171 |
-
$("select_meinpaket_attribute_" + index) ].flatten();
|
| 172 |
-
var serializedElements = Form.serializeElements(elements)
|
| 173 |
-
+ '&attribute_mapping_id=' + index;
|
| 174 |
-
new Ajax.Updater("attribute_table_" + index,
|
| 175 |
-
MeinPaket.url.editAttributeValues, {
|
| 176 |
-
parameters : serializedElements,
|
| 177 |
-
evalScripts : true,
|
| 178 |
-
insertion : 'bottom',
|
| 179 |
-
onComplete : function() {
|
| 180 |
-
// $("select_magento_attribute_"+index).disabled = true;
|
| 181 |
-
// $("select_meinpaket_attribute_"+index).disabled =
|
| 182 |
-
// true;
|
| 183 |
-
// $(\'save_button\').disabled = false;
|
| 184 |
-
// Event.observe($("select_itemtype"), \'change\',
|
| 185 |
-
// itemType.updateAttributes);
|
| 186 |
-
}
|
| 187 |
-
});
|
| 188 |
-
}
|
| 189 |
-
};
|
| 190 |
-
|
| 191 |
-
// create attribute instance
|
| 192 |
-
var meinPaketAttribute = new MeinPaket.Attribute();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skin/adminhtml/default/default/meinpaket/common.css
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
@CHARSET "UTF-8";
|
|
|
skin/adminhtml/default/default/meinpaket/common.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
|
|
|
skin/adminhtml/default/default/meinpaket/images/1.png
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/2.png
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/3.png
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/Thumbs.db
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/dhl_logo_kl.gif
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/loader.gif
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/meinpaket_logo.png
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaket/images/shadowtopbg.png
DELETED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/1.png
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/2.png
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/3.png
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/dhl_logo_kl.gif
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/loader.gif
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/meinpaket_logo.png
ADDED
|
Binary file
|
skin/adminhtml/default/default/meinpaketcommon/images/shadowtopbg.png
ADDED
|
Binary file
|
skin/adminhtml/default/default/{meinpaket → meinpaketcommon}/module.css
RENAMED
|
File without changes
|
skin/adminhtml/default/default/{meinpaket → meinpaketcommon}/module.js
RENAMED
|
File without changes
|
skin/frontend/default/default/meinpaket/images/dhl_checkout_button.png
CHANGED
|
Binary file
|
