Version Notes
==== v1.12.0 ====
==== New Features ====
- Added support for OneStepCheckout 4.5.6.
- Added ID check functionalities.
==== Changes ====
- Removed Magento2 template files.
==== Improvements ====
- Improved PostNL shipments to Belgium.
- Improved PostNL shipments from Belgium.
- Improvements in the Sameday delivery functionality.
- Visual improvement in dinstance to Postoffice location in Checkout.
- Added different Unit tests.
- Added French translations.
- Added PHP 7 support.
==== Bugfixes ====
- Fixed an issue where ordering after Sunday cut-off and before normal cut-off would return the wrong delivery dates.
- FIxed an issue where Belgian merchants couldn't use alternate delivery addresses.
==== v1.11.0 ====
- Internal Release.
==== v1.10.1 ====
==== Bug fixes ====
- Fixed calculation order totals in Idev OneStepCheckout and PostNL 1.10.1
==== v1.10.0 ====
==== New Features ====
- Added support for same day delivery.
- Added support for food delivery.
- Added support for shipment from Belgium.
- Matrix rates calculation can use a separate rate for PakjeGemak.
==== Improvements ====
- Compatibility for special characters on packing slip.
- Street number not always required for shipment outside of the Netherlands.
- Improved feedback about wrong configurations in the backend.
- PakjeGemak orders now save the location code and ID in the database.
- Google Maps JS library updated to version 3.22. - The shipmenttype is visible on the packing slip.
- Optional middle name is now visible on the shipment label.
- Different diacritical characters can be used in streetnames.
- Fixed a conflict with the Amasty Order Status extension.
- Several code improvements.
- Changes for the purpose of PHP 7.
==== Bug fixes ====
- If monday isn't a shipment day and the current day is sunday, tuesday won't be seen as delivery option anymore.
- OneStepCheckout doesn't default to PostNL as shipping method anymore.
- The e-mail handler shows the correct delivery times. - The inventory control on configured, bundled and grouped products will go right now.
- Fixed an issue where return shipping labels resulted in white pdf files. - Los voormelden from Globalpack shipment isn't possible anymore.
- Cyprus and Mali aren't EPS countries anymore.
- The correct business hours for pickup locations are now always shown.
==== v1.9.0 ====
- Internal release.
==== v1.8.0 ====
- Internal release.
==== v1.7.2 ====
==== Improvements ====
- Added additional compatibility with the Adyen_Payment extension
- Added a timeout for delivery options AJAX calls. The timeout is set to 5s by default
- Monday delivery is now clearly marked as such in front- and backend, rather than being considered a standard domestic shipment
==== Bug fixes ====
- Fixed a problem where Zend_Pdf could throw errors for certain character combinations
- Fixed a problem where orders without a delivery date could cause fatal errors in the order grid
- Fixed a problem where delivery options in OSC would sometimes not show the delivery address
- Fixed a problem where the PostNL shipping method would not be visible when shipping to the Netherlands when no EPS shipping option was selected
- Fixed a problem where you could choose a default post office delivery shipping option when post office delivery was disabled
- Fixed a problem where certain fields on the PostNL configuration page were available on storeview level, while their parent group was not
- Fixed a problem where fatal errors could occur in GoMage Lightcheckout due to an undefined variable
- PostNL postcode check now also works when the country field is disabled in Idev's OSC
- Fixed a problem where orders would always return next day delivery when delivery options are not used
- Fixed a problem where certain shipping options were unavailable when creating shipments
- Fixed a problem where getConfigMinQty would return 0 or 1 rather than the min Qty
- Non-domestic shipments will no longer show a domestic delivery date
==== v1.7.1 ====
==== Improvements ====
- Refactored references to the TIG_PostNL_Helper_DeliveryOptions class' fee methods so they now call their counterparts in the TIG_PostNL_Helper_DeliveryOptions_Fee class
- Refactored the canUseDeliveryOptions method for GoMage LightCheckout to improve performance
==== Bug Fixes ====
- Fixed an issue with EPS label rotation where sometimes EPS combi-labels would be displayed as regular, non combi-labels.
- Fixed a problem where two config fields would throw E_STRICT_NOTICE level errors which in certain server configurations could lead to subsequent fatal errors when Magento unsuccessfully tried to log the errors.
- Fixed a problem where orders without a PostNL order entity could not be shipped due to a coding error
==== v1.7.0 ====
==== New Features ====
- Added support for sunday delivery.
- Added ability to charge a fee for sunday delivery.
==== Improvements ====
- Added compatibility with Picqer extension.
- Added the option to disable system.xml fields. This may be useful for other extensions that want to replace PostNL features.
- Updated CIF services used to CIF 1.14.
- Improved delivery date calculation to improve performance and stability.
- Updated Track & Trace URL format to the new PostNL standards
- Delivery options on Idev's OneStepCheckout will not immediately save the first available delivery option, rather than waiting for customer interaction
==== Bug Fixes ====
- Fixed an issue where the buspakje configuration modus check ignored the 'isbuspakjeactive' flag.
- Fixed an issue where configurable products never allowed delivery options.
- Fixed a rare problem that could cause an infinite loading spinner in GoMage LightCheckout when saving the selected delivery options.
- Fixed a problem where delivery dates and delivery time estimations are double-corrected for timezone differences.
- Fixed a problem where certain cron jobs would report that a directory is not readable, when actually it is just empty.
- Removed an unnecessary check when determining whether delivery options are available for the current quote.
==== v1.6.0 ====
==== New Features ====
- PostNL delivery options are now compatible with GoMage LightCheckout.
- PostNL MijnPakket login and Postcode check are now compatible with GoMage LightCheckout.
- It is now possible to use Magento's Soap API to confirm PostNL shipments, print shipping labels, get Track&Trace information and more!
- Added the option to not print a PostNL shipping label when printing the PostNL packing slip.
- Added a new uninstall button to safely uninstall the PostNL extension.
==== Improvements ====
- Updated the Google Maps integration to v3.19.
- Optimized error handling for certain CIF errors.
- Reverted the PostNL extension's Zend_Soap implementation to native PHP SoapClient for improved compatibility with HHVM.
- Improved the out-of-stock check used in PostNL delivery options to better match merchant expectations.
- Improved performance when printing packing slips or shipping labels.
- Malta is now considered an EPS destination.
- Added compatibility with Magento's SUPEE-6285 patch.
- Improved the address-splitting regular expression to better split house numbers from street names.
==== Bug Fixes ====
- Fixed an incorrect variable name in the upgradeNotification block.
- Fixed an issue where the mobile phone number popup would not appear when selecting a parcel dispenser location in onestepcheckout after a coupon had been added.
- Fixed a conflict with OneStepCheckout, where selecting a delivery date in the popup and then closing the popup (not by saving, but by using the 'x' icon), PostNL would be selected as delivery option but not the date, leaving the shipment with no shipping information.
- Fixed an issue where products on the PostNL packing slip would sometimes show 0 tax amount.
- The shipping date is now also shown on the packing slip when the show shipping method option is disabled.
- Fixed a javascript issue with PostNL COD when Delivery Options are disabled .
- Fixed several problems relating to a server's time zone configuration.
- Fixed an issue in the date renderers in Magento's backend where an unnecessary timezone correction resulted in incorrect dates being displayed.
- Fixed an issue where the attribute update cron would not be removed automatically when all products were updated.
- Fixed a problem with the temporary update crons when config cache is active.
- Fixed a problem where re-activating a quote after the order had been placed could lead to missing PostNL data.
- Fixed an issue where orders could incorrectly have an expected delivery date when no delivery option was selected.
- Fixed compatibility with payment extensions (e.g. Sisow) to prevent crashing when printing packing slip.
==== v1.5.3 ====
==== Bug Fixes ====
- Fixed an issue where in certain situations the delivery date may be equal to the shipping date for orders where no delivery date was chosen during checkout.
- Fixed an issue where all orders would be considered to be placed past the cut off time when the shipping duration was configured to be more than 1 day.
==== v1.5.2 ====
==== New Features ====
- Added compatibility with the Bpost Shipping Manager extension.
- Added the option to hide often shown warnings for the current admin user.
==== Improvements ====
- Added a warning to the configuration page when using the Postcode.NL extension as this extension may conflict with the PostNL extension/
- The PostNL postcode check functionality is now automatically disabled when using the Postcode.NL extension.
- Improved error handling when changes were made directly to the Magento database.
- The expected shipping and delivery dates are now also saved when no delivery option was selected during checkout.
- Several additional characters are now allowed in the packing slip item columns.
- Modified the way delivery options determine whether products are in stock in order to better match merchant expectations.
- Modified interface element for stock options for delivery options to better match merchant expectations.
- Modified code to prevent errors when the default cut-off time is missing.
- Improved error handling when changing a package shipment to a letter box shipment and the default letter box product option is unavailable.
- Added caching to the store time zones in the PostNL data helper.
- Added additional checks to prevent no extra cover amount from being sent for extra cover shipments.
- Fixed an incorrect English name for parcel dispensers.
- Removed the parcel dispenser label from the delivery options interface.
- Added a new notification to the order email to make it more clear that the customer has chosen to have their order delivered at a pick up location.
- Added a new notification to the billing and shipping address templated in OPC to make it more clear that the customer can select a pick up location in the shipping method step.
- The shipping address is now hidden in the progress bar on OPC when a post office address is selected.
==== Bug Fixes ====
- Fixed the split address lines detection on the PostNL config page. This should prevent incorrect warnings about split address lines from being shown.
- Fixed a bug where the chosen product option was not saved when using the create shipments mass action.
- Fixed the order confirm date renderer for orders that were placed late at night.
- A PostNL order is now also created for orders that do not have an associated delivery option. This prevents unexpected behaviour in the order grid when filtering on the confirm date column.
- Shipping labels are now oriented horizontally to prevent errors when printing directly from Chrome.
- Fixed an issue where the extra cover amount option was shown on the create shipment page when the 'is_buspakje' checkbox was checked by default and an extra product option was selected as default.
- Fixed an issue where buspakje was available for avond shipments.
- Fixed issue with not selecting delivery option in OSC would cause order date to be show as delivery date.
- Fixed an issue where the delivery and confirm dates were calculated using the server's time zone, rather than the UTC time zone.
- Fixed a possible notice due to a missing default value in the 'hour-minute' field renderer.
- Fixed an issue where filtering on the order type column would cause errors due to an incorrect join alias.
- Removed regex-based validation for delivery location names to prevent valid names from being blocked. Instead all tags are stripped from the name and the name is additionally escaped before processing.
- Fixed an issue which caused the Magento table rates title to be displayed for PostNL.
- Fixed an issue which caused the default letter box parcel option configuration setting to not be visible.
- Fixed an issue which could cause JS errors when there was an error while loading delivery options.
- Dots are now allowed in street addresses..
- Fixed a small typo in certain error messages.
- Fixed a small layout problem in the delivery options on small desktop screens.
- Fixed a bug where delivery options are not available when purchasing the same configurable product twice with different options.
- Fixed a warning message in the update attributes cron due to an undefined index.
- Fixed an issue where only come delivery options are available when the product attribute cron is still running.
==== v1.5.1 ====
==== New Features ====
- Added a parcel dispenser filter to the delivery options location picker.
==== Improvements ====
- Improved the available filter options for the shipping date columns in the order and shipment grids.
- Improved the way parcel dispenser pick-up locations are shown in the delivery options interface.
- The chosen pick up location is now shown in Idev's OneStepCheckout's order preview pop-up.
- It is no longer possible to configure the extension to use split address lines when there is only 1 address line available.
- When using split address lines it is no longer possible to use the same address line for multiple fields.
==== Bug fixes ====
- Fixed a problem that prevented PostNL Checkout orders from being placed.
- Removed an unnecessary css link in the default Magento theme.
- Phone numbers are no longer mandatory for PostNL post office locations.
==== v1.5.0 ====
==== New features ====
- Added support for printing return labels and tracking return shipments.
- You may now change the number of parcels in a shipment as long as the shipment has not yet been confirmed with PostNL.
- Added the option to show the chosen delivery options and post office pick-up location in transactional e-mails.
- Added a new mass action to the shipment grid to update the shipping status of selected shipments.
==== Improvements ====
- The extension has been updated to CIF 1.10 specifications.
- Cut-off times now take the store's time zone into account.
- Improved performance in the webshop's backend.
- Reduced the risk of extension conflicts in the order and shipment grids.
- It is now possible to print GlobalPack shipping labels even when one of the products in the shipment is missing a country of origin value.
- Address lines on the PostNL packing slip now have a maximum size of 33 characters (up from 20).
- The selected post office location is now shown on the sales/guest/form pages in Magento.
- The confirm and delivery dates of a shipment are now stored in the UTC time zone in the database.
- The selected post office location is now shown on the OnePage Checkout progress bar during checkout.
- The schedules of several cronjobs related to background processes have been redistributed over the day to reduce the load on the sever's cron during peak hours.
- VAT and discounts are now taken into account when calculating a shipment's base grandtotal amount.
- The extension will now shown a proper error message when the sever's PHP version is below the minimum version required by the PostNL extension (PHP 5.3.0).
- Decimal values are now allowed in the alternative standard product option field.
- Shipping labels will now be deleted from the database 30 days after the shipment has been delivered in order to give the consumer enough time to return the shipments without allowing the database to become too bloated.
==== Bug fixes ====
- The Track & Trace URL for orders which are shipped to post office locations has been modified to correctly use the postcode of the intended recipient.
- PostNL mass actions in the order grid will no longer affect non-PostNL mass actions which may have been added by other extensions.
- Postcodes are no longer required in order to create a Track & Trace URL.
- It is no longer possible to modify the confirmation of letter box parcel shipments without Track & Trace.
- An issue in Magento CE 1.6 and EE 1.11 has been resolved by no longer relying on the 'DEFAULT_DEST_STREET' constant value.
- MijnPakket login and delivery options are now also compatible with Idev's OneStepCheckout when the shipping address form has been disabled.
- Letter box parcel configuration options are now also applied to grouped products.
- The chosen delivery day is no longer shown on the customer's account page when delivery days have been disabled in the extension's configuration.
- Product's alternative shipping duration values are now taken into account when calculating the probable delivery day for orders when no specific delivery day was chosen during checkout.
- Tuesday is no longer shown as a valid delivery day when monday is not a shipping day and it is already past saturday.
==== v1.4.1 ====
==== New features ====
- Completely redesigned the configuration page of the extension!
- The extension's configuration page has now been split into a wizard-style menu for the core settings and a separate advanced options menu.
==== Improvements ====
- Added forwards compatibility to Magento 1.6 for advanced configuration field dependencies and other features that were introduced in Magento 1.7.
- Only stated address fee will now be hidden if the fee is less than 1 cent.
- Delivery days will now show 'as soon as possible' as the delivery time when no delivery days are available.
- The status update cron will now run 3 times a day. Before it was only 2 times a day.
- Added additional transactional email parameters to the track & trace email.
==== Bug fixes ====
- Only stated address option is no longer available for letter box orders.
- Removed two legacy references to css files from the frontend's layout XML file.
- Fixed a problem where the delivery option fee would not be reset if delivery options became unavailable during checkout.
- Fixed the delivery options responsive design in OneStepCheckout on older versions of Magento.
- Fixed an issue that prevented the order grid from being filtered on the order ID column.
- International track & trace URL's now use PostNL's new track & trace URL syntax. The old syntax is no longer supported by PostNL.
- Fixed a PHP warning level error that could occur if no additional options were saved for a PostNL order.
==== v1.4.0 ====
==== New features ====
- Added a new responsive design for PostNL delivery options.
- Added the option to specify on which days of the week the merchant will ship orders.
- Added the option to print packing slips directly from the order detail page.
- Added the option for customers to choose whether their order can be delivered to their neighbours in case they are not home during the delivery.
- Added a new PostNL rate type that allows merchants to finely tune their shipping costs.
- Added the option to charge a separate shipping rate for letter box parcels.
==== Improvements ====
- Modified a lot of heavy loading functionality in order to improve performance.
- PostNL Checkout will now check if an order is a letter box parcel before deciding whether PostNL Checkout should be available.
- In order to decrease server load during the extension's installation or upgrade, modifying product attributes is now handled by a temporary cron job.
- A comment will now be added to the order and shipment page when the PostNL track & trace email is sent.
- Evening delivery will no longer be available for letter box parcel orders.
==== Bug fixes ====
- FIxed the filter functionality of the order grid's confirm date column.
- Fixed a problem where the extra cover amount was missing when extra cover was used as a default shipping option.
- Fixed a problem where adding coupon codes in OneStepCheckout would disable delivery options.
- PostNL Checkout's weight calculation will no longer assume all items are weightless when a free shipping cart rule is active.
- Fixed a problem in the CMS page source model causing errors.
- Fixed a problem where tax calculation would not work as expected when tax calculation was set to before discount.
- Fixed a problem where it would be impossible to use the create shipment mass action when certain product options were disabled.
- Fixed problem where shipping to EPS countries could cause errors.
- Fixed an issue where the COD payment method would be hidden for regular shipments.
- Fixed an issue where the print labels mass action would also confirm the shipment
- Adding a new address in multi-address checkout will no longer cause errors when postcode check has been enabled.
- Fixed a bug in the updatePostnlOrder observer that caused errors when ordering virtual orders.
==== v1.3.1 ====
==== Bug fixes ====
- Confirm dates will no longer be shown as always being in the future.
- Added additional checks to prevent deleted Magento orders and shipments from causing errors.
- Prevented VAT amounts from being shown twice on the checkout page.
- It is no longer impossible to create multi-parcel shipments when 'letter box calculation mode' is set to automatic.
- Prevented COD fees from causing errors on the invoice page in the backend.
==== v1.3.0 ====
==== New features ====
- Added the option to ship orders as letter box parcels. Letter box parcels are shipped using the regular mail service and can be shipped at a reduced rate. It's possible to let the PostNL extension determine when an order qualifies as a letter box parcel or to decide this manually when creating a shipment in Magento.
- Added a new PostNL COD payment method that is fully integrated in the other PostNL services offered by the extension. It's possible to charge an additional fee to customers for using PostNL COD. It's also possible to have the extension automatically invoice COD orders once they have been delivered to the customer.
- Added a new PostNL packing slip. This packing slip may contain the PostNL shipping label, allowing you to use the packing slip as the shipping label for the parcel.
- Added the option to enable or disable delivery options at the product level.
- Added the ability to convert existing shipments to a letter box parcel or to a regular parcel as long as they have not been received by PostNL.
- Added the ability to change the selected shipping option for a shipment as long as it has not yet been received by PostNL.
- Added the option to use additional shipping methods for PostNL.
- Added the option to create a shipment, confirm it and print it's shipping labels for an order straight from the order grid in a single click.
==== Improvements ====
- It's now possible to enable or disable time frames separately from delivery days.
- You can now specify the cut-off time in minutes as well as hours.
- You can now view an order's confirm date, confirm status and shipping phase in the order grid.
- Additional information regarding the chosen delivery option is now shown on the order detail page.
- Added a button to download all PostNL debug log files to the PostNL configuration page.
- The 'create shipments' massaction interface has been modified so that only valid options are displayed.
- Errors that occur whilst processing multiple shipments or orders will no longer stop the entire process. Instead the remaining orders and shipments will be processed and an error message specifying which orders or shipments caused an error will be displayed afterwards.
- The first and last name fields are no longer mandatory for the sender's address fields in the PostNL configuration.
- Spaces are now allowed in postcodes.
==== Bug fixes ====
- Deleting orders from Magento should no longer cause errors when processing PostNL shipments.
- The PostNL shipping method will no longer be selected by default.
- Greece will now be processed with EPS, instead of GlobalPack.
- Upgrade and install scripts will now check if certain columns and attributes exist before modifying them.
- The progress bar on the Onepage Checkout page will now correctly update the shipping costs when the customer has chosen a delivery option that charges an additional fee.
- Creating shipments for which no default shipping option is selected will no longer cause errors.
==== v1.2.2 ====
==== New features ====
- Added the option to send a copy of the track & trace email to a specified email address.
==== Improvements ====
- Performance of the entire extension has been improved. The extension will now attempt to cache several configuration values.
- Label printing will now always follow the 'label size' configuration setting.
==== Bug fixes ====
- Fixed several small html errors in the track & trace email template.
- Fixed an SQL error that could occur when filtering the 'store' column in the order and shipment grids.
==== v1.2.1 ====
==== Release highlights ====
- The extension now fully supports Magento 1.9 and 1.14!
==== Minor improvements ====
- Added additional checks to prevent errors when Magento's layout has been altered or PostNL's layout has not been uploaded properly.
- Added additional compatibility enhancements for MultiSafePay and other PSP extensions.
- Improved several minor texts and translations.
==== Bug fixes ====
- Fixed an issue that prevented MijnPakket login data from being cached.
- Fixed an issue where using PostNL-only features on non-PostNL shipments would cause an error.
- Fixed an issue where PostNL's feed messages would be loaded in the wrong order.
- Fixed an issue where several notifications would be added to Magento when installing an unsupported version of Magento with the PostNL extension.
- Fixed an issue with EPS comb-labels. EPS combi-labels were rotated by 90 degrees, causing overlapping issues with other labels being printed.
==== v1.2.0 =====
==== New features ====
- Added delivery options to the checkout flow. Customers can now choose where, when and how they want their order shipped when choosing their preferred shipping method.
- Added support for evening delivery, early pickup locations and parcel dispenser locations.
- Added Dutch postcode validation support.
- Added the option to create a parcelware export csv file directly from the Magento backend.
- Added a MijnPakket login feature. Customers who have a MijnPakket account can use this feature to automatically fill in their preferred billing and shipping address.
==== Minor improvements ====
- Refactored the label printing functionality. Shipping labels will now be opened in a separate window from where they may be printed or downloaded.
- Added the option to select where on an A4 page the shipping labels will start printing. This allows you to re-use partially used sticker-sheets.
- Added many new customization options for the shipment grid in the Magento backend.
- Added the ability to view and edit a chosen post office delivery address from the Magento backend.
- Added the option to only show the PostNL Checkout feature to customers who have a MijnPakket account.
- Refactored many sections of the source code to improve readability and extensibility.
- Moved several configuration settings.
- Merged the 'test/live mode' settings of PostNl Checkout and Label Printing & Confirming functionality. There is now a single option to set the entire extension to test or live mode.
- Added the option to upload separate csv files for the PostNL shipping method in 'table rate' configuration.
==== Bug fixes ====
- Fixed an issue where it was not possible to choose to only manually send track & trace information.
- Fixed several typos and translation errors.
==== v1.1.5 =====
==== Bug fixes ====
- Fixed a problem with account validation only using test mode account credentials
- Made a minor security improvement to the notification system.
- Fixed an issue where shipments could not be confirmed if the shipping address did not have an email address.
- Fixed an issue where PostNl Checkout would incorrectly identify a product as being out of stock.
- Fixed an issue where for some shops PostNl Checkout would not function due to incorrect usage of https in an http environment.
==== v1.1.4 =====
==== New features ====
- Added a default test account to the extension. New installation will automatically have a PostNL test account pre-configured.
- Added the option to undo a confirmation as long as the shipment has not been received by PostNL.
- Added the option to delete shipping labels. This allows you to correct an address after a shipping label has been printed. Before this change if you noticed an error in the address after you had already printed a shipping label, you had to place en entire new order to correct it. Now you can simply delete the shipping label, edit the address and print a new shipping label with the new address.
==== Minor change ====
- The validate settings button in the extension’s configuration page now also validates settings while the extension is set to test mode.
- Removed the 'EU Pack Standard (Belgium only, no signature)' product option. If you use this option, please contact the Total Internet Group servicedesk.
- The extension's test mode is now available by default. In earlier versions you had to allow test mode through a setting under advanced options.
- When a confirmation expires, the barcode's track & trace link will now also be removed.
- Improved various texts and translations.
==== Bug fixes ====
- Solved an issue where certain configurations of the PostNL shipping method would only appear if the Magento tablerates shipping method was also active.
- Solved an issue where filtering the order and shipment grids in the Magento backend on certain columns would cause an error.
- Solved an issue where the shipment status cron would stop as soon as it encountered an error, rather than continue processing the remaining shipments.
- Solved an issue where you could not confirm a shipment without a barcode due to process locking when developer mode is active.
- Solved issue in Safari where labels would be printed as .pdf.html, rather than just .pdf files.
==== v1.1.3 ====
- FIxed an issue with the extension's activation procedure.
==== v1.1.2 ====
- Updated manual.
==== v1.1.1 ====
- Fixed issue where filtering the first column of the shipment grid could cause errors.
- Removed PHP extension dependencies from the PostNL extension packages. Magento connect would sometimes falsely report a PHP extension as missing preventing the PostNL extension from being installed.
==== v1.1.0 ====
- First public release.
==== v1.0.8 ====
- Improved compatibility with Magento 1.6 and 1.11.
==== v1.0.7 ====
- Improved configuration fields.
- Improved translations.
==== v1.0.6 ====
- Improved shipment grid interface. It shoulod now be more clear which shipments have been confirmed and when they should be handed over to PostNL.
- Improved PostNL Checkout payment method handling. The Checkout summary page should now remember your chosen bank when you attempt to pay using iDEAL. 100% support for all payment methods is not guaranteed.
==== v1.0.5 ====
- Several bug fixes.
- Improved configuration interface.
==== v1.0.4 ====
- Several minor bug fixes.
- Improved Dutch translations.
- Added additional information to several fields in system/config.
==== v1.0.3 ====
- Several bug fixes. Including an issue preventing the extension from functioning properly with the compiler active.
- Several improvements to the Dutch translations.
- Improved the extension's system > config interface
- Added the Klarna payment method to PostNL Checkout
==== v1.0.2 ====
- A large number of bug fixes and general improvements
- Improved error handling. Almost all errors will now automatically provide you with a link where you can find more information and a possible solution.
==== v1.0.1 ====
- Added a filter to the possible product options you may select, based on the selected orders when mass-creating shipments from the order grid.
- Improved several translations.
- Fixed several minor bugs.
==== v1.0.0 ====
This is the initial beta release of the extension. If you have any questions, please contact the Total Internet Group Servicedesk
Release Info
Developer | TIG |
Extension | tig_postnl |
Version | 1.12.0 |
Comparing to | |
See all releases |
Code changes from version 1.10.1 to 1.12.0
- app/code/community/TIG/PostNL/Block/AddressValidation/GoMage/LightCheckout/Billing.php +1 -1
- app/code/community/TIG/PostNL/Block/AddressValidation/GoMage/LightCheckout/Shipping.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Carrier/Postnl/Matrixrate/Grid.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Carrier/Postnl/Tablerate/Grid.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/CronNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/IntegrityNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/LogNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Items/Column/Qty.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Create/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Creditmemo/Create/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Creditmemo/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Invoice/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/ProductOptions.php +3 -2
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/Create/ShipmentOptions.php +6 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/DeliveryOptions.php +10 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/ShippingStatus.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/Tab/StatusHistory.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Shipment/View/Tabs.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Order/View/DeliveryOptions.php +11 -6
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Sales/Returns/Grid.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/ActivateButton.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/ActivatedFieldHeader.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/AddressLines.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Anchor.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/CheckForWarningBox.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Checkbox.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/ConfigCheck.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/GoMageDeliveryDateConflicts.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/GooglePlacesActive.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Hidden.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/HourMinute.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/InfoBox.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/MatrixrateExport.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/MatrixrateImport.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Obscure.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/OscDeliveryDateActive.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/PackingSlipItemColumns.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/PostcodeNlExtensionActive.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Radios.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/SplitAddressCheck.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/SupportTab.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/TablerateExport.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/TablerateImport.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/TextBox/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/Tooltip/HourMinute.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/UninstallButton.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/ValidateButton.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/WarningBox.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Field/WizardSaveButton.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Form/Fieldset.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/System/Config/Js.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Template.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/UpgradeNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Form/Element/Dependence.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Filter/ConfirmDate.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/Action.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/Barcode.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ConfirmDate.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ConfirmStatus.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/CountryArray.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/DeliveryDate.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/OrderConfirmDate.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/OrderConfirmStatus.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/OrderType.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ReturnView.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ShipmentType.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingDescription.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/ShippingPhase.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/Time.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/Translate.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/Type/Abstract.php +74 -2
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Column/Renderer/YesNo.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Massaction/Item/Additional/LabelStartPos.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/Widget/Grid/Massaction/Item/Additional/ProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Block/Adminhtml/WindowsTheme.php +1 -1
- app/code/community/TIG/PostNL/Block/Checkout/Cart/CheckoutLink.php +1 -1
- app/code/community/TIG/PostNL/Block/Checkout/Cart/Js.php +1 -1
- app/code/community/TIG/PostNL/Block/Checkout/Summary.php +1 -1
- app/code/community/TIG/PostNL/Block/Checkout/Widget/Date.php +150 -0
- app/code/community/TIG/PostNL/Block/Checkout/Widget/Dob.php +101 -0
- app/code/community/TIG/PostNL/Block/Core/JsTranslate.php +1 -1
- app/code/community/TIG/PostNL/Block/Core/Order/Returns/Info.php +1 -1
- app/code/community/TIG/PostNL/Block/Core/Order/Returns/Shipment/Items.php +1 -1
- app/code/community/TIG/PostNL/Block/Core/ShippingStatus.php +1 -1
- app/code/community/TIG/PostNL/Block/Core/Template.php +45 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/AddPhoneNumber.php +1 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/DeliveryOptions.php +97 -24
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/GoMage/LightCheckout/DeliveryOptions.php +1 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/IdCheck.php +72 -0
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Checkout/Progress.php +1 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Js.php +13 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/PickupNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Template.php +1 -1
- app/code/community/TIG/PostNL/Block/DeliveryOptions/Theme.php +1 -1
- app/code/community/TIG/PostNL/Block/Mijnpakket/AccountNotification.php +1 -1
- app/code/community/TIG/PostNL/Block/Mijnpakket/Js.php +1 -1
- app/code/community/TIG/PostNL/Block/Mijnpakket/LoginButton.php +1 -1
- app/code/community/TIG/PostNL/Block/Mijnpakket/OrderSuccessJs.php +1 -1
- app/code/community/TIG/PostNL/Block/Payment/Checkout/Total/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Payment/Form/Cod.php +1 -44
- app/code/community/TIG/PostNL/Block/Payment/Info.php +1 -1
- app/code/community/TIG/PostNL/Block/Payment/Sales/Order/Creditmemo/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Payment/Sales/Order/Invoice/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Block/Payment/Sales/Order/Totals/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Controller/Adminhtml/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Controller/Adminhtml/Config.php +1 -1
- app/code/community/TIG/PostNL/Controller/Adminhtml/Shipment.php +1 -1
- app/code/community/TIG/PostNL/Controller/Sales.php +1 -1
- app/code/community/TIG/PostNL/Exception.php +1 -1
- app/code/community/TIG/PostNL/Helper/AddressValidation.php +1 -1
- app/code/community/TIG/PostNL/Helper/Adminhtml.php +1 -1
- app/code/community/TIG/PostNL/Helper/Carrier.php +1 -1
- app/code/community/TIG/PostNL/Helper/Checkout.php +1 -1
- app/code/community/TIG/PostNL/Helper/Cif.php +78 -4
- app/code/community/TIG/PostNL/Helper/Data.php +295 -12
- app/code/community/TIG/PostNL/Helper/Date.php +18 -5
- app/code/community/TIG/PostNL/Helper/DeliveryOptions.php +410 -54
- app/code/community/TIG/PostNL/Helper/DeliveryOptions/Fee.php +1 -1
- app/code/community/TIG/PostNL/Helper/DeliveryOptions/IDCheck.php +121 -0
- app/code/community/TIG/PostNL/Helper/Mijnpakket.php +1 -1
- app/code/community/TIG/PostNL/Helper/Parcelware.php +1 -1
- app/code/community/TIG/PostNL/Helper/Payment.php +1 -1
- app/code/community/TIG/PostNL/Helper/Webservices.php +1 -1
- app/code/community/TIG/PostNL/Model/AddressValidation/Cendris.php +1 -1
- app/code/community/TIG/PostNL/Model/AddressValidation/Cendris/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Model/AddressValidation/Observer/AddressBook.php +1 -1
- app/code/community/TIG/PostNL/Model/AddressValidation/Observer/OneStepCheckout.php +16 -3
- app/code/community/TIG/PostNL/Model/AddressValidation/Observer/Onepage.php +1 -1
- app/code/community/TIG/PostNL/Model/AddressValidation/System/Config/Backend/ValidateAccount.php +1 -1
- app/code/community/TIG/PostNL/Model/Admin/Inbox.php +1 -1
- app/code/community/TIG/PostNL/Model/Admin/Logging/Handler/Postnl.php +1 -1
- app/code/community/TIG/PostNL/Model/Admin/Logging/Observer.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/Form/Element/Checkbox.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/Observer/OrderGrid.php +21 -25
- app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentGrid.php +20 -17
- app/code/community/TIG/PostNL/Model/Adminhtml/Observer/ShipmentView.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/Observer/SystemConfig.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/Support/Logs.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Form/FoodWarnings.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/OrderGridColumns.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/OrderGridMassaction.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridColumns.php +1 -1
- app/code/community/TIG/PostNL/Model/Adminhtml/System/Config/Source/ShipmentGridMassaction.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Matrixrate.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Postnl.php +46 -7
- app/code/community/TIG/PostNL/Model/Carrier/Quote/Address/Total/Shipping.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Resource/Matrixrate.php +29 -2
- app/code/community/TIG/PostNL/Model/Carrier/Resource/Matrixrate/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Resource/Tablerate.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Resource/Tablerate/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/System/Config/Backend/Matrixrate.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/System/Config/Backend/Tablerate.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/System/Config/Source/RateType.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/System/Config/Source/TablerateSource.php +1 -1
- app/code/community/TIG/PostNL/Model/Carrier/Tablerate.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/Cif.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/Observer/Order.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/Observer/Shipment.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/Order.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/Service.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/System/Config/Source/ActivePaymentMethods.php +1 -1
- app/code/community/TIG/PostNL/Model/Checkout/System/Config/Source/CmsPage.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Api.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Api/V2.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Cache.php +22 -1
- app/code/community/TIG/PostNL/Model/Core/Cif.php +41 -9
- app/code/community/TIG/PostNL/Model/Core/Cif/Abstract.php +31 -1
- app/code/community/TIG/PostNL/Model/Core/Cif/Exception.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Label.php +44 -11
- app/code/community/TIG/PostNL/Model/Core/Observer/Barcode.php +13 -1
- app/code/community/TIG/PostNL/Model/Core/Observer/Cache.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Observer/Cron.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Observer/Returns.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Observer/SaveShipment.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Order.php +58 -11
- app/code/community/TIG/PostNL/Model/Core/PackingSlip.php +10 -1
- app/code/community/TIG/PostNL/Model/Core/Packingslip/Pdf/Items/Invoice/Default.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Integrity.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Integrity/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Order.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Order/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Barcode.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Barcode/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Label.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Label/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Status/History.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Resource/Shipment/Status/History/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/IntegrityCheck.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/InvoiceDummy.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/OrderDummy.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/PaymentDummy.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/PaymentMethodDummy.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Service/Shipment.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Shipment.php +256 -60
- app/code/community/TIG/PostNL/Model/Core/Shipment/Barcode.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Shipment/Label.php +3 -1
- app/code/community/TIG/PostNL/Model/Core/Shipment/Process.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/Shipment/Status/History.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Backend/HourMinute.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Backend/Image/Pdf.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Backend/ProductType.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Backend/SenderCountry.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Backend/ValidateDefaultOption.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/AgeCheckPakjegemakProductOptions.php +97 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/AgeCheckProductOptions.php +114 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/AllProductOptions.php +370 -3
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/Attributes.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/BirthdayCheckPakjegemakProductOptions.php +111 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/BirthdayCheckProductOptions.php +103 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/BuspakjeProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CheckoutExtensions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CommentType.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CooledProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/CutOffTime.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/DebugMode.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/Direction.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/EuProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/FoodProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/GlobalProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/GlobalpackShipmentType.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/HourMinute.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/IdCheckPakjegemakProductOptions.php +111 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/IdCheckProductOptions.php +103 -0
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/LabelSize.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ManualAutomatic.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/PackingSlipItemFields.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/PackingSlipLabel.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/PakjeGemakProductOptions.php +317 -68
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/PakketautomaatProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ProductOptions/Abstract.php +32 -4
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ReferenceType.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/SenderCountry.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingDays.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingDuration.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingDurationDays.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/ShippingMethods.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StandardProductOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StaticBlocks.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StreetField.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/StreetFieldWithDefault.php +1 -1
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/SundayProductOptions.php +2 -2
- app/code/community/TIG/PostNL/Model/Core/System/Config/Source/WeightUnit.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Cif.php +171 -33
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/GoMage/LightCheckout/Ajax.php +66 -4
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/IdCheck.php +299 -0
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/ShippingMethodAvailable.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/UpdateConfig.php +2 -2
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Observer/UpdatePostnlOrder.php +3 -22
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Product/Attribute/Source/IdcheckType.php +124 -0
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Product/Attribute/Source/ProductType.php +19 -4
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Product/Attribute/Source/ShippingDuration.php +2 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/Service.php +39 -7
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Backend/ValidateFee.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Backend/ValidateFee/SameDayDeliveryFee.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Backend/ValidateFee/SundayDeliveryFee.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Source/DeliveryDaysNumber.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Source/StockOptions.php +1 -1
- app/code/community/TIG/PostNL/Model/DeliveryOptions/System/Config/Source/Themes.php +1 -1
- app/code/community/TIG/PostNL/Model/ExtensionControl/Config.php +1 -1
- app/code/community/TIG/PostNL/Model/ExtensionControl/Feed.php +1 -1
- app/code/community/TIG/PostNL/Model/ExtensionControl/Observer/Cron.php +1 -1
- app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices.php +2 -2
- app/code/community/TIG/PostNL/Model/ExtensionControl/Webservices/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Model/Inbox.php +1 -1
- app/code/community/TIG/PostNL/Model/Mijnpakket/Cif.php +1 -1
- app/code/community/TIG/PostNL/Model/Mijnpakket/Service.php +1 -1
- app/code/community/TIG/PostNL/Model/Parcelware/Export.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Cod.php +95 -4
- app/code/community/TIG/PostNL/Model/Payment/Observer/Cod.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Creditmemo/Total/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Creditmemo/Total/CodFee/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Creditmemo/Total/CodFeeTax.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Invoice/Total/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Invoice/Total/CodFeeTax.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Invoice/Total/Subtotal.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Pdf/Total/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Pdf/Total/Grandtotal.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Order/Pdf/Total/Tax.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Quote/Address/Total/CodFee.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Quote/Address/Total/CodFee/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Quote/Address/Total/CodFeeTax.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/Service.php +1 -1
- app/code/community/TIG/PostNL/Model/Payment/System/Config/Source/CodFeeTaxClass.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Catalog/Product.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Db/Abstract.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Db/Collection/Postnl.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Order/Grid/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Order/Shipment.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Order/Shipment/Grid/Collection.php +1 -1
- app/code/community/TIG/PostNL/Model/Resource/Setup.php +1 -1
- app/code/community/TIG/PostNL/Model/System/Config/Backend/Checkbox.php +1 -1
- app/code/community/TIG/PostNL/Model/System/Config/Source/Testlive.php +1 -1
- app/code/community/TIG/PostNL/Model/System/Config/Source/Yesno.php +1 -1
- app/code/community/TIG/PostNL/Test/.coveralls.yml +1 -0
- app/code/community/TIG/PostNL/Test/Block/DeliveryOptions/JsTest.php +0 -119
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/agecheck.csv +4 -0
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/birthdaycheck.csv +10 -0
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/food.csv +7 -0
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/idcheck.csv +4 -0
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/letter_box.csv +2 -0
- app/code/community/TIG/PostNL/Test/Fixtures/Matrixrate/regular.csv +2 -0
- app/code/community/TIG/PostNL/Test/Helper/DeliveryOptionsTest.php +0 -225
- app/code/community/TIG/PostNL/Test/Scripts/AfterSuccess.sh +10 -0
- app/code/community/TIG/PostNL/Test/Scripts/InstallDependencies.sh +27 -0
- app/code/community/TIG/PostNL/Test/Scripts/Setup.sh +56 -0
- app/code/community/TIG/PostNL/Test/Unit/Block/Checkout/Widget/DobTest.php +133 -0
- app/code/community/TIG/PostNL/Test/{Block → Unit/Block}/DeliveryOptions/Checkout/AddPhoneNumberTest.php +4 -5
- app/code/community/TIG/PostNL/Test/Unit/Block/DeliveryOptions/Checkout/DeliveryOptionsTest.php +150 -0
- app/code/community/TIG/PostNL/Test/Unit/Block/DeliveryOptions/Checkout/IdCheckTest.php +73 -0
- app/code/community/TIG/PostNL/Test/{Model/Carrier/Postnl.php → Unit/Block/DeliveryOptions/JsTest.php} +16 -25
- app/code/community/TIG/PostNL/Test/{Controllers → Unit/Controllers}/AddressValidationControllerTest.php +5 -4
- app/code/community/TIG/PostNL/Test/{Controllers → Unit/Controllers}/DeliveryOptionsControllerTest.php +61 -31
- app/code/community/TIG/PostNL/Test/{Framework → Unit/Framework}/TIG/Test/Config.php +3 -3
- app/code/community/TIG/PostNL/Test/{Framework → Unit/Framework}/TIG/Test/Http/Response.php +3 -3
- app/code/community/TIG/PostNL/Test/{Framework → Unit/Framework}/TIG/Test/TestCase.php +53 -11
- app/code/community/TIG/PostNL/Test/Unit/Helper/DataTest.php +320 -0
- app/code/community/TIG/PostNL/Test/Unit/Helper/DeliveryOptionsTest.php +549 -0
- app/code/community/TIG/PostNL/Test/Unit/Install/V12Test.php +137 -0
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/Adminhtml/Observer/OrderGridTest.php +3 -3
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/Adminhtml/Observer/ShipmentGridTest.php +3 -3
- app/code/community/TIG/PostNL/Test/Unit/Model/Carrier/PostnlTest.php +155 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Carrier/Resource/MatrixrateTest.php +98 -0
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/Core/Cif/AbstractTest.php +2 -95
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/Core/OrderTest.php +27 -3
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/Core/ShipmentTest.php +84 -14
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/AgeCheckPakjegemakProductOptionsTest.php +83 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/AgeCheckProductOptionsTest.php +81 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/AllProductOptionsTest.php +121 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/BirthdayCheckPakjegemakProductOptionsTest.php +83 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/BirthdayCheckProductOptionsTest.php +81 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/IdCheckPakjegemakProductOptionsTest.php +83 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/IdCheckProductOptionsTest.php +81 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/Core/System/Config/Source/PakjeGemakProductOptionsTest.php +143 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/DeliveryOptions/CifTest.php +539 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/DeliveryOptions/Observer/GoMage/LightCheckout/AjaxTest.php +100 -0
- app/code/community/TIG/PostNL/Test/Unit/Model/DeliveryOptions/Observer/IdCheckTest.php +424 -0
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/DeliveryOptions/Observer/UpdatePostnlOrderTest.php +8 -46
- app/code/community/TIG/PostNL/Test/Unit/Model/DeliveryOptions/Product/Attribute/Source/ProductTypeTest.php +75 -0
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/DeliveryOptions/ServiceTest.php +4 -27
- app/code/community/TIG/PostNL/Test/{Model → Unit/Model}/DeliveryOptions/System/Config/Backend/ValidateFeeTest.php +4 -51
- app/code/community/TIG/PostNL/Test/Unit/Model/Payment/CodTest.php +181 -0
- app/code/community/TIG/PostNL/Test/bootstrap.php +1 -1
- app/code/community/TIG/PostNL/Test/phpunit.xml +8 -4
- app/code/community/TIG/PostNL/Test/setup.sh +0 -86
- app/code/community/TIG/PostNL/controllers/AddressValidationController.php +1 -1
- app/code/community/TIG/PostNL/controllers/CheckoutController.php +1 -1
- app/code/community/TIG/PostNL/controllers/DeliveryOptionsController.php +28 -2
- app/code/community/TIG/PostNL/controllers/GuestController.php +1 -1
- app/code/community/TIG/PostNL/controllers/MijnpakketController.php +1 -1
- app/code/community/TIG/PostNL/controllers/OrderController.php +1 -1
- app/code/community/TIG/PostNL/controllers/PostnlAdminhtml/ConfigController.php +1 -1
- app/code/community/TIG/PostNL/controllers/PostnlAdminhtml/ExtensionControlController.php +1 -1
- app/code/community/TIG/PostNL/controllers/PostnlAdminhtml/ReturnsController.php +1 -1
- app/code/community/TIG/PostNL/controllers/PostnlAdminhtml/ShipmentController.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.0.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.0.3.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.1.4.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.3.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.4.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.4.1.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.5.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.5.2.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.7.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.7.2.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.8.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-install-1.9.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-uninstall-1.5.2.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-uninstall-1.9.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.1.5-1.2.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.10.0-1.11.0.php +73 -0
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.2.2-1.3.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.2.2-1.4.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.3.1-1.4.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.4.0-1.4.1.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.4.1-1.5.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.5.1-1.5.2.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.6.0-1.6.1.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.6.1-1.7.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.7.1-1.7.2.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.7.2-1.8.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.8.0-1.9.0.php +1 -1
- app/code/community/TIG/PostNL/data/postnl_setup/data-upgrade-1.9.0-1.10.0.php +64 -0
- app/code/community/TIG/PostNL/docs/how_to_enable_the_Pakjegemak_BE_not_insured_product_option.txt +5 -0
- app/code/community/TIG/PostNL/docs/modman +0 -27
- app/code/community/TIG/PostNL/docs/postnl_api_test_script.php +1 -1
- app/code/community/TIG/PostNL/etc/adminhtml.xml +1 -1
- app/code/community/TIG/PostNL/etc/api.xml +1 -1
- app/code/community/TIG/PostNL/etc/config.xml +121 -11
- app/code/community/TIG/PostNL/etc/jstranslator.xml +4 -1
- app/code/community/TIG/PostNL/etc/logging.xml +1 -1
- app/code/community/TIG/PostNL/etc/system.xml +465 -234
- app/code/community/TIG/PostNL/sql/postnl_setup/install-1.0.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.1.5-1.2.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.11.0-1.12.0.php +206 -0
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.2.2-1.3.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.3.1-1.4.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.4.1-1.5.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.8.0-1.9.0.php +1 -1
- app/code/community/TIG/PostNL/sql/postnl_setup/upgrade-1.9.0-1.10.0.php +2 -2
- app/design/adminhtml/default/default/layout/TIG/postnl.xml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/cron_notification.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/integrity_notification.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/log_notification.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/payment/checkout/form/cod.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/items/column/qty.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/address/form/container.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/create/js.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/creditmemo/create/totals/cod_fee.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/filter_massaction.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/js.phtml +7 -3
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/product_options.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/create/shipment_options.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/filter_massaction.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view.phtml +4 -2
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/delivery_options.phtml +2 -2
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/pakje_gemak_address.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/shipping_status.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/shipment/view/tab/status_history.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/view/delivery_options.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/view/pakje_gemak_address.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/order/windows_theme.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/customize_link.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/js.phtml +7 -3
- app/design/adminhtml/default/default/template/TIG/PostNL/sales/shipment/testmode_warning.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/check_for_warning_box.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/config_check.phtml +2 -2
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/field_header.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/info_box.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/js.phtml +5 -5
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/split_address_check.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/support_tab.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/system/config/form/field/warning_box.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/upgrade_notification.phtml +1 -1
- app/design/adminhtml/default/default/template/TIG/PostNL/widget/grid/massaction/label_start_pos.phtml +1 -1
- app/design/adminhtml/default/magento2/template/TIG/PostNL/system/config/form/field/js.phtml +0 -419
- app/design/frontend/base/default/layout/TIG/postnl.xml +6 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/checkout/onepage/billing.phtml +59 -45
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml +2 -2
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/checkout/onepage/shipping.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/customer/address/edit.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/customer/address/postcode_check.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/gomage_checkout/billing.phtml +6 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/gomage_checkout/postcode_check.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/gomage_checkout/shipping.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/billing_fields.phtml +143 -33
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/legacy/billing_fields.phtml +277 -0
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/legacy/shipping_fields.phtml +124 -0
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/postcode_check.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/onestepcheckout/shipping_fields.phtml +80 -22
- app/design/frontend/base/default/template/TIG/PostNL/address_validation/validate.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/checkout/cart/js.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/checkout/cart/link.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/checkout/cart/spinner.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/checkout/summary.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/checkout/widget/date.phtml +113 -0
- app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/info.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/core/order/returns/shipment/items.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/core/page/html/js_translate.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/delivery_options.phtml +13 -10
- app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/email/pakjegemak_address.phtml +22 -19
- app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/pakje_gemak_address.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/core/sales/order/shipment/shipping_status.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/addlocation.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/addphonenumber.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/gomage_checkout/available.phtml +1 -1
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/gomage_checkout/deliveryoptions.phtml +86 -15
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/idcheck.phtml +88 -0
- app/design/frontend/base/default/template/TIG/PostNL/delivery_options/js.phtml +1 -1
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
class TIG_PostNL_Block_AddressValidation_GoMage_LightCheckout_Billing extends GoMage_Checkout_Block_Onepage_Billing
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
class TIG_PostNL_Block_AddressValidation_GoMage_LightCheckout_Billing extends GoMage_Checkout_Block_Onepage_Billing
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
class TIG_PostNL_Block_AddressValidation_GoMage_LightCheckout_Shipping extends GoMage_Checkout_Block_Onepage_Shipping
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
class TIG_PostNL_Block_AddressValidation_GoMage_LightCheckout_Shipping extends GoMage_Checkout_Block_Onepage_Shipping
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Carrier_Postnl_Matrixrate_Grid
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Carrier_Postnl_Matrixrate_Grid
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Carrier_Postnl_Tablerate_Grid
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Carrier_Postnl_Tablerate_Grid
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_CronNotification extends TIG_PostNL_Block_Adminhtml_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_CronNotification extends TIG_PostNL_Block_Adminhtml_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_IntegrityNotification extends TIG_PostNL_Block_Adminhtml_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_IntegrityNotification extends TIG_PostNL_Block_Adminhtml_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasMaxLogSize()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasMaxLogSize()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Items_Column_Qty extends Mage_Adminhtml_Block_Sales_Items_Column_Qty
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Items_Column_Qty extends Mage_Adminhtml_Block_Sales_Items_Column_Qty
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Object getTotal()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Object getTotal()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Creditmemo_Create_CodFee extends Mage_Adminhtml_Block_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Creditmemo_Create_CodFee extends Mage_Adminhtml_Block_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Creditmemo_Totals_CodFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Creditmemo_Totals_CodFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Invoice_Totals_CodFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Invoice_Totals_CodFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasExtraCoverProductOptions()
|
@@ -86,7 +86,8 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_ProductOptions extends TIG_PostNL_B
|
|
86 |
return '';
|
87 |
}
|
88 |
|
89 |
-
$
|
|
|
90 |
$this->setGlobalpackProductOption($optionValue);
|
91 |
return $optionValue;
|
92 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasExtraCoverProductOptions()
|
86 |
return '';
|
87 |
}
|
88 |
|
89 |
+
$current = current($globalPackProductOption);
|
90 |
+
$optionValue = $current['value'];
|
91 |
$this->setGlobalpackProductOption($optionValue);
|
92 |
return $optionValue;
|
93 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasShipment()
|
@@ -255,6 +255,11 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_Create_ShipmentOptions ext
|
|
255 |
{
|
256 |
$shipment = $this->getShipment();
|
257 |
$items = $shipment->getAllItems();
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
/**
|
260 |
* @var Mage_Sales_Model_Order_Shipment_Item $item
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasShipment()
|
255 |
{
|
256 |
$shipment = $this->getShipment();
|
257 |
$items = $shipment->getAllItems();
|
258 |
+
$order = $this->getPostnlOrder();
|
259 |
+
|
260 |
+
if ($order->isIDCheck()) {
|
261 |
+
return false;
|
262 |
+
}
|
263 |
|
264 |
/**
|
265 |
* @var Mage_Sales_Model_Order_Shipment_Item $item
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipment()
|
@@ -230,6 +230,15 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_DeliveryOptions
|
|
230 |
case $postnlShipment::SHIPMENT_TYPE_COOLED:
|
231 |
$shipmentType = $this->__('Cooled Food Delivery');
|
232 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
|
235 |
return $shipmentType;
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipment()
|
230 |
case $postnlShipment::SHIPMENT_TYPE_COOLED:
|
231 |
$shipmentType = $this->__('Cooled Food Delivery');
|
232 |
break;
|
233 |
+
case $postnlShipment::SHIPMENT_TYPE_AGECHECK:
|
234 |
+
$shipmentType = $this->__('Age Check');
|
235 |
+
break;
|
236 |
+
case $postnlShipment::SHIPMENT_TYPE_BIRTHDAYCHECK:
|
237 |
+
$shipmentType = $this->__('Birthday Check');
|
238 |
+
break;
|
239 |
+
case $postnlShipment::SHIPMENT_TYPE_IDCHECK:
|
240 |
+
$shipmentType = $this->__('ID Check');
|
241 |
+
break;
|
242 |
}
|
243 |
|
244 |
return $shipmentType;
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus extends TIG_PostNL_Block_Adminhtml_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus extends TIG_PostNL_Block_Adminhtml_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_Shipment getPostnlShipment()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_Shipment getPostnlShipment()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tabs setTitle($title)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_Tabs setTitle($title)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Totals_CodFee extends Mage_Adminhtml_Block_Sales_Order_Totals
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Order_Totals_CodFee extends Mage_Adminhtml_Block_Sales_Order_Totals
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasOrder()
|
@@ -156,6 +156,15 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_View_DeliveryOptions extends TIG_Po
|
|
156 |
case 'Cooledfood':
|
157 |
$shipmentType = $this->__('Cooled Food Delivery');
|
158 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
}
|
160 |
|
161 |
if ($shipmentType) {
|
@@ -164,11 +173,7 @@ class TIG_PostNL_Block_Adminhtml_Sales_Order_View_DeliveryOptions extends TIG_Po
|
|
164 |
|
165 |
if (
|
166 |
$countryId == $domesticCountry ||
|
167 |
-
(
|
168 |
-
$domesticCountry == 'BE' &&
|
169 |
-
$countryId == 'NL' &&
|
170 |
-
Mage::helper('postnl/deliveryOptions')->canUseDutchProducts()
|
171 |
-
)
|
172 |
) {
|
173 |
$shipmentType = $this->__('Domestic');
|
174 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasOrder()
|
156 |
case 'Cooledfood':
|
157 |
$shipmentType = $this->__('Cooled Food Delivery');
|
158 |
break;
|
159 |
+
case 'AgeCheck':
|
160 |
+
$shipmentType = $this->__('Age Check');
|
161 |
+
break;
|
162 |
+
case 'BirthdayCheck':
|
163 |
+
$shipmentType = $this->__('Birthday Check');
|
164 |
+
break;
|
165 |
+
case 'IDCheck':
|
166 |
+
$shipmentType = $this->__('ID Check');
|
167 |
+
break;
|
168 |
}
|
169 |
|
170 |
if ($shipmentType) {
|
173 |
|
174 |
if (
|
175 |
$countryId == $domesticCountry ||
|
176 |
+
Mage::helper('postnl/deliveryOptions')->canUseDutchProducts(false)
|
|
|
|
|
|
|
|
|
177 |
) {
|
178 |
$shipmentType = $this->__('Domestic');
|
179 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Returns extends Mage_Adminhtml_Block_Sales_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Returns extends Mage_Adminhtml_Block_Sales_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Returns_Grid extends Mage_Adminhtml_Block_Sales_Shipment_Grid
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Sales_Returns_Grid extends Mage_Adminhtml_Block_Sales_Shipment_Grid
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasFieldsetParam()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasFieldsetParam()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivatedFieldHeader
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivatedFieldHeader
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_AddressLines
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_AddressLines
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_CheckForWarningBox
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_CheckForWarningBox
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method mixed getValue()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method mixed getValue()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlHelper()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlHelper()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_GoMageDeliveryDateConflicts
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_GoMageDeliveryDateConflicts
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_GooglePlacesActive
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_GooglePlacesActive
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_Hidden
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_Hidden
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_HourMinute
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_HourMinute
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_InfoBox
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_InfoBox
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_MatrixrateExport
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_MatrixrateExport
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_MatrixrateImport
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_MatrixrateImport
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_Obscure
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_Obscure
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_OscDeliveryDateActive
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_OscDeliveryDateActive
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_PostcodeNlExtensionActive
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_PostcodeNlExtensionActive
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method string getValue()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method string getValue()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SplitAddressCheck
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SplitAddressCheck
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SupportTab
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SupportTab
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_TablerateExport
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_TablerateExport
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_TablerateImport
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_TablerateImport
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Data_Form_Element_Abstract getElement()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Core_Model_Config_Element getElement()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Core_Model_Config_Element getElement()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ValidateButton setElement(Varien_Data_Form_Element_Abstract $element)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ValidateButton setElement(Varien_Data_Form_Element_Abstract $element)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ActivateButton setElement(Varien_Data_Form_Element_Abstract $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This entire class is extended from Magento's core class for backwards compatibility on Magento 1.6.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This entire class is extended from Magento's core class for backwards compatibility on Magento 1.6.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Js extends TIG_PostNL_Block_Adminhtml_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_System_Config_Js extends TIG_PostNL_Block_Adminhtml_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_Adminhtml_Template extends Mage_Adminhtml_Block_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_Adminhtml_Template extends Mage_Adminhtml_Block_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_UpgradeNotification extends TIG_PostNL_Block_Adminhtml_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_UpgradeNotification extends TIG_PostNL_Block_Adminhtml_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Form element dependencies mapper
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Form element dependencies mapper
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Filter_ConfirmDate
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Filter_ConfirmDate
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Barcode
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Barcode
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmStatus
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmStatus
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_CountryArray
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_CountryArray
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_DeliveryDate
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_DeliveryDate
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.6.0 This class has been moved to TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate. A
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.6.0 This class has been moved to TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ConfirmDate. A
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderConfirmStatus
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderConfirmStatus
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_OrderType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ReturnView
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ReturnView
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShipmentType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShipmentType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShippingDescription
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShippingDescription
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShippingPhase
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_ShippingPhase
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Time
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Time
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Translate
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Translate
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
@@ -136,6 +136,15 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
|
136 |
case $postnlShipmentClass::SHIPMENT_TYPE_COOLED:
|
137 |
$label = $helper->__('Cooled Food Delivery');
|
138 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
140 |
|
141 |
$renderedValue = "<b id='postnl-shipmenttype-{$row->getId()}' data-product-type='{$type}'>{$label}</b>";
|
@@ -219,6 +228,12 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
|
219 |
return $this->_getFoodRenderedValue($row);
|
220 |
} elseif ($optionType == 'Cooledfood') {
|
221 |
return $this->_getCooledfoodRenderedValue($row);
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
} elseif ($row->getData(self::IS_PAKKETAUTOMAAT_COLUMN)) {
|
223 |
return $this->_getPaRenderedValue($row);
|
224 |
} elseif ($row->getData(self::IS_PAKJE_GEMAK_COLUMN)) {
|
@@ -234,7 +249,7 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
|
234 |
(
|
235 |
$value == 'NL' &&
|
236 |
$domesticCountry == 'BE' &&
|
237 |
-
Mage::helper('postnl/deliveryOptions')->canUseDutchProducts()
|
238 |
)
|
239 |
) {
|
240 |
return $this->_getDomesticRenderedValue($row, $value);
|
@@ -453,6 +468,63 @@ class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
|
453 |
return $renderedValue;
|
454 |
}
|
455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
/**
|
457 |
* Render this column for a domestic shipment.
|
458 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_Type_Abstract
|
136 |
case $postnlShipmentClass::SHIPMENT_TYPE_COOLED:
|
137 |
$label = $helper->__('Cooled Food Delivery');
|
138 |
break;
|
139 |
+
case $postnlShipmentClass::SHIPMENT_TYPE_AGECHECK:
|
140 |
+
$label = $helper->__('Age Check');
|
141 |
+
break;
|
142 |
+
case $postnlShipmentClass::SHIPMENT_TYPE_BIRTHDAYCHECK:
|
143 |
+
$label = $helper->__('Birthday Check');
|
144 |
+
break;
|
145 |
+
case $postnlShipmentClass::SHIPMENT_TYPE_IDCHECK:
|
146 |
+
$label = $helper->__('ID Check');
|
147 |
+
break;
|
148 |
}
|
149 |
|
150 |
$renderedValue = "<b id='postnl-shipmenttype-{$row->getId()}' data-product-type='{$type}'>{$label}</b>";
|
228 |
return $this->_getFoodRenderedValue($row);
|
229 |
} elseif ($optionType == 'Cooledfood') {
|
230 |
return $this->_getCooledfoodRenderedValue($row);
|
231 |
+
} elseif ($optionType == 'AgeCheck') {
|
232 |
+
return $this->_getAgeCheckfoodRenderedValue($row);
|
233 |
+
} elseif ($optionType == 'BirthdayCheck') {
|
234 |
+
return $this->_getBirthdayCheckfoodRenderedValue($row);
|
235 |
+
} elseif ($optionType == 'IDCheck') {
|
236 |
+
return $this->_getIDCheckfoodRenderedValue($row);
|
237 |
} elseif ($row->getData(self::IS_PAKKETAUTOMAAT_COLUMN)) {
|
238 |
return $this->_getPaRenderedValue($row);
|
239 |
} elseif ($row->getData(self::IS_PAKJE_GEMAK_COLUMN)) {
|
249 |
(
|
250 |
$value == 'NL' &&
|
251 |
$domesticCountry == 'BE' &&
|
252 |
+
Mage::helper('postnl/deliveryOptions')->canUseDutchProducts(false)
|
253 |
)
|
254 |
) {
|
255 |
return $this->_getDomesticRenderedValue($row, $value);
|
468 |
return $renderedValue;
|
469 |
}
|
470 |
|
471 |
+
/**
|
472 |
+
* Render this column for a age check shipment.
|
473 |
+
*
|
474 |
+
* @param Varien_Object $row
|
475 |
+
*
|
476 |
+
* @return string
|
477 |
+
*/
|
478 |
+
protected function _getAgeCheckfoodRenderedValue(Varien_Object $row)
|
479 |
+
{
|
480 |
+
$helper = Mage::helper('postnl');
|
481 |
+
|
482 |
+
$label = $helper->__('Age Check');
|
483 |
+
$type = 'agecheck';
|
484 |
+
|
485 |
+
$renderedValue = "<b id='postnl-shipmenttype-{$row->getId()}' data-product-type='{$type}'>{$label}</b>";
|
486 |
+
|
487 |
+
return $renderedValue;
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* Render this column for a birthday check shipment.
|
492 |
+
*
|
493 |
+
* @param Varien_Object $row
|
494 |
+
*
|
495 |
+
* @return string
|
496 |
+
*/
|
497 |
+
protected function _getBirthdayCheckfoodRenderedValue(Varien_Object $row)
|
498 |
+
{
|
499 |
+
$helper = Mage::helper('postnl');
|
500 |
+
|
501 |
+
$label = $helper->__('Birthday Check');
|
502 |
+
$type = 'birthdaycheck';
|
503 |
+
|
504 |
+
$renderedValue = "<b id='postnl-shipmenttype-{$row->getId()}' data-product-type='{$type}'>{$label}</b>";
|
505 |
+
|
506 |
+
return $renderedValue;
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* Render this column for a age check shipment.
|
511 |
+
*
|
512 |
+
* @param Varien_Object $row
|
513 |
+
*
|
514 |
+
* @return string
|
515 |
+
*/
|
516 |
+
protected function _getIDCheckfoodRenderedValue(Varien_Object $row)
|
517 |
+
{
|
518 |
+
$helper = Mage::helper('postnl');
|
519 |
+
|
520 |
+
$label = $helper->__('ID Check');
|
521 |
+
$type = 'idcheck';
|
522 |
+
|
523 |
+
$renderedValue = "<b id='postnl-shipmenttype-{$row->getId()}' data-product-type='{$type}'>{$label}</b>";
|
524 |
+
|
525 |
+
return $renderedValue;
|
526 |
+
}
|
527 |
+
|
528 |
/**
|
529 |
* Render this column for a domestic shipment.
|
530 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_YesNo
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Column_Renderer_YesNo
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Massaction_Item_Additional_ProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Adminhtml_Widget_Grid_Massaction_Item_Additional_ProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsOldMagento()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsOldMagento()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPublicWebshopId()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPublicWebshopId()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasWebshopId()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasWebshopId()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasQuote()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasQuote()
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @method $this setTime(string $date)
|
42 |
+
* @method int getTime()
|
43 |
+
* @method $this setFieldIdFormat(string $format)
|
44 |
+
* @method $this setFieldNameFormat(string $format)
|
45 |
+
* @method $this setIsRequired()
|
46 |
+
* @method bool|null getIsRequired()
|
47 |
+
* @method bool hasLabel()
|
48 |
+
* @method $this setLabel(string $value)
|
49 |
+
* @method bool|null getLabel()
|
50 |
+
*/
|
51 |
+
class TIG_PostNL_Block_Checkout_Widget_Date extends Mage_Customer_Block_Widget_Abstract
|
52 |
+
{
|
53 |
+
/**
|
54 |
+
* Date inputs
|
55 |
+
*
|
56 |
+
* @var array
|
57 |
+
*/
|
58 |
+
protected $_dateInputs = array();
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Set the template
|
62 |
+
*/
|
63 |
+
public function _construct()
|
64 |
+
{
|
65 |
+
parent::_construct();
|
66 |
+
|
67 |
+
// default template location
|
68 |
+
$this->setTemplate('TIG/PostNL/checkout/widget/date.phtml');
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @param $date
|
73 |
+
*
|
74 |
+
* @return $this
|
75 |
+
*/
|
76 |
+
public function setDate($date)
|
77 |
+
{
|
78 |
+
$this->setTime($date ? strtotime($date) : false);
|
79 |
+
$this->setData('date', $date);
|
80 |
+
return $this;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @return bool|string
|
85 |
+
*/
|
86 |
+
public function getDay()
|
87 |
+
{
|
88 |
+
return $this->getTime() ? date('d', $this->getTime()) : '';
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @return bool|string
|
93 |
+
*/
|
94 |
+
public function getMonth()
|
95 |
+
{
|
96 |
+
return $this->getTime() ? date('m', $this->getTime()) : '';
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @return bool|string
|
101 |
+
*/
|
102 |
+
public function getYear()
|
103 |
+
{
|
104 |
+
return $this->getTime() ? date('Y', $this->getTime()) : '';
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Returns format which will be applied for DOB in javascript
|
109 |
+
*
|
110 |
+
* @return string
|
111 |
+
*/
|
112 |
+
public function getDateFormat()
|
113 |
+
{
|
114 |
+
return Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Add date input html
|
119 |
+
*
|
120 |
+
* @param string $code
|
121 |
+
* @param string $html
|
122 |
+
*/
|
123 |
+
public function setDateInput($code, $html)
|
124 |
+
{
|
125 |
+
$this->_dateInputs[$code] = $html;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Sort date inputs by dateformat order of current locale
|
130 |
+
*
|
131 |
+
* @return string
|
132 |
+
*/
|
133 |
+
public function getSortedDateInputs()
|
134 |
+
{
|
135 |
+
$strtr = array(
|
136 |
+
'%b' => '%1$s',
|
137 |
+
'%B' => '%1$s',
|
138 |
+
'%m' => '%1$s',
|
139 |
+
'%d' => '%2$s',
|
140 |
+
'%e' => '%2$s',
|
141 |
+
'%Y' => '%3$s',
|
142 |
+
'%y' => '%3$s'
|
143 |
+
);
|
144 |
+
|
145 |
+
$dateFormat = preg_replace('/[^\%\w]/', '\\1', $this->getDateFormat());
|
146 |
+
|
147 |
+
return sprintf(strtr($dateFormat, $strtr),
|
148 |
+
$this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);
|
149 |
+
}
|
150 |
+
}
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Class TIG_PostNL_Block_Checkout_Widget_Dob
|
42 |
+
*
|
43 |
+
* @method setFieldIdFormat(String $value) $this
|
44 |
+
* @method setFieldNameFormat(String $value) $this
|
45 |
+
* @method setGenderFieldContents(String $value) $this
|
46 |
+
* @method hasGenderFieldContents() bool
|
47 |
+
* @method getGenderFieldContents() string
|
48 |
+
*/
|
49 |
+
class TIG_PostNL_Block_Checkout_Widget_Dob extends Mage_Customer_Block_Widget_Dob
|
50 |
+
{
|
51 |
+
/**
|
52 |
+
* @var null|TIG_PostNL_Helper_DeliveryOptions
|
53 |
+
*/
|
54 |
+
protected $_helper = null;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return TIG_PostNL_Helper_DeliveryOptions
|
58 |
+
*/
|
59 |
+
protected function getDeliveryOptionsHelper()
|
60 |
+
{
|
61 |
+
if ($this->_helper === null) {
|
62 |
+
$this->_helper = Mage::helper('postnl/deliveryOptions');
|
63 |
+
}
|
64 |
+
|
65 |
+
return $this->_helper;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @return bool
|
70 |
+
*/
|
71 |
+
public function isEnabled()
|
72 |
+
{
|
73 |
+
if (parent::isEnabled()) {
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
|
77 |
+
return $this->isBirthdayCheckShipment();
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @return bool
|
82 |
+
*/
|
83 |
+
public function isRequired()
|
84 |
+
{
|
85 |
+
if (parent::isRequired()) {
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
|
89 |
+
return $this->isBirthdayCheckShipment();
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @return bool
|
94 |
+
*/
|
95 |
+
protected function isBirthdayCheckShipment()
|
96 |
+
{
|
97 |
+
return
|
98 |
+
$this->getDeliveryOptionsHelper()->canUseBirthdayCheckDelivery() &&
|
99 |
+
$this->getDeliveryOptionsHelper()->quoteIsBirthdayCheck();
|
100 |
+
}
|
101 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Core_JsTranslate extends TIG_PostNL_Block_Core_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Core_JsTranslate extends TIG_PostNL_Block_Core_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Core_Order_Returns_Info extends Mage_Sales_Block_Order_Info
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Core_Order_Returns_Info extends Mage_Sales_Block_Order_Info
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipmentCollection()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipmentCollection()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipment()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlShipment()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_Core_Template extends Mage_Core_Block_Template
|
@@ -43,6 +43,50 @@ abstract class TIG_PostNL_Block_Core_Template extends Mage_Core_Block_Template
|
|
43 |
*/
|
44 |
protected $_eventPrefix = 'postnl_core_template';
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
/**
|
47 |
* Renders a template block. Also throws 2 events based on the current event prefix.
|
48 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_Core_Template extends Mage_Core_Block_Template
|
43 |
*/
|
44 |
protected $_eventPrefix = 'postnl_core_template';
|
45 |
|
46 |
+
/**
|
47 |
+
* @var array
|
48 |
+
*/
|
49 |
+
protected $_helpers = array();
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var array
|
53 |
+
*/
|
54 |
+
protected $_models = array();
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @param null $helperName
|
58 |
+
*
|
59 |
+
* @return TIG_PostNL_Helper_Data
|
60 |
+
*/
|
61 |
+
protected function _getHelper($helperName = null)
|
62 |
+
{
|
63 |
+
$helper = 'postnl';
|
64 |
+
|
65 |
+
if ($helperName !== null) {
|
66 |
+
$helper .= '/' . $helperName;
|
67 |
+
}
|
68 |
+
|
69 |
+
if (!array_key_exists($helper, $this->_helpers)) {
|
70 |
+
$this->_helpers[$helper] = Mage::helper($helper);
|
71 |
+
}
|
72 |
+
|
73 |
+
return $this->_helpers[$helper];
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @param $model
|
78 |
+
*
|
79 |
+
* @return false|Mage_Core_Model_Abstract
|
80 |
+
*/
|
81 |
+
protected function _getModel($model)
|
82 |
+
{
|
83 |
+
if (array_key_exists($model, $this->_models)) {
|
84 |
+
return $this->_models[$model];
|
85 |
+
}
|
86 |
+
|
87 |
+
return Mage::getModel($model);
|
88 |
+
}
|
89 |
+
|
90 |
/**
|
91 |
* Renders a template block. Also throws 2 events based on the current event prefix.
|
92 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPhoneNumber()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPhoneNumber()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions setStreetnameField(int $value)
|
@@ -291,6 +291,18 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
291 |
return $postcode;
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
/**
|
295 |
* Get the currently selected shipping address's country.
|
296 |
*
|
@@ -310,11 +322,13 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
310 |
/**
|
311 |
* Get the earliest possible delivery date.
|
312 |
*
|
|
|
|
|
313 |
* @return null|string
|
314 |
*/
|
315 |
-
public function getDeliveryDate()
|
316 |
{
|
317 |
-
$deliveryDate = $this->_deliveryDate;
|
318 |
|
319 |
if ($deliveryDate !== null) {
|
320 |
return $deliveryDate;
|
@@ -326,7 +340,7 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
326 |
$country = $this->getCountry();
|
327 |
|
328 |
try {
|
329 |
-
$deliveryDate = $this->_getDeliveryDate($postcode, $country, $quote);
|
330 |
} catch (Exception $e) {
|
331 |
/** @var TIG_PostNL_Helper_Date $helper */
|
332 |
$helper = Mage::helper('postnl/date');
|
@@ -336,7 +350,8 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
336 |
->format('d-m-Y');
|
337 |
}
|
338 |
|
339 |
-
$this->setDeliveryDate($deliveryDate);
|
|
|
340 |
return $deliveryDate;
|
341 |
}
|
342 |
|
@@ -345,11 +360,13 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
345 |
*
|
346 |
* @param string $deliveryDate
|
347 |
*
|
|
|
|
|
348 |
* @return $this
|
349 |
*/
|
350 |
-
public function setDeliveryDate($deliveryDate)
|
351 |
{
|
352 |
-
$this->_deliveryDate = $deliveryDate;
|
353 |
|
354 |
return $this;
|
355 |
}
|
@@ -540,8 +557,13 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
540 |
return 0;
|
541 |
}
|
542 |
|
543 |
-
|
|
|
|
|
|
|
|
|
544 |
|
|
|
545 |
/** @var TIG_PostNL_Helper_DeliveryOptions_Fee $helper */
|
546 |
$helper = Mage::helper('postnl/deliveryOptions_fee');
|
547 |
return $helper->getPakjeGemakFee($currentRate, $formatted, $includingTax);
|
@@ -634,13 +656,15 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
634 |
/**
|
635 |
* Checks whether PakjeGemak locations are allowed.
|
636 |
*
|
637 |
-
* @
|
|
|
|
|
638 |
*/
|
639 |
-
public function canUsePakjeGemak()
|
640 |
{
|
641 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
642 |
$helper = Mage::helper('postnl/deliveryOptions');
|
643 |
-
$canUsePakjeGemak = $helper->canUsePakjeGemak();
|
644 |
return $canUsePakjeGemak;
|
645 |
}
|
646 |
|
@@ -921,20 +945,31 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
921 |
* @param string $country
|
922 |
* @param Mage_Sales_Model_Quote $quote
|
923 |
*
|
924 |
-
* @
|
925 |
*
|
926 |
* @return string
|
|
|
927 |
*/
|
928 |
-
protected function _getDeliveryDate($postcode, $country, Mage_Sales_Model_Quote $quote)
|
|
|
929 |
$postcode = str_replace(' ', '', strtoupper($postcode));
|
930 |
|
931 |
$validator = new Zend_Validate_PostCode('nl_NL');
|
932 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
933 |
throw new TIG_PostNL_Exception(
|
934 |
$this->__(
|
935 |
-
|
936 |
-
|
937 |
-
$postcode
|
938 |
),
|
939 |
'POSTNL-0131'
|
940 |
);
|
@@ -944,22 +979,43 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
944 |
throw new TIG_PostNL_Exception(
|
945 |
$this->__(
|
946 |
'Invalid country supplied for GetDeliveryDate request: %s. Only "NL" and "BE" are allowed.',
|
947 |
-
$
|
948 |
),
|
949 |
'POSTNL-0235'
|
950 |
);
|
951 |
}
|
952 |
|
|
|
|
|
953 |
/** @var TIG_PostNL_Model_DeliveryOptions_Cif $cif */
|
954 |
-
$cif =
|
955 |
-
$response = $cif->setStoreId(Mage::app()->getStore()->getId())
|
956 |
-
->getDeliveryDate($postcode, $country, $quote);
|
957 |
|
958 |
-
|
959 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
960 |
|
961 |
$dateObject = new DateTime($response, new DateTimeZone('UTC'));
|
962 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
$dateObject->add(new DateInterval("P{$correction}D"));
|
964 |
|
965 |
return $dateObject->format('d-m-Y');
|
@@ -981,4 +1037,21 @@ class TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions extends TIG_Post
|
|
981 |
return parent::escapeHtml($data, $allowedTags);
|
982 |
}
|
983 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions setStreetnameField(int $value)
|
291 |
return $postcode;
|
292 |
}
|
293 |
|
294 |
+
/**
|
295 |
+
* Get the currently inserted shipping address's city.
|
296 |
+
*
|
297 |
+
* @return string
|
298 |
+
*/
|
299 |
+
public function getCity()
|
300 |
+
{
|
301 |
+
$city = $this->getShippingAddress()->getCity();
|
302 |
+
|
303 |
+
return $city;
|
304 |
+
}
|
305 |
+
|
306 |
/**
|
307 |
* Get the currently selected shipping address's country.
|
308 |
*
|
322 |
/**
|
323 |
* Get the earliest possible delivery date.
|
324 |
*
|
325 |
+
* @param string $for delivery or pickup
|
326 |
+
*
|
327 |
* @return null|string
|
328 |
*/
|
329 |
+
public function getDeliveryDate($for = 'delivery')
|
330 |
{
|
331 |
+
$deliveryDate = isset($this->_deliveryDate[$for]) ? $this->_deliveryDate[$for] : null;
|
332 |
|
333 |
if ($deliveryDate !== null) {
|
334 |
return $deliveryDate;
|
340 |
$country = $this->getCountry();
|
341 |
|
342 |
try {
|
343 |
+
$deliveryDate = $this->_getDeliveryDate($postcode, $country, $quote, $for);
|
344 |
} catch (Exception $e) {
|
345 |
/** @var TIG_PostNL_Helper_Date $helper */
|
346 |
$helper = Mage::helper('postnl/date');
|
350 |
->format('d-m-Y');
|
351 |
}
|
352 |
|
353 |
+
$this->setDeliveryDate($deliveryDate, $for);
|
354 |
+
|
355 |
return $deliveryDate;
|
356 |
}
|
357 |
|
360 |
*
|
361 |
* @param string $deliveryDate
|
362 |
*
|
363 |
+
* @param string $for delivery or pickup
|
364 |
+
*
|
365 |
* @return $this
|
366 |
*/
|
367 |
+
public function setDeliveryDate($deliveryDate, $for = 'delivery')
|
368 |
{
|
369 |
+
$this->_deliveryDate[$for] = $deliveryDate;
|
370 |
|
371 |
return $this;
|
372 |
}
|
557 |
return 0;
|
558 |
}
|
559 |
|
560 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
561 |
+
$helper = Mage::helper('postnl');
|
562 |
+
if ($helper->quoteHasIDCheckProducts()) {
|
563 |
+
return 0;
|
564 |
+
}
|
565 |
|
566 |
+
$currentRate = $this->getMethodRate();
|
567 |
/** @var TIG_PostNL_Helper_DeliveryOptions_Fee $helper */
|
568 |
$helper = Mage::helper('postnl/deliveryOptions_fee');
|
569 |
return $helper->getPakjeGemakFee($currentRate, $formatted, $includingTax);
|
656 |
/**
|
657 |
* Checks whether PakjeGemak locations are allowed.
|
658 |
*
|
659 |
+
* @param mixed $country
|
660 |
+
*
|
661 |
+
* @return bool
|
662 |
*/
|
663 |
+
public function canUsePakjeGemak($country = false)
|
664 |
{
|
665 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
666 |
$helper = Mage::helper('postnl/deliveryOptions');
|
667 |
+
$canUsePakjeGemak = $helper->canUsePakjeGemak(false, true, $country);
|
668 |
return $canUsePakjeGemak;
|
669 |
}
|
670 |
|
945 |
* @param string $country
|
946 |
* @param Mage_Sales_Model_Quote $quote
|
947 |
*
|
948 |
+
* @param string $for delivery or pickup
|
949 |
*
|
950 |
* @return string
|
951 |
+
* @throws TIG_PostNL_Exception
|
952 |
*/
|
953 |
+
protected function _getDeliveryDate($postcode, $country, Mage_Sales_Model_Quote $quote, $for)
|
954 |
+
{
|
955 |
$postcode = str_replace(' ', '', strtoupper($postcode));
|
956 |
|
957 |
$validator = new Zend_Validate_PostCode('nl_NL');
|
958 |
+
$validatorBe = new Zend_Validate_PostCode('nl_BE');
|
959 |
+
if (!$validator->isValid($postcode) && !$validatorBe->isValid($postcode)) {
|
960 |
+
$exceptionMessage = 'Invalid postcode supplied for GetDeliveryDate request: '
|
961 |
+
. '%s Postcodes may only contain 4 numbers';
|
962 |
+
|
963 |
+
if ($country == 'NL') {
|
964 |
+
$exceptionMessage .= ' and 2 letters';
|
965 |
+
}
|
966 |
+
|
967 |
+
$exceptionMessage .= '.';
|
968 |
+
|
969 |
throw new TIG_PostNL_Exception(
|
970 |
$this->__(
|
971 |
+
$exceptionMessage,
|
972 |
+
$postcode
|
|
|
973 |
),
|
974 |
'POSTNL-0131'
|
975 |
);
|
979 |
throw new TIG_PostNL_Exception(
|
980 |
$this->__(
|
981 |
'Invalid country supplied for GetDeliveryDate request: %s. Only "NL" and "BE" are allowed.',
|
982 |
+
$country
|
983 |
),
|
984 |
'POSTNL-0235'
|
985 |
);
|
986 |
}
|
987 |
|
988 |
+
$storeId = Mage::app()->getStore()->getId();
|
989 |
+
|
990 |
/** @var TIG_PostNL_Model_DeliveryOptions_Cif $cif */
|
991 |
+
$cif = $this->_getModel('postnl_deliveryoptions/cif');
|
|
|
|
|
992 |
|
993 |
+
$response = $cif->setStoreId($storeId)
|
994 |
+
->getDeliveryDate($postcode, $country, $quote, $for);
|
995 |
+
|
996 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
997 |
+
$deliveryOptionsHelper = $this->_getHelper('deliveryOptions');
|
998 |
+
|
999 |
+
/** @var TIG_PostNL_Helper_Date $dateHelper */
|
1000 |
+
$dateHelper = $this->_getHelper('date');
|
1001 |
|
1002 |
$dateObject = new DateTime($response, new DateTimeZone('UTC'));
|
1003 |
+
|
1004 |
+
/**
|
1005 |
+
* If we are after the cutoff time, the deliverydate webservice will return the next day if sameday is
|
1006 |
+
* enabled. That's why we need to add a day. The getDeliveryDateCorrection will check if it is
|
1007 |
+
* not in the weekend etc.
|
1008 |
+
*/
|
1009 |
+
if (
|
1010 |
+
$country == 'NL' &&
|
1011 |
+
$deliveryOptionsHelper->canUseSameDayDelivery() &&
|
1012 |
+
$dateHelper->isPastCutOff($dateObject, $storeId) &&
|
1013 |
+
$for == 'pickup'
|
1014 |
+
) {
|
1015 |
+
$dateObject->add(new DateInterval("P1D"));
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
$correction = $dateHelper->getDeliveryDateCorrection($dateObject);
|
1019 |
$dateObject->add(new DateInterval("P{$correction}D"));
|
1020 |
|
1021 |
return $dateObject->format('d-m-Y');
|
1037 |
return parent::escapeHtml($data, $allowedTags);
|
1038 |
}
|
1039 |
}
|
1040 |
+
|
1041 |
+
/**
|
1042 |
+
* @param $type
|
1043 |
+
*
|
1044 |
+
* @return DateTime
|
1045 |
+
*/
|
1046 |
+
public function getCutOff($type)
|
1047 |
+
{
|
1048 |
+
/** @var $storeId */
|
1049 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
1050 |
+
$storeId = Mage::app()->getStore()->getStoreId();
|
1051 |
+
|
1052 |
+
/** @var TIG_PostNL_Helper_Date $helper */
|
1053 |
+
$helper = $this->_getHelper('date');
|
1054 |
+
|
1055 |
+
return $helper->getCutOff($storeId, $type);
|
1056 |
+
}
|
1057 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_DeliveryOptions_Checkout_GoMage_LightCheckout_DeliveryOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_DeliveryOptions_Checkout_GoMage_LightCheckout_DeliveryOptions
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Block_DeliveryOptions_Checkout_IdCheck extends Mage_Core_Block_Template
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @var null|TIG_PostNL_Model_Core_Order
|
43 |
+
*/
|
44 |
+
protected $_order = null;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @return mixed
|
48 |
+
* @throws Zend_Locale_Exception
|
49 |
+
*/
|
50 |
+
public function getMonthList()
|
51 |
+
{
|
52 |
+
$localeCode = Mage::app()->getLocale()->getLocaleCode();
|
53 |
+
$months = Zend_Locale_Data::getList($localeCode, 'months');
|
54 |
+
|
55 |
+
return $months['format']['wide'];
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @return TIG_PostNL_Model_Core_Order
|
60 |
+
*/
|
61 |
+
public function getPostnlOrder()
|
62 |
+
{
|
63 |
+
if ($this->_order === null) {
|
64 |
+
$session = Mage::getSingleton('checkout/session');
|
65 |
+
$quote_id = $session->getQuoteId();
|
66 |
+
|
67 |
+
$this->_order = Mage::getModel('postnl_core/order')->load($quote_id, 'quote_id');
|
68 |
+
}
|
69 |
+
|
70 |
+
return $this->_order;
|
71 |
+
}
|
72 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_DeliveryOptions_Checkout_Progress extends TIG_PostNL_Block_DeliveryOptions_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_DeliveryOptions_Checkout_Progress extends TIG_PostNL_Block_DeliveryOptions_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasApiKey()
|
@@ -71,6 +71,18 @@ class TIG_PostNL_Block_DeliveryOptions_Js extends TIG_PostNL_Block_DeliveryOptio
|
|
71 |
return $apiKey;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* Render the template if allowed.
|
76 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasApiKey()
|
71 |
return $apiKey;
|
72 |
}
|
73 |
|
74 |
+
/**
|
75 |
+
* @return string
|
76 |
+
*/
|
77 |
+
public function getVersion()
|
78 |
+
{
|
79 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
80 |
+
$helper = Mage::helper('postnl');
|
81 |
+
$version = $helper->getModuleVersion();
|
82 |
+
|
83 |
+
return $version;
|
84 |
+
}
|
85 |
+
|
86 |
/**
|
87 |
* Render the template if allowed.
|
88 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasApiKey()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasApiKey()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_DeliveryOptions_Template extends TIG_PostNL_Block_Core_Template
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Block_DeliveryOptions_Template extends TIG_PostNL_Block_Core_Template
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsOsc()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsOsc()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasCanShowNotification()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasCanShowNotification()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsTestMode()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Object getTotal()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Object getTotal()
|
@@ -33,16 +33,11 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Form_Cod extends Mage_Payment_Block_Form
|
40 |
{
|
41 |
-
/**
|
42 |
-
* Xpath to the 'allow_for_buspakje' configuration setting.
|
43 |
-
*/
|
44 |
-
const XPATH_ALLOW_FOR_BUSPAKJE = 'payment/postnl_cod/allow_for_buspakje';
|
45 |
-
|
46 |
/**
|
47 |
* @var string
|
48 |
*/
|
@@ -72,44 +67,6 @@ class TIG_PostNL_Block_Payment_Form_Cod extends Mage_Payment_Block_Form
|
|
72 |
return $this->_instructions;
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* Check if the PostNL COD payment method may be shown for letter box parcel orders.
|
77 |
-
*
|
78 |
-
* @return boolean
|
79 |
-
*/
|
80 |
-
public function canShowForBuspakje()
|
81 |
-
{
|
82 |
-
/**
|
83 |
-
* Check the configuration setting.
|
84 |
-
*/
|
85 |
-
$showForBuspakje = Mage::getStoreConfigFlag(self::XPATH_ALLOW_FOR_BUSPAKJE, Mage::app()->getStore()->getId());
|
86 |
-
if ($showForBuspakje) {
|
87 |
-
return true;
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Check if the buspakje calculation mode is set to automatic.
|
92 |
-
*/
|
93 |
-
/** @var TIG_PostNL_Helper_Data $helper */
|
94 |
-
$helper = Mage::helper('postnl');
|
95 |
-
$calculationMode = $helper->getBuspakjeCalculationMode();
|
96 |
-
if ($calculationMode != 'automatic') {
|
97 |
-
return true;
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Check if the current quote fits as a letter box parcel.
|
102 |
-
*/
|
103 |
-
/** @var Mage_Checkout_Model_Session $session */
|
104 |
-
$session = Mage::getSingleton('checkout/session');
|
105 |
-
$quote = $session->getQuote();
|
106 |
-
if (!$helper->fitsAsBuspakje($quote->getAllItems())) {
|
107 |
-
return true;
|
108 |
-
}
|
109 |
-
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
/**
|
114 |
* Renders a template block. Also throws 2 events based on the current event prefix.
|
115 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Form_Cod extends Mage_Payment_Block_Form
|
40 |
{
|
|
|
|
|
|
|
|
|
|
|
41 |
/**
|
42 |
* @var string
|
43 |
*/
|
67 |
return $this->_instructions;
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
/**
|
71 |
* Renders a template block. Also throws 2 events based on the current event prefix.
|
72 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Info extends Mage_Payment_Block_Info
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Info extends Mage_Payment_Block_Info
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Creditmemo_Totals_CodFee extends Mage_Sales_Block_Order_Creditmemo_Totals
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Creditmemo_Totals_CodFee extends Mage_Sales_Block_Order_Creditmemo_Totals
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Invoice_Totals_CodFee extends Mage_Sales_Block_Order_Invoice_Totals
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Invoice_Totals_CodFee extends Mage_Sales_Block_Order_Invoice_Totals
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Totals_CodFee extends Mage_Sales_Block_Order_Totals
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Block_Payment_Sales_Order_Totals_CodFee extends Mage_Sales_Block_Order_Totals
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Controller_Adminhtml_Abstract extends Mage_Adminhtml_Controller_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Controller_Adminhtml_Abstract extends Mage_Adminhtml_Controller_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Adminhtml_Config extends TIG_PostNL_Controller_Adminhtml_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Adminhtml_Config extends TIG_PostNL_Controller_Adminhtml_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Adminhtml_Shipment extends TIG_PostNL_Controller_Adminhtml_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Adminhtml_Shipment extends TIG_PostNL_Controller_Adminhtml_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Sales extends Mage_Core_Controller_Front_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Controller_Sales extends Mage_Core_Controller_Front_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* General exception class for TIG_PostNL extension
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* General exception class for TIG_PostNL extension
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_AddressValidation extends TIG_PostNL_Helper_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Adminhtml extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Adminhtml extends TIG_PostNL_Helper_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Carrier extends TIG_PostNL_Helper_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Checkout extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Checkout extends TIG_PostNL_Helper_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -380,18 +380,20 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
|
|
380 |
* @param boolean $flat
|
381 |
* @param string|bool $destination
|
382 |
*
|
|
|
|
|
383 |
* @return array
|
384 |
*/
|
385 |
-
public function getPakjeGemakProductCodes($flat = true, $destination = false)
|
386 |
{
|
387 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions $pakjeGemakProductCodes */
|
388 |
$pakjeGemakProductCodes = Mage::getSingleton('postnl_core/system_config_source_pakjeGemakProductOptions');
|
389 |
|
390 |
if ($destination == 'BE') {
|
391 |
-
return $pakjeGemakProductCodes->getAvailableBeOptions($flat);
|
392 |
}
|
393 |
|
394 |
-
return $pakjeGemakProductCodes->getAvailableOptions($flat);
|
395 |
}
|
396 |
|
397 |
/**
|
@@ -546,6 +548,78 @@ class TIG_PostNL_Helper_Cif extends TIG_PostNL_Helper_Data
|
|
546 |
return $cooledProductCodes->getAvailableSameDayOptions($flat);
|
547 |
}
|
548 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
/**
|
550 |
* Get an array of possible shipment types
|
551 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
380 |
* @param boolean $flat
|
381 |
* @param string|bool $destination
|
382 |
*
|
383 |
+
* @param string $group
|
384 |
+
*
|
385 |
* @return array
|
386 |
*/
|
387 |
+
public function getPakjeGemakProductCodes($flat = true, $destination = false, $group = 'default')
|
388 |
{
|
389 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions $pakjeGemakProductCodes */
|
390 |
$pakjeGemakProductCodes = Mage::getSingleton('postnl_core/system_config_source_pakjeGemakProductOptions');
|
391 |
|
392 |
if ($destination == 'BE') {
|
393 |
+
return $pakjeGemakProductCodes->getAvailableBeOptions($flat, $group);
|
394 |
}
|
395 |
|
396 |
+
return $pakjeGemakProductCodes->getAvailableOptions($flat, $group);
|
397 |
}
|
398 |
|
399 |
/**
|
548 |
return $cooledProductCodes->getAvailableSameDayOptions($flat);
|
549 |
}
|
550 |
|
551 |
+
/**
|
552 |
+
* @param bool $flat
|
553 |
+
*
|
554 |
+
* @return mixed
|
555 |
+
*/
|
556 |
+
public function getAgeCheckProductCodes($flat = true)
|
557 |
+
{
|
558 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_AgeCheckProductOptions $productCode */
|
559 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_ageCheckProductOptions');
|
560 |
+
return $productCodes->getAvailableOptions($flat);
|
561 |
+
}
|
562 |
+
|
563 |
+
/**
|
564 |
+
* @param bool $flat
|
565 |
+
*
|
566 |
+
* @return mixed
|
567 |
+
*/
|
568 |
+
public function getAgeCheckPakjegemakProductCodes($flat = true)
|
569 |
+
{
|
570 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_AgeCheckProductOptions $productCode */
|
571 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_ageCheckPakjegemakProductOptions');
|
572 |
+
return $productCodes->getAvailableOptions($flat);
|
573 |
+
}
|
574 |
+
|
575 |
+
/**
|
576 |
+
* @param bool $flat
|
577 |
+
*
|
578 |
+
* @return mixed
|
579 |
+
*/
|
580 |
+
public function getBirthdayCheckProductCodes($flat = true)
|
581 |
+
{
|
582 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckProductOptions $productCode */
|
583 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_birthdayCheckProductOptions');
|
584 |
+
return $productCodes->getAvailableOptions($flat);
|
585 |
+
}
|
586 |
+
|
587 |
+
/**
|
588 |
+
* @param bool $flat
|
589 |
+
*
|
590 |
+
* @return mixed
|
591 |
+
*/
|
592 |
+
public function getBirthdayCheckPakjegemakProductCodes($flat = true)
|
593 |
+
{
|
594 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckProductOptions $productCode */
|
595 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_birthdayCheckPakjegemakProductOptions');
|
596 |
+
return $productCodes->getAvailableOptions($flat);
|
597 |
+
}
|
598 |
+
|
599 |
+
/**
|
600 |
+
* @param bool $flat
|
601 |
+
*
|
602 |
+
* @return mixed
|
603 |
+
*/
|
604 |
+
public function getIDCheckProductCodes($flat = true)
|
605 |
+
{
|
606 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_IdCheckProductOptions $productCode */
|
607 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_idCheckProductOptions');
|
608 |
+
return $productCodes->getAvailableOptions($flat);
|
609 |
+
}
|
610 |
+
|
611 |
+
/**
|
612 |
+
* @param bool $flat
|
613 |
+
*
|
614 |
+
* @return mixed
|
615 |
+
*/
|
616 |
+
public function getIDCheckPakjegemakProductCodes($flat = true)
|
617 |
+
{
|
618 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_IdCheckProductOptions $productCode */
|
619 |
+
$productCodes = Mage::getSingleton('postnl_core/system_config_source_idCheckPakjegemakProductOptions');
|
620 |
+
return $productCodes->getAvailableOptions($flat);
|
621 |
+
}
|
622 |
+
|
623 |
/**
|
624 |
* Get an array of possible shipment types
|
625 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
@@ -93,6 +93,11 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
93 |
*/
|
94 |
const XPATH_ALLOW_EPS_BE_ONLY_OPTION = 'postnl/cif_product_options/allow_eps_be_only_options';
|
95 |
|
|
|
|
|
|
|
|
|
|
|
96 |
/**
|
97 |
* XML path to weight unit used
|
98 |
*/
|
@@ -154,6 +159,11 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
154 |
*/
|
155 |
const XPATH_SENDER_COUNTRY = 'postnl/cif_address/country';
|
156 |
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* Required configuration fields.
|
159 |
*
|
@@ -674,7 +684,7 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
674 |
}
|
675 |
|
676 |
/**
|
677 |
-
* Checks to see if the module may ship to the Netherlands using PostNL standard shipments.
|
678 |
*
|
679 |
* @return boolean
|
680 |
*/
|
@@ -686,12 +696,44 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
686 |
return $cache->getPostnlCoreCanUseStandard();
|
687 |
}
|
688 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
689 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_StandardProductOptions $standardProductOptionsModel */
|
690 |
$standardProductOptionsModel = Mage::getModel('postnl_core/system_config_source_standardProductOptions');
|
691 |
-
$standardProductOptions = $standardProductOptionsModel->getAvailableOptions();
|
692 |
if (empty($standardProductOptions)) {
|
693 |
if ($cache) {
|
694 |
-
$cache
|
695 |
->saveCache();
|
696 |
}
|
697 |
|
@@ -699,7 +741,7 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
699 |
}
|
700 |
|
701 |
if ($cache) {
|
702 |
-
$cache
|
703 |
->saveCache();
|
704 |
}
|
705 |
|
@@ -709,23 +751,45 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
709 |
/**
|
710 |
* Checks to see if the module may ship using PakjeGemak.
|
711 |
*
|
712 |
-
* @
|
|
|
|
|
713 |
*/
|
714 |
-
public function canUsePakjeGemak()
|
715 |
{
|
716 |
$cache = $this->getCache();
|
717 |
|
718 |
-
|
719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
}
|
721 |
|
722 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions $pakjeGemakProductoptionsModel */
|
723 |
$pakjeGemakProductoptionsModel = Mage::getModel('postnl_core/system_config_source_pakjeGemakProductOptions');
|
724 |
-
$pakjeGemakProductoptions = $pakjeGemakProductoptionsModel->
|
725 |
|
726 |
if (empty($pakjeGemakProductoptions)) {
|
727 |
if ($cache) {
|
728 |
-
$cache
|
729 |
->saveCache();
|
730 |
}
|
731 |
|
@@ -733,7 +797,7 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
733 |
}
|
734 |
|
735 |
if ($cache) {
|
736 |
-
$cache
|
737 |
->saveCache();
|
738 |
}
|
739 |
return true;
|
@@ -888,6 +952,35 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
888 |
return $epsBeOnlyOptionAllowed;
|
889 |
}
|
890 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
/**
|
892 |
* Save state of configuration field sets
|
893 |
*
|
@@ -985,6 +1078,13 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
985 |
return false;
|
986 |
}
|
987 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
988 |
/**
|
989 |
* If the buspakje calculation mode is set to 'manual', no further checks are required as the regular delivery
|
990 |
* option rules will apply.
|
@@ -1080,6 +1180,118 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
1080 |
return $foodType;
|
1081 |
}
|
1082 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1083 |
/**
|
1084 |
* Gets the currently configured buspakje calculation mode.
|
1085 |
*
|
@@ -2797,6 +3009,44 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
2797 |
return $errorMessage;
|
2798 |
}
|
2799 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2800 |
/**
|
2801 |
* Checks to see if we can show error details (error code and knowledgebase link) in the frontend when an error
|
2802 |
* occurs.
|
@@ -2823,6 +3073,39 @@ class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
|
2823 |
return false;
|
2824 |
}
|
2825 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2826 |
/**
|
2827 |
* Save the stored time zones to the PostNl cache.
|
2828 |
*/
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
|
93 |
*/
|
94 |
const XPATH_ALLOW_EPS_BE_ONLY_OPTION = 'postnl/cif_product_options/allow_eps_be_only_options';
|
95 |
|
96 |
+
/**
|
97 |
+
* XPATH to the allow Pakjegemak not insured setting.
|
98 |
+
*/
|
99 |
+
const XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED = 'postnl/cif_product_options/allow_pakjegemak_not_insured';
|
100 |
+
|
101 |
/**
|
102 |
* XML path to weight unit used
|
103 |
*/
|
159 |
*/
|
160 |
const XPATH_SENDER_COUNTRY = 'postnl/cif_address/country';
|
161 |
|
162 |
+
/**
|
163 |
+
* Xpath to the used checkout extension
|
164 |
+
*/
|
165 |
+
const XPATH_CHECKOUT_EXTENSION = 'postnl/cif_labels_and_confirming/checkout_extension';
|
166 |
+
|
167 |
/**
|
168 |
* Required configuration fields.
|
169 |
*
|
684 |
}
|
685 |
|
686 |
/**
|
687 |
+
* Checks to see if the module may ship to the Netherlands or Belgium using PostNL standard shipments.
|
688 |
*
|
689 |
* @return boolean
|
690 |
*/
|
696 |
return $cache->getPostnlCoreCanUseStandard();
|
697 |
}
|
698 |
|
699 |
+
$canUseStandardNL = $this->canUseStandardForCountry('NL');
|
700 |
+
$canUseStandardBE = $this->canUseStandardForCountry('BE');
|
701 |
+
|
702 |
+
$result = $canUseStandardNL || $canUseStandardBE;
|
703 |
+
|
704 |
+
if ($cache) {
|
705 |
+
$cache->setPostnlCoreCanUseStandard($result)
|
706 |
+
->saveCache();
|
707 |
+
}
|
708 |
+
|
709 |
+
return $result;
|
710 |
+
}
|
711 |
+
|
712 |
+
/**
|
713 |
+
* Checks to see if the module may ship to the Netherlands using PostNL standard shipments.
|
714 |
+
*
|
715 |
+
* @param $country
|
716 |
+
*
|
717 |
+
* @return bool
|
718 |
+
*/
|
719 |
+
public function canUseStandardForCountry($country)
|
720 |
+
{
|
721 |
+
$cache = $this->getCache();
|
722 |
+
|
723 |
+
$hasPostnlCoreCanUseStandard = 'hasPostnlCoreCanUseStandard' . $country;
|
724 |
+
$getPostnlCoreCanUseStandard = 'getPostnlCoreCanUseStandard' . $country;
|
725 |
+
$setPostnlCoreCanUseStandard = 'setPostnlCoreCanUseStandard' . $country;
|
726 |
+
|
727 |
+
if ($cache && $cache->$hasPostnlCoreCanUseStandard()) {
|
728 |
+
return $cache->$getPostnlCoreCanUseStandard();
|
729 |
+
}
|
730 |
+
|
731 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_StandardProductOptions $standardProductOptionsModel */
|
732 |
$standardProductOptionsModel = Mage::getModel('postnl_core/system_config_source_standardProductOptions');
|
733 |
+
$standardProductOptions = $standardProductOptionsModel->getAvailableOptions(false, $country);
|
734 |
if (empty($standardProductOptions)) {
|
735 |
if ($cache) {
|
736 |
+
$cache->$setPostnlCoreCanUseStandard(false)
|
737 |
->saveCache();
|
738 |
}
|
739 |
|
741 |
}
|
742 |
|
743 |
if ($cache) {
|
744 |
+
$cache->$setPostnlCoreCanUseStandard(true)
|
745 |
->saveCache();
|
746 |
}
|
747 |
|
751 |
/**
|
752 |
* Checks to see if the module may ship using PakjeGemak.
|
753 |
*
|
754 |
+
* @param mixed $country
|
755 |
+
*
|
756 |
+
* @return bool
|
757 |
*/
|
758 |
+
public function canUsePakjeGemak($country = false)
|
759 |
{
|
760 |
$cache = $this->getCache();
|
761 |
|
762 |
+
$setPostnlCoreCanUsePakjeGemak = 'setPostnlCoreCanUsePakjeGemak';
|
763 |
+
$hasPostnlCoreCanUsePakjeGemak = 'hasPostnlCoreCanUsePakjeGemak';
|
764 |
+
$getPostnlCoreCanUsePakjeGemak = 'getPostnlCoreCanUsePakjeGemak';
|
765 |
+
|
766 |
+
if ($country) {
|
767 |
+
$setPostnlCoreCanUsePakjeGemak .= $country;
|
768 |
+
$hasPostnlCoreCanUsePakjeGemak .= $country;
|
769 |
+
$getPostnlCoreCanUsePakjeGemak .= $country;
|
770 |
+
}
|
771 |
+
|
772 |
+
if ($cache && $cache->$hasPostnlCoreCanUsePakjeGemak()) {
|
773 |
+
return $cache->$getPostnlCoreCanUsePakjeGemak();
|
774 |
+
}
|
775 |
+
|
776 |
+
$options = array(
|
777 |
+
'isCod' => false,
|
778 |
+
);
|
779 |
+
|
780 |
+
if ($country) {
|
781 |
+
$options['countryLimitation'] = $country;
|
782 |
+
} else {
|
783 |
+
$options['isBelgiumOnly'] = false;
|
784 |
}
|
785 |
|
786 |
/** @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions $pakjeGemakProductoptionsModel */
|
787 |
$pakjeGemakProductoptionsModel = Mage::getModel('postnl_core/system_config_source_pakjeGemakProductOptions');
|
788 |
+
$pakjeGemakProductoptions = $pakjeGemakProductoptionsModel->getOptions($options, false, true);
|
789 |
|
790 |
if (empty($pakjeGemakProductoptions)) {
|
791 |
if ($cache) {
|
792 |
+
$cache->$setPostnlCoreCanUsePakjeGemak(false)
|
793 |
->saveCache();
|
794 |
}
|
795 |
|
797 |
}
|
798 |
|
799 |
if ($cache) {
|
800 |
+
$cache->$setPostnlCoreCanUsePakjeGemak(true)
|
801 |
->saveCache();
|
802 |
}
|
803 |
return true;
|
952 |
return $epsBeOnlyOptionAllowed;
|
953 |
}
|
954 |
|
955 |
+
/**
|
956 |
+
* Checks if the productcode 4936 is allowed.
|
957 |
+
*
|
958 |
+
* @param bool $storeId
|
959 |
+
*
|
960 |
+
* @return bool
|
961 |
+
*/
|
962 |
+
public function canUsePakjegemakBeNotInsured($storeId = false)
|
963 |
+
{
|
964 |
+
$cache = $this->getCache();
|
965 |
+
|
966 |
+
if ($cache && $cache->hasPostnlCoreCanUsePakjegemakNotInsured()) {
|
967 |
+
return $cache->getPostnlCoreCanUsePakjegemakNotInsured();
|
968 |
+
}
|
969 |
+
|
970 |
+
if ($storeId === false) {
|
971 |
+
$storeId = Mage::app()->getStore()->getId();
|
972 |
+
}
|
973 |
+
|
974 |
+
$pakjegemakNotInsuredAllowed = Mage::getStoreConfigFlag(self::XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED, $storeId);
|
975 |
+
|
976 |
+
if ($cache) {
|
977 |
+
$cache->setPostnlCoreCanUsePakjegemakNotInsured($pakjegemakNotInsuredAllowed)
|
978 |
+
->saveCache();
|
979 |
+
}
|
980 |
+
|
981 |
+
return $pakjegemakNotInsuredAllowed;
|
982 |
+
}
|
983 |
+
|
984 |
/**
|
985 |
* Save state of configuration field sets
|
986 |
*
|
1078 |
return false;
|
1079 |
}
|
1080 |
|
1081 |
+
/**
|
1082 |
+
* ID Check orders are never letter box parcels.
|
1083 |
+
*/
|
1084 |
+
if ($this->quoteHasIDCheckProducts($quote)) {
|
1085 |
+
return false;
|
1086 |
+
}
|
1087 |
+
|
1088 |
/**
|
1089 |
* If the buspakje calculation mode is set to 'manual', no further checks are required as the regular delivery
|
1090 |
* option rules will apply.
|
1180 |
return $foodType;
|
1181 |
}
|
1182 |
|
1183 |
+
/**
|
1184 |
+
* @param Mage_Sales_Model_Quote $quote
|
1185 |
+
*
|
1186 |
+
* @return bool|mixed
|
1187 |
+
*/
|
1188 |
+
public function quoteHasIDCheckProducts(Mage_Sales_Model_Quote $quote = null)
|
1189 |
+
{
|
1190 |
+
if ($quote === null) {
|
1191 |
+
$quote = $this->getQuote();
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
$registryKey = 'postnl_quote_has_id_check_products_' . $quote->getId();
|
1195 |
+
if (Mage::registry($registryKey) !== null) {
|
1196 |
+
return Mage::registry($registryKey);
|
1197 |
+
}
|
1198 |
+
|
1199 |
+
if ($this->quoteIsAgeCheck($quote)) {
|
1200 |
+
Mage::registry($registryKey, true);
|
1201 |
+
return true;
|
1202 |
+
}
|
1203 |
+
|
1204 |
+
if ($this->quoteIsBirthdayCheck($quote)) {
|
1205 |
+
Mage::registry($registryKey, true);
|
1206 |
+
return true;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
if ($this->quoteIsIDCheck($quote)) {
|
1210 |
+
Mage::registry($registryKey, true);
|
1211 |
+
return true;
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
return false;
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
/**
|
1218 |
+
* Check if this quote has a ID Check product.
|
1219 |
+
*
|
1220 |
+
* @param Mage_Sales_Model_Quote $quote
|
1221 |
+
*
|
1222 |
+
* @return bool|mixed
|
1223 |
+
*/
|
1224 |
+
public function quoteIsIDCheck(Mage_Sales_Model_Quote $quote = null)
|
1225 |
+
{
|
1226 |
+
if ($quote === null) {
|
1227 |
+
$quote = $this->getQuote();
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
$registryKey = 'postnl_quote_is_id_check_' . $quote->getId();
|
1231 |
+
if (Mage::registry($registryKey) !== null) {
|
1232 |
+
return Mage::registry($registryKey);
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
1236 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
1237 |
+
$result = $this->_hasQuotePostnlProductType($deliveryOptionsHelper::IDCHECK_TYPE_ID, $quote);
|
1238 |
+
|
1239 |
+
Mage::register($registryKey, $result);
|
1240 |
+
return $result;
|
1241 |
+
}
|
1242 |
+
|
1243 |
+
/**
|
1244 |
+
* Check if this quote has a Age Check product.
|
1245 |
+
*
|
1246 |
+
* @param Mage_Sales_Model_Quote $quote
|
1247 |
+
*
|
1248 |
+
* @return bool|mixed
|
1249 |
+
*/
|
1250 |
+
public function quoteIsAgeCheck(Mage_Sales_Model_Quote $quote = null)
|
1251 |
+
{
|
1252 |
+
if ($quote === null) {
|
1253 |
+
$quote = $this->getQuote();
|
1254 |
+
}
|
1255 |
+
|
1256 |
+
$registryKey = 'postnl_quote_is_age_check_' . $quote->getId();
|
1257 |
+
if (Mage::registry($registryKey) !== null) {
|
1258 |
+
return Mage::registry($registryKey);
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
1262 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
1263 |
+
$result = $this->_hasQuotePostnlProductType($deliveryOptionsHelper::IDCHECK_TYPE_AGE, $quote);
|
1264 |
+
|
1265 |
+
Mage::register($registryKey, $result);
|
1266 |
+
return $result;
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
/**
|
1270 |
+
* Check if this quote has a Age Check product.
|
1271 |
+
*
|
1272 |
+
* @param Mage_Sales_Model_Quote $quote
|
1273 |
+
*
|
1274 |
+
* @return bool|mixed
|
1275 |
+
*/
|
1276 |
+
public function quoteIsBirthdayCheck(Mage_Sales_Model_Quote $quote = null)
|
1277 |
+
{
|
1278 |
+
if ($quote === null) {
|
1279 |
+
$quote = $this->getQuote();
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
$registryKey = 'postnl_quote_is_birthday_check_' . $quote->getId();
|
1283 |
+
if (Mage::registry($registryKey) !== null) {
|
1284 |
+
return Mage::registry($registryKey);
|
1285 |
+
}
|
1286 |
+
|
1287 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
1288 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
1289 |
+
$result = $this->_hasQuotePostnlProductType($deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY, $quote);
|
1290 |
+
|
1291 |
+
Mage::register($registryKey, $result);
|
1292 |
+
return $result;
|
1293 |
+
}
|
1294 |
+
|
1295 |
/**
|
1296 |
* Gets the currently configured buspakje calculation mode.
|
1297 |
*
|
3009 |
return $errorMessage;
|
3010 |
}
|
3011 |
|
3012 |
+
/**
|
3013 |
+
* @param null $quote
|
3014 |
+
*
|
3015 |
+
* @return bool
|
3016 |
+
*/
|
3017 |
+
public function getQuoteIdCheckType($quote = null)
|
3018 |
+
{
|
3019 |
+
if ($quote === null) {
|
3020 |
+
$quote = $this->getQuote();
|
3021 |
+
}
|
3022 |
+
|
3023 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
3024 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
3025 |
+
|
3026 |
+
$shipmentType = false;
|
3027 |
+
if ($this->quoteIsAgeCheck($quote)) {
|
3028 |
+
$shipmentType = $deliveryOptionsHelper::IDCHECK_TYPE_AGE;
|
3029 |
+
}
|
3030 |
+
|
3031 |
+
if ($this->quoteIsBirthdayCheck($quote)) {
|
3032 |
+
$shipmentType = $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY;
|
3033 |
+
}
|
3034 |
+
|
3035 |
+
if ($this->quoteIsIdCheck($quote)) {
|
3036 |
+
$shipmentType = $deliveryOptionsHelper::IDCHECK_TYPE_ID;
|
3037 |
+
}
|
3038 |
+
|
3039 |
+
return $shipmentType;
|
3040 |
+
}
|
3041 |
+
|
3042 |
+
/**
|
3043 |
+
* @return bool
|
3044 |
+
*/
|
3045 |
+
public function isIdevOsc()
|
3046 |
+
{
|
3047 |
+
return Mage::getStoreConfig(self::XPATH_CHECKOUT_EXTENSION) == 'idev_onestepcheckout';
|
3048 |
+
}
|
3049 |
+
|
3050 |
/**
|
3051 |
* Checks to see if we can show error details (error code and knowledgebase link) in the frontend when an error
|
3052 |
* occurs.
|
3073 |
return false;
|
3074 |
}
|
3075 |
|
3076 |
+
/**
|
3077 |
+
* @param array|string $types
|
3078 |
+
* @param Mage_Sales_Model_Quote $quote
|
3079 |
+
*
|
3080 |
+
* @return bool
|
3081 |
+
*/
|
3082 |
+
protected function _hasQuotePostnlProductType($types, Mage_Sales_Model_Quote $quote = null)
|
3083 |
+
{
|
3084 |
+
if (!is_array($types)) {
|
3085 |
+
$types = array($types);
|
3086 |
+
}
|
3087 |
+
|
3088 |
+
if ($quote === null) {
|
3089 |
+
$quote = $this->getQuote();
|
3090 |
+
}
|
3091 |
+
|
3092 |
+
$quoteHasIDCheckType = false;
|
3093 |
+
/** @var Mage_Sales_Model_Quote_Item $quoteItem */
|
3094 |
+
foreach ($quote->getAllItems() as $quoteItem) {
|
3095 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
3096 |
+
$postnlProductType = $quoteItem->getProduct()->getPostnlProductType();
|
3097 |
+
|
3098 |
+
foreach ($types as $type) {
|
3099 |
+
if ($postnlProductType == $type) {
|
3100 |
+
$quoteHasIDCheckType = true;
|
3101 |
+
break;
|
3102 |
+
}
|
3103 |
+
}
|
3104 |
+
}
|
3105 |
+
|
3106 |
+
return $quoteHasIDCheckType;
|
3107 |
+
}
|
3108 |
+
|
3109 |
/**
|
3110 |
* Save the stored time zones to the PostNl cache.
|
3111 |
*/
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
@@ -312,12 +312,16 @@ class TIG_PostNL_Helper_Date extends TIG_PostNL_Helper_DeliveryOptions
|
|
312 |
/**
|
313 |
* Gets the shipping date calculated from the supplied deliveryDate.
|
314 |
*
|
315 |
-
* @param
|
316 |
-
* @param
|
|
|
|
|
317 |
*
|
318 |
* @return DateTime
|
|
|
|
|
319 |
*/
|
320 |
-
public function getShippingDateFromDeliveryDate($deliveryDate, $storeId)
|
321 |
{
|
322 |
/**
|
323 |
* Get required config values and date object.
|
@@ -342,10 +346,19 @@ class TIG_PostNL_Helper_Date extends TIG_PostNL_Helper_DeliveryOptions
|
|
342 |
}
|
343 |
}
|
344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
/**
|
346 |
* Substract the delivery delay from the delivery date to get to the shipping date.
|
347 |
*/
|
348 |
-
$dateObject->sub(new DateInterval("P{$
|
349 |
|
350 |
/**
|
351 |
* If the projected shipping date is not a valid shipping date, substract 1 day and check again.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
312 |
/**
|
313 |
* Gets the shipping date calculated from the supplied deliveryDate.
|
314 |
*
|
315 |
+
* @param $deliveryDate
|
316 |
+
* @param $storeId
|
317 |
+
*
|
318 |
+
* @param bool $isPGBE
|
319 |
*
|
320 |
* @return DateTime
|
321 |
+
* @note In the future this could be refactored to use this:
|
322 |
+
* https://developer.postnl.nl/apis/deliverydate-webservice/documentation#toc-10
|
323 |
*/
|
324 |
+
public function getShippingDateFromDeliveryDate($deliveryDate, $storeId, $isPGBE = false)
|
325 |
{
|
326 |
/**
|
327 |
* Get required config values and date object.
|
346 |
}
|
347 |
}
|
348 |
|
349 |
+
$deliveryDelay = $this->_postnlDeliveryDelay;
|
350 |
+
|
351 |
+
/**
|
352 |
+
* PG BE defaults to a delivery delay of 2 days, no exceptions.
|
353 |
+
*/
|
354 |
+
if ($isPGBE) {
|
355 |
+
$deliveryDelay = 2;
|
356 |
+
}
|
357 |
+
|
358 |
/**
|
359 |
* Substract the delivery delay from the delivery date to get to the shipping date.
|
360 |
*/
|
361 |
+
$dateObject->sub(new DateInterval("P{$deliveryDelay}D"));
|
362 |
|
363 |
/**
|
364 |
* If the projected shipping date is not a valid shipping date, substract 1 day and check again.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @todo Cache the available delivery options in the checkout session. That way we only recalculate them if the quote
|
@@ -45,18 +45,18 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
45 |
* Xpath to delivery options enabled config settings.
|
46 |
*/
|
47 |
const XPATH_DELIVERY_OPTIONS_ACTIVE = 'postnl/delivery_options/delivery_options_active';
|
48 |
-
const XPATH_DELIVERY_OPTIONS_BE_ACTIVE = 'postnl/
|
49 |
const XPATH_USE_DUTCH_PRODUCTS = 'postnl/cif_labels_and_confirming/use_dutch_products';
|
50 |
|
51 |
/**
|
52 |
* Xpaths to various possible delivery option settings.
|
53 |
*/
|
54 |
const XPATH_ENABLE_PAKJEGEMAK = 'postnl/delivery_options/enable_pakjegemak';
|
55 |
-
const XPATH_ENABLE_PAKJEGEMAK_BE = 'postnl/
|
56 |
const XPATH_ENABLE_PAKJEGEMAK_EXPRESS = 'postnl/delivery_options/enable_pakjegemak_express';
|
57 |
const XPATH_ENABLE_PAKKETAUTOMAAT_LOCATIONS = 'postnl/delivery_options/enable_pakketautomaat_locations';
|
58 |
const XPATH_ENABLE_DELIVERY_DAYS = 'postnl/delivery_options/enable_delivery_days';
|
59 |
-
const XPATH_ENABLE_DELIVERY_DAYS_BE = 'postnl/
|
60 |
const XPATH_ENABLE_TIMEFRAMES = 'postnl/delivery_options/enable_timeframes';
|
61 |
const XPATH_ENABLE_EVENING_TIMEFRAMES = 'postnl/delivery_options/enable_evening_timeframes';
|
62 |
|
@@ -65,7 +65,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
65 |
*/
|
66 |
const XPATH_STOCK_OPTIONS = 'postnl/delivery_options/stock_options';
|
67 |
const XPATH_ALLOW_SUNDAY_SORTING = 'postnl/delivery_options/allow_sunday_sorting';
|
68 |
-
const XPATH_ALLOW_SUNDAY_SORTING_BE = 'postnl/
|
69 |
const XPATH_SHOW_OPTIONS_FOR_BUSPAKJE = 'postnl/delivery_options/show_options_for_buspakje';
|
70 |
const XPATH_SHOW_ALL_OPTIONS_FOR_BUSPAKJE = 'postnl/delivery_options/show_all_options_for_buspakje';
|
71 |
const XPATH_ENABLE_DELIVERY_DAYS_FOR_BUSPAKJE = 'postnl/delivery_options/enable_delivery_days_for_buspakje';
|
@@ -75,6 +75,9 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
75 |
const XPATH_ENABLE_SUNDAY_DELIVERY = 'postnl/delivery_options/enable_sunday_delivery';
|
76 |
const XPATH_ENABLE_SAMEDAY_DELIVERY = 'postnl/delivery_options/enable_sameday_delivery';
|
77 |
const XPATH_ENABLE_FOOD_DELIVERY = 'postnl/delivery_options/enable_food_delivery';
|
|
|
|
|
|
|
78 |
const XPATH_AVAILABLE_PRODUCT_OPTIONS = 'postnl/grid/supported_product_options';
|
79 |
|
80 |
/**
|
@@ -136,6 +139,13 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
136 |
const FOOD_TYPE_DRY_GROCERIES = 1;
|
137 |
const FOOD_TYPE_COOL_PRODUCTS = 2;
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
/**
|
140 |
* @var array
|
141 |
*/
|
@@ -157,6 +167,28 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
157 |
'3084',
|
158 |
);
|
159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
/**
|
161 |
* @var null
|
162 |
*/
|
@@ -173,9 +205,9 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
173 |
protected $_configMinQty = null;
|
174 |
|
175 |
/**
|
176 |
-
* @var
|
177 |
*/
|
178 |
-
protected $
|
179 |
|
180 |
/**
|
181 |
* @return int
|
@@ -676,12 +708,21 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
676 |
* @param StdClass[] $timeframes
|
677 |
* @param int $storeId
|
678 |
* @param string $destinationCountry
|
|
|
679 |
*
|
680 |
* @return false|StdClass[]
|
681 |
-
* @
|
|
|
|
|
682 |
*/
|
683 |
-
public function filterTimeFrames($timeframes, $storeId, $destinationCountry = 'NL')
|
684 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
685 |
/**
|
686 |
* Retrieves required config values.
|
687 |
*/
|
@@ -693,15 +734,53 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
693 |
|
694 |
$deliveryDateArray = $helper->getValidDeliveryDaysArray($storeId);
|
695 |
$today = new DateTime('now', new DateTimeZone('UTC'));
|
|
|
|
|
|
|
|
|
|
|
696 |
|
697 |
foreach ($timeframes as $key => $timeFrame) {
|
698 |
$forceSameDayTimeFrame = false;
|
699 |
$timeFrameDate = new DateTime($timeFrame->Date, new DateTimeZone('UTC'));
|
700 |
|
701 |
/**
|
702 |
-
*
|
|
|
703 |
*/
|
704 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
/**
|
706 |
* Check for each sub-timeframe if it is indeed same day delivery.
|
707 |
*/
|
@@ -733,6 +812,25 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
733 |
*/
|
734 |
unset($timeframes[$key]);
|
735 |
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
}
|
737 |
|
738 |
$timeFrameDay = $timeFrameDate->format('N');
|
@@ -747,7 +845,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
747 |
/**
|
748 |
* If:
|
749 |
* - Sunday delivery is not active
|
750 |
-
* - Sunday sorting (monday delivery) IS active
|
751 |
* - Today is saturday
|
752 |
* - We are after the cut-off time
|
753 |
*
|
@@ -756,6 +854,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
756 |
if (
|
757 |
!$sundayDelivery &&
|
758 |
$sundaySorting &&
|
|
|
759 |
$today->format('N') == TIG_PostNL_Helper_Date::SATURDAY &&
|
760 |
$helper->isPastCutOff($today, $storeId)
|
761 |
) {
|
@@ -1250,9 +1349,11 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1250 |
* @param boolean $storeId
|
1251 |
* @param boolean $checkQuote
|
1252 |
*
|
1253 |
-
* @
|
|
|
|
|
1254 |
*/
|
1255 |
-
public function canUsePakjeGemak($storeId = false, $checkQuote = true)
|
1256 |
{
|
1257 |
/**
|
1258 |
* Form a unique registry key for the current quote (if available) so we can cache the result of this method in
|
@@ -1265,6 +1366,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1265 |
$registryKey .= '_' . $quote->getId();
|
1266 |
}
|
1267 |
|
|
|
|
|
|
|
|
|
1268 |
/**
|
1269 |
* Check if the result of this method has been cached in the registry.
|
1270 |
*/
|
@@ -1285,24 +1390,33 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1285 |
}
|
1286 |
|
1287 |
$cache = $this->getCache();
|
|
|
|
|
|
|
1288 |
|
1289 |
-
if ($
|
|
|
|
|
|
|
|
|
|
|
|
|
1290 |
/**
|
1291 |
* Check if the result of this method has been cached in the PostNL cache.
|
1292 |
*/
|
1293 |
-
$allowed = $cache
|
1294 |
|
1295 |
Mage::register($registryKey, $allowed);
|
1296 |
return $allowed;
|
1297 |
}
|
1298 |
|
1299 |
-
$allowed = $this->_canUsePakjeGemak();
|
1300 |
|
1301 |
if ($cache) {
|
1302 |
/**
|
1303 |
* Save the result in the PostNL cache.
|
1304 |
*/
|
1305 |
-
$cache
|
1306 |
->saveCache();
|
1307 |
}
|
1308 |
|
@@ -1399,9 +1513,11 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1399 |
/**
|
1400 |
* Checks if PakjeGemak is available.
|
1401 |
*
|
1402 |
-
* @
|
|
|
|
|
1403 |
*/
|
1404 |
-
protected function _canUsePakjeGemak()
|
1405 |
{
|
1406 |
$storeId = Mage::app()->getStore()->getId();
|
1407 |
|
@@ -1409,7 +1525,15 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1409 |
* Check if PakjeGemak has ben enabled in the configuration.
|
1410 |
*/
|
1411 |
$enabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_PAKJEGEMAK, $storeId);
|
1412 |
-
if (!$enabled) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1413 |
return false;
|
1414 |
}
|
1415 |
|
@@ -1484,6 +1608,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
1484 |
$allowed = $this->canUsePakjeGemakExpressForQuote();
|
1485 |
}
|
1486 |
|
|
|
|
|
|
|
|
|
1487 |
if ($cache) {
|
1488 |
/**
|
1489 |
* Save the result in the PostNL cache.
|
@@ -2158,6 +2286,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2158 |
$allowed = true;
|
2159 |
}
|
2160 |
|
|
|
|
|
|
|
|
|
2161 |
return $allowed;
|
2162 |
}
|
2163 |
|
@@ -2199,30 +2331,23 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2199 |
return $cache->getPostnlDeliveryOptionsCanUseSundaySorting();
|
2200 |
}
|
2201 |
|
2202 |
-
|
2203 |
-
|
2204 |
-
} else {
|
2205 |
-
$storeId = Mage::app()->getStore()->getId();
|
2206 |
|
2207 |
-
|
2208 |
-
|
2209 |
-
$allowedXpath = self::XPATH_ALLOW_SUNDAY_SORTING;
|
2210 |
-
if ($quote && $quote->getShippingAddress() && $quote->getShippingAddress()->getCountryId() == 'BE') {
|
2211 |
-
$allowedXpath = self::XPATH_ALLOW_SUNDAY_SORTING_BE;
|
2212 |
-
}
|
2213 |
|
2214 |
-
|
2215 |
-
|
2216 |
|
2217 |
if ($cache) {
|
2218 |
/**
|
2219 |
* Save the result in the PostNL cache.
|
2220 |
*/
|
2221 |
-
$cache->setPostnlDeliveryOptionsCanUseSundaySorting($
|
2222 |
->saveCache();
|
2223 |
}
|
2224 |
|
2225 |
-
return $
|
2226 |
}
|
2227 |
|
2228 |
/**
|
@@ -2280,7 +2405,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2280 |
}
|
2281 |
|
2282 |
/**
|
2283 |
-
* Check if at least one food product code is
|
2284 |
*
|
2285 |
* @param null $storeId
|
2286 |
*
|
@@ -2306,6 +2431,154 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2306 |
return $available;
|
2307 |
}
|
2308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2309 |
/**
|
2310 |
* Checks if sunday sorting is allowed.
|
2311 |
*
|
@@ -2355,6 +2628,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2355 |
$allowed = Mage::getStoreConfigFlag(self::XPATH_ENABLE_SAMEDAY_DELIVERY, $storeId);
|
2356 |
}
|
2357 |
|
|
|
|
|
|
|
|
|
2358 |
if ($cache) {
|
2359 |
/**
|
2360 |
* Save the result in the PostNL cache.
|
@@ -2366,6 +2643,32 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2366 |
return $allowed;
|
2367 |
}
|
2368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2369 |
/**
|
2370 |
* Check if PostNL delivery options may be used based on a quote.
|
2371 |
*
|
@@ -2395,9 +2698,9 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2395 |
Mage::unregister('postnl_delivery_options_can_use_delivery_options_errors');
|
2396 |
|
2397 |
/**
|
2398 |
-
* Delivery options are only available when shipping from the Netherlands.
|
2399 |
*/
|
2400 |
-
if (!$this->
|
2401 |
Mage::register($registryKey, false);
|
2402 |
return false;
|
2403 |
}
|
@@ -2408,7 +2711,7 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2408 |
array(
|
2409 |
'code' => 'POSTNL-0237',
|
2410 |
'message' => $this->__(
|
2411 |
-
'Delivery options are only available when shipping from the Netherlands.'
|
2412 |
),
|
2413 |
)
|
2414 |
);
|
@@ -2572,8 +2875,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
2572 |
|
2573 |
if (
|
2574 |
$quote->getShippingAddress()->getCountryId() !== null &&
|
2575 |
-
$quote->getShippingAddress()->getCountryId()
|
2576 |
-
$this->getDomesticCountry()
|
|
|
|
|
2577 |
) {
|
2578 |
return false;
|
2579 |
}
|
@@ -3074,6 +3379,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
3074 |
|
3075 |
$allowed = $this->_canShowOnlyStatedAddressOption();
|
3076 |
|
|
|
|
|
|
|
|
|
3077 |
if ($cache) {
|
3078 |
/**
|
3079 |
* Save the result in the PostNL cache.
|
@@ -3117,6 +3426,14 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
3117 |
return false;
|
3118 |
}
|
3119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3120 |
/**
|
3121 |
* This shipment cannot be used for buspakje shipments.
|
3122 |
*/
|
@@ -3314,9 +3631,10 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
3314 |
return false;
|
3315 |
}
|
3316 |
|
3317 |
-
$
|
|
|
3318 |
|
3319 |
-
return $
|
3320 |
}
|
3321 |
|
3322 |
/**
|
@@ -3415,28 +3733,36 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
3415 |
/**
|
3416 |
* Check if we can use Dutch products.
|
3417 |
*
|
|
|
|
|
3418 |
* @return bool|null
|
3419 |
*/
|
3420 |
-
public function canUseDutchProducts()
|
3421 |
{
|
3422 |
-
|
3423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3424 |
}
|
3425 |
|
3426 |
/**
|
3427 |
* The Netherlands is always allowed.
|
3428 |
*/
|
3429 |
if ($this->getDomesticCountry() == 'NL') {
|
3430 |
-
$
|
3431 |
-
return
|
3432 |
}
|
3433 |
|
3434 |
/**
|
3435 |
* In some cases Belgium is also allowed. Other countries are never allowed.
|
3436 |
*/
|
3437 |
if ($this->getDomesticCountry() != 'BE') {
|
3438 |
-
$
|
3439 |
-
return
|
3440 |
}
|
3441 |
|
3442 |
/**
|
@@ -3444,11 +3770,41 @@ class TIG_PostNL_Helper_DeliveryOptions extends TIG_PostNL_Helper_Checkout
|
|
3444 |
*/
|
3445 |
$use_dutch_products = Mage::getStoreConfig(self::XPATH_USE_DUTCH_PRODUCTS, Mage::app()->getStore()->getId());
|
3446 |
if ($use_dutch_products == '1') {
|
3447 |
-
$
|
3448 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3449 |
}
|
3450 |
|
3451 |
-
$this->
|
3452 |
-
return $this->_canUseDutchProducts;
|
3453 |
}
|
3454 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @todo Cache the available delivery options in the checkout session. That way we only recalculate them if the quote
|
45 |
* Xpath to delivery options enabled config settings.
|
46 |
*/
|
47 |
const XPATH_DELIVERY_OPTIONS_ACTIVE = 'postnl/delivery_options/delivery_options_active';
|
48 |
+
const XPATH_DELIVERY_OPTIONS_BE_ACTIVE = 'postnl/delivery_options_int/delivery_options_be_active';
|
49 |
const XPATH_USE_DUTCH_PRODUCTS = 'postnl/cif_labels_and_confirming/use_dutch_products';
|
50 |
|
51 |
/**
|
52 |
* Xpaths to various possible delivery option settings.
|
53 |
*/
|
54 |
const XPATH_ENABLE_PAKJEGEMAK = 'postnl/delivery_options/enable_pakjegemak';
|
55 |
+
const XPATH_ENABLE_PAKJEGEMAK_BE = 'postnl/delivery_options_int/enable_pakjegemak_be';
|
56 |
const XPATH_ENABLE_PAKJEGEMAK_EXPRESS = 'postnl/delivery_options/enable_pakjegemak_express';
|
57 |
const XPATH_ENABLE_PAKKETAUTOMAAT_LOCATIONS = 'postnl/delivery_options/enable_pakketautomaat_locations';
|
58 |
const XPATH_ENABLE_DELIVERY_DAYS = 'postnl/delivery_options/enable_delivery_days';
|
59 |
+
const XPATH_ENABLE_DELIVERY_DAYS_BE = 'postnl/delivery_options_int/enable_delivery_days_be';
|
60 |
const XPATH_ENABLE_TIMEFRAMES = 'postnl/delivery_options/enable_timeframes';
|
61 |
const XPATH_ENABLE_EVENING_TIMEFRAMES = 'postnl/delivery_options/enable_evening_timeframes';
|
62 |
|
65 |
*/
|
66 |
const XPATH_STOCK_OPTIONS = 'postnl/delivery_options/stock_options';
|
67 |
const XPATH_ALLOW_SUNDAY_SORTING = 'postnl/delivery_options/allow_sunday_sorting';
|
68 |
+
const XPATH_ALLOW_SUNDAY_SORTING_BE = 'postnl/delivery_options_int/allow_sunday_sorting_be';
|
69 |
const XPATH_SHOW_OPTIONS_FOR_BUSPAKJE = 'postnl/delivery_options/show_options_for_buspakje';
|
70 |
const XPATH_SHOW_ALL_OPTIONS_FOR_BUSPAKJE = 'postnl/delivery_options/show_all_options_for_buspakje';
|
71 |
const XPATH_ENABLE_DELIVERY_DAYS_FOR_BUSPAKJE = 'postnl/delivery_options/enable_delivery_days_for_buspakje';
|
75 |
const XPATH_ENABLE_SUNDAY_DELIVERY = 'postnl/delivery_options/enable_sunday_delivery';
|
76 |
const XPATH_ENABLE_SAMEDAY_DELIVERY = 'postnl/delivery_options/enable_sameday_delivery';
|
77 |
const XPATH_ENABLE_FOOD_DELIVERY = 'postnl/delivery_options/enable_food_delivery';
|
78 |
+
const XPATH_ENABLE_BIRTHDAY_CHECK_DELIVERY = 'postnl/delivery_options/enable_birthday_check_delivery';
|
79 |
+
const XPATH_ENABLE_ID_CHECK_DELIVERY = 'postnl/delivery_options/enable_id_check_delivery';
|
80 |
+
const XPATH_ENABLE_AGE_CHECK_DELIVERY = 'postnl/delivery_options/enable_age_check_delivery';
|
81 |
const XPATH_AVAILABLE_PRODUCT_OPTIONS = 'postnl/grid/supported_product_options';
|
82 |
|
83 |
/**
|
139 |
const FOOD_TYPE_DRY_GROCERIES = 1;
|
140 |
const FOOD_TYPE_COOL_PRODUCTS = 2;
|
141 |
|
142 |
+
/**
|
143 |
+
* The two supported validation delivery types.
|
144 |
+
*/
|
145 |
+
const IDCHECK_TYPE_AGE = 3;
|
146 |
+
const IDCHECK_TYPE_BIRTHDAY = 4;
|
147 |
+
const IDCHECK_TYPE_ID = 5;
|
148 |
+
|
149 |
/**
|
150 |
* @var array
|
151 |
*/
|
167 |
'3084',
|
168 |
);
|
169 |
|
170 |
+
protected $_idCheckProductCodes = array(
|
171 |
+
'3442',
|
172 |
+
'3445',
|
173 |
+
'3448',
|
174 |
+
'3451',
|
175 |
+
);
|
176 |
+
|
177 |
+
protected $_ageCheckProductCodes = array(
|
178 |
+
'3437',
|
179 |
+
'3438',
|
180 |
+
'3449',
|
181 |
+
'3443',
|
182 |
+
'3446',
|
183 |
+
);
|
184 |
+
|
185 |
+
protected $_birthdayCheckProductCodes = array(
|
186 |
+
'3440',
|
187 |
+
'3444',
|
188 |
+
'3447',
|
189 |
+
'3450',
|
190 |
+
);
|
191 |
+
|
192 |
/**
|
193 |
* @var null
|
194 |
*/
|
205 |
protected $_configMinQty = null;
|
206 |
|
207 |
/**
|
208 |
+
* @var array
|
209 |
*/
|
210 |
+
protected $_dates = array();
|
211 |
|
212 |
/**
|
213 |
* @return int
|
708 |
* @param StdClass[] $timeframes
|
709 |
* @param int $storeId
|
710 |
* @param string $destinationCountry
|
711 |
+
* @param null $firstDeliveryDate
|
712 |
*
|
713 |
* @return false|StdClass[]
|
714 |
+
* @internal param null $deliveryDate
|
715 |
+
*
|
716 |
+
* @todo Add unit tests
|
717 |
*/
|
718 |
+
public function filterTimeFrames($timeframes, $storeId, $destinationCountry = 'NL', $firstDeliveryDate = null)
|
719 |
{
|
720 |
+
if ($firstDeliveryDate === null) {
|
721 |
+
$firstDeliveryDate = new DateTime('now', new DateTimeZone('UTC'));
|
722 |
+
} else {
|
723 |
+
$firstDeliveryDate = new DateTime($firstDeliveryDate, new DateTimeZone('UTC'));
|
724 |
+
}
|
725 |
+
|
726 |
/**
|
727 |
* Retrieves required config values.
|
728 |
*/
|
734 |
|
735 |
$deliveryDateArray = $helper->getValidDeliveryDaysArray($storeId);
|
736 |
$today = new DateTime('now', new DateTimeZone('UTC'));
|
737 |
+
$tomorrow = clone $today;
|
738 |
+
$tomorrow->add(new DateInterval('P1D'));
|
739 |
+
|
740 |
+
$helper->setUseFoodCutOffTime(false);
|
741 |
+
$isPastCutoff = $helper->isPastCutOff($today, $storeId);
|
742 |
|
743 |
foreach ($timeframes as $key => $timeFrame) {
|
744 |
$forceSameDayTimeFrame = false;
|
745 |
$timeFrameDate = new DateTime($timeFrame->Date, new DateTimeZone('UTC'));
|
746 |
|
747 |
/**
|
748 |
+
* If this is the first possible deliverydate, and we are after the last cutoff time, then filter all
|
749 |
+
* timeframes that are not Sameday.
|
750 |
*/
|
751 |
+
if (
|
752 |
+
$timeFrameDate->format('Y-m-d') == $firstDeliveryDate->format('Y-m-d') &&
|
753 |
+
$firstDeliveryDate->format('Y-m-d') == $tomorrow->format('Y-m-d') &&
|
754 |
+
$this->_canUseSameDayDelivery() &&
|
755 |
+
$isPastCutoff
|
756 |
+
) {
|
757 |
+
foreach ($timeFrame->Timeframes->TimeframeTimeFrame as $timeFrameTimeFrameKey => $timeFrameTimeFrame) {
|
758 |
+
$sameDay = false;
|
759 |
+
|
760 |
+
/**
|
761 |
+
* Same day delivery timeframes may have multiple 'options'. Only one of these needs to actually be
|
762 |
+
* 'Sameday'.
|
763 |
+
*/
|
764 |
+
foreach ($timeFrameTimeFrame->Options->string as $timeFrameTimeFrameOption) {
|
765 |
+
if ($timeFrameTimeFrameOption == 'Sameday') {
|
766 |
+
$sameDay = true;
|
767 |
+
}
|
768 |
+
}
|
769 |
+
|
770 |
+
if (!$sameDay) {
|
771 |
+
unset($timeFrame->Timeframes->TimeframeTimeFrame[$timeFrameTimeFrameKey]);
|
772 |
+
}
|
773 |
+
}
|
774 |
+
/**
|
775 |
+
* Reset the indices of the TimeframeTimeFrame's array.
|
776 |
+
*/
|
777 |
+
$timeFrame->Timeframes->TimeframeTimeFrame = array_values($timeFrame->Timeframes->TimeframeTimeFrame);
|
778 |
+
|
779 |
+
/**
|
780 |
+
* Check if the time frame's date is today, or the first shipping date. If so, it is probably a
|
781 |
+
* same day delivery time frame.
|
782 |
+
*/
|
783 |
+
} elseif ($timeFrameDate->format('Y-m-d') == $today->format('Y-m-d') && $this->canUseSameDayDelivery(true)) {
|
784 |
/**
|
785 |
* Check for each sub-timeframe if it is indeed same day delivery.
|
786 |
*/
|
812 |
*/
|
813 |
unset($timeframes[$key]);
|
814 |
continue;
|
815 |
+
} elseif (
|
816 |
+
$timeFrameDate->format('Y-m-d') != $today->format('Y-m-d') &&
|
817 |
+
!$this->canUseTimeframes() &&
|
818 |
+
!$this->quoteIsFood()
|
819 |
+
) {
|
820 |
+
$allowedOptions = array('Daytime', 'Sunday', 'Monday');
|
821 |
+
foreach ($timeFrame->Timeframes->TimeframeTimeFrame as $timeFrameTimeFrameKey => $timeFrameTimeFrame) {
|
822 |
+
foreach ($timeFrameTimeFrame->Options->string as $timeFrameTimeFrameOption) {
|
823 |
+
if (!in_array($timeFrameTimeFrameOption, $allowedOptions)) {
|
824 |
+
unset($timeFrame->Timeframes->TimeframeTimeFrame[$timeFrameTimeFrameKey]);
|
825 |
+
break;
|
826 |
+
}
|
827 |
+
}
|
828 |
+
}
|
829 |
+
|
830 |
+
/**
|
831 |
+
* Reset the indices of the TimeframeTimeFrame's array.
|
832 |
+
*/
|
833 |
+
$timeFrame->Timeframes->TimeframeTimeFrame = array_values($timeFrame->Timeframes->TimeframeTimeFrame);
|
834 |
}
|
835 |
|
836 |
$timeFrameDay = $timeFrameDate->format('N');
|
845 |
/**
|
846 |
* If:
|
847 |
* - Sunday delivery is not active
|
848 |
+
* - Sunday sorting (monday delivery) IS NOT active
|
849 |
* - Today is saturday
|
850 |
* - We are after the cut-off time
|
851 |
*
|
854 |
if (
|
855 |
!$sundayDelivery &&
|
856 |
$sundaySorting &&
|
857 |
+
!array_key_exists(6, $deliveryDateArray) &&
|
858 |
$today->format('N') == TIG_PostNL_Helper_Date::SATURDAY &&
|
859 |
$helper->isPastCutOff($today, $storeId)
|
860 |
) {
|
1349 |
* @param boolean $storeId
|
1350 |
* @param boolean $checkQuote
|
1351 |
*
|
1352 |
+
* @param mixed $country
|
1353 |
+
*
|
1354 |
+
* @return bool
|
1355 |
*/
|
1356 |
+
public function canUsePakjeGemak($storeId = false, $checkQuote = true, $country = false)
|
1357 |
{
|
1358 |
/**
|
1359 |
* Form a unique registry key for the current quote (if available) so we can cache the result of this method in
|
1366 |
$registryKey .= '_' . $quote->getId();
|
1367 |
}
|
1368 |
|
1369 |
+
if (!$country) {
|
1370 |
+
$registryKey .= '_' . $country;
|
1371 |
+
}
|
1372 |
+
|
1373 |
/**
|
1374 |
* Check if the result of this method has been cached in the registry.
|
1375 |
*/
|
1390 |
}
|
1391 |
|
1392 |
$cache = $this->getCache();
|
1393 |
+
$hasPostnlDeliveryOptionsCanUsePakjeGemak = 'hasPostnlDeliveryOptionsCanUsePakjeGemak';
|
1394 |
+
$getPostnlDeliveryOptionsCanUsePakjeGemak = 'getPostnlDeliveryOptionsCanUsePakjeGemak';
|
1395 |
+
$setPostnlDeliveryOptionsCanUsePakjeGemak = 'setPostnlDeliveryOptionsCanUsePakjeGemak';
|
1396 |
|
1397 |
+
if ($country) {
|
1398 |
+
$hasPostnlDeliveryOptionsCanUsePakjeGemak .= $country;
|
1399 |
+
$getPostnlDeliveryOptionsCanUsePakjeGemak .= $country;
|
1400 |
+
$setPostnlDeliveryOptionsCanUsePakjeGemak .= $country;
|
1401 |
+
}
|
1402 |
+
|
1403 |
+
if ($cache && $cache->$hasPostnlDeliveryOptionsCanUsePakjeGemak()) {
|
1404 |
/**
|
1405 |
* Check if the result of this method has been cached in the PostNL cache.
|
1406 |
*/
|
1407 |
+
$allowed = $cache->$getPostnlDeliveryOptionsCanUsePakjeGemak();
|
1408 |
|
1409 |
Mage::register($registryKey, $allowed);
|
1410 |
return $allowed;
|
1411 |
}
|
1412 |
|
1413 |
+
$allowed = $this->_canUsePakjeGemak($country);
|
1414 |
|
1415 |
if ($cache) {
|
1416 |
/**
|
1417 |
* Save the result in the PostNL cache.
|
1418 |
*/
|
1419 |
+
$cache->$setPostnlDeliveryOptionsCanUsePakjeGemak($allowed)
|
1420 |
->saveCache();
|
1421 |
}
|
1422 |
|
1513 |
/**
|
1514 |
* Checks if PakjeGemak is available.
|
1515 |
*
|
1516 |
+
* @param mixed $country
|
1517 |
+
*
|
1518 |
+
* @return bool
|
1519 |
*/
|
1520 |
+
protected function _canUsePakjeGemak($country = false)
|
1521 |
{
|
1522 |
$storeId = Mage::app()->getStore()->getId();
|
1523 |
|
1525 |
* Check if PakjeGemak has ben enabled in the configuration.
|
1526 |
*/
|
1527 |
$enabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_PAKJEGEMAK, $storeId);
|
1528 |
+
if ($country && $country == 'NL' && !$enabled) {
|
1529 |
+
return false;
|
1530 |
+
}
|
1531 |
+
|
1532 |
+
/**
|
1533 |
+
* Check if PakjeGemak is enabled for Belgium
|
1534 |
+
*/
|
1535 |
+
$enabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_PAKJEGEMAK_BE, $storeId);
|
1536 |
+
if ($country && $country == 'BE' && !$enabled) {
|
1537 |
return false;
|
1538 |
}
|
1539 |
|
1608 |
$allowed = $this->canUsePakjeGemakExpressForQuote();
|
1609 |
}
|
1610 |
|
1611 |
+
if ($allowed && $checkQuote && $this->quoteHasIDCheckProducts($quote)) {
|
1612 |
+
$allowed = false;
|
1613 |
+
}
|
1614 |
+
|
1615 |
if ($cache) {
|
1616 |
/**
|
1617 |
* Save the result in the PostNL cache.
|
2286 |
$allowed = true;
|
2287 |
}
|
2288 |
|
2289 |
+
if ($allowed && $this->quoteHasIDCheckProducts()) {
|
2290 |
+
$allowed = false;
|
2291 |
+
}
|
2292 |
+
|
2293 |
return $allowed;
|
2294 |
}
|
2295 |
|
2331 |
return $cache->getPostnlDeliveryOptionsCanUseSundaySorting();
|
2332 |
}
|
2333 |
|
2334 |
+
$allowedXpathNl = self::XPATH_ALLOW_SUNDAY_SORTING;
|
2335 |
+
$allowedXpathBe = self::XPATH_ALLOW_SUNDAY_SORTING_BE;
|
|
|
|
|
2336 |
|
2337 |
+
$storeId = Mage::app()->getStore()->getId();
|
|
|
|
|
|
|
|
|
|
|
2338 |
|
2339 |
+
$allowedNl = Mage::getStoreConfigFlag($allowedXpathNl, $storeId);
|
2340 |
+
$allowedBe = Mage::getStoreConfigFlag($allowedXpathBe, $storeId);
|
2341 |
|
2342 |
if ($cache) {
|
2343 |
/**
|
2344 |
* Save the result in the PostNL cache.
|
2345 |
*/
|
2346 |
+
$cache->setPostnlDeliveryOptionsCanUseSundaySorting($allowedNl || $allowedBe)
|
2347 |
->saveCache();
|
2348 |
}
|
2349 |
|
2350 |
+
return $allowedNl || $allowedBe;
|
2351 |
}
|
2352 |
|
2353 |
/**
|
2405 |
}
|
2406 |
|
2407 |
/**
|
2408 |
+
* Check if at least one food product code is available in the config.
|
2409 |
*
|
2410 |
* @param null $storeId
|
2411 |
*
|
2431 |
return $available;
|
2432 |
}
|
2433 |
|
2434 |
+
/**
|
2435 |
+
* Determines if id check delivery is allowed, by checking the configuration.
|
2436 |
+
*
|
2437 |
+
* @return bool
|
2438 |
+
*/
|
2439 |
+
public function canUseIdCheckDelivery()
|
2440 |
+
{
|
2441 |
+
return $this->_canUseIdCheckDelivery();
|
2442 |
+
}
|
2443 |
+
|
2444 |
+
/**
|
2445 |
+
* Checks the configured (and possibly cached) options to determine if ID Check Delivery is allowed
|
2446 |
+
*
|
2447 |
+
* @return bool
|
2448 |
+
*/
|
2449 |
+
protected function _canUseIdCheckDelivery()
|
2450 |
+
{
|
2451 |
+
$allowed = false;
|
2452 |
+
|
2453 |
+
$cache = $this->getCache();
|
2454 |
+
|
2455 |
+
if ($cache && $cache->hasPostnlDeliveryOptionsCanUseIdCheckDelivery()) {
|
2456 |
+
return $cache->getPostnlDeliveryOptionsCanUseIdCheckDelivery();
|
2457 |
+
}
|
2458 |
+
|
2459 |
+
$storeId = Mage::app()->getStore()->getId();
|
2460 |
+
$idCheckDeliveryEnabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_ID_CHECK_DELIVERY, $storeId);
|
2461 |
+
|
2462 |
+
if ($idCheckDeliveryEnabled && $this->_getCheckProductOptionsAvailable($this->_idCheckProductCodes,$storeId)) {
|
2463 |
+
$allowed = true;
|
2464 |
+
}
|
2465 |
+
|
2466 |
+
if ($cache) {
|
2467 |
+
$cache->setPostnlDeliveryOptionsCanUseIdCheckDelivery($allowed)
|
2468 |
+
->saveCache();
|
2469 |
+
}
|
2470 |
+
|
2471 |
+
return $allowed;
|
2472 |
+
}
|
2473 |
+
|
2474 |
+
/**
|
2475 |
+
* Determines if age check delivery is allowed, by checking the configuration.
|
2476 |
+
*
|
2477 |
+
* @return bool
|
2478 |
+
*/
|
2479 |
+
public function canUseAgeCheckDelivery()
|
2480 |
+
{
|
2481 |
+
return $this->_canUseAgeCheckDelivery();
|
2482 |
+
}
|
2483 |
+
|
2484 |
+
/**
|
2485 |
+
* Checks the configured (and possibly cached) options to determine if Age Check Delivery is allowed
|
2486 |
+
*
|
2487 |
+
* @return bool
|
2488 |
+
*/
|
2489 |
+
protected function _canUseAgeCheckDelivery()
|
2490 |
+
{
|
2491 |
+
$allowed = false;
|
2492 |
+
|
2493 |
+
$cache = $this->getCache();
|
2494 |
+
|
2495 |
+
if ($cache && $cache->hasPostnlDeliveryOptionsCanUseAgeCheckDelivery()) {
|
2496 |
+
return $cache->getPostnlDeliveryOptionsCanUseAgeCheckDelivery();
|
2497 |
+
}
|
2498 |
+
|
2499 |
+
$storeId = Mage::app()->getStore()->getId();
|
2500 |
+
$idCheckDeliveryEnabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_AGE_CHECK_DELIVERY, $storeId);
|
2501 |
+
|
2502 |
+
if ($idCheckDeliveryEnabled && $this->_getCheckProductOptionsAvailable($this->_ageCheckProductCodes,$storeId)) {
|
2503 |
+
$allowed = true;
|
2504 |
+
}
|
2505 |
+
|
2506 |
+
if ($cache) {
|
2507 |
+
$cache->setPostnlDeliveryOptionsCanUseAgeCheckDelivery($allowed)
|
2508 |
+
->saveCache();
|
2509 |
+
}
|
2510 |
+
|
2511 |
+
return $allowed;
|
2512 |
+
}
|
2513 |
+
|
2514 |
+
/**
|
2515 |
+
* Determines if birthday check delivery is allowed, by checking the configuration.
|
2516 |
+
*
|
2517 |
+
* @return bool
|
2518 |
+
*/
|
2519 |
+
public function canUseBirthdayCheckDelivery()
|
2520 |
+
{
|
2521 |
+
return $this->_canUseBirthdayCheckDelivery();
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
/**
|
2525 |
+
* Checks the configured (and possibly cached) options to determine if Birthday Check Delivery is allowed
|
2526 |
+
*
|
2527 |
+
* @return bool
|
2528 |
+
*/
|
2529 |
+
protected function _canUseBirthdayCheckDelivery()
|
2530 |
+
{
|
2531 |
+
$allowed = false;
|
2532 |
+
|
2533 |
+
$cache = $this->getCache();
|
2534 |
+
|
2535 |
+
if ($cache && $cache->hasPostnlDeliveryOptionsCanUseBirthdayCheckDelivery()) {
|
2536 |
+
return $cache->getPostnlDeliveryOptionsCanUseBirthdayCheckDelivery();
|
2537 |
+
}
|
2538 |
+
|
2539 |
+
$storeId = Mage::app()->getStore()->getId();
|
2540 |
+
$idCheckDeliveryEnabled = Mage::getStoreConfigFlag(self::XPATH_ENABLE_BIRTHDAY_CHECK_DELIVERY, $storeId);
|
2541 |
+
|
2542 |
+
if ($idCheckDeliveryEnabled && $this->_getCheckProductOptionsAvailable($this->_birthdayCheckProductCodes,$storeId)) {
|
2543 |
+
$allowed = true;
|
2544 |
+
}
|
2545 |
+
|
2546 |
+
if ($cache) {
|
2547 |
+
$cache->setPostnlDeliveryOptionsCanUseBirthdayCheckDelivery($allowed)
|
2548 |
+
->saveCache();
|
2549 |
+
}
|
2550 |
+
|
2551 |
+
return $allowed;
|
2552 |
+
}
|
2553 |
+
|
2554 |
+
/**
|
2555 |
+
* Check if at least one Check product code is available in the config.
|
2556 |
+
*
|
2557 |
+
* @param null $storeId
|
2558 |
+
* @param array $productCodes
|
2559 |
+
*
|
2560 |
+
* @return bool
|
2561 |
+
*/
|
2562 |
+
protected function _getCheckProductOptionsAvailable($productCodes, $storeId = null)
|
2563 |
+
{
|
2564 |
+
$available = false;
|
2565 |
+
|
2566 |
+
if (!$storeId) {
|
2567 |
+
$storeId = Mage::app()->getStore()->getId();
|
2568 |
+
}
|
2569 |
+
|
2570 |
+
$availableProductOptions = explode(',', Mage::getStoreConfig(self::XPATH_AVAILABLE_PRODUCT_OPTIONS, $storeId));
|
2571 |
+
|
2572 |
+
foreach ($productCodes as $idCheckProductCode) {
|
2573 |
+
if (in_array($idCheckProductCode, $availableProductOptions)) {
|
2574 |
+
$available = true;
|
2575 |
+
break;
|
2576 |
+
}
|
2577 |
+
}
|
2578 |
+
|
2579 |
+
return $available;
|
2580 |
+
}
|
2581 |
+
|
2582 |
/**
|
2583 |
* Checks if sunday sorting is allowed.
|
2584 |
*
|
2628 |
$allowed = Mage::getStoreConfigFlag(self::XPATH_ENABLE_SAMEDAY_DELIVERY, $storeId);
|
2629 |
}
|
2630 |
|
2631 |
+
if ($allowed && $this->quoteHasIDCheckProducts()) {
|
2632 |
+
$allowed = false;
|
2633 |
+
}
|
2634 |
+
|
2635 |
if ($cache) {
|
2636 |
/**
|
2637 |
* Save the result in the PostNL cache.
|
2643 |
return $allowed;
|
2644 |
}
|
2645 |
|
2646 |
+
public function canUseSundayDelivery()
|
2647 |
+
{
|
2648 |
+
$cache = $this->getCache();
|
2649 |
+
|
2650 |
+
if ($cache && $cache->hasPostnlDeliveryOptionsCanUseSundayDelivery()) {
|
2651 |
+
return $cache->getPostnlDeliveryOptionsCanUseSundayDelivery();
|
2652 |
+
}
|
2653 |
+
|
2654 |
+
$storeId = Mage::app()->getStore()->getId();
|
2655 |
+
$allowed = Mage::getStoreConfig(self::XPATH_ENABLE_SUNDAY_DELIVERY, $storeId);
|
2656 |
+
|
2657 |
+
if ($allowed && $this->quoteHasIDCheckProducts()) {
|
2658 |
+
$allowed = false;
|
2659 |
+
}
|
2660 |
+
|
2661 |
+
if ($cache) {
|
2662 |
+
/**
|
2663 |
+
* Save the result in the PostNL cache.
|
2664 |
+
*/
|
2665 |
+
$cache->setPostnlDeliveryOptionsCanUseSundayDelivery($allowed)
|
2666 |
+
->saveCache();
|
2667 |
+
}
|
2668 |
+
|
2669 |
+
return $allowed;
|
2670 |
+
}
|
2671 |
+
|
2672 |
/**
|
2673 |
* Check if PostNL delivery options may be used based on a quote.
|
2674 |
*
|
2698 |
Mage::unregister('postnl_delivery_options_can_use_delivery_options_errors');
|
2699 |
|
2700 |
/**
|
2701 |
+
* Delivery options are only available when shipping from the Netherlands or Belgium.
|
2702 |
*/
|
2703 |
+
if (!$this->getDomesticCountry() == 'NL' || !$this->getDomesticCountry() == 'BE') {
|
2704 |
Mage::register($registryKey, false);
|
2705 |
return false;
|
2706 |
}
|
2711 |
array(
|
2712 |
'code' => 'POSTNL-0237',
|
2713 |
'message' => $this->__(
|
2714 |
+
'Delivery options are only available when shipping from the Netherlands or Belgium.'
|
2715 |
),
|
2716 |
)
|
2717 |
);
|
2875 |
|
2876 |
if (
|
2877 |
$quote->getShippingAddress()->getCountryId() !== null &&
|
2878 |
+
$quote->getShippingAddress()->getCountryId() == 'NL' &&
|
2879 |
+
$this->getDomesticCountry() == 'NL' &&
|
2880 |
+
$quote->getShippingAddress()->getCountryId() == 'BE' &&
|
2881 |
+
$this->getDomesticCountry() == 'BE'
|
2882 |
) {
|
2883 |
return false;
|
2884 |
}
|
3379 |
|
3380 |
$allowed = $this->_canShowOnlyStatedAddressOption();
|
3381 |
|
3382 |
+
if ($allowed && $quote && $this->quoteHasIDCheckProducts($quote)) {
|
3383 |
+
$allowed = false;
|
3384 |
+
}
|
3385 |
+
|
3386 |
if ($cache) {
|
3387 |
/**
|
3388 |
* Save the result in the PostNL cache.
|
3426 |
return false;
|
3427 |
}
|
3428 |
|
3429 |
+
/**
|
3430 |
+
* This is only allowed for non-NL to NL shipments when dutch products is enabled.
|
3431 |
+
*/
|
3432 |
+
if ($this->getDomesticCountry() != 'NL' && !$this->canUseDutchProducts()) {
|
3433 |
+
Mage::register($registryKey, false);
|
3434 |
+
return false;
|
3435 |
+
}
|
3436 |
+
|
3437 |
/**
|
3438 |
* This shipment cannot be used for buspakje shipments.
|
3439 |
*/
|
3631 |
return false;
|
3632 |
}
|
3633 |
|
3634 |
+
$isActiveNL = Mage::getStoreConfigFlag(self::XPATH_DELIVERY_OPTIONS_ACTIVE, $storeId);
|
3635 |
+
$isActiveBE = Mage::getStoreConfigFlag(self::XPATH_DELIVERY_OPTIONS_BE_ACTIVE, $storeId);
|
3636 |
|
3637 |
+
return $isActiveNL || $isActiveBE;
|
3638 |
}
|
3639 |
|
3640 |
/**
|
3733 |
/**
|
3734 |
* Check if we can use Dutch products.
|
3735 |
*
|
3736 |
+
* @param bool $useQuote
|
3737 |
+
*
|
3738 |
* @return bool|null
|
3739 |
*/
|
3740 |
+
public function canUseDutchProducts($useQuote = true)
|
3741 |
{
|
3742 |
+
$registryKey = 'can_use_dutch_products';
|
3743 |
+
|
3744 |
+
if ($useQuote && $this->getQuote()) {
|
3745 |
+
$registryKey .= '_' . $this->getQuote()->getId();
|
3746 |
+
}
|
3747 |
+
|
3748 |
+
if (Mage::registry($registryKey) !== null) {
|
3749 |
+
return Mage::registry($registryKey);
|
3750 |
}
|
3751 |
|
3752 |
/**
|
3753 |
* The Netherlands is always allowed.
|
3754 |
*/
|
3755 |
if ($this->getDomesticCountry() == 'NL') {
|
3756 |
+
Mage::register($registryKey, true);
|
3757 |
+
return true;
|
3758 |
}
|
3759 |
|
3760 |
/**
|
3761 |
* In some cases Belgium is also allowed. Other countries are never allowed.
|
3762 |
*/
|
3763 |
if ($this->getDomesticCountry() != 'BE') {
|
3764 |
+
Mage::register($registryKey, false);
|
3765 |
+
return false;
|
3766 |
}
|
3767 |
|
3768 |
/**
|
3770 |
*/
|
3771 |
$use_dutch_products = Mage::getStoreConfig(self::XPATH_USE_DUTCH_PRODUCTS, Mage::app()->getStore()->getId());
|
3772 |
if ($use_dutch_products == '1') {
|
3773 |
+
Mage::register($registryKey, true);
|
3774 |
+
return true;
|
3775 |
+
}
|
3776 |
+
|
3777 |
+
/**
|
3778 |
+
* If both the user and buyer are in Belgium, it is allowed to use Dutch products.
|
3779 |
+
*/
|
3780 |
+
if ($useQuote) {
|
3781 |
+
$shippingCountry = $this->getQuote()->getShippingAddress()->getCountryId();
|
3782 |
+
if ($shippingCountry == 'BE') {
|
3783 |
+
Mage::register($registryKey, true);
|
3784 |
+
|
3785 |
+
return true;
|
3786 |
+
}
|
3787 |
+
}
|
3788 |
+
|
3789 |
+
Mage::register($registryKey, false);
|
3790 |
+
return false;
|
3791 |
+
}
|
3792 |
+
|
3793 |
+
/**
|
3794 |
+
* @param $dateString
|
3795 |
+
* @param $storeId
|
3796 |
+
*
|
3797 |
+
* @return DateTime
|
3798 |
+
*/
|
3799 |
+
public function getDateTime($dateString, $storeId = null)
|
3800 |
+
{
|
3801 |
+
if (!array_key_exists($dateString, $this->_dates)) {
|
3802 |
+
$date = new DateTime('now', $this->getStoreTimeZone($storeId, true));
|
3803 |
+
$date->setTimezone(new DateTimeZone('Europe/Berlin'));
|
3804 |
+
|
3805 |
+
$this->_dates[$dateString] = $date;
|
3806 |
}
|
3807 |
|
3808 |
+
return $this->_dates[$dateString];
|
|
|
3809 |
}
|
3810 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_DeliveryOptions_Fee extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_DeliveryOptions_Fee extends TIG_PostNL_Helper_Data
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Helper_DeliveryOptions_IDCheck extends Mage_Core_Helper_Abstract
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @source https://developer.postnl.nl/apis/labelling-webservice/how-use#toc-26
|
43 |
+
*/
|
44 |
+
const TYPE_DUTCH_FOREIGNERS_DOCUMENT = '01';
|
45 |
+
const TYPE_DUTCH_ID = '02';
|
46 |
+
const TYPE_DUTCH_PASSPORT = '03';
|
47 |
+
const TYPE_DUTCH_DRIVERS_LICENSE = '04';
|
48 |
+
const TYPE_EUROPEAN_ID = '05';
|
49 |
+
const TYPE_ABROAD_PASSPORT = '07';
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var null|TIG_PostNL_Helper_Data
|
53 |
+
*/
|
54 |
+
protected $_helper = null;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return TIG_PostNL_Helper_Data
|
58 |
+
*/
|
59 |
+
protected function getHelper()
|
60 |
+
{
|
61 |
+
if ($this->_helper === null) {
|
62 |
+
/** @var TIG_PostNL_Helper_Data _helper */
|
63 |
+
$this->_helper = Mage::helper('postnl');
|
64 |
+
}
|
65 |
+
|
66 |
+
return $this->_helper;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @return array
|
71 |
+
*/
|
72 |
+
public function getValidationOptions()
|
73 |
+
{
|
74 |
+
$helper = $this->getHelper();
|
75 |
+
|
76 |
+
return array(
|
77 |
+
array(
|
78 |
+
'value' => self::TYPE_DUTCH_PASSPORT,
|
79 |
+
'label' => $helper->__('Nederlands paspoort'),
|
80 |
+
),
|
81 |
+
array(
|
82 |
+
'value' => self::TYPE_DUTCH_ID,
|
83 |
+
'label' => $helper->__('Nederlandse identiteitskaart'),
|
84 |
+
),
|
85 |
+
array(
|
86 |
+
'value' => self::TYPE_DUTCH_DRIVERS_LICENSE,
|
87 |
+
'label' => $helper->__('Nederlands rijbewijs'),
|
88 |
+
),
|
89 |
+
array(
|
90 |
+
'value' => self::TYPE_DUTCH_FOREIGNERS_DOCUMENT,
|
91 |
+
'label' => $helper->__('Nederlands vreemdelingendocument'),
|
92 |
+
),
|
93 |
+
array(
|
94 |
+
'value' => self::TYPE_EUROPEAN_ID,
|
95 |
+
'label' => $helper->__('Europese identiteitskaart'),
|
96 |
+
),
|
97 |
+
array(
|
98 |
+
'value' => self::TYPE_ABROAD_PASSPORT,
|
99 |
+
'label' => $helper->__('Buitenlands paspoort'),
|
100 |
+
),
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @param $value
|
106 |
+
*
|
107 |
+
* @return bool
|
108 |
+
*/
|
109 |
+
public function isValidOption($value)
|
110 |
+
{
|
111 |
+
$options = $this->getValidationOptions();
|
112 |
+
|
113 |
+
foreach ($options as $option) {
|
114 |
+
if ($option['value'] == $value) {
|
115 |
+
return true;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Mijnpakket extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Mijnpakket extends TIG_PostNL_Helper_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Parcelware extends TIG_PostNL_Helper_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Helper_Parcelware extends TIG_PostNL_Helper_Data
|
@@ -35,7 +35,7 @@
|
|
35 |
*
|
36 |
* @category TIG
|
37 |
* @package TIG_PostNL
|
38 |
-
* @copyright Copyright (c)
|
39 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
40 |
* @link http://store.tig.nl/tig/postnl.html
|
41 |
*/
|
35 |
*
|
36 |
* @category TIG
|
37 |
* @package TIG_PostNL
|
38 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
39 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
40 |
* @link http://store.tig.nl/tig/postnl.html
|
41 |
*/
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_AddressValidation_Cendris extends TIG_PostNL_Model_AddressValidation_Cendris_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_AddressValidation_Cendris extends TIG_PostNL_Model_AddressValidation_Cendris_Abstract
|
@@ -33,7 +33,7 @@ advanced * Do not edit or add to this file if you wish to upgrade this module to
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_AddressValidation_Cendris_Abstract extends Varien_Object
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_AddressValidation_Cendris_Abstract extends Varien_Object
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasAddressBlockClass()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasAddressBlockClass()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasAddressBlockClass()
|
@@ -120,17 +120,30 @@ class TIG_PostNL_Model_AddressValidation_Observer_OneStepCheckout extends Varien
|
|
120 |
/**
|
121 |
* Get the blocks alias and alter it's template based on this.
|
122 |
*/
|
|
|
123 |
$blockAlias = $block->getBlockAlias();
|
124 |
switch ($blockAlias) {
|
125 |
case self::BILLING_ADDRESS_BLOCK_ALIAS:
|
126 |
-
$block->setTemplate('TIG/PostNL/address_validation/onestepcheckout/billing_fields.phtml');
|
127 |
break;
|
128 |
case self::SHIPPING_ADDRESS_BLOCK_ALIAS:
|
129 |
-
$block->setTemplate('TIG/PostNL/address_validation/onestepcheckout/shipping_fields.phtml');
|
130 |
break;
|
131 |
//no default
|
132 |
}
|
133 |
|
134 |
return $this;
|
135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasAddressBlockClass()
|
120 |
/**
|
121 |
* Get the blocks alias and alter it's template based on this.
|
122 |
*/
|
123 |
+
$legacy = $this->isLegacy() ? 'legacy/' : '';
|
124 |
$blockAlias = $block->getBlockAlias();
|
125 |
switch ($blockAlias) {
|
126 |
case self::BILLING_ADDRESS_BLOCK_ALIAS:
|
127 |
+
$block->setTemplate('TIG/PostNL/address_validation/onestepcheckout/' . $legacy . 'billing_fields.phtml');
|
128 |
break;
|
129 |
case self::SHIPPING_ADDRESS_BLOCK_ALIAS:
|
130 |
+
$block->setTemplate('TIG/PostNL/address_validation/onestepcheckout/' . $legacy . 'shipping_fields.phtml');
|
131 |
break;
|
132 |
//no default
|
133 |
}
|
134 |
|
135 |
return $this;
|
136 |
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Idev changed the layout of the OSC fields in version 4.5.6. Now we have 2 files: The files working for 4.5.6 and
|
140 |
+
* the files for version 4.5.5 and lower. These latter files are located in the "legacy" folder. We use this check
|
141 |
+
* to see if the current version is 4.5.6 and higher.
|
142 |
+
*
|
143 |
+
* @return bool
|
144 |
+
*/
|
145 |
+
private function isLegacy()
|
146 |
+
{
|
147 |
+
return !method_exists('Idev_OneStepCheckout_Block_Checkout', 'echoAddressFields');
|
148 |
+
}
|
149 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasBillingAddressBlockClass()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasBillingAddressBlockClass()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasStoreId()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasStoreId()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* The only reason this class exists is because the add() method and it's derivatives are only present since EE 1.12 and
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* The only reason this class exists is because the add() method and it's derivatives are only present since EE 1.12 and
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated this class is no longer used as of v1.7.0.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated this class is no longer used as of v1.7.0.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated this class is no longer used as of v1.7.0.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated this class is no longer used as of v1.7.0.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean getChecked()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean getChecked()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > order grid
|
@@ -463,6 +463,9 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
|
|
463 |
'pakje_gemak_express' => $helper->__('Early Pickup'),
|
464 |
'food' => $helper->__('Food Delivery'),
|
465 |
'cooledfood' => $helper->__('Cooled Food Delivery'),
|
|
|
|
|
|
|
466 |
),
|
467 |
);
|
468 |
|
@@ -1596,32 +1599,25 @@ class TIG_PostNL_Model_Adminhtml_Observer_OrderGrid extends Varien_Object
|
|
1596 |
return $this;
|
1597 |
}
|
1598 |
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
array('eq' => 'Cooledfood'),
|
1607 |
-
)
|
1608 |
-
);
|
1609 |
-
|
1610 |
-
return $this;
|
1611 |
-
}
|
1612 |
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
)
|
1622 |
-
);
|
1623 |
|
1624 |
-
|
|
|
1625 |
}
|
1626 |
|
1627 |
/**
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > order grid
|
463 |
'pakje_gemak_express' => $helper->__('Early Pickup'),
|
464 |
'food' => $helper->__('Food Delivery'),
|
465 |
'cooledfood' => $helper->__('Cooled Food Delivery'),
|
466 |
+
'agecheck' => $helper->__('Age Check'),
|
467 |
+
'birthdaycheck' => $helper->__('Birthday Check'),
|
468 |
+
'idcheck' => $helper->__('ID Check'),
|
469 |
),
|
470 |
);
|
471 |
|
1599 |
return $this;
|
1600 |
}
|
1601 |
|
1602 |
+
$filters = array(
|
1603 |
+
'cooledfood' => 'Cooledfood',
|
1604 |
+
'food' => 'Food',
|
1605 |
+
'agecheck' => 'AgeCheck',
|
1606 |
+
'birthdaycheck' => 'BirthdayCheck',
|
1607 |
+
'idcheck' => 'IDCheck',
|
1608 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
|
1610 |
+
foreach ($filters as $filterName => $value) {
|
1611 |
+
if ($filterCond == $filterName) {
|
1612 |
+
$collection->addFieldToFilter(
|
1613 |
+
'postnl_order.type',
|
1614 |
+
array(
|
1615 |
+
array('eq' => $value),
|
1616 |
+
)
|
1617 |
+
);
|
|
|
|
|
1618 |
|
1619 |
+
return $this;
|
1620 |
+
}
|
1621 |
}
|
1622 |
|
1623 |
/**
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
@@ -409,24 +409,27 @@ class TIG_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends Varien_Object
|
|
409 |
'width' => '75px',
|
410 |
'sortable' => false,
|
411 |
'options' => array(
|
412 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_DOMESTIC
|
413 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_DOMESTIC_COD
|
414 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PG
|
415 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PG_COD
|
416 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_EPS
|
417 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_GLOBALPACK
|
418 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PA
|
419 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_AVOND
|
420 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_AVOND_COD
|
421 |
'Evening Delivery (COD)'
|
422 |
),
|
423 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_SUNDAY
|
424 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_MONDAY
|
425 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PGE
|
426 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PGE_COD
|
427 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_BUSPAKJE
|
428 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_FOOD
|
429 |
-
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_COOLED
|
|
|
|
|
|
|
430 |
),
|
431 |
),
|
432 |
$after
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
409 |
'width' => '75px',
|
410 |
'sortable' => false,
|
411 |
'options' => array(
|
412 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_DOMESTIC => $helper->__('Domestic'),
|
413 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_DOMESTIC_COD => $helper->__('Domestic (COD)'),
|
414 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PG => $helper->__('PakjeGemak'),
|
415 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PG_COD => $helper->__('PakjeGemak (COD)'),
|
416 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_EPS => $helper->__('EPS'),
|
417 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_GLOBALPACK => $helper->__('GlobalPack'),
|
418 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PA => $helper->__('Parcel Dispenser'),
|
419 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_AVOND => $helper->__('Evening Delivery'),
|
420 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_AVOND_COD => $helper->__(
|
421 |
'Evening Delivery (COD)'
|
422 |
),
|
423 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_SUNDAY => $helper->__('Sunday Delivery'),
|
424 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_MONDAY => $helper->__('Monday Delivery'),
|
425 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PGE => $helper->__('Early Pickup'),
|
426 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_PGE_COD => $helper->__('Early Pickup (COD)'),
|
427 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_BUSPAKJE => $helper->__('Letter Box Parcel'),
|
428 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_FOOD => $helper->__('Food Delivery'),
|
429 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_COOLED => $helper->__('Cooled Food Delivery'),
|
430 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_AGECHECK => $helper->__('Age Check'),
|
431 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_BIRTHDAYCHECK => $helper->__('Birthday Check'),
|
432 |
+
TIG_PostNL_Model_Core_Shipment::SHIPMENT_TYPE_IDCHECK => $helper->__('ID Check'),
|
433 |
),
|
434 |
),
|
435 |
$after
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the shipment view
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the shipment view
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_Observer_SystemConfig
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_Observer_SystemConfig
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_Support_Logs
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_Support_Logs
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Form_FoodWarnings extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Form_FoodWarnings extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_OrderGridColumns
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_OrderGridColumns
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_OrderGridMassaction
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_OrderGridMassaction
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridColumns
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridColumns
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridMassAction
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Adminhtml_System_Config_Source_ShipmentGridMassAction
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This is a dummy class for the matrixrate export/import functionality.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This is a dummy class for the matrixrate export/import functionality.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* PostNL shipping method model
|
@@ -63,10 +63,13 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
|
|
63 |
/**
|
64 |
* String values for parcel types.
|
65 |
*/
|
66 |
-
const PARCEL_TYPE_REGULAR
|
67 |
-
const PARCEL_TYPE_LETTERBOX
|
68 |
-
const PARCEL_TYPE_FOOD
|
69 |
-
const PARCEL_TYPE_PAKJE_GEMAK
|
|
|
|
|
|
|
70 |
|
71 |
/**
|
72 |
* String values for different rate types.
|
@@ -194,11 +197,33 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
|
|
194 |
*/
|
195 |
$this->_findParcelType();
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
/**
|
198 |
* If parcel_type is food, there can be no rate shown for non-domestic shipments.
|
199 |
*/
|
200 |
/** @noinspection PhpUndefinedMethodInspection */
|
201 |
-
if ($
|
202 |
return $this->_addShippingRateNotFoundError();
|
203 |
}
|
204 |
|
@@ -299,7 +324,17 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
|
|
299 |
/** @var TIG_PostNL_Model_Core_Order $postnlOrder */
|
300 |
$postnlOrder = Mage::getModel('postnl_core/order');
|
301 |
$postnlOrder = $postnlOrder->loadByQuote($quote);
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
/** @noinspection PhpUndefinedMethodInspection */
|
304 |
$this->_request->setParcelType(self::PARCEL_TYPE_PAKJE_GEMAK);
|
305 |
} elseif ($this->getHelper()->quoteIsBuspakje($quote)) {
|
@@ -781,6 +816,10 @@ class TIG_PostNL_Model_Carrier_Postnl extends Mage_Shipping_Model_Carrier_Abstra
|
|
781 |
switch ($parcelType) {
|
782 |
case self::PARCEL_TYPE_FOOD:
|
783 |
return $this->getConfigData('foodspecificerrmsg');
|
|
|
|
|
|
|
|
|
784 |
default:
|
785 |
return $this->getConfigData('specificerrmsg');
|
786 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* PostNL shipping method model
|
63 |
/**
|
64 |
* String values for parcel types.
|
65 |
*/
|
66 |
+
const PARCEL_TYPE_REGULAR = 'regular';
|
67 |
+
const PARCEL_TYPE_LETTERBOX = 'letter_box';
|
68 |
+
const PARCEL_TYPE_FOOD = 'food';
|
69 |
+
const PARCEL_TYPE_PAKJE_GEMAK = 'pakje_gemak';
|
70 |
+
const PARCEL_TYPE_AGECHECK = 'agecheck';
|
71 |
+
const PARCEL_TYPE_BIRTHDAYCHECK = 'birthdaycheck';
|
72 |
+
const PARCEL_TYPE_IDCHECK = 'idcheck';
|
73 |
|
74 |
/**
|
75 |
* String values for different rate types.
|
197 |
*/
|
198 |
$this->_findParcelType();
|
199 |
|
200 |
+
/**
|
201 |
+
* Get the parceltype
|
202 |
+
*/
|
203 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
204 |
+
$parcelType = $this->_request->getParcelType();
|
205 |
+
|
206 |
+
/**
|
207 |
+
* If parcel_type is food, there can be no rate shown for non-domestic shipments.
|
208 |
+
*/
|
209 |
+
if ($parcelType == self::PARCEL_TYPE_FOOD && $countryId != 'NL') {
|
210 |
+
return $this->_addShippingRateNotFoundError();
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Which types of shipments are only allow to the Netherlands?
|
215 |
+
*/
|
216 |
+
$idCheckTypes = array(
|
217 |
+
self::PARCEL_TYPE_AGECHECK,
|
218 |
+
self::PARCEL_TYPE_BIRTHDAYCHECK,
|
219 |
+
self::PARCEL_TYPE_IDCHECK,
|
220 |
+
);
|
221 |
+
|
222 |
/**
|
223 |
* If parcel_type is food, there can be no rate shown for non-domestic shipments.
|
224 |
*/
|
225 |
/** @noinspection PhpUndefinedMethodInspection */
|
226 |
+
if (in_array($parcelType, $idCheckTypes) && $countryId != 'NL') {
|
227 |
return $this->_addShippingRateNotFoundError();
|
228 |
}
|
229 |
|
324 |
/** @var TIG_PostNL_Model_Core_Order $postnlOrder */
|
325 |
$postnlOrder = Mage::getModel('postnl_core/order');
|
326 |
$postnlOrder = $postnlOrder->loadByQuote($quote);
|
327 |
+
|
328 |
+
if ($this->getHelper()->quoteIsAgeCheck()) {
|
329 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
330 |
+
$this->_request->setParcelType(self::PARCEL_TYPE_AGECHECK);
|
331 |
+
} elseif ($this->getHelper()->quoteIsBirthdayCheck()) {
|
332 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
333 |
+
$this->_request->setParcelType(self::PARCEL_TYPE_BIRTHDAYCHECK);
|
334 |
+
} elseif ($this->getHelper()->quoteIsIDCheck()) {
|
335 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
336 |
+
$this->_request->setParcelType(self::PARCEL_TYPE_IDCHECK);
|
337 |
+
} elseif ($postnlOrder && $postnlOrder->getId() && $postnlOrder->getIsPakjeGemak()) {
|
338 |
/** @noinspection PhpUndefinedMethodInspection */
|
339 |
$this->_request->setParcelType(self::PARCEL_TYPE_PAKJE_GEMAK);
|
340 |
} elseif ($this->getHelper()->quoteIsBuspakje($quote)) {
|
816 |
switch ($parcelType) {
|
817 |
case self::PARCEL_TYPE_FOOD:
|
818 |
return $this->getConfigData('foodspecificerrmsg');
|
819 |
+
case self::PARCEL_TYPE_AGECHECK:
|
820 |
+
case self::PARCEL_TYPE_BIRTHDAYCHECK:
|
821 |
+
case self::PARCEL_TYPE_IDCHECK:
|
822 |
+
return $this->getConfigData('idcheckspecificerrmsg');
|
823 |
default:
|
824 |
return $this->getConfigData('specificerrmsg');
|
825 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Quote_Address_Total_Shipping
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Quote_Address_Total_Shipping
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Matrixrate extends Mage_Shipping_Model_Resource_Carrier_Tablerate
|
@@ -101,7 +101,10 @@ class TIG_PostNL_Model_Carrier_Resource_Matrixrate extends Mage_Shipping_Model_R
|
|
101 |
" WHEN 'pakje_gemak' THEN 2" .
|
102 |
" WHEN 'food' THEN 3" .
|
103 |
" WHEN 'regular' THEN 4" .
|
104 |
-
" WHEN '
|
|
|
|
|
|
|
105 |
" ELSE 100" .
|
106 |
" END) ASC"
|
107 |
),
|
@@ -468,6 +471,9 @@ class TIG_PostNL_Model_Carrier_Resource_Matrixrate extends Mage_Shipping_Model_R
|
|
468 |
'regular',
|
469 |
'pakje_gemak',
|
470 |
'food',
|
|
|
|
|
|
|
471 |
);
|
472 |
|
473 |
$this->_importErrors[] = Mage::helper('postnl')->__(
|
@@ -623,6 +629,27 @@ class TIG_PostNL_Model_Carrier_Resource_Matrixrate extends Mage_Shipping_Model_R
|
|
623 |
case 'gekoeld': //no break
|
624 |
$formattedType = 'food';
|
625 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
626 |
//no default
|
627 |
}
|
628 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Matrixrate extends Mage_Shipping_Model_Resource_Carrier_Tablerate
|
101 |
" WHEN 'pakje_gemak' THEN 2" .
|
102 |
" WHEN 'food' THEN 3" .
|
103 |
" WHEN 'regular' THEN 4" .
|
104 |
+
" WHEN 'agecheck' THEN 5" .
|
105 |
+
" WHEN 'birthdaycheck' THEN 6" .
|
106 |
+
" WHEN 'idcheck' THEN 7" .
|
107 |
+
" WHEN '*' THEN 8" .
|
108 |
" ELSE 100" .
|
109 |
" END) ASC"
|
110 |
),
|
471 |
'regular',
|
472 |
'pakje_gemak',
|
473 |
'food',
|
474 |
+
'agecheck',
|
475 |
+
'birthdaycheck',
|
476 |
+
'idcheck',
|
477 |
);
|
478 |
|
479 |
$this->_importErrors[] = Mage::helper('postnl')->__(
|
629 |
case 'gekoeld': //no break
|
630 |
$formattedType = 'food';
|
631 |
break;
|
632 |
+
case 'agecheck': //no break
|
633 |
+
case 'age check': //no break
|
634 |
+
case 'age-check': //no break
|
635 |
+
$formattedType = 'agecheck';
|
636 |
+
break;
|
637 |
+
case 'idcheck': //no break
|
638 |
+
case 'id check': //no break
|
639 |
+
case 'id-check': //no break
|
640 |
+
$formattedType = 'idcheck';
|
641 |
+
break;
|
642 |
+
case 'birthday': //no break
|
643 |
+
case 'birth day': //no break
|
644 |
+
case 'birth-day': //no break
|
645 |
+
case 'birthdaycheck': //no break
|
646 |
+
case 'birthday check': //no break
|
647 |
+
case 'birth day check': //no break
|
648 |
+
case 'birth day-check': //no break
|
649 |
+
case 'birth-day check': //no break
|
650 |
+
case 'birth-day-check': //no break
|
651 |
+
$formattedType = 'birthdaycheck';
|
652 |
+
break;
|
653 |
//no default
|
654 |
}
|
655 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Matrixrate_Collection
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Matrixrate_Collection
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Tablerate extends Mage_Shipping_Model_Resource_Carrier_Tablerate
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Tablerate extends Mage_Shipping_Model_Resource_Carrier_Tablerate
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Tablerate_Collection
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_Resource_Tablerate_Collection
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Backend_Matrixrate extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Backend_Matrixrate extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Backend_Tablerate extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Backend_Tablerate extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Source_RateType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Source_RateType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Source_TablerateSource
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Carrier_System_Config_Source_TablerateSource
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This is a dummy class for the tablerate export/import functionality.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* This is a dummy class for the tablerate export/import functionality.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Checkout_Cif setStoreId(int $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Checkout_Cif setStoreId(int $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_Observer_Order
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_Observer_Order
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_Observer_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_Observer_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.2.0 This class has been moved to TIG_PostNL_Model_Core_Order. A dummy class has been left behind to
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.2.0 This class has been moved to TIG_PostNL_Model_Core_Order. A dummy class has been left behind to
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Checkout_Service setQuote(Mage_Sales_Model_Quote $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Checkout_Service setQuote(Mage_Sales_Model_Quote $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_System_Config_Source_ActivePaymentMethods
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_System_Config_Source_ActivePaymentMethods
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_System_Config_Source_CmsPage
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Checkout_System_Config_Source_CmsPage
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Api extends Mage_Api_Model_Resource_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Api extends Mage_Api_Model_Resource_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Api_V2 extends TIG_PostNL_Model_Core_Api
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Api_V2 extends TIG_PostNL_Model_Core_Api
|
@@ -33,13 +33,15 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlCoreIsEnabled()
|
40 |
* @method boolean hasPostnlCoreIsConfigured()
|
41 |
* @method boolean hasPostnlCoreIsGlobalConfigured()
|
42 |
* @method boolean hasPostnlCoreCanUseStandard()
|
|
|
|
|
43 |
* @method boolean hasPostnlCoreCanUsePakjeGemak()
|
44 |
* @method boolean hasPostnlCoreCanUseEps()
|
45 |
* @method boolean hasPostnlCoreCanUseGlobalPack()
|
@@ -53,8 +55,12 @@
|
|
53 |
* @method boolean hasPostnlDeliveryOptionsCanUseTimeframes()
|
54 |
* @method boolean hasPostnlDeliveryOptionsCanUseEveningTimeframes()
|
55 |
* @method boolean hasPostnlDeliveryOptionsCanUseSundaySorting()
|
|
|
56 |
* @method boolean hasPostnlDeliveryOptionsCanUseSameDayDelivery()
|
57 |
* @method boolean hasPostnlDeliveryOptionsCanUseFoodDelivery()
|
|
|
|
|
|
|
58 |
* @method boolean hasPostnlMijnpakketIsActive()
|
59 |
* @method boolean hasPostnlMijnpakketCanShowNotification()
|
60 |
* @method boolean hasPostnlCoreCanUseBuspakje()
|
@@ -66,11 +72,14 @@
|
|
66 |
* @method boolean hasStoreTimeZones()
|
67 |
* @method boolean hasValidDeliveryDaysArray()
|
68 |
* @method boolean hasDomesticCountry()
|
|
|
69 |
*
|
70 |
* @method boolean getPostnlCoreIsEnabled()
|
71 |
* @method boolean getPostnlCoreIsConfigured()
|
72 |
* @method boolean getPostnlCoreIsGlobalConfigured()
|
73 |
* @method boolean getPostnlCoreCanUseStandard()
|
|
|
|
|
74 |
* @method boolean getPostnlCoreCanUsePakjeGemak()
|
75 |
* @method boolean getPostnlCoreCanUseEps()
|
76 |
* @method boolean getPostnlCoreCanUseGlobalPack()
|
@@ -84,13 +93,18 @@
|
|
84 |
* @method boolean getPostnlDeliveryOptionsCanUseTimeframes()
|
85 |
* @method boolean getPostnlDeliveryOptionsCanUseEveningTimeframes()
|
86 |
* @method boolean getPostnlDeliveryOptionsCanUseSundaySorting()
|
|
|
87 |
* @method boolean getPostnlDeliveryOptionsCanUseSameDayDelivery()
|
88 |
* @method boolean getPostnlDeliveryOptionsCanUseFoodDelivery()
|
|
|
|
|
|
|
89 |
* @method boolean getPostnlMijnpakketIsActive()
|
90 |
* @method boolean getPostnlMijnpakketCanShowNotification()
|
91 |
* @method boolean getPostnlCoreCanUseBuspakje()
|
92 |
* @method boolean getPostnlDeliveryOptionsCanUseDeliveryDays()
|
93 |
* @method boolean getCanShowOnlyStatedAddressOption()
|
|
|
94 |
* @method array getPostnlShippingMethods()
|
95 |
* @method array getMatchedPostnlShippingMethods()
|
96 |
* @method boolean getCanUseResponsiveDeliveryOptions()
|
@@ -102,6 +116,8 @@
|
|
102 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreIsConfigured(boolean $value)
|
103 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreIsGlobalConfigured(boolean $value)
|
104 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseStandard(boolean $value)
|
|
|
|
|
105 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUsePakjeGemak(boolean $value)
|
106 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseEps(boolean $value)
|
107 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseGlobalPack(boolean $value)
|
@@ -115,8 +131,12 @@
|
|
115 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseTimeframes(boolean $value)
|
116 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseEveningTimeframes(boolean $value)
|
117 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseSundaySorting(boolean $value)
|
|
|
118 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseSameDayDelivery(boolean $value)
|
119 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseFoodDelivery(boolean $value)
|
|
|
|
|
|
|
120 |
* @method TIG_PostNL_Model_Core_Cache setPostnlMijnpakketIsActive(boolean $value)
|
121 |
* @method TIG_PostNL_Model_Core_Cache setPostnlMijnpakketCanShowNotification(boolean $value)
|
122 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseBuspakje(boolean $value)
|
@@ -128,6 +148,7 @@
|
|
128 |
* @method TIG_PostNL_Model_Core_Cache setStoreTimeZones(array $value)
|
129 |
* @method TIG_PostNL_Model_Core_Cache setValidDeliveryDaysArray(array $value)
|
130 |
* @method TIG_PostNL_Model_Core_Cache setDomesticCountry(array $value)
|
|
|
131 |
*/
|
132 |
class TIG_PostNL_Model_Core_Cache extends Varien_Object
|
133 |
{
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasPostnlCoreIsEnabled()
|
40 |
* @method boolean hasPostnlCoreIsConfigured()
|
41 |
* @method boolean hasPostnlCoreIsGlobalConfigured()
|
42 |
* @method boolean hasPostnlCoreCanUseStandard()
|
43 |
+
* @method boolean hasPostnlCoreCanUseStandardNL()
|
44 |
+
* @method boolean hasPostnlCoreCanUseStandardBE()
|
45 |
* @method boolean hasPostnlCoreCanUsePakjeGemak()
|
46 |
* @method boolean hasPostnlCoreCanUseEps()
|
47 |
* @method boolean hasPostnlCoreCanUseGlobalPack()
|
55 |
* @method boolean hasPostnlDeliveryOptionsCanUseTimeframes()
|
56 |
* @method boolean hasPostnlDeliveryOptionsCanUseEveningTimeframes()
|
57 |
* @method boolean hasPostnlDeliveryOptionsCanUseSundaySorting()
|
58 |
+
* @method boolean hasPostnlDeliveryOptionsCanUseSundayDelivery()
|
59 |
* @method boolean hasPostnlDeliveryOptionsCanUseSameDayDelivery()
|
60 |
* @method boolean hasPostnlDeliveryOptionsCanUseFoodDelivery()
|
61 |
+
* @method boolean hasPostnlDeliveryOptionsCanUseIdCheckDelivery()
|
62 |
+
* @method boolean hasPostnlDeliveryOptionsCanUseAgeCheckDelivery
|
63 |
+
* @method boolean hasPostnlDeliveryOptionsCanUseBirthdayCheckDelivery()
|
64 |
* @method boolean hasPostnlMijnpakketIsActive()
|
65 |
* @method boolean hasPostnlMijnpakketCanShowNotification()
|
66 |
* @method boolean hasPostnlCoreCanUseBuspakje()
|
72 |
* @method boolean hasStoreTimeZones()
|
73 |
* @method boolean hasValidDeliveryDaysArray()
|
74 |
* @method boolean hasDomesticCountry()
|
75 |
+
* @method boolean hasPostnlCoreCanUsePakjegemakNotInsured()
|
76 |
*
|
77 |
* @method boolean getPostnlCoreIsEnabled()
|
78 |
* @method boolean getPostnlCoreIsConfigured()
|
79 |
* @method boolean getPostnlCoreIsGlobalConfigured()
|
80 |
* @method boolean getPostnlCoreCanUseStandard()
|
81 |
+
* @method boolean getPostnlCoreCanUseStandardNL()
|
82 |
+
* @method boolean getPostnlCoreCanUseStandardBE()
|
83 |
* @method boolean getPostnlCoreCanUsePakjeGemak()
|
84 |
* @method boolean getPostnlCoreCanUseEps()
|
85 |
* @method boolean getPostnlCoreCanUseGlobalPack()
|
93 |
* @method boolean getPostnlDeliveryOptionsCanUseTimeframes()
|
94 |
* @method boolean getPostnlDeliveryOptionsCanUseEveningTimeframes()
|
95 |
* @method boolean getPostnlDeliveryOptionsCanUseSundaySorting()
|
96 |
+
* @method boolean getPostnlDeliveryOptionsCanUseSundayDelivery()
|
97 |
* @method boolean getPostnlDeliveryOptionsCanUseSameDayDelivery()
|
98 |
* @method boolean getPostnlDeliveryOptionsCanUseFoodDelivery()
|
99 |
+
* @method boolean getPostnlDeliveryOptionsCanUseIdCheckDelivery()
|
100 |
+
* @method boolean getPostnlDeliveryOptionsCanUseBirthdayCheckDelivery()
|
101 |
+
* @method boolean getPostnlDeliveryOptionsCanUseAgeCheckDelivery()
|
102 |
* @method boolean getPostnlMijnpakketIsActive()
|
103 |
* @method boolean getPostnlMijnpakketCanShowNotification()
|
104 |
* @method boolean getPostnlCoreCanUseBuspakje()
|
105 |
* @method boolean getPostnlDeliveryOptionsCanUseDeliveryDays()
|
106 |
* @method boolean getCanShowOnlyStatedAddressOption()
|
107 |
+
* @method boolean getPostnlCoreCanUsePakjegemakNotInsured()
|
108 |
* @method array getPostnlShippingMethods()
|
109 |
* @method array getMatchedPostnlShippingMethods()
|
110 |
* @method boolean getCanUseResponsiveDeliveryOptions()
|
116 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreIsConfigured(boolean $value)
|
117 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreIsGlobalConfigured(boolean $value)
|
118 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseStandard(boolean $value)
|
119 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseStandardNL(boolean $value)
|
120 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseStandardBE(boolean $value)
|
121 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUsePakjeGemak(boolean $value)
|
122 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseEps(boolean $value)
|
123 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseGlobalPack(boolean $value)
|
131 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseTimeframes(boolean $value)
|
132 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseEveningTimeframes(boolean $value)
|
133 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseSundaySorting(boolean $value)
|
134 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseSundayDelivery(boolean $value)
|
135 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseSameDayDelivery(boolean $value)
|
136 |
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseFoodDelivery(boolean $value)
|
137 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseIdCheckDelivery(boolean $value)
|
138 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseAgeCheckDelivery(boolean $value)
|
139 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlDeliveryOptionsCanUseBirthdayCheckDelivery(boolean $value)
|
140 |
* @method TIG_PostNL_Model_Core_Cache setPostnlMijnpakketIsActive(boolean $value)
|
141 |
* @method TIG_PostNL_Model_Core_Cache setPostnlMijnpakketCanShowNotification(boolean $value)
|
142 |
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUseBuspakje(boolean $value)
|
148 |
* @method TIG_PostNL_Model_Core_Cache setStoreTimeZones(array $value)
|
149 |
* @method TIG_PostNL_Model_Core_Cache setValidDeliveryDaysArray(array $value)
|
150 |
* @method TIG_PostNL_Model_Core_Cache setDomesticCountry(array $value)
|
151 |
+
* @method TIG_PostNL_Model_Core_Cache setPostnlCoreCanUsePakjegemakNotInsured(boolean $value)
|
152 |
*/
|
153 |
class TIG_PostNL_Model_Core_Cache extends Varien_Object
|
154 |
{
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class containing all default methods used for CIF communication by this extension.
|
@@ -143,6 +143,11 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
|
|
143 |
*/
|
144 |
const DEFAULT_HS_TARIFF = '000000';
|
145 |
|
|
|
|
|
|
|
|
|
|
|
146 |
/**
|
147 |
* Array containing possible address types.
|
148 |
*
|
@@ -284,6 +289,18 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
|
|
284 |
'Option' => '006',
|
285 |
),
|
286 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
);
|
288 |
|
289 |
/**
|
@@ -887,17 +904,11 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
|
|
887 |
|
888 |
$customer = array_merge($customer, $additionalCustomerData);
|
889 |
|
890 |
-
/**
|
891 |
-
* This is an edge case:
|
892 |
-
*
|
893 |
-
* If the domestic country is BE, the shipment is being sent to Netherlands and the
|
894 |
-
* option "Use Dutch products" is enabled, we must fool CIF and return the alternative customer id,
|
895 |
-
* customer code and the Dutch alternative address.
|
896 |
-
*/
|
897 |
if (
|
898 |
$this->getHelper()->getDomesticCountry() == 'BE' &&
|
899 |
$shipment->getShippingAddress()->getCountryId() == 'NL' &&
|
900 |
-
Mage::helper('postnl/deliveryoptions')->canUseDutchProducts()
|
|
|
901 |
) {
|
902 |
$customer['CustomerCode'] = $this->_getDutchCustomerCode();
|
903 |
$customer['CustomerNumber'] = $this->_getDutchCustomerNumber();
|
@@ -1046,6 +1057,27 @@ class TIG_PostNL_Model_Core_Cif extends TIG_PostNL_Model_Core_Cif_Abstract
|
|
1046 |
$shipmentData['ProductOptions'] = $productOptions;
|
1047 |
}
|
1048 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
/**
|
1050 |
* Add 'DownPartner' data.
|
1051 |
*/
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class containing all default methods used for CIF communication by this extension.
|
143 |
*/
|
144 |
const DEFAULT_HS_TARIFF = '000000';
|
145 |
|
146 |
+
/**
|
147 |
+
* Can we use the dutch address (BE -> NL shipments only)
|
148 |
+
*/
|
149 |
+
const XPATH_USE_DUTCH_ADDRESS = 'postnl/cif_address/use_dutch_address';
|
150 |
+
|
151 |
/**
|
152 |
* Array containing possible address types.
|
153 |
*
|
289 |
'Option' => '006',
|
290 |
),
|
291 |
),
|
292 |
+
'AgeCheck' => array(
|
293 |
+
'Characteristic' => '014',
|
294 |
+
'Option' => '002',
|
295 |
+
),
|
296 |
+
'BirthdayCheck' => array(
|
297 |
+
'Characteristic' => '016',
|
298 |
+
'Option' => '002',
|
299 |
+
),
|
300 |
+
'IDCheck' => array(
|
301 |
+
'Characteristic' => '012',
|
302 |
+
'Option' => '002',
|
303 |
+
),
|
304 |
);
|
305 |
|
306 |
/**
|
904 |
|
905 |
$customer = array_merge($customer, $additionalCustomerData);
|
906 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
907 |
if (
|
908 |
$this->getHelper()->getDomesticCountry() == 'BE' &&
|
909 |
$shipment->getShippingAddress()->getCountryId() == 'NL' &&
|
910 |
+
Mage::helper('postnl/deliveryoptions')->canUseDutchProducts() &&
|
911 |
+
Mage::getStoreConfigFlag(self::XPATH_USE_DUTCH_ADDRESS)
|
912 |
) {
|
913 |
$customer['CustomerCode'] = $this->_getDutchCustomerCode();
|
914 |
$customer['CustomerNumber'] = $this->_getDutchCustomerNumber();
|
1057 |
$shipmentData['ProductOptions'] = $productOptions;
|
1058 |
}
|
1059 |
|
1060 |
+
if ($postnlShipment->isBirthdayCheckShipment()) {
|
1061 |
+
$customerDob = $order->getCustomerDob();
|
1062 |
+
$customerDobObject = new DateTime($customerDob, new DateTimeZone('UTC'));
|
1063 |
+
$customerDobObject->setTimezone(new DateTimeZone('Europe/Berlin'));
|
1064 |
+
|
1065 |
+
$shipmentData['ReceiverDateOfBirth'] = $customerDobObject->format('d-m-Y');
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
/**
|
1069 |
+
* @source https://developer.postnl.nl/apis/confirming-webservice/documentation#toc-14
|
1070 |
+
*/
|
1071 |
+
if ($postnlShipment->isIDCheckShipment()) {
|
1072 |
+
$expirationDate = $postnlShipment->getIdcheckExpirationDate();
|
1073 |
+
$expirationDateObject = new DateTime($expirationDate, new DateTimeZone('UTC'));
|
1074 |
+
$expirationDateObject->setTimezone(new DateTimeZone('Europe/Berlin'));
|
1075 |
+
|
1076 |
+
$shipmentData['IDExpiration'] = $expirationDateObject->format('d-m-Y');
|
1077 |
+
$shipmentData['IDNumber'] = $postnlShipment->getIdcheckNumber();
|
1078 |
+
$shipmentData['IDType'] = $postnlShipment->getIdcheckType();
|
1079 |
+
}
|
1080 |
+
|
1081 |
/**
|
1082 |
* Add 'DownPartner' data.
|
1083 |
*/
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Base CIF model. Contains general code for communicating with the CIF API
|
@@ -117,6 +117,16 @@ abstract class TIG_PostNL_Model_Core_Cif_Abstract extends Varien_Object
|
|
117 |
*/
|
118 |
const SHIPMENT_NOT_FOUND_ERROR_NUMBER = 13;
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
/**
|
121 |
* Check if the required PHP extensions are installed.
|
122 |
*
|
@@ -703,4 +713,24 @@ abstract class TIG_PostNL_Model_Core_Cif_Abstract extends Varien_Object
|
|
703 |
|
704 |
return $this;
|
705 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Base CIF model. Contains general code for communicating with the CIF API
|
117 |
*/
|
118 |
const SHIPMENT_NOT_FOUND_ERROR_NUMBER = 13;
|
119 |
|
120 |
+
/**
|
121 |
+
* @var array
|
122 |
+
*/
|
123 |
+
protected $_helpers = array();
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @var array
|
127 |
+
*/
|
128 |
+
protected $_dates = array();
|
129 |
+
|
130 |
/**
|
131 |
* Check if the required PHP extensions are installed.
|
132 |
*
|
713 |
|
714 |
return $this;
|
715 |
}
|
716 |
+
|
717 |
+
/**
|
718 |
+
* @param string $helper
|
719 |
+
*
|
720 |
+
* @return TIG_PostNL_Helper_Data|TIG_PostNL_Helper_DeliveryOptions
|
721 |
+
*/
|
722 |
+
protected function _getHelper($helper = '')
|
723 |
+
{
|
724 |
+
if ($helper == '') {
|
725 |
+
$helper = 'postnl';
|
726 |
+
} else {
|
727 |
+
$helper = 'postnl/' . $helper;
|
728 |
+
}
|
729 |
+
|
730 |
+
if (!array_key_exists($helper, $this->_helpers)) {
|
731 |
+
$this->_helpers[$helper] = Mage::helper($helper);
|
732 |
+
}
|
733 |
+
|
734 |
+
return $this->_helpers[$helper];
|
735 |
+
}
|
736 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_Label setLabelSize(string $value)
|
@@ -208,12 +208,12 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
208 |
),
|
209 |
3 => array(
|
210 |
'x' => 0.5,
|
211 |
-
'y' => -
|
212 |
'w' => 105.3,
|
213 |
),
|
214 |
4 => array(
|
215 |
'x' => 105.3,
|
216 |
-
'y' => -
|
217 |
'w' => 105.3,
|
218 |
),
|
219 |
),
|
@@ -247,6 +247,23 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
247 |
),
|
248 |
);
|
249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
/**
|
251 |
* @param string $outputMode
|
252 |
*
|
@@ -569,7 +586,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
569 |
|
570 |
if (isset($matches[1]) && isset($matches[2]) && $matches[1] < $matches[2]) {
|
571 |
// combilabel detected
|
572 |
-
$pdf->insertTemplate($tempLabel, $this->pix2pt(400), $this->pix2pt(
|
573 |
} else {
|
574 |
$pdf->Rotate(90);
|
575 |
$pdf->insertTemplate($tempLabel, $this->pix2pt(-1037), $this->pix2pt(413), $this->pix2pt(538));
|
@@ -670,6 +687,13 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
670 |
*/
|
671 |
$labelType = $label->getLabelType();
|
672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
if ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL
|
674 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL_COMBI
|
675 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJE
|
@@ -684,7 +708,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
684 |
}
|
685 |
|
686 |
if ($this->getLabelSize() == 'A4' && $this->getIsFirstLabel()) {
|
687 |
-
$pdf->addOrientedPage(
|
688 |
$this->setIsFirstLabel(false);
|
689 |
if (!$this->getLabelCounter()) {
|
690 |
$this->resetLabelCounter();
|
@@ -694,7 +718,7 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
694 |
!$this->getLabelCounter() || $this->getLabelCounter() > 4
|
695 |
)
|
696 |
) {
|
697 |
-
$pdf->addOrientedPage(
|
698 |
$this->resetLabelCounter();
|
699 |
}
|
700 |
|
@@ -703,15 +727,15 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
703 |
*/
|
704 |
if($this->getLabelSize() == 'A6') {
|
705 |
$this->setLabelCounter(3); //used to calculate the top left position
|
706 |
-
$pdf->addOrientedPage(
|
707 |
}
|
708 |
} elseif ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CODCARD) {
|
709 |
-
$pdf->addOrientedPage(
|
710 |
} elseif ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CN23
|
711 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_COMMERCIALINVOICE
|
712 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CODCARD
|
713 |
) {
|
714 |
-
$pdf->addOrientedPage(
|
715 |
}
|
716 |
|
717 |
/**
|
@@ -744,9 +768,18 @@ class TIG_PostNL_Model_Core_Label extends Varien_Object
|
|
744 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJE:
|
745 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJEEXTRA:
|
746 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_RETURN_LABEL:
|
747 |
-
$
|
748 |
|
749 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
750 |
break;
|
751 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CN23:
|
752 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_COMMERCIALINVOICE:
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_Label setLabelSize(string $value)
|
208 |
),
|
209 |
3 => array(
|
210 |
'x' => 0.5,
|
211 |
+
'y' => -128.5,
|
212 |
'w' => 105.3,
|
213 |
),
|
214 |
4 => array(
|
215 |
'x' => 105.3,
|
216 |
+
'y' => -128.5,
|
217 |
'w' => 105.3,
|
218 |
),
|
219 |
),
|
247 |
),
|
248 |
);
|
249 |
|
250 |
+
/**
|
251 |
+
* An array of label default page orientation L = landscape. P = portrait.
|
252 |
+
*
|
253 |
+
* @var array
|
254 |
+
*/
|
255 |
+
protected $_labelDefaultOrientation = array(
|
256 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL => 'P',
|
257 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_RETURN_LABEL => 'L',
|
258 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJE => 'P',
|
259 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJEEXTRA => 'P',
|
260 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL_COMBI => 'L',
|
261 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CODCARD => 'P',
|
262 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CN23 => 'P',
|
263 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_COMMERCIALINVOICE => 'P',
|
264 |
+
TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CP71 => 'P',
|
265 |
+
);
|
266 |
+
|
267 |
/**
|
268 |
* @param string $outputMode
|
269 |
*
|
586 |
|
587 |
if (isset($matches[1]) && isset($matches[2]) && $matches[1] < $matches[2]) {
|
588 |
// combilabel detected
|
589 |
+
$pdf->insertTemplate($tempLabel, $this->pix2pt(400), $this->pix2pt(560), $this->pix2pt(400));
|
590 |
} else {
|
591 |
$pdf->Rotate(90);
|
592 |
$pdf->insertTemplate($tempLabel, $this->pix2pt(-1037), $this->pix2pt(413), $this->pix2pt(538));
|
687 |
*/
|
688 |
$labelType = $label->getLabelType();
|
689 |
|
690 |
+
/**
|
691 |
+
* Get orientation bvased on $labelType returns L = Landscape, P = Portrait
|
692 |
+
*/
|
693 |
+
$pageOrientation = (isset($this->_labelDefaultOrientation[$labelType]))
|
694 |
+
? $this->_labelDefaultOrientation[$labelType]
|
695 |
+
: 'L';
|
696 |
+
|
697 |
if ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL
|
698 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_LABEL_COMBI
|
699 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJE
|
708 |
}
|
709 |
|
710 |
if ($this->getLabelSize() == 'A4' && $this->getIsFirstLabel()) {
|
711 |
+
$pdf->addOrientedPage($pageOrientation, 'A4');
|
712 |
$this->setIsFirstLabel(false);
|
713 |
if (!$this->getLabelCounter()) {
|
714 |
$this->resetLabelCounter();
|
718 |
!$this->getLabelCounter() || $this->getLabelCounter() > 4
|
719 |
)
|
720 |
) {
|
721 |
+
$pdf->addOrientedPage($pageOrientation, 'A4');
|
722 |
$this->resetLabelCounter();
|
723 |
}
|
724 |
|
727 |
*/
|
728 |
if($this->getLabelSize() == 'A6') {
|
729 |
$this->setLabelCounter(3); //used to calculate the top left position
|
730 |
+
$pdf->addOrientedPage($pageOrientation, 'A6');
|
731 |
}
|
732 |
} elseif ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CODCARD) {
|
733 |
+
$pdf->addOrientedPage($pageOrientation, array(156.65, 73.85));
|
734 |
} elseif ($labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CN23
|
735 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_COMMERCIALINVOICE
|
736 |
|| $labelType == TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CODCARD
|
737 |
) {
|
738 |
+
$pdf->addOrientedPage($pageOrientation, 'A4');
|
739 |
}
|
740 |
|
741 |
/**
|
768 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJE:
|
769 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_BUSPAKJEEXTRA:
|
770 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_RETURN_LABEL:
|
771 |
+
$pdf->Rotate(90);
|
772 |
|
773 |
+
$position['x'] = $this->pix2pt(-1037);
|
774 |
+
$position['y'] = $this->pix2pt(413);
|
775 |
+
$position['w'] = $this->pix2pt(538);
|
776 |
+
|
777 |
+
/**
|
778 |
+
* increase the label counter to above 4. This will prompt the creation of a new page.
|
779 |
+
*/
|
780 |
+
$this->setLabelCounter(5);
|
781 |
+
|
782 |
+
$rotate = true;
|
783 |
break;
|
784 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_CN23:
|
785 |
case TIG_PostNL_Model_Core_Shipment_Label::LABEL_TYPE_COMMERCIALINVOICE:
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Barcode
|
@@ -138,6 +138,18 @@ class TIG_PostNL_Model_Core_Observer_Barcode
|
|
138 |
if ($postnlOrder->hasPgRetailNetworkId()) {
|
139 |
$postnlShipment->setPgRetailNetworkId($postnlOrder->getPgRetailNetworkId());
|
140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
|
143 |
/**
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Barcode
|
138 |
if ($postnlOrder->hasPgRetailNetworkId()) {
|
139 |
$postnlShipment->setPgRetailNetworkId($postnlOrder->getPgRetailNetworkId());
|
140 |
}
|
141 |
+
|
142 |
+
if ($postnlOrder->hasIdcheckType()) {
|
143 |
+
$postnlShipment->setIdcheckType($postnlOrder->getIdcheckType());
|
144 |
+
}
|
145 |
+
|
146 |
+
if ($postnlOrder->hasIdcheckNumber()) {
|
147 |
+
$postnlShipment->setIdcheckNumber($postnlOrder->getIdcheckNumber());
|
148 |
+
}
|
149 |
+
|
150 |
+
if ($postnlOrder->hasIdcheckExpirationDate()) {
|
151 |
+
$postnlShipment->setIdcheckExpirationDate($postnlOrder->getIdcheckExpirationDate());
|
152 |
+
}
|
153 |
}
|
154 |
|
155 |
/**
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Cache
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Cache
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Cron
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Cron
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Returns
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_Returns
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_SaveShipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Observer_SaveShipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Order
|
@@ -59,13 +59,15 @@
|
|
59 |
* @method string getCreatedAt()
|
60 |
* @method string getPgLocationCode()
|
61 |
* @method string getPgRetailNetworkId()
|
|
|
|
|
|
|
62 |
*
|
63 |
* @method TIG_PostNL_Model_Core_Order setIsPakketautomaat(int $value)
|
64 |
* @method TIG_PostNL_Model_Core_Order setEntityId(int $value)
|
65 |
* @method TIG_PostNL_Model_Core_Order setOrder(Mage_Sales_Model_Order $value)
|
66 |
* @method TIG_PostNL_Model_Core_Order setQuote(Mage_Sales_Model_Quote $value)
|
67 |
* @method TIG_PostNL_Model_Core_Order setOrderId(int $value)
|
68 |
-
* @method TIG_PostNL_Model_Core_Order setType(string $value)
|
69 |
* @method TIG_PostNL_Model_Core_Order setQuoteId(int $value)
|
70 |
* @method TIG_PostNL_Model_Core_Order setDeliveryDate(string $value)
|
71 |
* @method TIG_PostNL_Model_Core_Order setIsCanceled(int $value)
|
@@ -82,6 +84,9 @@
|
|
82 |
* @method TIG_PostNL_Model_Core_Order setStoreId(int $value)
|
83 |
* @method TIG_PostNL_Model_Core_Order setPgLocationCode(string $value)
|
84 |
* @method TIG_PostNL_Model_Core_Order setPgRetailNetworkId(string $value)
|
|
|
|
|
|
|
85 |
*
|
86 |
* @method boolean hasOrderId()
|
87 |
* @method boolean hasQuoteId()
|
@@ -95,6 +100,9 @@
|
|
95 |
* @method boolean hasStoreId()
|
96 |
* @method string hasPgLocationCode()
|
97 |
* @method string hasPgRetailNetworkId()
|
|
|
|
|
|
|
98 |
*/
|
99 |
class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
|
100 |
{
|
@@ -109,15 +117,18 @@ class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
|
|
109 |
/**
|
110 |
* Available types.
|
111 |
*/
|
112 |
-
const TYPE_OVERDAG
|
113 |
-
const TYPE_AVOND
|
114 |
-
const TYPE_SUNDAY
|
115 |
-
const TYPE_PG
|
116 |
-
const TYPE_PGE
|
117 |
-
const TYPE_PA
|
118 |
-
const TYPE_SAMEDAY
|
119 |
-
const TYPE_FOOD
|
120 |
-
const TYPE_COOLED_FOOD
|
|
|
|
|
|
|
121 |
|
122 |
/**
|
123 |
* Prefix of model events names.
|
@@ -447,6 +458,21 @@ class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
|
|
447 |
return false;
|
448 |
}
|
449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
/**
|
451 |
* Validate the chosen extra options. If an option is invalid, it will be unset.
|
452 |
*
|
@@ -520,6 +546,27 @@ class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
|
|
520 |
return $this;
|
521 |
}
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
/**
|
524 |
* Sets new PostNL Orders to active before saving
|
525 |
*
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Order
|
59 |
* @method string getCreatedAt()
|
60 |
* @method string getPgLocationCode()
|
61 |
* @method string getPgRetailNetworkId()
|
62 |
+
* @method string getIdcheckType()
|
63 |
+
* @method string getIdcheckNumber()
|
64 |
+
* @method string getIdcheckExpirationDate()
|
65 |
*
|
66 |
* @method TIG_PostNL_Model_Core_Order setIsPakketautomaat(int $value)
|
67 |
* @method TIG_PostNL_Model_Core_Order setEntityId(int $value)
|
68 |
* @method TIG_PostNL_Model_Core_Order setOrder(Mage_Sales_Model_Order $value)
|
69 |
* @method TIG_PostNL_Model_Core_Order setQuote(Mage_Sales_Model_Quote $value)
|
70 |
* @method TIG_PostNL_Model_Core_Order setOrderId(int $value)
|
|
|
71 |
* @method TIG_PostNL_Model_Core_Order setQuoteId(int $value)
|
72 |
* @method TIG_PostNL_Model_Core_Order setDeliveryDate(string $value)
|
73 |
* @method TIG_PostNL_Model_Core_Order setIsCanceled(int $value)
|
84 |
* @method TIG_PostNL_Model_Core_Order setStoreId(int $value)
|
85 |
* @method TIG_PostNL_Model_Core_Order setPgLocationCode(string $value)
|
86 |
* @method TIG_PostNL_Model_Core_Order setPgRetailNetworkId(string $value)
|
87 |
+
* @method TIG_PostNL_Model_Core_Order setIdcheckType(string $value)
|
88 |
+
* @method TIG_PostNL_Model_Core_Order setIdcheckNumber(string $value)
|
89 |
+
* @method TIG_PostNL_Model_Core_Order setIdcheckExpirationDate(string $value)
|
90 |
*
|
91 |
* @method boolean hasOrderId()
|
92 |
* @method boolean hasQuoteId()
|
100 |
* @method boolean hasStoreId()
|
101 |
* @method string hasPgLocationCode()
|
102 |
* @method string hasPgRetailNetworkId()
|
103 |
+
* @method string hasIdcheckType()
|
104 |
+
* @method string hasIdcheckNumber()
|
105 |
+
* @method string hasIdcheckExpirationDate()
|
106 |
*/
|
107 |
class TIG_PostNL_Model_Core_Order extends Mage_Core_Model_Abstract
|
108 |
{
|
117 |
/**
|
118 |
* Available types.
|
119 |
*/
|
120 |
+
const TYPE_OVERDAG = 'Overdag';
|
121 |
+
const TYPE_AVOND = 'Avond';
|
122 |
+
const TYPE_SUNDAY = 'Sunday';
|
123 |
+
const TYPE_PG = 'PG';
|
124 |
+
const TYPE_PGE = 'PGE';
|
125 |
+
const TYPE_PA = 'PA';
|
126 |
+
const TYPE_SAMEDAY = 'Sameday';
|
127 |
+
const TYPE_FOOD = 'Food';
|
128 |
+
const TYPE_COOLED_FOOD = 'Cooledfood';
|
129 |
+
const TYPE_AGECHECK = 'AgeCheck';
|
130 |
+
const TYPE_BIRTHDAYCHECK = 'BirthdayCheck';
|
131 |
+
const TYPE_IDCHECK = 'IDCheck';
|
132 |
|
133 |
/**
|
134 |
* Prefix of model events names.
|
458 |
return false;
|
459 |
}
|
460 |
|
461 |
+
/**
|
462 |
+
* Check if this order needs verification at the door.
|
463 |
+
*
|
464 |
+
* @return bool
|
465 |
+
*/
|
466 |
+
public function isIDCheck()
|
467 |
+
{
|
468 |
+
$type = $this->getType();
|
469 |
+
if ($type == self::TYPE_AGECHECK || $type == self::TYPE_BIRTHDAYCHECK || $type == self::TYPE_IDCHECK) {
|
470 |
+
return true;
|
471 |
+
}
|
472 |
+
|
473 |
+
return false;
|
474 |
+
}
|
475 |
+
|
476 |
/**
|
477 |
* Validate the chosen extra options. If an option is invalid, it will be unset.
|
478 |
*
|
546 |
return $this;
|
547 |
}
|
548 |
|
549 |
+
/**
|
550 |
+
* @param $type
|
551 |
+
*
|
552 |
+
* @return $this
|
553 |
+
*/
|
554 |
+
public function setType($type)
|
555 |
+
{
|
556 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
557 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
558 |
+
|
559 |
+
if ($type == $deliveryOptionsHelper::IDCHECK_TYPE_AGE) {
|
560 |
+
return $this->setData('type', self::TYPE_AGECHECK);
|
561 |
+
} elseif ($type == $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY) {
|
562 |
+
return $this->setData('type', self::TYPE_BIRTHDAYCHECK);
|
563 |
+
} elseif ($type == $deliveryOptionsHelper::IDCHECK_TYPE_ID) {
|
564 |
+
return $this->setData('type', self::TYPE_IDCHECK);
|
565 |
+
}
|
566 |
+
|
567 |
+
return $this->setData('type', $type);
|
568 |
+
}
|
569 |
+
|
570 |
/**
|
571 |
* Sets new PostNL Orders to active before saving
|
572 |
*
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_PackingSlip setStoreId(int $value)
|
@@ -905,6 +905,15 @@ class TIG_PostNL_Model_Core_PackingSlip extends Mage_Sales_Model_Order_Pdf_Abstr
|
|
905 |
case $postnlShipment::SHIPMENT_TYPE_COOLED:
|
906 |
$text .= ' (' . $this->getHelper()->__('Cooled Food Delivery') . ')';
|
907 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
908 |
// no default
|
909 |
}
|
910 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Core_PackingSlip setStoreId(int $value)
|
905 |
case $postnlShipment::SHIPMENT_TYPE_COOLED:
|
906 |
$text .= ' (' . $this->getHelper()->__('Cooled Food Delivery') . ')';
|
907 |
break;
|
908 |
+
case $postnlShipment::SHIPMENT_TYPE_AGECHECK:
|
909 |
+
$text .= ' (' . $this->getHelper()->__('Age Check') . ')';
|
910 |
+
break;
|
911 |
+
case $postnlShipment::SHIPMENT_TYPE_BIRTHDAYCHECK:
|
912 |
+
$text .= ' (' . $this->getHelper()->__('Birthday Check') . ')';
|
913 |
+
break;
|
914 |
+
case $postnlShipment::SHIPMENT_TYPE_IDCHECK:
|
915 |
+
$text .= ' (' . $this->getHelper()->__('ID Check') . ')';
|
916 |
+
break;
|
917 |
// no default
|
918 |
}
|
919 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method array getItemColumns()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method array getItemColumns()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Integrity extends TIG_PostNL_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Integrity extends TIG_PostNL_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Integrity_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Integrity_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Order extends TIG_PostNL_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Order extends TIG_PostNL_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Order_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Order_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment extends TIG_PostNL_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment extends TIG_PostNL_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Barcode extends Mage_Core_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Barcode extends Mage_Core_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Barcode_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Label extends Mage_Core_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Label extends Mage_Core_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Label_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Label_Collection extends TIG_PostNL_Model_Resource_Db_Collection_Postnl
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Status_History extends Mage_Core_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Status_History extends Mage_Core_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Status_History_Collection
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Resource_Shipment_Status_History_Collection
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_IntegrityCheck
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_IntegrityCheck
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_InvoiceDummy extends Mage_Sales_Model_Order_Invoice
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_InvoiceDummy extends Mage_Sales_Model_Order_Invoice
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_OrderDummy extends Mage_Sales_Model_Order
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_OrderDummy extends Mage_Sales_Model_Order
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_PaymentDummy extends Mage_Sales_Model_Order_Payment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_PaymentDummy extends Mage_Sales_Model_Order_Payment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_PaymentMethodDummy extends Mage_Payment_Model_Method_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_PaymentMethodDummy extends Mage_Payment_Model_Method_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Service_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
* @package TIG
|
39 |
* @module PostNL
|
@@ -103,6 +103,12 @@
|
|
103 |
* @method boolean getIsSameDayShipment()
|
104 |
* @method boolean getIsFoodShipment()
|
105 |
* @method boolean getIsCooledShipment()
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
* @method int getReturnLabelsPrinted()
|
107 |
* @method string getExpectedDeliveryTimeStart()
|
108 |
* @method string getExpectedDeliveryTimeEnd()
|
@@ -147,6 +153,9 @@
|
|
147 |
* @method TIG_PostNL_Model_Core_Shipment setIsSameDayShipment(bool $value)
|
148 |
* @method TIG_PostNL_Model_Core_Shipment setIsFoodShipment(bool $value)
|
149 |
* @method TIG_PostNL_Model_Core_Shipment setIsCooledShipment(bool $value)
|
|
|
|
|
|
|
150 |
* @method TIG_PostNL_Model_Core_Shipment setDefaultProductCode(string $value)
|
151 |
* @method TIG_PostNL_Model_Core_Shipment setLabels(mixed $value)
|
152 |
* @method TIG_PostNL_Model_Core_Shipment setProductOption(string $value)
|
@@ -186,6 +195,9 @@
|
|
186 |
* @method boolean hasIsSameDayShipment()
|
187 |
* @method boolean hasIsFoodShipment()
|
188 |
* @method boolean hasIsCooledShipment()
|
|
|
|
|
|
|
189 |
* @method boolean hasDefaultProductCode()
|
190 |
* @method boolean hasProductOption()
|
191 |
* @method boolean hasPayment()
|
@@ -224,50 +236,61 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
224 |
/**
|
225 |
* Possible shipment types.
|
226 |
*/
|
227 |
-
const SHIPMENT_TYPE_DOMESTIC
|
228 |
-
const SHIPMENT_TYPE_DOMESTIC_COD
|
229 |
-
const SHIPMENT_TYPE_AVOND
|
230 |
-
const SHIPMENT_TYPE_AVOND_COD
|
231 |
-
const SHIPMENT_TYPE_PG
|
232 |
-
const SHIPMENT_TYPE_PG_COD
|
233 |
-
const SHIPMENT_TYPE_PGE
|
234 |
-
const SHIPMENT_TYPE_PGE_COD
|
235 |
-
const SHIPMENT_TYPE_PA
|
236 |
-
const SHIPMENT_TYPE_EPS
|
237 |
-
const SHIPMENT_TYPE_GLOBALPACK
|
238 |
-
const SHIPMENT_TYPE_BUSPAKJE
|
239 |
-
const SHIPMENT_TYPE_SUNDAY
|
240 |
-
const SHIPMENT_TYPE_MONDAY
|
241 |
-
const SHIPMENT_TYPE_SAMEDAY
|
242 |
-
const SHIPMENT_TYPE_FOOD
|
243 |
-
const SHIPMENT_TYPE_COOLED
|
|
|
|
|
|
|
244 |
|
245 |
/**
|
246 |
* Xpaths to default product options settings.
|
247 |
*/
|
248 |
-
const XPATH_DEFAULT_STANDARD_PRODUCT_OPTION
|
249 |
-
const XPATH_DEFAULT_STANDARD_PRODUCT_OPTION_NETHERLANDS
|
250 |
-
const XPATH_DEFAULT_STANDARD_COD_PRODUCT_OPTION
|
251 |
-
const XPATH_DEFAULT_EVENING_PRODUCT_OPTION
|
252 |
-
const XPATH_DEFAULT_EVENING_COD_PRODUCT_OPTION
|
253 |
-
const XPATH_DEFAULT_PAKJEGEMAK_PRODUCT_OPTION
|
254 |
-
const
|
255 |
-
const
|
256 |
-
const
|
257 |
-
const
|
258 |
-
const
|
259 |
-
const
|
260 |
-
const
|
261 |
-
const
|
262 |
-
const
|
263 |
-
const
|
264 |
-
const
|
265 |
-
const
|
266 |
-
const
|
267 |
-
const
|
268 |
-
const
|
269 |
-
const
|
270 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
/**
|
273 |
* Xpath to weight per parcel config setting.
|
@@ -807,6 +830,18 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
807 |
}
|
808 |
}
|
809 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
810 |
if ($this->isPgeShipment()) {
|
811 |
return self::SHIPMENT_TYPE_PGE;
|
812 |
}
|
@@ -1225,7 +1260,15 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
1225 |
break;
|
1226 |
case self::SHIPMENT_TYPE_PG:
|
1227 |
if ($this->isBelgiumShipment()) {
|
1228 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1229 |
} else {
|
1230 |
$xpath = self::XPATH_DEFAULT_PAKJEGEMAK_PRODUCT_OPTION;
|
1231 |
}
|
@@ -1269,6 +1312,27 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
1269 |
case self::SHIPMENT_TYPE_COOLED:
|
1270 |
$xpath = self::XPATH_DEFAULT_COOLED_PRODUCT_OPTION;
|
1271 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1272 |
|
1273 |
|
1274 |
//no default
|
@@ -1672,7 +1736,16 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
1672 |
$destination = $shippingAddress->getCountryId();
|
1673 |
}
|
1674 |
|
1675 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1676 |
break;
|
1677 |
case self::SHIPMENT_TYPE_PG_COD:
|
1678 |
$allowedProductCodes = $cifHelper->getPakjeGemakCodProductCodes($flat);
|
@@ -1707,6 +1780,27 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
1707 |
case self::SHIPMENT_TYPE_FOOD:
|
1708 |
$allowedProductCodes = $cifHelper->getFoodProductCodes($flat);
|
1709 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1710 |
default:
|
1711 |
$allowedProductCodes = array();
|
1712 |
break;
|
@@ -2293,11 +2387,7 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
2293 |
return true;
|
2294 |
}
|
2295 |
|
2296 |
-
if (
|
2297 |
-
$shippingDestination == 'NL' &&
|
2298 |
-
$domesticCountry == 'BE' &&
|
2299 |
-
$this->getHelper('deliveryOptions')->canUseDutchProducts()
|
2300 |
-
) {
|
2301 |
return true;
|
2302 |
}
|
2303 |
|
@@ -2613,6 +2703,57 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
2613 |
return $isFood;
|
2614 |
}
|
2615 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2616 |
/**
|
2617 |
* Checks if the order of this shipment is a Sunday order.
|
2618 |
*
|
@@ -2696,6 +2837,51 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
2696 |
return false;
|
2697 |
}
|
2698 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2699 |
/**
|
2700 |
* Checks if this shipment is a COD shipment.
|
2701 |
*
|
@@ -4251,18 +4437,21 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
4251 |
|
4252 |
/** @noinspection PhpUndefinedMethodInspection */
|
4253 |
$templateVariables = array(
|
4254 |
-
'postnlshipment'
|
4255 |
-
'barcode'
|
4256 |
-
'barcode_url'
|
4257 |
-
'shipment'
|
4258 |
-
'order'
|
4259 |
-
'payment_html'
|
4260 |
-
'customer'
|
4261 |
-
'quote'
|
4262 |
-
'shipment_comment'
|
4263 |
-
'billing'
|
4264 |
-
'shipping'
|
4265 |
-
'pakje_gemak'
|
|
|
|
|
|
|
4266 |
);
|
4267 |
|
4268 |
$templateVariables = new Varien_Object($templateVariables);
|
@@ -4487,6 +4676,13 @@ class TIG_PostNL_Model_Core_Shipment extends Mage_Core_Model_Abstract
|
|
4487 |
->setLabel(base64_encode($label->Content))
|
4488 |
->setLabelType($labelType);
|
4489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4490 |
$labels = $this->getLabels();
|
4491 |
$labels[] = $postnlLabel;
|
4492 |
$this->setLabels($labels);
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
* @package TIG
|
39 |
* @module PostNL
|
103 |
* @method boolean getIsSameDayShipment()
|
104 |
* @method boolean getIsFoodShipment()
|
105 |
* @method boolean getIsCooledShipment()
|
106 |
+
* @method boolean getIsAgeCheckShipment()
|
107 |
+
* @method boolean getIsBirthdayCheckShipment()
|
108 |
+
* @method boolean getIsIDCheckShipment()
|
109 |
+
* @method boolean getIdcheckExpirationDate()
|
110 |
+
* @method boolean getIdcheckNumber()
|
111 |
+
* @method boolean getIdcheckType()
|
112 |
* @method int getReturnLabelsPrinted()
|
113 |
* @method string getExpectedDeliveryTimeStart()
|
114 |
* @method string getExpectedDeliveryTimeEnd()
|
153 |
* @method TIG_PostNL_Model_Core_Shipment setIsSameDayShipment(bool $value)
|
154 |
* @method TIG_PostNL_Model_Core_Shipment setIsFoodShipment(bool $value)
|
155 |
* @method TIG_PostNL_Model_Core_Shipment setIsCooledShipment(bool $value)
|
156 |
+
* @method TIG_PostNL_Model_Core_Shipment setIsAgeCheckShipment(bool $value)
|
157 |
+
* @method TIG_PostNL_Model_Core_Shipment setIsBirthdayCheckShipment(bool $value)
|
158 |
+
* @method TIG_PostNL_Model_Core_Shipment setIsIDCheckShipment(bool $value)
|
159 |
* @method TIG_PostNL_Model_Core_Shipment setDefaultProductCode(string $value)
|
160 |
* @method TIG_PostNL_Model_Core_Shipment setLabels(mixed $value)
|
161 |
* @method TIG_PostNL_Model_Core_Shipment setProductOption(string $value)
|
195 |
* @method boolean hasIsSameDayShipment()
|
196 |
* @method boolean hasIsFoodShipment()
|
197 |
* @method boolean hasIsCooledShipment()
|
198 |
+
* @method boolean hasIsAgeCheckShipment()
|
199 |
+
* @method boolean hasIsBirthdayCheckShipment()
|
200 |
+
* @method boolean hasIsIDCheckShipment()
|
201 |
* @method boolean hasDefaultProductCode()
|
202 |
* @method boolean hasProductOption()
|
203 |
* @method boolean hasPayment()
|
236 |
/**
|
237 |
* Possible shipment types.
|
238 |
*/
|
239 |
+
const SHIPMENT_TYPE_DOMESTIC = 'domestic';
|
240 |
+
const SHIPMENT_TYPE_DOMESTIC_COD = 'domestic_cod';
|
241 |
+
const SHIPMENT_TYPE_AVOND = 'avond';
|
242 |
+
const SHIPMENT_TYPE_AVOND_COD = 'avond_cod';
|
243 |
+
const SHIPMENT_TYPE_PG = 'pg';
|
244 |
+
const SHIPMENT_TYPE_PG_COD = 'pg_cod';
|
245 |
+
const SHIPMENT_TYPE_PGE = 'pge';
|
246 |
+
const SHIPMENT_TYPE_PGE_COD = 'pge_cod';
|
247 |
+
const SHIPMENT_TYPE_PA = 'pa';
|
248 |
+
const SHIPMENT_TYPE_EPS = 'eps';
|
249 |
+
const SHIPMENT_TYPE_GLOBALPACK = 'globalpack';
|
250 |
+
const SHIPMENT_TYPE_BUSPAKJE = 'buspakje';
|
251 |
+
const SHIPMENT_TYPE_SUNDAY = 'sunday';
|
252 |
+
const SHIPMENT_TYPE_MONDAY = 'monday';
|
253 |
+
const SHIPMENT_TYPE_SAMEDAY = 'sameday';
|
254 |
+
const SHIPMENT_TYPE_FOOD = 'food';
|
255 |
+
const SHIPMENT_TYPE_COOLED = 'cooledfood'; /** @todo rename to 'cooled_food' for consistency */
|
256 |
+
const SHIPMENT_TYPE_AGECHECK = 'AgeCheck';
|
257 |
+
const SHIPMENT_TYPE_BIRTHDAYCHECK = 'BirthdayCheck';
|
258 |
+
const SHIPMENT_TYPE_IDCHECK = 'IDCheck';
|
259 |
|
260 |
/**
|
261 |
* Xpaths to default product options settings.
|
262 |
*/
|
263 |
+
const XPATH_DEFAULT_STANDARD_PRODUCT_OPTION = 'postnl/grid/default_product_option';
|
264 |
+
const XPATH_DEFAULT_STANDARD_PRODUCT_OPTION_NETHERLANDS = 'postnl/grid/default_product_option_netherlands';
|
265 |
+
const XPATH_DEFAULT_STANDARD_COD_PRODUCT_OPTION = 'postnl/cod/default_cod_product_option';
|
266 |
+
const XPATH_DEFAULT_EVENING_PRODUCT_OPTION = 'postnl/grid/default_evening_product_option';
|
267 |
+
const XPATH_DEFAULT_EVENING_COD_PRODUCT_OPTION = 'postnl/cod/default_evening_cod_product_option';
|
268 |
+
const XPATH_DEFAULT_PAKJEGEMAK_PRODUCT_OPTION = 'postnl/grid/default_pakjegemak_product_option';
|
269 |
+
const XPATH_DEFAULT_PAKJEGEMAK_NL_BE_PRODUCT_OPTION = 'postnl/grid/default_pakjegemak_nl_be_product_option';
|
270 |
+
const XPATH_DEFAULT_PAKJEGEMAK_BE_BE_PRODUCT_OPTION = 'postnl/grid/default_pakjegemak_be_be_product_option';
|
271 |
+
const XPATH_DEFAULT_PAKJEGEMAK_BE_NOT_INSURED_PRODUCT_OPTION = 'postnl/grid/default_pakjegemak_be_not_insured_product_option';
|
272 |
+
const XPATH_DEFAULT_PAKJEGEMAK_COD_PRODUCT_OPTION = 'postnl/cod/default_pakjegemak_cod_product_option';
|
273 |
+
const XPATH_DEFAULT_PGE_PRODUCT_OPTION = 'postnl/grid/default_pge_product_option';
|
274 |
+
const XPATH_DEFAULT_PGE_COD_PRODUCT_OPTION = 'postnl/cod/default_pge_cod_product_option';
|
275 |
+
const XPATH_DEFAULT_PAKKETAUTOMAAT_PRODUCT_OPTION = 'postnl/delivery_options/default_pakketautomaat_product_option';
|
276 |
+
const XPATH_DEFAULT_FOOD_PRODUCT_OPTION = 'postnl/delivery_options/default_food_product_option';
|
277 |
+
const XPATH_DEFAULT_COOLED_PRODUCT_OPTION = 'postnl/delivery_options/default_cooled_product_option';
|
278 |
+
const XPATH_DEFAULT_AGECHECK_DELIVERY_PRODUCT_OPTION = 'postnl/grid/default_age_check_delivery_product_option';
|
279 |
+
const XPATH_DEFAULT_AGECHECK_PICKUP_PRODUCT_OPTION = 'postnl/grid/default_age_check_pickup_product_option';
|
280 |
+
const XPATH_DEFAULT_BIRTHDAYCHECK_DELIVERY_PRODUCT_OPTION = 'postnl/grid/default_birthday_check_delivery_product_option';
|
281 |
+
const XPATH_DEFAULT_BIRTHDAYCHECK_PICKUP_PRODUCT_OPTION = 'postnl/grid/default_birthday_check_pickup_product_option';
|
282 |
+
const XPATH_DEFAULT_IDCHECK_DELIVERY_PRODUCT_OPTION = 'postnl/grid/default_id_check_delivery_product_option';
|
283 |
+
const XPATH_DEFAULT_IDCHECK_PICKUP_PRODUCT_OPTION = 'postnl/grid/default_id_check_pickup_product_option';
|
284 |
+
const XPATH_DEFAULT_EU_PRODUCT_OPTION = 'postnl/grid/default_eu_product_option';
|
285 |
+
const XPATH_DEFAULT_EU_BE_PRODUCT_OPTION = 'postnl/grid/default_eu_be_product_option';
|
286 |
+
const XPATH_DEFAULT_GLOBAL_PRODUCT_OPTION = 'postnl/cif_globalpack_settings/default_global_product_option';
|
287 |
+
const XPATH_DEFAULT_BUSPAKJE_PRODUCT_OPTION = 'postnl/grid/default_buspakje_product_option';
|
288 |
+
const XPATH_USE_ALTERNATIVE_DEFAULT = 'postnl/grid/use_alternative_default';
|
289 |
+
const XPATH_ALTERNATIVE_DEFAULT_MAX_AMOUNT = 'postnl/grid/alternative_default_max_amount';
|
290 |
+
const XPATH_ALTERNATIVE_DEFAULT_OPTION = 'postnl/grid/alternative_default_option';
|
291 |
+
const XPATH_DEFAULT_STATED_ADDRESS_ONLY_OPTION = 'postnl/grid/default_stated_address_only_product_option';
|
292 |
+
const XPATH_DEFAULT_SUNDAY_PRODUCT_OPTION = 'postnl/grid/default_sunday_product_option';
|
293 |
+
const XPATH_DEFAULT_SAMEDAY_PRODUCT_OPTION = 'postnl/grid/default_sameday_product_option';
|
294 |
|
295 |
/**
|
296 |
* Xpath to weight per parcel config setting.
|
830 |
}
|
831 |
}
|
832 |
|
833 |
+
if ($this->isAgeCheckShipment()) {
|
834 |
+
return self::SHIPMENT_TYPE_AGECHECK;
|
835 |
+
}
|
836 |
+
|
837 |
+
if ($this->isBirthdayCheckShipment()) {
|
838 |
+
return self::SHIPMENT_TYPE_BIRTHDAYCHECK;
|
839 |
+
}
|
840 |
+
|
841 |
+
if ($this->isIDCheckShipment()) {
|
842 |
+
return self::SHIPMENT_TYPE_IDCHECK;
|
843 |
+
}
|
844 |
+
|
845 |
if ($this->isPgeShipment()) {
|
846 |
return self::SHIPMENT_TYPE_PGE;
|
847 |
}
|
1260 |
break;
|
1261 |
case self::SHIPMENT_TYPE_PG:
|
1262 |
if ($this->isBelgiumShipment()) {
|
1263 |
+
if ($this->getHelper()->getDomesticCountry() == 'BE') {
|
1264 |
+
$xpath = self::XPATH_DEFAULT_PAKJEGEMAK_BE_BE_PRODUCT_OPTION;
|
1265 |
+
} else {
|
1266 |
+
if ($this->getHelper()->canUsePakjegemakBeNotInsured($this->getStoreId())) {
|
1267 |
+
$xpath = self::XPATH_DEFAULT_PAKJEGEMAK_BE_NOT_INSURED_PRODUCT_OPTION;
|
1268 |
+
} else {
|
1269 |
+
$xpath = self::XPATH_DEFAULT_PAKJEGEMAK_NL_BE_PRODUCT_OPTION;
|
1270 |
+
}
|
1271 |
+
}
|
1272 |
} else {
|
1273 |
$xpath = self::XPATH_DEFAULT_PAKJEGEMAK_PRODUCT_OPTION;
|
1274 |
}
|
1312 |
case self::SHIPMENT_TYPE_COOLED:
|
1313 |
$xpath = self::XPATH_DEFAULT_COOLED_PRODUCT_OPTION;
|
1314 |
break;
|
1315 |
+
case self::SHIPMENT_TYPE_AGECHECK:
|
1316 |
+
if ($this->isPakjeGemakShipment()) {
|
1317 |
+
$xpath = self::XPATH_DEFAULT_AGECHECK_PICKUP_PRODUCT_OPTION;
|
1318 |
+
} else {
|
1319 |
+
$xpath = self::XPATH_DEFAULT_AGECHECK_DELIVERY_PRODUCT_OPTION;
|
1320 |
+
}
|
1321 |
+
break;
|
1322 |
+
case self::SHIPMENT_TYPE_BIRTHDAYCHECK:
|
1323 |
+
if ($this->isPakjeGemakShipment()) {
|
1324 |
+
$xpath = self::XPATH_DEFAULT_BIRTHDAYCHECK_PICKUP_PRODUCT_OPTION;
|
1325 |
+
} else {
|
1326 |
+
$xpath = self::XPATH_DEFAULT_BIRTHDAYCHECK_DELIVERY_PRODUCT_OPTION;
|
1327 |
+
}
|
1328 |
+
break;
|
1329 |
+
case self::SHIPMENT_TYPE_IDCHECK:
|
1330 |
+
if ($this->isPakjeGemakShipment()) {
|
1331 |
+
$xpath = self::XPATH_DEFAULT_IDCHECK_PICKUP_PRODUCT_OPTION;
|
1332 |
+
} else {
|
1333 |
+
$xpath = self::XPATH_DEFAULT_IDCHECK_DELIVERY_PRODUCT_OPTION;
|
1334 |
+
}
|
1335 |
+
break;
|
1336 |
|
1337 |
|
1338 |
//no default
|
1736 |
$destination = $shippingAddress->getCountryId();
|
1737 |
}
|
1738 |
|
1739 |
+
$group = 'default';
|
1740 |
+
if ($this->isAgeCheckShipment()) {
|
1741 |
+
$group = 'AgeCheck';
|
1742 |
+
} elseif ($this->isBirthdayCheckShipment()) {
|
1743 |
+
$group = 'BirthdayCheck';
|
1744 |
+
} elseif ($this->isIDCheckShipment()) {
|
1745 |
+
$group = 'IDCheck';
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
$allowedProductCodes = $cifHelper->getPakjeGemakProductCodes($flat, $destination, $group);
|
1749 |
break;
|
1750 |
case self::SHIPMENT_TYPE_PG_COD:
|
1751 |
$allowedProductCodes = $cifHelper->getPakjeGemakCodProductCodes($flat);
|
1780 |
case self::SHIPMENT_TYPE_FOOD:
|
1781 |
$allowedProductCodes = $cifHelper->getFoodProductCodes($flat);
|
1782 |
break;
|
1783 |
+
case self::SHIPMENT_TYPE_AGECHECK:
|
1784 |
+
if ($this->isPakjeGemakShipment()) {
|
1785 |
+
$allowedProductCodes = $cifHelper->getAgeCheckPakjegemakProductCodes($flat);
|
1786 |
+
} else {
|
1787 |
+
$allowedProductCodes = $cifHelper->getAgeCheckProductCodes($flat);
|
1788 |
+
}
|
1789 |
+
break;
|
1790 |
+
case self::SHIPMENT_TYPE_BIRTHDAYCHECK:
|
1791 |
+
if ($this->isPakjeGemakShipment()) {
|
1792 |
+
$allowedProductCodes = $cifHelper->getBirthdayCheckPakjegemakProductCodes($flat);
|
1793 |
+
} else {
|
1794 |
+
$allowedProductCodes = $cifHelper->getBirthdayCheckProductCodes($flat);
|
1795 |
+
}
|
1796 |
+
break;
|
1797 |
+
case self::SHIPMENT_TYPE_IDCHECK:
|
1798 |
+
if ($this->isPakjeGemakShipment()) {
|
1799 |
+
$allowedProductCodes = $cifHelper->getIDCheckPakjegemakProductCodes($flat);
|
1800 |
+
} else {
|
1801 |
+
$allowedProductCodes = $cifHelper->getIDCheckProductCodes($flat);
|
1802 |
+
}
|
1803 |
+
break;
|
1804 |
default:
|
1805 |
$allowedProductCodes = array();
|
1806 |
break;
|
2387 |
return true;
|
2388 |
}
|
2389 |
|
2390 |
+
if ($domesticCountry == 'BE' && $this->getHelper('deliveryOptions')->canUseDutchProducts(false)) {
|
|
|
|
|
|
|
|
|
2391 |
return true;
|
2392 |
}
|
2393 |
|
2703 |
return $isFood;
|
2704 |
}
|
2705 |
|
2706 |
+
/**
|
2707 |
+
* Check if this shipment is a age check shipment.
|
2708 |
+
*
|
2709 |
+
* @return bool
|
2710 |
+
*/
|
2711 |
+
public function isAgeCheckShipment()
|
2712 |
+
{
|
2713 |
+
if ($this->hasIsAgeCheckShipment()) {
|
2714 |
+
return $this->getIsAgeCheckShipment();
|
2715 |
+
}
|
2716 |
+
|
2717 |
+
$value = $this->isAgeCheck();
|
2718 |
+
|
2719 |
+
$this->setIsAgeCheckShipment($value);
|
2720 |
+
return $value;
|
2721 |
+
}
|
2722 |
+
|
2723 |
+
/**
|
2724 |
+
* Check if this shipment is a birthday check shipment.
|
2725 |
+
*
|
2726 |
+
* @return bool
|
2727 |
+
*/
|
2728 |
+
public function isBirthdayCheckShipment()
|
2729 |
+
{
|
2730 |
+
if ($this->hasIsBirthdayCheckShipment()) {
|
2731 |
+
return $this->getIsBirthdayCheckShipment();
|
2732 |
+
}
|
2733 |
+
|
2734 |
+
$value = $this->isBirthdayCheck();
|
2735 |
+
|
2736 |
+
$this->setIsAgeCheckShipment($value);
|
2737 |
+
return $value;
|
2738 |
+
}
|
2739 |
+
|
2740 |
+
/**
|
2741 |
+
* Check if this shipment is a ID check shipment.
|
2742 |
+
*
|
2743 |
+
* @return bool
|
2744 |
+
*/
|
2745 |
+
public function isIDCheckShipment()
|
2746 |
+
{
|
2747 |
+
if ($this->hasIsIDCheckShipment()) {
|
2748 |
+
return $this->getIsIDCheckShipment();
|
2749 |
+
}
|
2750 |
+
|
2751 |
+
$value = $this->isIDCheck();
|
2752 |
+
|
2753 |
+
$this->setIsIDCheckShipment($value);
|
2754 |
+
return $value;
|
2755 |
+
}
|
2756 |
+
|
2757 |
/**
|
2758 |
* Checks if the order of this shipment is a Sunday order.
|
2759 |
*
|
2837 |
return false;
|
2838 |
}
|
2839 |
|
2840 |
+
/**
|
2841 |
+
* Checks if the order of this shipment is a age check order.
|
2842 |
+
*
|
2843 |
+
* @return bool
|
2844 |
+
*/
|
2845 |
+
public function isAgeCheck()
|
2846 |
+
{
|
2847 |
+
$postnlOrder = $this->getPostnlOrder();
|
2848 |
+
if ($postnlOrder && $postnlOrder->getType() == $postnlOrder::TYPE_AGECHECK) {
|
2849 |
+
return true;
|
2850 |
+
}
|
2851 |
+
|
2852 |
+
return false;
|
2853 |
+
}
|
2854 |
+
|
2855 |
+
/**
|
2856 |
+
* Checks if the order of this shipment is a birthday check order.
|
2857 |
+
*
|
2858 |
+
* @return bool
|
2859 |
+
*/
|
2860 |
+
public function isBirthdayCheck()
|
2861 |
+
{
|
2862 |
+
$postnlOrder = $this->getPostnlOrder();
|
2863 |
+
if ($postnlOrder && $postnlOrder->getType() == $postnlOrder::TYPE_BIRTHDAYCHECK) {
|
2864 |
+
return true;
|
2865 |
+
}
|
2866 |
+
|
2867 |
+
return false;
|
2868 |
+
}
|
2869 |
+
|
2870 |
+
/**
|
2871 |
+
* Checks if the order of this shipment is a ID check order.
|
2872 |
+
*
|
2873 |
+
* @return bool
|
2874 |
+
*/
|
2875 |
+
public function isIDCheck()
|
2876 |
+
{
|
2877 |
+
$postnlOrder = $this->getPostnlOrder();
|
2878 |
+
if ($postnlOrder && $postnlOrder->getType() == $postnlOrder::TYPE_IDCHECK) {
|
2879 |
+
return true;
|
2880 |
+
}
|
2881 |
+
|
2882 |
+
return false;
|
2883 |
+
}
|
2884 |
+
|
2885 |
/**
|
2886 |
* Checks if this shipment is a COD shipment.
|
2887 |
*
|
4437 |
|
4438 |
/** @noinspection PhpUndefinedMethodInspection */
|
4439 |
$templateVariables = array(
|
4440 |
+
'postnlshipment' => $this,
|
4441 |
+
'barcode' => $this->getMainBarcode(),
|
4442 |
+
'barcode_url' => $this->getBarcodeUrl(false),
|
4443 |
+
'shipment' => $shipment,
|
4444 |
+
'order' => $order,
|
4445 |
+
'payment_html' => $paymentBlockHtml,
|
4446 |
+
'customer' => $order->getCustomer(),
|
4447 |
+
'quote' => $order->getQuote(),
|
4448 |
+
'shipment_comment' => '', /** @todo add last shipment comment */
|
4449 |
+
'billing' => $order->getBillingAddress(),
|
4450 |
+
'shipping' => $order->getShippingAddress(),
|
4451 |
+
'pakje_gemak' => $this->getPakjeGemakAddress(),
|
4452 |
+
'is_age_check' => $this->isAgeCheckShipment(),
|
4453 |
+
'is_birthday_check' => $this->isBirthdayCheckShipment(),
|
4454 |
+
'is_id_check' => $this->isIDCheckShipment(),
|
4455 |
);
|
4456 |
|
4457 |
$templateVariables = new Varien_Object($templateVariables);
|
4676 |
->setLabel(base64_encode($label->Content))
|
4677 |
->setLabelType($labelType);
|
4678 |
|
4679 |
+
/**
|
4680 |
+
* PG BE labels are slightly bigger than the rest, so resize them back so they fix everywhere.
|
4681 |
+
*/
|
4682 |
+
if ($this->getShipmentType() == self::SHIPMENT_TYPE_PG && $this->getShippingAddress()->getCountryId() == 'BE') {
|
4683 |
+
$postnlLabel->setResize(true);
|
4684 |
+
}
|
4685 |
+
|
4686 |
$labels = $this->getLabels();
|
4687 |
$labels[] = $postnlLabel;
|
4688 |
$this->setLabels($labels);
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Barcode
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Barcode
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Label
|
@@ -45,6 +45,8 @@
|
|
45 |
* @method TIG_PostNL_Model_Core_Shipment_Label setLabel(string $value)
|
46 |
* @method int getParentId()
|
47 |
* @method TIG_PostNL_Model_Core_Shipment_Label setParentId(int $value)
|
|
|
|
|
48 |
*/
|
49 |
class TIG_PostNL_Model_Core_Shipment_Label extends Mage_Core_Model_Abstract
|
50 |
{
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Label
|
45 |
* @method TIG_PostNL_Model_Core_Shipment_Label setLabel(string $value)
|
46 |
* @method int getParentId()
|
47 |
* @method TIG_PostNL_Model_Core_Shipment_Label setParentId(int $value)
|
48 |
+
* @method bool getResize()
|
49 |
+
* @method TIG_PostNL_Model_Core_Shipment_Label setResize(bool $value)
|
50 |
*/
|
51 |
class TIG_PostNL_Model_Core_Shipment_Label extends Mage_Core_Model_Abstract
|
52 |
{
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Shipment_Process extends Mage_Index_Model_Process
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_Shipment_Process extends Mage_Index_Model_Process
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Status_History
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Class TIG_PostNL_Model_Core_Shipment_Status_History
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_HourMinute extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_HourMinute extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Simplexml_Element getFieldConfig()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Varien_Simplexml_Element getFieldConfig()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_ProductType extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_ProductType extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_SenderCountry extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Backend_SenderCountry extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsIncludingTax()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasIsIncludingTax()
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_AgeCheckPakjegemakProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
array(
|
47 |
+
'value' => '3571',
|
48 |
+
'label' => 'Post Office + Agecheck 18+',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isCod' => false,
|
51 |
+
'statedAddressOnly' => false,
|
52 |
+
'isBelgiumOnly' => false,
|
53 |
+
'group' => 'AgeCheck',
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'value' => '3574',
|
57 |
+
'label' => 'Post Office + Notification + Agecheck 18+',
|
58 |
+
'isExtraCover' => false,
|
59 |
+
'isCod' => false,
|
60 |
+
'isPge' => true,
|
61 |
+
'statedAddressOnly' => false,
|
62 |
+
'isBelgiumOnly' => false,
|
63 |
+
'group' => 'AgeCheck',
|
64 |
+
),
|
65 |
+
array(
|
66 |
+
'value' => '3581',
|
67 |
+
'label' => 'Post Office + Extra Cover + Agecheck 18+',
|
68 |
+
'isExtraCover' => true,
|
69 |
+
'isCod' => false,
|
70 |
+
'statedAddressOnly' => false,
|
71 |
+
'isBelgiumOnly' => false,
|
72 |
+
'group' => 'AgeCheck',
|
73 |
+
),
|
74 |
+
array(
|
75 |
+
'value' => '3584',
|
76 |
+
'label' => 'Post Office + Extra Cover + Notification + Agecheck 18+',
|
77 |
+
'isExtraCover' => true,
|
78 |
+
'isCod' => false,
|
79 |
+
'isPge' => true,
|
80 |
+
'statedAddressOnly' => false,
|
81 |
+
'isBelgiumOnly' => false,
|
82 |
+
'group' => 'AgeCheck',
|
83 |
+
),
|
84 |
+
);
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Get available id check options
|
88 |
+
*
|
89 |
+
* @param bool $flat
|
90 |
+
*
|
91 |
+
* @return array
|
92 |
+
*/
|
93 |
+
public function getAvailableOptions($flat = false)
|
94 |
+
{
|
95 |
+
return $this->getOptions(array(), $flat, true);
|
96 |
+
}
|
97 |
+
}
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_AgeCheckProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
array(
|
47 |
+
'value' => '3438',
|
48 |
+
'label' => 'Parcel with Agecheck 18+',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isAvond' => true,
|
51 |
+
'isSunday' => true,
|
52 |
+
'isCod' => false,
|
53 |
+
'isSameDay' => true,
|
54 |
+
'statedAddressOnly' => false,
|
55 |
+
'countryLimitation' => 'NL',
|
56 |
+
),
|
57 |
+
array(
|
58 |
+
'value' => '3443',
|
59 |
+
'label' => 'Parcel with Extra Cover + Agecheck 18+',
|
60 |
+
'isExtraCover' => true,
|
61 |
+
'isAvond' => true,
|
62 |
+
'isSunday' => true,
|
63 |
+
'isCod' => false,
|
64 |
+
'isSameDay' => true,
|
65 |
+
'statedAddressOnly' => false,
|
66 |
+
'countryLimitation' => 'NL',
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'value' => '3446',
|
70 |
+
'label' => 'Parcel with Extra Cover + Agecheck 18+ Return when not home',
|
71 |
+
'isExtraCover' => true,
|
72 |
+
'isAvond' => true,
|
73 |
+
'isSunday' => true,
|
74 |
+
'isCod' => false,
|
75 |
+
'isSameDay' => true,
|
76 |
+
'statedAddressOnly' => false,
|
77 |
+
'countryLimitation' => 'NL',
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'value' => '3449',
|
81 |
+
'label' => 'Parcel with Agecheck 18+ Return when not home',
|
82 |
+
'isExtraCover' => false,
|
83 |
+
'isAvond' => true,
|
84 |
+
'isSunday' => true,
|
85 |
+
'isCod' => false,
|
86 |
+
'isSameDay' => true,
|
87 |
+
'statedAddressOnly' => false,
|
88 |
+
'countryLimitation' => 'NL',
|
89 |
+
),
|
90 |
+
array(
|
91 |
+
'value' => '3437',
|
92 |
+
'label' => 'Parcel with Agecheck 18+ Neighbors',
|
93 |
+
'isExtraCover' => false,
|
94 |
+
'isAvond' => true,
|
95 |
+
'isSunday' => true,
|
96 |
+
'isCod' => false,
|
97 |
+
'isSameDay' => true,
|
98 |
+
'statedAddressOnly' => false,
|
99 |
+
'countryLimitation' => 'NL',
|
100 |
+
),
|
101 |
+
);
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Get available id check options
|
105 |
+
*
|
106 |
+
* @param bool $flat
|
107 |
+
*
|
108 |
+
* @return array
|
109 |
+
*/
|
110 |
+
public function getAvailableOptions($flat = false)
|
111 |
+
{
|
112 |
+
return $this->getOptions(array(), $flat, true);
|
113 |
+
}
|
114 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
@@ -281,7 +281,7 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
|
281 |
),
|
282 |
'4932' => array(
|
283 |
'value' => '4932',
|
284 |
-
'label' => 'Post Office',
|
285 |
'isExtraCover' => false,
|
286 |
'isSunday' => false,
|
287 |
'isPge' => false,
|
@@ -290,6 +290,28 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
|
290 |
'countryLimitation' => 'NL',
|
291 |
'group' => 'pakjegemak_be_options',
|
292 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
'4952' => array(
|
294 |
'value' => '4952',
|
295 |
'label' => 'EU Pack Special Consumer (incl. signature)',
|
@@ -452,6 +474,317 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
|
452 |
'countryLimitation' => 'NL',
|
453 |
'group' => 'cooled_options',
|
454 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
);
|
456 |
|
457 |
/**
|
@@ -468,6 +801,9 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
|
468 |
'sunday_options' => 'Sunday options',
|
469 |
'food_options' => 'Food Delivery Options',
|
470 |
'cooled_options' => 'Cooled Delivery Options',
|
|
|
|
|
|
|
471 |
);
|
472 |
|
473 |
/**
|
@@ -517,9 +853,40 @@ class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
|
517 |
$options['4955'] = $helper->__('EU Pack Standard (Belgium only, no signature)');
|
518 |
}
|
519 |
|
520 |
-
ksort($options);
|
521 |
}
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
return $options;
|
524 |
}
|
525 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
281 |
),
|
282 |
'4932' => array(
|
283 |
'value' => '4932',
|
284 |
+
'label' => '4932 - Post Office Belgium + Extra Cover',
|
285 |
'isExtraCover' => false,
|
286 |
'isSunday' => false,
|
287 |
'isPge' => false,
|
290 |
'countryLimitation' => 'NL',
|
291 |
'group' => 'pakjegemak_be_options',
|
292 |
),
|
293 |
+
'4878' => array(
|
294 |
+
'value' => '4878',
|
295 |
+
'label' => '4878 - Post Office Belgium + Extra Cover',
|
296 |
+
'isExtraCover' => false,
|
297 |
+
'isSunday' => false,
|
298 |
+
'isPge' => false,
|
299 |
+
'isCod' => false,
|
300 |
+
'isBelgiumOnly' => true,
|
301 |
+
'countryLimitation' => 'BE',
|
302 |
+
'group' => 'pakjegemak_be_options',
|
303 |
+
),
|
304 |
+
'4880' => array(
|
305 |
+
'value' => '4880',
|
306 |
+
'label' => '4880 - Post Office Belgium',
|
307 |
+
'isExtraCover' => false,
|
308 |
+
'isSunday' => false,
|
309 |
+
'isPge' => false,
|
310 |
+
'isCod' => false,
|
311 |
+
'isBelgiumOnly' => true,
|
312 |
+
'countryLimitation' => 'BE',
|
313 |
+
'group' => 'pakjegemak_be_options',
|
314 |
+
),
|
315 |
'4952' => array(
|
316 |
'value' => '4952',
|
317 |
'label' => 'EU Pack Special Consumer (incl. signature)',
|
474 |
'countryLimitation' => 'NL',
|
475 |
'group' => 'cooled_options',
|
476 |
),
|
477 |
+
/** New Codes for Age, ID and Birthday check */
|
478 |
+
'3438' => array(
|
479 |
+
'value' => '3438',
|
480 |
+
'label' => 'Parcel with Agecheck 18+',
|
481 |
+
'isExtraCover' => false,
|
482 |
+
'isAvond' => true,
|
483 |
+
'isSunday' => true,
|
484 |
+
'isCod' => false,
|
485 |
+
'isSameDay' => true,
|
486 |
+
'statedAddressOnly' => false,
|
487 |
+
'countryLimitation' => 'NL',
|
488 |
+
'group' => 'agecheck_options'
|
489 |
+
),
|
490 |
+
'3443' => array(
|
491 |
+
'value' => '3443',
|
492 |
+
'label' => 'Parcel with Extra Cover + Agecheck 18+',
|
493 |
+
'isExtraCover' => true,
|
494 |
+
'isAvond' => true,
|
495 |
+
'isSunday' => true,
|
496 |
+
'isCod' => false,
|
497 |
+
'isSameDay' => true,
|
498 |
+
'statedAddressOnly' => false,
|
499 |
+
'countryLimitation' => 'NL',
|
500 |
+
'group' => 'agecheck_options'
|
501 |
+
),
|
502 |
+
'3446' => array(
|
503 |
+
'value' => '3446',
|
504 |
+
'label' => 'Parcel with Extra Cover + Agecheck 18+ Return when not home',
|
505 |
+
'isExtraCover' => true,
|
506 |
+
'isAvond' => true,
|
507 |
+
'isSunday' => true,
|
508 |
+
'isCod' => false,
|
509 |
+
'isSameDay' => true,
|
510 |
+
'statedAddressOnly' => false,
|
511 |
+
'countryLimitation' => 'NL',
|
512 |
+
'group' => 'agecheck_options'
|
513 |
+
),
|
514 |
+
'3449' => array(
|
515 |
+
'value' => '3449',
|
516 |
+
'label' => 'Parcel with Agecheck 18+ Return when not home',
|
517 |
+
'isExtraCover' => false,
|
518 |
+
'isAvond' => true,
|
519 |
+
'isSunday' => true,
|
520 |
+
'isCod' => false,
|
521 |
+
'isSameDay' => true,
|
522 |
+
'statedAddressOnly' => false,
|
523 |
+
'countryLimitation' => 'NL',
|
524 |
+
'group' => 'agecheck_options'
|
525 |
+
),
|
526 |
+
'3437' => array(
|
527 |
+
'value' => '3437',
|
528 |
+
'label' => 'Parcel with Agecheck 18+ Neighbors',
|
529 |
+
'isExtraCover' => false,
|
530 |
+
'isAvond' => true,
|
531 |
+
'isSunday' => true,
|
532 |
+
'isCod' => false,
|
533 |
+
'isSameDay' => true,
|
534 |
+
'statedAddressOnly' => false,
|
535 |
+
'countryLimitation' => 'NL',
|
536 |
+
'group' => 'agecheck_options'
|
537 |
+
),
|
538 |
+
'3571' => array(
|
539 |
+
'value' => '3571',
|
540 |
+
'label' => 'Post Office + Agecheck 18+',
|
541 |
+
'isExtraCover' => false,
|
542 |
+
'isAvond' => true,
|
543 |
+
'isSunday' => true,
|
544 |
+
'isCod' => false,
|
545 |
+
'isSameDay' => true,
|
546 |
+
'statedAddressOnly' => false,
|
547 |
+
'countryLimitation' => 'NL',
|
548 |
+
'group' => 'pakjegemak_options'
|
549 |
+
),
|
550 |
+
'3574' => array(
|
551 |
+
'value' => '3574',
|
552 |
+
'label' => 'Post Office + Notification + Agecheck 18+',
|
553 |
+
'isExtraCover' => false,
|
554 |
+
'isAvond' => true,
|
555 |
+
'isSunday' => true,
|
556 |
+
'isCod' => false,
|
557 |
+
'isSameDay' => true,
|
558 |
+
'isPge' => true,
|
559 |
+
'statedAddressOnly' => false,
|
560 |
+
'countryLimitation' => 'NL',
|
561 |
+
'group' => 'pakjegemak_options'
|
562 |
+
),
|
563 |
+
'3581' => array(
|
564 |
+
'value' => '3581',
|
565 |
+
'label' => 'Post Office + Extra Cover + Agecheck 18+',
|
566 |
+
'isExtraCover' => true,
|
567 |
+
'isAvond' => true,
|
568 |
+
'isSunday' => true,
|
569 |
+
'isCod' => false,
|
570 |
+
'isSameDay' => true,
|
571 |
+
'statedAddressOnly' => false,
|
572 |
+
'countryLimitation' => 'NL',
|
573 |
+
'group' => 'pakjegemak_options'
|
574 |
+
),
|
575 |
+
'3584' => array(
|
576 |
+
'value' => '3584',
|
577 |
+
'label' => 'Post Office + Extra Cover + Notification + Agecheck 18+',
|
578 |
+
'isExtraCover' => true,
|
579 |
+
'isAvond' => true,
|
580 |
+
'isSunday' => true,
|
581 |
+
'isCod' => false,
|
582 |
+
'isSameDay' => true,
|
583 |
+
'isPge' => true,
|
584 |
+
'statedAddressOnly' => false,
|
585 |
+
'countryLimitation' => 'NL',
|
586 |
+
'group' => 'pakjegemak_options'
|
587 |
+
),
|
588 |
+
'3442' => array(
|
589 |
+
'value' => '3442',
|
590 |
+
'label' => 'Parcel with ID check (based on ID-number)',
|
591 |
+
'isExtraCover' => false,
|
592 |
+
'isAvond' => true,
|
593 |
+
'isSunday' => true,
|
594 |
+
'isCod' => false,
|
595 |
+
'isSameDay' => true,
|
596 |
+
'statedAddressOnly' => false,
|
597 |
+
'countryLimitation' => 'NL',
|
598 |
+
'group' => 'id_check_options'
|
599 |
+
),
|
600 |
+
'3445' => array(
|
601 |
+
'value' => '3445',
|
602 |
+
'label' => 'Parcel with Extra Cover + ID check',
|
603 |
+
'isExtraCover' => true,
|
604 |
+
'isAvond' => true,
|
605 |
+
'isSunday' => true,
|
606 |
+
'isCod' => false,
|
607 |
+
'isSameDay' => true,
|
608 |
+
'statedAddressOnly' => false,
|
609 |
+
'countryLimitation' => 'NL',
|
610 |
+
'group' => 'id_check_options'
|
611 |
+
),
|
612 |
+
'3448' => array(
|
613 |
+
'value' => '3448',
|
614 |
+
'label' => 'Parcel with Extra Cover + ID check + Return when not home',
|
615 |
+
'isExtraCover' => true,
|
616 |
+
'isAvond' => true,
|
617 |
+
'isSunday' => true,
|
618 |
+
'isCod' => false,
|
619 |
+
'isSameDay' => true,
|
620 |
+
'statedAddressOnly' => false,
|
621 |
+
'countryLimitation' => 'NL',
|
622 |
+
'group' => 'id_check_options'
|
623 |
+
),
|
624 |
+
'3451' => array(
|
625 |
+
'value' => '3451',
|
626 |
+
'label' => 'Parcel with ID check + Return when not home',
|
627 |
+
'isExtraCover' => false,
|
628 |
+
'isAvond' => true,
|
629 |
+
'isSunday' => true,
|
630 |
+
'isCod' => false,
|
631 |
+
'isSameDay' => true,
|
632 |
+
'statedAddressOnly' => false,
|
633 |
+
'countryLimitation' => 'NL',
|
634 |
+
'group' => 'id_check_options'
|
635 |
+
),
|
636 |
+
'3573' => array(
|
637 |
+
'value' => '3573',
|
638 |
+
'label' => 'Post Office + ID Check',
|
639 |
+
'isExtraCover' => false,
|
640 |
+
'isAvond' => true,
|
641 |
+
'isSunday' => true,
|
642 |
+
'isPge' => false,
|
643 |
+
'isCod' => false,
|
644 |
+
'isSameDay' => true,
|
645 |
+
'statedAddressOnly' => false,
|
646 |
+
'countryLimitation' => 'NL',
|
647 |
+
'group' => 'pakjegemak_options'
|
648 |
+
),
|
649 |
+
'3576' => array(
|
650 |
+
'value' => '3576',
|
651 |
+
'label' => 'Post Office + Notification + ID Check',
|
652 |
+
'isExtraCover' => false,
|
653 |
+
'isAvond' => true,
|
654 |
+
'isSunday' => true,
|
655 |
+
'isCod' => false,
|
656 |
+
'isPge' => true,
|
657 |
+
'isSameDay' => true,
|
658 |
+
'statedAddressOnly' => false,
|
659 |
+
'countryLimitation' => 'NL',
|
660 |
+
'group' => 'pakjegemak_options'
|
661 |
+
),
|
662 |
+
'3583' => array(
|
663 |
+
'value' => '3583',
|
664 |
+
'label' => 'Post Office + Extra Cover + ID Check',
|
665 |
+
'isExtraCover' => true,
|
666 |
+
'isAvond' => true,
|
667 |
+
'isSunday' => true,
|
668 |
+
'isCod' => false,
|
669 |
+
'isPge' => false,
|
670 |
+
'isSameDay' => true,
|
671 |
+
'statedAddressOnly' => false,
|
672 |
+
'countryLimitation' => 'NL',
|
673 |
+
'group' => 'pakjegemak_options'
|
674 |
+
),
|
675 |
+
'3586' => array(
|
676 |
+
'value' => '3586',
|
677 |
+
'label' => 'Post Office + Extra Cover + Notification + ID Check',
|
678 |
+
'isExtraCover' => true,
|
679 |
+
'isAvond' => true,
|
680 |
+
'isSunday' => true,
|
681 |
+
'isCod' => false,
|
682 |
+
'isPge' => true,
|
683 |
+
'isSameDay' => true,
|
684 |
+
'statedAddressOnly' => false,
|
685 |
+
'countryLimitation' => 'NL',
|
686 |
+
'group' => 'pakjegemak_options'
|
687 |
+
),
|
688 |
+
'3440' => array(
|
689 |
+
'value' => '3440',
|
690 |
+
'label' => 'Parcel with Birthday Check',
|
691 |
+
'isExtraCover' => false,
|
692 |
+
'isAvond' => true,
|
693 |
+
'isSunday' => true,
|
694 |
+
'isCod' => false,
|
695 |
+
'isSameDay' => true,
|
696 |
+
'statedAddressOnly' => false,
|
697 |
+
'countryLimitation' => 'NL',
|
698 |
+
'group' => 'birthday_check_options'
|
699 |
+
),
|
700 |
+
'3444' => array(
|
701 |
+
'value' => '3444',
|
702 |
+
'label' => 'Parcel with Extra Cover + Birthday Check',
|
703 |
+
'isExtraCover' => true,
|
704 |
+
'isAvond' => true,
|
705 |
+
'isSunday' => true,
|
706 |
+
'isCod' => false,
|
707 |
+
'isSameDay' => true,
|
708 |
+
'statedAddressOnly' => false,
|
709 |
+
'countryLimitation' => 'NL',
|
710 |
+
'group' => 'birthday_check_options'
|
711 |
+
),
|
712 |
+
'3447' => array(
|
713 |
+
'value' => '3447',
|
714 |
+
'label' => 'Parcel with Extra Cover + Birthday Check + Return when not home',
|
715 |
+
'isExtraCover' => true,
|
716 |
+
'isAvond' => true,
|
717 |
+
'isSunday' => true,
|
718 |
+
'isCod' => false,
|
719 |
+
'isSameDay' => true,
|
720 |
+
'statedAddressOnly' => false,
|
721 |
+
'countryLimitation' => 'NL',
|
722 |
+
'group' => 'birthday_check_options'
|
723 |
+
),
|
724 |
+
'3450' => array(
|
725 |
+
'value' => '3450',
|
726 |
+
'label' => 'Parcel with Birthday Check + Return when not home',
|
727 |
+
'isExtraCover' => false,
|
728 |
+
'isAvond' => true,
|
729 |
+
'isSunday' => true,
|
730 |
+
'isCod' => false,
|
731 |
+
'isSameDay' => true,
|
732 |
+
'statedAddressOnly' => false,
|
733 |
+
'countryLimitation' => 'NL',
|
734 |
+
'group' => 'birthday_check_options'
|
735 |
+
),
|
736 |
+
'3572' => array(
|
737 |
+
'value' => '3572',
|
738 |
+
'label' => 'Post Office + Birthday Check',
|
739 |
+
'isExtraCover' => false,
|
740 |
+
'isAvond' => true,
|
741 |
+
'isSunday' => true,
|
742 |
+
'isCod' => false,
|
743 |
+
'isSameDay' => true,
|
744 |
+
'isPge' => false,
|
745 |
+
'statedAddressOnly' => false,
|
746 |
+
'countryLimitation' => 'NL',
|
747 |
+
'group' => 'pakjegemak_options'
|
748 |
+
),
|
749 |
+
'3575' => array(
|
750 |
+
'value' => '3575',
|
751 |
+
'label' => 'Post Office + Notification + Birthday Check',
|
752 |
+
'isExtraCover' => false,
|
753 |
+
'isAvond' => true,
|
754 |
+
'isSunday' => true,
|
755 |
+
'isCod' => false,
|
756 |
+
'isSameDay' => true,
|
757 |
+
'isPge' => true,
|
758 |
+
'statedAddressOnly' => false,
|
759 |
+
'countryLimitation' => 'NL',
|
760 |
+
'group' => 'pakjegemak_options'
|
761 |
+
),
|
762 |
+
'3582' => array(
|
763 |
+
'value' => '3582',
|
764 |
+
'label' => 'Post Office + Extra Cover + Birthday Check',
|
765 |
+
'isExtraCover' => true,
|
766 |
+
'isAvond' => true,
|
767 |
+
'isSunday' => true,
|
768 |
+
'isCod' => false,
|
769 |
+
'isSameDay' => true,
|
770 |
+
'isPge' => false,
|
771 |
+
'statedAddressOnly' => false,
|
772 |
+
'countryLimitation' => 'NL',
|
773 |
+
'group' => 'pakjegemak_options'
|
774 |
+
),
|
775 |
+
'3585' => array(
|
776 |
+
'value' => '3585',
|
777 |
+
'label' => 'Post Office + Extra Cover + Notification + Birthday Check',
|
778 |
+
'isExtraCover' => true,
|
779 |
+
'isAvond' => true,
|
780 |
+
'isSunday' => true,
|
781 |
+
'isCod' => false,
|
782 |
+
'isSameDay' => true,
|
783 |
+
'isPge' => true,
|
784 |
+
'statedAddressOnly' => false,
|
785 |
+
'countryLimitation' => 'NL',
|
786 |
+
'group' => 'pakjegemak_options'
|
787 |
+
),
|
788 |
);
|
789 |
|
790 |
/**
|
801 |
'sunday_options' => 'Sunday options',
|
802 |
'food_options' => 'Food Delivery Options',
|
803 |
'cooled_options' => 'Cooled Delivery Options',
|
804 |
+
'agecheck_options' => 'Parcel with Age check Options',
|
805 |
+
'id_check_options' => 'Parcel with ID check Options',
|
806 |
+
'birthday_check_options' => 'Parcel with Birthday Check Options',
|
807 |
);
|
808 |
|
809 |
/**
|
853 |
$options['4955'] = $helper->__('EU Pack Standard (Belgium only, no signature)');
|
854 |
}
|
855 |
|
|
|
856 |
}
|
857 |
|
858 |
+
if (
|
859 |
+
$helper->canUsePakjegemakBeNotInsured()
|
860 |
+
&& (!isset($flags['isBelgiumOnly'])
|
861 |
+
|| $flags['isBelgiumOnly'] == true
|
862 |
+
)
|
863 |
+
&& (!isset($flags['isExtraCover'])
|
864 |
+
|| $flags['isExtraCover'] == false
|
865 |
+
)
|
866 |
+
&& (!isset($flags['countryLimitation'])
|
867 |
+
|| $flags['countryLimitation'] == 'NL'
|
868 |
+
)
|
869 |
+
) {
|
870 |
+
if (!$asFlatArray) {
|
871 |
+
$options[] = array(
|
872 |
+
'value' => '4936',
|
873 |
+
'label' => $helper->__('4936 - Post Office Belgium'),
|
874 |
+
'isBelgiumOnly' => true,
|
875 |
+
'isExtraCover' => false,
|
876 |
+
'isAvond' => false,
|
877 |
+
'isSunday' => false,
|
878 |
+
'isCod' => false,
|
879 |
+
'statedAddressOnly' => false,
|
880 |
+
'countryLimitation' => 'NL',
|
881 |
+
'group' => 'pakjegemak_be_options'
|
882 |
+
);
|
883 |
+
} else {
|
884 |
+
$options['4936'] = $helper->__('4936 - Post Office Belgium');
|
885 |
+
}
|
886 |
+
}
|
887 |
+
|
888 |
+
ksort($options);
|
889 |
+
|
890 |
return $options;
|
891 |
}
|
892 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_Attributes
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_Attributes
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckPakjegemakProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
'3572' => array(
|
47 |
+
'value' => '3572',
|
48 |
+
'label' => 'Post Office + Birthday Check',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isAvond' => true,
|
51 |
+
'isSunday' => true,
|
52 |
+
'isCod' => false,
|
53 |
+
'isSameDay' => true,
|
54 |
+
'isPge' => false,
|
55 |
+
'statedAddressOnly' => false,
|
56 |
+
'countryLimitation' => 'NL',
|
57 |
+
'group' => 'pakjegemak_options'
|
58 |
+
),
|
59 |
+
'3575' => array(
|
60 |
+
'value' => '3575',
|
61 |
+
'label' => 'Post Office + Notification + Birthday Check',
|
62 |
+
'isExtraCover' => false,
|
63 |
+
'isAvond' => true,
|
64 |
+
'isSunday' => true,
|
65 |
+
'isCod' => false,
|
66 |
+
'isSameDay' => true,
|
67 |
+
'isPge' => true,
|
68 |
+
'statedAddressOnly' => false,
|
69 |
+
'countryLimitation' => 'NL',
|
70 |
+
'group' => 'pakjegemak_options'
|
71 |
+
),
|
72 |
+
'3582' => array(
|
73 |
+
'value' => '3582',
|
74 |
+
'label' => 'Post Office + Extra Cover + Birthday Check',
|
75 |
+
'isExtraCover' => true,
|
76 |
+
'isAvond' => true,
|
77 |
+
'isSunday' => true,
|
78 |
+
'isCod' => false,
|
79 |
+
'isSameDay' => true,
|
80 |
+
'isPge' => false,
|
81 |
+
'statedAddressOnly' => false,
|
82 |
+
'countryLimitation' => 'NL',
|
83 |
+
'group' => 'pakjegemak_options'
|
84 |
+
),
|
85 |
+
'3585' => array(
|
86 |
+
'value' => '3585',
|
87 |
+
'label' => 'Post Office + Extra Cover + Notification + Birthday Check',
|
88 |
+
'isExtraCover' => true,
|
89 |
+
'isAvond' => true,
|
90 |
+
'isSunday' => true,
|
91 |
+
'isCod' => false,
|
92 |
+
'isSameDay' => true,
|
93 |
+
'isPge' => true,
|
94 |
+
'statedAddressOnly' => false,
|
95 |
+
'countryLimitation' => 'NL',
|
96 |
+
'group' => 'pakjegemak_options'
|
97 |
+
),
|
98 |
+
);
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get available id check options
|
102 |
+
*
|
103 |
+
* @param bool $flat
|
104 |
+
*
|
105 |
+
* @return array
|
106 |
+
*/
|
107 |
+
public function getAvailableOptions($flat = false)
|
108 |
+
{
|
109 |
+
return $this->getOptions(array(), $flat, true);
|
110 |
+
}
|
111 |
+
}
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
array(
|
47 |
+
'value' => '3440',
|
48 |
+
'label' => 'Parcel with Birthday Check',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isAvond' => true,
|
51 |
+
'isSunday' => true,
|
52 |
+
'isCod' => false,
|
53 |
+
'isSameDay' => true,
|
54 |
+
'statedAddressOnly' => false,
|
55 |
+
'countryLimitation' => 'NL',
|
56 |
+
),
|
57 |
+
array(
|
58 |
+
'value' => '3444',
|
59 |
+
'label' => 'Parcel with Extra Cover + Birthday Check',
|
60 |
+
'isExtraCover' => true,
|
61 |
+
'isAvond' => true,
|
62 |
+
'isSunday' => true,
|
63 |
+
'isCod' => false,
|
64 |
+
'isSameDay' => true,
|
65 |
+
'statedAddressOnly' => false,
|
66 |
+
'countryLimitation' => 'NL',
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'value' => '3447',
|
70 |
+
'label' => 'Parcel with Extra Cover + Birthday Check + Return when not home',
|
71 |
+
'isExtraCover' => true,
|
72 |
+
'isAvond' => true,
|
73 |
+
'isSunday' => true,
|
74 |
+
'isCod' => false,
|
75 |
+
'isSameDay' => true,
|
76 |
+
'statedAddressOnly' => false,
|
77 |
+
'countryLimitation' => 'NL',
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'value' => '3450',
|
81 |
+
'label' => 'Parcel with Birthday Check + Return when not home',
|
82 |
+
'isExtraCover' => false,
|
83 |
+
'isAvond' => true,
|
84 |
+
'isSunday' => true,
|
85 |
+
'isCod' => false,
|
86 |
+
'isSameDay' => true,
|
87 |
+
'statedAddressOnly' => false,
|
88 |
+
'countryLimitation' => 'NL',
|
89 |
+
),
|
90 |
+
);
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get available id check options
|
94 |
+
*
|
95 |
+
* @param bool $flat
|
96 |
+
*
|
97 |
+
* @return array
|
98 |
+
*/
|
99 |
+
public function getAvailableOptions($flat = false)
|
100 |
+
{
|
101 |
+
return $this->getOptions(array(), $flat, true);
|
102 |
+
}
|
103 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_BuspakjeProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_BuspakjeProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CheckoutExtensions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CheckoutExtensions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CommentType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CommentType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CooledProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CooledProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CutOffTime
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_CutOffTime
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_DebugMode
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_DebugMode
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_Direction
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_Direction
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_EuProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_EuProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_FoodProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_FoodProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_GlobalProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_GlobalProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_GlobalpackShipmentType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_GlobalpackShipmentType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_HourMinute
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_HourMinute
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_IdCheckPakjegemakProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array $_options
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
'3573' => array(
|
47 |
+
'value' => '3573',
|
48 |
+
'label' => 'Post Office + ID Check',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isAvond' => true,
|
51 |
+
'isSunday' => true,
|
52 |
+
'isPge' => false,
|
53 |
+
'isCod' => false,
|
54 |
+
'isSameDay' => true,
|
55 |
+
'statedAddressOnly' => false,
|
56 |
+
'countryLimitation' => 'NL',
|
57 |
+
'group' => 'pakjegemak_options'
|
58 |
+
),
|
59 |
+
'3576' => array(
|
60 |
+
'value' => '3576',
|
61 |
+
'label' => 'Post Office + Notification + ID Check',
|
62 |
+
'isExtraCover' => false,
|
63 |
+
'isAvond' => true,
|
64 |
+
'isSunday' => true,
|
65 |
+
'isCod' => false,
|
66 |
+
'isPge' => true,
|
67 |
+
'isSameDay' => true,
|
68 |
+
'statedAddressOnly' => false,
|
69 |
+
'countryLimitation' => 'NL',
|
70 |
+
'group' => 'pakjegemak_options'
|
71 |
+
),
|
72 |
+
'3583' => array(
|
73 |
+
'value' => '3583',
|
74 |
+
'label' => 'Post Office + Extra Cover + ID Check',
|
75 |
+
'isExtraCover' => true,
|
76 |
+
'isAvond' => true,
|
77 |
+
'isSunday' => true,
|
78 |
+
'isCod' => false,
|
79 |
+
'isPge' => false,
|
80 |
+
'isSameDay' => true,
|
81 |
+
'statedAddressOnly' => false,
|
82 |
+
'countryLimitation' => 'NL',
|
83 |
+
'group' => 'pakjegemak_options'
|
84 |
+
),
|
85 |
+
'3586' => array(
|
86 |
+
'value' => '3586',
|
87 |
+
'label' => 'Post Office + Extra Cover + Notification + ID Check',
|
88 |
+
'isExtraCover' => true,
|
89 |
+
'isAvond' => true,
|
90 |
+
'isSunday' => true,
|
91 |
+
'isCod' => false,
|
92 |
+
'isPge' => true,
|
93 |
+
'isSameDay' => true,
|
94 |
+
'statedAddressOnly' => false,
|
95 |
+
'countryLimitation' => 'NL',
|
96 |
+
'group' => 'pakjegemak_options'
|
97 |
+
),
|
98 |
+
);
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get available id check options
|
102 |
+
*
|
103 |
+
* @param bool $flat
|
104 |
+
*
|
105 |
+
* @return array
|
106 |
+
*/
|
107 |
+
public function getAvailableOptions($flat = false)
|
108 |
+
{
|
109 |
+
return $this->getOptions(array(), $flat, true);
|
110 |
+
}
|
111 |
+
}
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_Core_System_Config_Source_IdCheckProductOptions
|
40 |
+
extends TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var array $_options
|
44 |
+
*/
|
45 |
+
protected $_options = array(
|
46 |
+
array(
|
47 |
+
'value' => '3442',
|
48 |
+
'label' => 'Parcel with ID check (based on ID-number)',
|
49 |
+
'isExtraCover' => false,
|
50 |
+
'isAvond' => true,
|
51 |
+
'isSunday' => true,
|
52 |
+
'isCod' => false,
|
53 |
+
'isSameDay' => true,
|
54 |
+
'statedAddressOnly' => false,
|
55 |
+
'countryLimitation' => 'NL',
|
56 |
+
),
|
57 |
+
array(
|
58 |
+
'value' => '3445',
|
59 |
+
'label' => 'Parcel with Extra Cover + ID check',
|
60 |
+
'isExtraCover' => true,
|
61 |
+
'isAvond' => true,
|
62 |
+
'isSunday' => true,
|
63 |
+
'isCod' => false,
|
64 |
+
'isSameDay' => true,
|
65 |
+
'statedAddressOnly' => false,
|
66 |
+
'countryLimitation' => 'NL',
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'value' => '3448',
|
70 |
+
'label' => 'Parcel with Extra Cover + ID check + Return when not home',
|
71 |
+
'isExtraCover' => true,
|
72 |
+
'isAvond' => true,
|
73 |
+
'isSunday' => true,
|
74 |
+
'isCod' => false,
|
75 |
+
'isSameDay' => true,
|
76 |
+
'statedAddressOnly' => false,
|
77 |
+
'countryLimitation' => 'NL',
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'value' => '3451',
|
81 |
+
'label' => 'Parcel with ID check + Return when not home',
|
82 |
+
'isExtraCover' => false,
|
83 |
+
'isAvond' => true,
|
84 |
+
'isSunday' => true,
|
85 |
+
'isCod' => false,
|
86 |
+
'isSameDay' => true,
|
87 |
+
'statedAddressOnly' => false,
|
88 |
+
'countryLimitation' => 'NL',
|
89 |
+
)
|
90 |
+
);
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get available id check options
|
94 |
+
*
|
95 |
+
* @param bool $flat
|
96 |
+
*
|
97 |
+
* @return array
|
98 |
+
*/
|
99 |
+
public function getAvailableOptions($flat = false)
|
100 |
+
{
|
101 |
+
return $this->getOptions(array(), $flat, true);
|
102 |
+
}
|
103 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_LabelSize
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_LabelSize
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ManualAutomatic
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ManualAutomatic
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PackingSlipItemFields
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PackingSlipItemFields
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
@@ -44,79 +44,274 @@ class TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
|
44 |
*/
|
45 |
protected $_options = array(
|
46 |
array(
|
47 |
-
'value'
|
48 |
-
'label'
|
49 |
-
'isExtraCover'
|
50 |
-
'isPge'
|
51 |
-
'isCod'
|
52 |
-
'isBelgiumOnly'
|
|
|
53 |
),
|
54 |
array(
|
55 |
-
'value'
|
56 |
-
'label'
|
57 |
-
'isExtraCover'
|
58 |
-
'isPge'
|
59 |
-
'isCod'
|
60 |
-
'isBelgiumOnly'
|
|
|
61 |
),
|
62 |
array(
|
63 |
-
'value'
|
64 |
-
'label'
|
65 |
-
'isExtraCover'
|
66 |
-
'isPge'
|
67 |
-
'isCod'
|
68 |
-
'isBelgiumOnly'
|
|
|
69 |
),
|
70 |
array(
|
71 |
-
'value'
|
72 |
-
'label'
|
73 |
-
'isExtraCover'
|
74 |
-
'isPge'
|
75 |
-
'isCod'
|
76 |
-
'isBelgiumOnly'
|
|
|
77 |
),
|
78 |
array(
|
79 |
-
'value'
|
80 |
-
'label'
|
81 |
-
'isExtraCover'
|
82 |
-
'isPge'
|
83 |
-
'isCod'
|
84 |
-
'isBelgiumOnly'
|
|
|
85 |
),
|
86 |
array(
|
87 |
-
'value'
|
88 |
-
'label'
|
89 |
-
'isExtraCover'
|
90 |
-
'isPge'
|
91 |
-
'isCod'
|
92 |
-
'isBelgiumOnly'
|
|
|
93 |
),
|
94 |
array(
|
95 |
-
'value'
|
96 |
-
'label'
|
97 |
-
'isExtraCover'
|
98 |
-
'isPge'
|
99 |
-
'isCod'
|
100 |
-
'isBelgiumOnly'
|
|
|
101 |
),
|
102 |
array(
|
103 |
-
'value'
|
104 |
-
'label'
|
105 |
-
'isExtraCover'
|
106 |
-
'isPge'
|
107 |
-
'isCod'
|
108 |
-
'isBelgiumOnly'
|
|
|
109 |
),
|
110 |
array(
|
111 |
-
'value'
|
112 |
-
'label'
|
113 |
-
'isExtraCover'
|
114 |
-
'isPge'
|
115 |
-
'isCod'
|
116 |
-
'isBelgiumOnly'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
),
|
118 |
);
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
/**
|
121 |
* Returns an option array for all possible PostNL product options.
|
122 |
*
|
@@ -132,11 +327,13 @@ class TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
|
132 |
*
|
133 |
* @param boolean $flat
|
134 |
*
|
|
|
|
|
135 |
* @return array
|
136 |
*/
|
137 |
-
public function getAvailableOptions($flat = false)
|
138 |
{
|
139 |
-
return $this->getOptions(array('isCod' => false, 'isBelgiumOnly' => false), $flat, true);
|
140 |
}
|
141 |
|
142 |
/**
|
@@ -145,46 +342,98 @@ class TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
|
145 |
*
|
146 |
* @param boolean $flat
|
147 |
*
|
|
|
|
|
148 |
* @return array
|
149 |
*/
|
150 |
-
public function getAvailableBeOptions($flat = false)
|
151 |
{
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
|
155 |
/**
|
156 |
* Get available COD options.
|
157 |
*
|
158 |
-
* @param bool
|
|
|
|
|
159 |
*
|
160 |
* @return array
|
161 |
*/
|
162 |
-
public function getAvailableCodOptions($flat = false)
|
163 |
{
|
164 |
-
return $this->getOptions(array('isCod' => true), $flat, true);
|
165 |
}
|
166 |
|
167 |
/**
|
168 |
* Get available PGE options.
|
169 |
*
|
170 |
-
* @param bool
|
|
|
|
|
171 |
*
|
172 |
* @return array
|
173 |
*/
|
174 |
-
public function getAvailablePgeOptions($flat = false)
|
175 |
{
|
176 |
-
return $this->getOptions(array('isPge' => true, 'isCod' => false), $flat, true);
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
* Get available PGE options that are also COD.
|
181 |
*
|
182 |
-
* @param bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
*
|
184 |
* @return array
|
185 |
*/
|
186 |
-
public function
|
187 |
{
|
188 |
-
return $this->getOptions(array('
|
189 |
}
|
190 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
44 |
*/
|
45 |
protected $_options = array(
|
46 |
array(
|
47 |
+
'value' => '3534',
|
48 |
+
'label' => 'Post Office + Extra Cover',
|
49 |
+
'isExtraCover' => true,
|
50 |
+
'isPge' => false,
|
51 |
+
'isCod' => false,
|
52 |
+
'isBelgiumOnly' => false,
|
53 |
+
'group' => 'default',
|
54 |
),
|
55 |
array(
|
56 |
+
'value' => '3544',
|
57 |
+
'label' => 'Post Office + Extra Cover + Notification',
|
58 |
+
'isExtraCover' => true,
|
59 |
+
'isPge' => true,
|
60 |
+
'isCod' => false,
|
61 |
+
'isBelgiumOnly' => false,
|
62 |
+
'group' => 'default',
|
63 |
),
|
64 |
array(
|
65 |
+
'value' => '3533',
|
66 |
+
'label' => 'Post Office + Signature on Delivery',
|
67 |
+
'isExtraCover' => false,
|
68 |
+
'isPge' => false,
|
69 |
+
'isCod' => false,
|
70 |
+
'isBelgiumOnly' => false,
|
71 |
+
'group' => 'default',
|
72 |
),
|
73 |
array(
|
74 |
+
'value' => '3543',
|
75 |
+
'label' => 'Post Office + Signature on Delivery + Notification',
|
76 |
+
'isExtraCover' => false,
|
77 |
+
'isPge' => true,
|
78 |
+
'isCod' => false,
|
79 |
+
'isBelgiumOnly' => false,
|
80 |
+
'group' => 'default',
|
81 |
),
|
82 |
array(
|
83 |
+
'value' => '3535',
|
84 |
+
'label' => 'Post Office + COD',
|
85 |
+
'isExtraCover' => false,
|
86 |
+
'isPge' => false,
|
87 |
+
'isCod' => true,
|
88 |
+
'isBelgiumOnly' => false,
|
89 |
+
'group' => 'default',
|
90 |
),
|
91 |
array(
|
92 |
+
'value' => '3545',
|
93 |
+
'label' => 'Post Office + COD + Notification',
|
94 |
+
'isExtraCover' => false,
|
95 |
+
'isPge' => true,
|
96 |
+
'isCod' => true,
|
97 |
+
'isBelgiumOnly' => false,
|
98 |
+
'group' => 'default',
|
99 |
),
|
100 |
array(
|
101 |
+
'value' => '3536',
|
102 |
+
'label' => 'Post Office + COD + Extra Cover',
|
103 |
+
'isExtraCover' => false,
|
104 |
+
'isPge' => false,
|
105 |
+
'isCod' => true,
|
106 |
+
'isBelgiumOnly' => false,
|
107 |
+
'group' => 'default',
|
108 |
),
|
109 |
array(
|
110 |
+
'value' => '3546',
|
111 |
+
'label' => 'Post Office + COD + Extra Cover + Notification',
|
112 |
+
'isExtraCover' => false,
|
113 |
+
'isPge' => true,
|
114 |
+
'isCod' => true,
|
115 |
+
'isBelgiumOnly' => false,
|
116 |
+
'group' => 'default',
|
117 |
),
|
118 |
array(
|
119 |
+
'value' => '4932',
|
120 |
+
'label' => '4932 - Post Office Belgium + Extra Cover',
|
121 |
+
'isExtraCover' => false,
|
122 |
+
'isPge' => false,
|
123 |
+
'isCod' => false,
|
124 |
+
'isBelgiumOnly' => true,
|
125 |
+
'countryLimitation' => 'NL',
|
126 |
+
'group' => 'default',
|
127 |
+
),
|
128 |
+
array(
|
129 |
+
'value' => '4878',
|
130 |
+
'label' => '4878 - Post Office Belgium + Extra Cover',
|
131 |
+
'isExtraCover' => false,
|
132 |
+
'isPge' => false,
|
133 |
+
'isCod' => false,
|
134 |
+
'isBelgiumOnly' => true,
|
135 |
+
'countryLimitation' => 'BE',
|
136 |
+
'group' => 'default',
|
137 |
+
),
|
138 |
+
array(
|
139 |
+
'value' => '4880',
|
140 |
+
'label' => '4880 - Post Office Belgium',
|
141 |
+
'isExtraCover' => false,
|
142 |
+
'isPge' => false,
|
143 |
+
'isCod' => false,
|
144 |
+
'isBelgiumOnly' => true,
|
145 |
+
'countryLimitation' => 'BE',
|
146 |
+
'group' => 'default',
|
147 |
+
),
|
148 |
+
array(
|
149 |
+
'value' => '3571',
|
150 |
+
'label' => 'Post Office + Agecheck 18+',
|
151 |
+
'isExtraCover' => false,
|
152 |
+
'isCod' => false,
|
153 |
+
'statedAddressOnly' => false,
|
154 |
+
'isBelgiumOnly' => false,
|
155 |
+
'group' => 'AgeCheck',
|
156 |
+
),
|
157 |
+
array(
|
158 |
+
'value' => '3574',
|
159 |
+
'label' => 'Post Office + Notification + Agecheck 18+',
|
160 |
+
'isExtraCover' => false,
|
161 |
+
'isCod' => false,
|
162 |
+
'isPge' => true,
|
163 |
+
'statedAddressOnly' => false,
|
164 |
+
'isBelgiumOnly' => false,
|
165 |
+
'group' => 'AgeCheck',
|
166 |
+
),
|
167 |
+
array(
|
168 |
+
'value' => '3581',
|
169 |
+
'label' => 'Post Office + Extra Cover + Agecheck 18+',
|
170 |
+
'isExtraCover' => true,
|
171 |
+
'isCod' => false,
|
172 |
+
'statedAddressOnly' => false,
|
173 |
+
'isBelgiumOnly' => false,
|
174 |
+
'group' => 'AgeCheck',
|
175 |
+
),
|
176 |
+
array(
|
177 |
+
'value' => '3584',
|
178 |
+
'label' => 'Post Office + Extra Cover + Notification + Agecheck 18+',
|
179 |
+
'isExtraCover' => true,
|
180 |
+
'isCod' => false,
|
181 |
+
'isPge' => true,
|
182 |
+
'statedAddressOnly' => false,
|
183 |
+
'isBelgiumOnly' => false,
|
184 |
+
'group' => 'AgeCheck',
|
185 |
+
),
|
186 |
+
array(
|
187 |
+
'value' => '3573',
|
188 |
+
'label' => 'Post Office + ID Check',
|
189 |
+
'isExtraCover' => false,
|
190 |
+
'isPge' => false,
|
191 |
+
'isCod' => false,
|
192 |
+
'statedAddressOnly' => false,
|
193 |
+
'countryLimitation' => 'NL',
|
194 |
+
'group' => 'IDCheck',
|
195 |
+
),
|
196 |
+
array(
|
197 |
+
'value' => '3576',
|
198 |
+
'label' => 'Post Office + Notification + ID Check',
|
199 |
+
'isExtraCover' => false,
|
200 |
+
'isCod' => false,
|
201 |
+
'isPge' => true,
|
202 |
+
'statedAddressOnly' => false,
|
203 |
+
'isBelgiumOnly' => false,
|
204 |
+
'group' => 'IDCheck',
|
205 |
+
),
|
206 |
+
array(
|
207 |
+
'value' => '3583',
|
208 |
+
'label' => 'Post Office + Extra Cover + ID Check',
|
209 |
+
'isExtraCover' => true,
|
210 |
+
'isCod' => false,
|
211 |
+
'isPge' => false,
|
212 |
+
'statedAddressOnly' => false,
|
213 |
+
'isBelgiumOnly' => false,
|
214 |
+
'group' => 'IDCheck',
|
215 |
+
),
|
216 |
+
array(
|
217 |
+
'value' => '3586',
|
218 |
+
'label' => 'Post Office + Extra Cover + Notification + ID Check',
|
219 |
+
'isExtraCover' => true,
|
220 |
+
'isCod' => false,
|
221 |
+
'isPge' => true,
|
222 |
+
'statedAddressOnly' => false,
|
223 |
+
'isBelgiumOnly' => false,
|
224 |
+
'group' => 'IDCheck',
|
225 |
+
),
|
226 |
+
array(
|
227 |
+
'value' => '3572',
|
228 |
+
'label' => 'Post Office + Birthday Check',
|
229 |
+
'isExtraCover' => false,
|
230 |
+
'isCod' => false,
|
231 |
+
'isPge' => false,
|
232 |
+
'statedAddressOnly' => false,
|
233 |
+
'isBelgiumOnly' => false,
|
234 |
+
'group' => 'BirthdayCheck',
|
235 |
+
),
|
236 |
+
array(
|
237 |
+
'value' => '3575',
|
238 |
+
'label' => 'Post Office + Notification + Birthday Check',
|
239 |
+
'isExtraCover' => false,
|
240 |
+
'isCod' => false,
|
241 |
+
'isPge' => true,
|
242 |
+
'statedAddressOnly' => false,
|
243 |
+
'isBelgiumOnly' => false,
|
244 |
+
'group' => 'BirthdayCheck',
|
245 |
+
),
|
246 |
+
array(
|
247 |
+
'value' => '3582',
|
248 |
+
'label' => 'Post Office + Extra Cover + Birthday Check',
|
249 |
+
'isExtraCover' => true,
|
250 |
+
'isCod' => false,
|
251 |
+
'isPge' => false,
|
252 |
+
'statedAddressOnly' => false,
|
253 |
+
'isBelgiumOnly' => false,
|
254 |
+
'group' => 'BirthdayCheck',
|
255 |
+
),
|
256 |
+
array(
|
257 |
+
'value' => '3585',
|
258 |
+
'label' => 'Post Office + Extra Cover + Notification + Birthday Check',
|
259 |
+
'isExtraCover' => true,
|
260 |
+
'isCod' => false,
|
261 |
+
'isPge' => true,
|
262 |
+
'statedAddressOnly' => false,
|
263 |
+
'isBelgiumOnly' => false,
|
264 |
+
'group' => 'BirthdayCheck',
|
265 |
),
|
266 |
);
|
267 |
|
268 |
+
/**
|
269 |
+
* Gets all possible product options matching an array of flags.
|
270 |
+
*
|
271 |
+
* @param array $flags
|
272 |
+
* @param bool $asFlatArray
|
273 |
+
* @param bool $checkAvailable
|
274 |
+
*
|
275 |
+
* @return array
|
276 |
+
*/
|
277 |
+
public function getOptions($flags = array(), $asFlatArray = false, $checkAvailable = false)
|
278 |
+
{
|
279 |
+
$options = parent::getOptions($flags, $asFlatArray, $checkAvailable);
|
280 |
+
|
281 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
282 |
+
$helper = Mage::helper('postnl');
|
283 |
+
if (
|
284 |
+
$helper->canUsePakjegemakBeNotInsured()
|
285 |
+
&& (!isset($flags['isBelgiumOnly'])
|
286 |
+
|| $flags['isBelgiumOnly'] == true
|
287 |
+
) && (!isset($flags['isExtraCover'])
|
288 |
+
|| $flags['isExtraCover'] == false
|
289 |
+
) && (!isset($flags['isCod'])
|
290 |
+
|| $flags['isCod'] == false
|
291 |
+
) && (!isset($flags['isPge'])
|
292 |
+
|| $flags['isPge'] == false
|
293 |
+
) && (!isset($flags['countryLimitation'])
|
294 |
+
|| $flags['countryLimitation'] == 'NL'
|
295 |
+
)
|
296 |
+
) {
|
297 |
+
if (!$asFlatArray) {
|
298 |
+
$options[] = array(
|
299 |
+
'value' => '4936',
|
300 |
+
'label' => $helper->__('4936 - Post Office Belgium'),
|
301 |
+
'isBelgiumOnly' => false,
|
302 |
+
'isExtraCover' => false,
|
303 |
+
'countryLimitation' => 'NL',
|
304 |
+
);
|
305 |
+
} else {
|
306 |
+
$options['4936'] = $helper->__('4936 - Post Office Belgium');
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
ksort($options);
|
311 |
+
|
312 |
+
return $options;
|
313 |
+
}
|
314 |
+
|
315 |
/**
|
316 |
* Returns an option array for all possible PostNL product options.
|
317 |
*
|
327 |
*
|
328 |
* @param boolean $flat
|
329 |
*
|
330 |
+
* @param string $group
|
331 |
+
*
|
332 |
* @return array
|
333 |
*/
|
334 |
+
public function getAvailableOptions($flat = false, $group = 'default')
|
335 |
{
|
336 |
+
return $this->getOptions(array('isCod' => false, 'isBelgiumOnly' => false, 'group' => $group), $flat, true);
|
337 |
}
|
338 |
|
339 |
/**
|
342 |
*
|
343 |
* @param boolean $flat
|
344 |
*
|
345 |
+
* @param string $group
|
346 |
+
*
|
347 |
* @return array
|
348 |
*/
|
349 |
+
public function getAvailableBeOptions($flat = false, $group = 'default')
|
350 |
{
|
351 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
352 |
+
$helper = Mage::helper('postnl');
|
353 |
+
|
354 |
+
return $this->getOptions(array(
|
355 |
+
'isCod' => false,
|
356 |
+
'isBelgiumOnly' => true,
|
357 |
+
'countryLimitation' => $helper->getDomesticCountry(),
|
358 |
+
'group' => $group,
|
359 |
+
), $flat, true);
|
360 |
}
|
361 |
|
362 |
/**
|
363 |
* Get available COD options.
|
364 |
*
|
365 |
+
* @param bool $flat
|
366 |
+
*
|
367 |
+
* @param string $group
|
368 |
*
|
369 |
* @return array
|
370 |
*/
|
371 |
+
public function getAvailableCodOptions($flat = false, $group = 'default')
|
372 |
{
|
373 |
+
return $this->getOptions(array('isCod' => true, 'group' => $group), $flat, true);
|
374 |
}
|
375 |
|
376 |
/**
|
377 |
* Get available PGE options.
|
378 |
*
|
379 |
+
* @param bool $flat
|
380 |
+
*
|
381 |
+
* @param string $group
|
382 |
*
|
383 |
* @return array
|
384 |
*/
|
385 |
+
public function getAvailablePgeOptions($flat = false, $group = 'default')
|
386 |
{
|
387 |
+
return $this->getOptions(array('isPge' => true, 'isCod' => false, 'group' => $group), $flat, true);
|
388 |
}
|
389 |
|
390 |
/**
|
391 |
* Get available PGE options that are also COD.
|
392 |
*
|
393 |
+
* @param bool $flat
|
394 |
+
*
|
395 |
+
* @param string $group
|
396 |
+
*
|
397 |
+
* @return array
|
398 |
+
*/
|
399 |
+
public function getAvailablePgeCodOptions($flat = false, $group = 'default')
|
400 |
+
{
|
401 |
+
return $this->getOptions(array('isPge' => true, 'isCod' => true, 'group' => $group), $flat, true);
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* Get available Age Check options.
|
406 |
+
*
|
407 |
+
* @param bool $flat
|
408 |
+
*
|
409 |
+
* @return array
|
410 |
+
*/
|
411 |
+
public function getAgeCheckOptions($flat = false)
|
412 |
+
{
|
413 |
+
return $this->getOptions(array('isCod' => false, 'group' => 'AgeCheck'), $flat, true);
|
414 |
+
}
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Get available Birthday Check options.
|
418 |
+
*
|
419 |
+
* @param bool $flat
|
420 |
+
*
|
421 |
+
* @return array
|
422 |
+
*/
|
423 |
+
public function getBirthdayCheckOptions($flat = false)
|
424 |
+
{
|
425 |
+
return $this->getOptions(array('isCod' => false, 'group' => 'BirthdayCheck'), $flat, true);
|
426 |
+
}
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Get available ID Check options.
|
430 |
+
*
|
431 |
+
* @param bool $flat
|
432 |
*
|
433 |
* @return array
|
434 |
*/
|
435 |
+
public function getIDCheckOptions($flat = false)
|
436 |
{
|
437 |
+
return $this->getOptions(array('isCod' => false, 'group' => 'IDCheck'), $flat, true);
|
438 |
}
|
439 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PakketautomaatProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_PakketautomaatProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
@@ -41,8 +41,9 @@ abstract class TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstrac
|
|
41 |
/**
|
42 |
* Xpath to supported options configuration setting
|
43 |
*/
|
44 |
-
const XPATH_SUPPORTED_PRODUCT_OPTIONS
|
45 |
-
const
|
|
|
46 |
|
47 |
/**
|
48 |
* @var array
|
@@ -54,6 +55,23 @@ abstract class TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstrac
|
|
54 |
*/
|
55 |
protected $_groups = array();
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Gets all possible product options matching an array of flags.
|
59 |
*
|
@@ -236,18 +254,28 @@ abstract class TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstrac
|
|
236 |
/** @var TIG_PostNL_Helper_Data $helper */
|
237 |
$helper = Mage::helper('postnl');
|
238 |
$canUseEpsBEOnly = $helper->canUseEpsBEOnlyOption();
|
|
|
239 |
|
240 |
$storeId = Mage::app()->getStore()->getId();
|
241 |
|
242 |
/**
|
243 |
* Get the list of supported product options from the shop's configuration
|
244 |
*/
|
245 |
-
$
|
|
|
|
|
|
|
|
|
|
|
246 |
$supportedOptionsArray = explode(',', $supportedOptions);
|
247 |
if ($canUseEpsBEOnly) {
|
248 |
$supportedOptionsArray[] = '4955';
|
249 |
}
|
250 |
|
|
|
|
|
|
|
|
|
251 |
foreach ($options as $key => $option) {
|
252 |
$code = $option['value'];
|
253 |
if (!in_array($code, $supportedOptionsArray)) {
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Core_System_Config_Source_ProductOptions_Abstract
|
41 |
/**
|
42 |
* Xpath to supported options configuration setting
|
43 |
*/
|
44 |
+
const XPATH_SUPPORTED_PRODUCT_OPTIONS = 'postnl/grid/supported_product_options';
|
45 |
+
const XPATH_SUPPORTED_PRODUCT_OPTIONS_BE = 'postnl/grid/supported_product_options_be';
|
46 |
+
const XPATH_USE_DUTCH_PRODUCTS = 'postnl/cif_labels_and_confirming/use_dutch_products';
|
47 |
|
48 |
/**
|
49 |
* @var array
|
55 |
*/
|
56 |
protected $_groups = array();
|
57 |
|
58 |
+
/**
|
59 |
+
* @var null|TIG_PostNL_Helper_Data
|
60 |
+
*/
|
61 |
+
protected $_helper = null;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @return TIG_PostNL_Helper_Data
|
65 |
+
*/
|
66 |
+
protected function getHelper()
|
67 |
+
{
|
68 |
+
if ($this->_helper === null) {
|
69 |
+
$this->_helper = Mage::helper('postnl');
|
70 |
+
}
|
71 |
+
|
72 |
+
return $this->_helper;
|
73 |
+
}
|
74 |
+
|
75 |
/**
|
76 |
* Gets all possible product options matching an array of flags.
|
77 |
*
|
254 |
/** @var TIG_PostNL_Helper_Data $helper */
|
255 |
$helper = Mage::helper('postnl');
|
256 |
$canUseEpsBEOnly = $helper->canUseEpsBEOnlyOption();
|
257 |
+
$canUsePakjegemakBeNotInsured = $helper->canUsePakjegemakBeNotInsured();
|
258 |
|
259 |
$storeId = Mage::app()->getStore()->getId();
|
260 |
|
261 |
/**
|
262 |
* Get the list of supported product options from the shop's configuration
|
263 |
*/
|
264 |
+
if ($helper->getDomesticCountry() == 'BE') {
|
265 |
+
$supportedOptions = Mage::getStoreConfig(self::XPATH_SUPPORTED_PRODUCT_OPTIONS_BE, $storeId);
|
266 |
+
} else {
|
267 |
+
$supportedOptions = Mage::getStoreConfig(self::XPATH_SUPPORTED_PRODUCT_OPTIONS, $storeId);
|
268 |
+
}
|
269 |
+
|
270 |
$supportedOptionsArray = explode(',', $supportedOptions);
|
271 |
if ($canUseEpsBEOnly) {
|
272 |
$supportedOptionsArray[] = '4955';
|
273 |
}
|
274 |
|
275 |
+
if ($canUsePakjegemakBeNotInsured) {
|
276 |
+
$supportedOptionsArray[] = '4936';
|
277 |
+
}
|
278 |
+
|
279 |
foreach ($options as $key => $option) {
|
280 |
$code = $option['value'];
|
281 |
if (!in_array($code, $supportedOptionsArray)) {
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ReferenceType
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ReferenceType
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_SenderCountry
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_SenderCountry
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDays
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDays
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDuration
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDuration
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDurationDays
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingDurationDays
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingMethods
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_ShippingMethods
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StandardProductOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StandardProductOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StaticBlocks
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StaticBlocks
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StreetField
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_StreetField
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_SundayProductOptions
|
@@ -104,4 +104,4 @@ class TIG_PostNL_Model_Core_System_Config_Source_SundayProductOptions
|
|
104 |
{
|
105 |
return $this->getOptions(array('isSunday' => true, 'isCod' => false), $flat, true);
|
106 |
}
|
107 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_SundayProductOptions
|
104 |
{
|
105 |
return $this->getOptions(array('isSunday' => true, 'isCod' => false), $flat, true);
|
106 |
}
|
107 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_WeightUnit
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Core_System_Config_Source_WeightUnit
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_DeliveryOptions_Cif setStoreId(int $value)
|
@@ -51,6 +51,7 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
51 |
const EVENING_DELIVERY_OPTION = 'Evening';
|
52 |
const SUNDAY_DELIVERY_OPTION = 'Sunday';
|
53 |
const SAMEDAY_DELIVERY_OPTION = 'Sameday';
|
|
|
54 |
|
55 |
/**
|
56 |
* Config options used by the getDeliveryDate service.
|
@@ -58,10 +59,10 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
58 |
const XPATH_SHIPPING_DURATION = 'postnl/cif_labels_and_confirming/shipping_duration';
|
59 |
const XPATH_CUTOFF_TIME = 'postnl/cif_labels_and_confirming/cutoff_time';
|
60 |
const XPATH_ALLOW_SUNDAY_SORTING = 'postnl/delivery_options/allow_sunday_sorting';
|
61 |
-
const XPATH_ALLOW_SUNDAY_SORTING_BE = 'postnl/
|
62 |
const XPATH_SUNDAY_CUTOFF_TIME = 'postnl/cif_labels_and_confirming/sunday_cutoff_time';
|
63 |
const XPATH_DELIVERY_DAYS_NUMBER = 'postnl/delivery_options/delivery_days_number';
|
64 |
-
const XPATH_DELIVERY_DAYS_NUMBER_BE = 'postnl/
|
65 |
const XPATH_ENABLE_SUNDAY_DELIVERY = 'postnl/delivery_options/enable_sunday_delivery';
|
66 |
|
67 |
/**
|
@@ -89,11 +90,12 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
89 |
* @param string $country
|
90 |
* @param Mage_Sales_Model_Quote $quote
|
91 |
*
|
92 |
-
* @
|
93 |
*
|
|
|
94 |
* @throws TIG_PostNL_Exception
|
95 |
*/
|
96 |
-
public function getDeliveryDate($postcode, $country = 'NL', Mage_Sales_Model_Quote $quote)
|
97 |
{
|
98 |
if (empty($postcode)) {
|
99 |
throw new TIG_PostNL_Exception(
|
@@ -114,18 +116,9 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
114 |
*
|
115 |
* Day 00 indicates weekdays and saturday, while day 07 indicates sunday
|
116 |
*/
|
117 |
-
$CutOffTimes =
|
118 |
-
array(
|
119 |
-
'Day' => '00',
|
120 |
-
'Time' => $this->_getCutOffTime()
|
121 |
-
),
|
122 |
-
array(
|
123 |
-
'Day' => '07',
|
124 |
-
'Time' => $this->_getSundaySortingCutOffTime()
|
125 |
-
)
|
126 |
-
);
|
127 |
|
128 |
-
$options = $this->_getDeliveryDateOptionsArray($shippingDuration, $country);
|
129 |
|
130 |
$soapParams = array(
|
131 |
'GetDeliveryDate' => array(
|
@@ -165,13 +158,14 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
165 |
/**
|
166 |
* Get evening time frames for the specified postcode and delivery window.
|
167 |
*
|
168 |
-
* @param array
|
169 |
*
|
170 |
-
* @
|
171 |
*
|
|
|
172 |
* @throws TIG_PostNL_Exception
|
173 |
*/
|
174 |
-
public function getDeliveryTimeframes($data)
|
175 |
{
|
176 |
if (empty($data)) {
|
177 |
throw new TIG_PostNL_Exception(
|
@@ -201,7 +195,7 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
201 |
$endDate = new DateTime($startDate, new DateTimeZone('UTC'));
|
202 |
$endDate->add(new DateInterval("P{$maximumNumberOfDeliveryDays}D"));
|
203 |
|
204 |
-
$options = $this->_getDeliveryTimeframesOptionsArray($data['country']);
|
205 |
|
206 |
$soapParams = array(
|
207 |
'Timeframe' => array(
|
@@ -357,6 +351,51 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
357 |
return $cutOffTime;
|
358 |
}
|
359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
/**
|
361 |
* Checks whether sunday sorting is allowed for this storeview.
|
362 |
*
|
@@ -446,6 +485,20 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
446 |
$location['Street'] = $data['street'];
|
447 |
}
|
448 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
/**
|
450 |
* Add coordinates if both a latitude and longitude are available.
|
451 |
*/
|
@@ -529,12 +582,12 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
529 |
$storeId = $this->getStoreId();
|
530 |
|
531 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
532 |
-
$helper =
|
533 |
|
534 |
/**
|
535 |
* In the case of a food delivery, only sameday and evening delivery timeframes should be shown.
|
536 |
*/
|
537 |
-
if ($country == 'NL' && $helper->canUseFoodDelivery(true)) {
|
538 |
$options = array(
|
539 |
self::SAMEDAY_DELIVERY_OPTION,
|
540 |
self::EVENING_DELIVERY_OPTION,
|
@@ -547,14 +600,14 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
547 |
|
548 |
if ($country == 'NL' && $helper->canUseSameDayDelivery()) {
|
549 |
$options[] = self::SAMEDAY_DELIVERY_OPTION;
|
|
|
550 |
}
|
551 |
|
552 |
-
if ($country == 'NL' && $helper->canUseEveningTimeframes()) {
|
553 |
$options[] = self::EVENING_DELIVERY_OPTION;
|
554 |
}
|
555 |
|
556 |
-
$
|
557 |
-
if ($country == 'NL' && $sundayDelivery) {
|
558 |
$options[] = self::SUNDAY_DELIVERY_OPTION;
|
559 |
}
|
560 |
|
@@ -570,24 +623,51 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
570 |
* @param null $shippingDuration
|
571 |
* @param string $country
|
572 |
*
|
|
|
|
|
573 |
* @return array
|
574 |
*/
|
575 |
-
protected function _getDeliveryDateOptionsArray($shippingDuration = null, $country = 'NL')
|
576 |
{
|
577 |
$storeId = $this->getStoreId();
|
578 |
|
579 |
-
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
580 |
-
$helper = Mage::helper('postnl/deliveryOptions');
|
581 |
-
|
582 |
$options = array();
|
|
|
|
|
|
|
583 |
$sameDayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SAMEDAY_DELIVERY, $storeId);
|
|
|
|
|
584 |
|
585 |
-
if ($shippingDuration
|
586 |
$shippingDuration = Mage::getStoreConfig($helper::XPATH_SHIPPING_DURATION, $storeId);
|
587 |
}
|
588 |
|
589 |
-
|
590 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
}
|
592 |
|
593 |
$sundayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SUNDAY_DELIVERY, $storeId);
|
@@ -595,7 +675,11 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
595 |
$options[] = self::SUNDAY_DELIVERY_OPTION;
|
596 |
}
|
597 |
|
598 |
-
$
|
|
|
|
|
|
|
|
|
599 |
|
600 |
if ($country == 'NL' && $helper->canUseEveningTimeframes()) {
|
601 |
$options[] = self::EVENING_DELIVERY_OPTION;
|
@@ -603,4 +687,58 @@ class TIG_PostNL_Model_DeliveryOptions_Cif extends TIG_PostNL_Model_Core_Cif
|
|
603 |
|
604 |
return $options;
|
605 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_DeliveryOptions_Cif setStoreId(int $value)
|
51 |
const EVENING_DELIVERY_OPTION = 'Evening';
|
52 |
const SUNDAY_DELIVERY_OPTION = 'Sunday';
|
53 |
const SAMEDAY_DELIVERY_OPTION = 'Sameday';
|
54 |
+
const PICKUP_DELIVERY_OPTION = 'Pickup';
|
55 |
|
56 |
/**
|
57 |
* Config options used by the getDeliveryDate service.
|
59 |
const XPATH_SHIPPING_DURATION = 'postnl/cif_labels_and_confirming/shipping_duration';
|
60 |
const XPATH_CUTOFF_TIME = 'postnl/cif_labels_and_confirming/cutoff_time';
|
61 |
const XPATH_ALLOW_SUNDAY_SORTING = 'postnl/delivery_options/allow_sunday_sorting';
|
62 |
+
const XPATH_ALLOW_SUNDAY_SORTING_BE = 'postnl/delivery_options_int/allow_sunday_sorting_be';
|
63 |
const XPATH_SUNDAY_CUTOFF_TIME = 'postnl/cif_labels_and_confirming/sunday_cutoff_time';
|
64 |
const XPATH_DELIVERY_DAYS_NUMBER = 'postnl/delivery_options/delivery_days_number';
|
65 |
+
const XPATH_DELIVERY_DAYS_NUMBER_BE = 'postnl/delivery_options_int/delivery_days_number_be';
|
66 |
const XPATH_ENABLE_SUNDAY_DELIVERY = 'postnl/delivery_options/enable_sunday_delivery';
|
67 |
|
68 |
/**
|
90 |
* @param string $country
|
91 |
* @param Mage_Sales_Model_Quote $quote
|
92 |
*
|
93 |
+
* @param string $for delivery or pickup
|
94 |
*
|
95 |
+
* @return string
|
96 |
* @throws TIG_PostNL_Exception
|
97 |
*/
|
98 |
+
public function getDeliveryDate($postcode, $country = 'NL', Mage_Sales_Model_Quote $quote, $for = 'delivery')
|
99 |
{
|
100 |
if (empty($postcode)) {
|
101 |
throw new TIG_PostNL_Exception(
|
116 |
*
|
117 |
* Day 00 indicates weekdays and saturday, while day 07 indicates sunday
|
118 |
*/
|
119 |
+
$CutOffTimes = $this->_getCutOffTimes($quote->getStoreId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
+
$options = $this->_getDeliveryDateOptionsArray($shippingDuration, $country, $for);
|
122 |
|
123 |
$soapParams = array(
|
124 |
'GetDeliveryDate' => array(
|
158 |
/**
|
159 |
* Get evening time frames for the specified postcode and delivery window.
|
160 |
*
|
161 |
+
* @param array $data
|
162 |
*
|
163 |
+
* @param string $for delivery or pickup
|
164 |
*
|
165 |
+
* @return false|StdClass[]
|
166 |
* @throws TIG_PostNL_Exception
|
167 |
*/
|
168 |
+
public function getDeliveryTimeframes($data, $for = 'delivery')
|
169 |
{
|
170 |
if (empty($data)) {
|
171 |
throw new TIG_PostNL_Exception(
|
195 |
$endDate = new DateTime($startDate, new DateTimeZone('UTC'));
|
196 |
$endDate->add(new DateInterval("P{$maximumNumberOfDeliveryDays}D"));
|
197 |
|
198 |
+
$options = $this->_getDeliveryTimeframesOptionsArray($data['country'], $for);
|
199 |
|
200 |
$soapParams = array(
|
201 |
'Timeframe' => array(
|
351 |
return $cutOffTime;
|
352 |
}
|
353 |
|
354 |
+
/**
|
355 |
+
* Gets the regular cut-off time for this storeview.
|
356 |
+
*
|
357 |
+
* @param $storeId
|
358 |
+
*
|
359 |
+
* @return string
|
360 |
+
*/
|
361 |
+
protected function _getCutOffTimes($storeId)
|
362 |
+
{
|
363 |
+
$monSatCutoff = $this->_getCutOffTime();
|
364 |
+
|
365 |
+
$helper = $this->_getHelper('deliveryOptions');
|
366 |
+
$sameDayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SAMEDAY_DELIVERY, $storeId);
|
367 |
+
if ($sameDayDelivery) {
|
368 |
+
$date = $helper->getDateTime('now');
|
369 |
+
$sameDayDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_SAMEDAY_CUTOFF_TIME, $storeId);
|
370 |
+
$regularDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_CUTOFF_TIME, $storeId);
|
371 |
+
|
372 |
+
if ($date->getTimestamp() < $sameDayDeliveryCutoff->getTimestamp()) {
|
373 |
+
$monSatCutoff = $sameDayDeliveryCutoff->format('H:i:00');
|
374 |
+
} elseif ($date->getTimestamp() > $regularDeliveryCutoff->getTimestamp() && $date->format('N') != 5) {
|
375 |
+
$monSatCutoff = $sameDayDeliveryCutoff->format('H:i:00');
|
376 |
+
} elseif (
|
377 |
+
$helper->quoteIsFood()
|
378 |
+
&& $helper->getQuoteFoodType() == $helper::FOOD_TYPE_COOL_PRODUCTS
|
379 |
+
&& $date->format('N') == 5
|
380 |
+
) {
|
381 |
+
$monSatCutoff = $sameDayDeliveryCutoff->format('H:i:00');
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
$CutOffTimes = array(
|
386 |
+
array(
|
387 |
+
'Day' => '00',
|
388 |
+
'Time' => $monSatCutoff,
|
389 |
+
),
|
390 |
+
array(
|
391 |
+
'Day' => '07',
|
392 |
+
'Time' => $this->_getSundaySortingCutOffTime(),
|
393 |
+
)
|
394 |
+
);
|
395 |
+
|
396 |
+
return $CutOffTimes;
|
397 |
+
}
|
398 |
+
|
399 |
/**
|
400 |
* Checks whether sunday sorting is allowed for this storeview.
|
401 |
*
|
485 |
$location['Street'] = $data['street'];
|
486 |
}
|
487 |
|
488 |
+
/**
|
489 |
+
* Add the housenumber if available.
|
490 |
+
*/
|
491 |
+
if (isset($data['housenumber'])) {
|
492 |
+
$location['HouseNr'] = $data['housenumber'];
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* Add the city if available.
|
497 |
+
*/
|
498 |
+
if (isset($data['city'])) {
|
499 |
+
$location['City'] = $data['city'];
|
500 |
+
}
|
501 |
+
|
502 |
/**
|
503 |
* Add coordinates if both a latitude and longitude are available.
|
504 |
*/
|
582 |
$storeId = $this->getStoreId();
|
583 |
|
584 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
585 |
+
$helper = $this->_getHelper('deliveryOptions');
|
586 |
|
587 |
/**
|
588 |
* In the case of a food delivery, only sameday and evening delivery timeframes should be shown.
|
589 |
*/
|
590 |
+
if ($country == 'NL' && $helper->canUseFoodDelivery(true) && $helper->quoteIsFood()) {
|
591 |
$options = array(
|
592 |
self::SAMEDAY_DELIVERY_OPTION,
|
593 |
self::EVENING_DELIVERY_OPTION,
|
600 |
|
601 |
if ($country == 'NL' && $helper->canUseSameDayDelivery()) {
|
602 |
$options[] = self::SAMEDAY_DELIVERY_OPTION;
|
603 |
+
$options[] = self::EVENING_DELIVERY_OPTION;
|
604 |
}
|
605 |
|
606 |
+
if ($country == 'NL' && $helper->canUseEveningTimeframes() && !$helper->canUseSameDayDelivery()) {
|
607 |
$options[] = self::EVENING_DELIVERY_OPTION;
|
608 |
}
|
609 |
|
610 |
+
if ($country == 'NL' && $helper->canUseSundayDelivery()) {
|
|
|
611 |
$options[] = self::SUNDAY_DELIVERY_OPTION;
|
612 |
}
|
613 |
|
623 |
* @param null $shippingDuration
|
624 |
* @param string $country
|
625 |
*
|
626 |
+
* @param string $for delivery or pickup
|
627 |
+
*
|
628 |
* @return array
|
629 |
*/
|
630 |
+
protected function _getDeliveryDateOptionsArray($shippingDuration = null, $country = 'NL', $for = 'delivery')
|
631 |
{
|
632 |
$storeId = $this->getStoreId();
|
633 |
|
|
|
|
|
|
|
634 |
$options = array();
|
635 |
+
$helper = $this->_getHelper('deliveryOptions');
|
636 |
+
$date = $helper->getDateTime('now');
|
637 |
+
$dayOfWeek = $date->format('N');
|
638 |
$sameDayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SAMEDAY_DELIVERY, $storeId);
|
639 |
+
$sameDayDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_SAMEDAY_CUTOFF_TIME, $storeId);
|
640 |
+
$regularDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_CUTOFF_TIME, $storeId);
|
641 |
|
642 |
+
if ($shippingDuration === null) {
|
643 |
$shippingDuration = Mage::getStoreConfig($helper::XPATH_SHIPPING_DURATION, $storeId);
|
644 |
}
|
645 |
|
646 |
+
/**
|
647 |
+
* Sameday must be combined with evening, and can't be combined with other options.
|
648 |
+
*/
|
649 |
+
if ($country == 'NL' && $sameDayDelivery && $shippingDuration == 0 && $for == 'delivery') {
|
650 |
+
if (
|
651 |
+
$date->getTimestamp() < $sameDayDeliveryCutoff->getTimestamp() ||
|
652 |
+
(
|
653 |
+
$date->getTimestamp() > $regularDeliveryCutoff->getTimestamp() &&
|
654 |
+
$dayOfWeek != 5
|
655 |
+
)
|
656 |
+
) {
|
657 |
+
$options[] = self::SAMEDAY_DELIVERY_OPTION;
|
658 |
+
$options[] = self::EVENING_DELIVERY_OPTION;
|
659 |
+
|
660 |
+
return $options;
|
661 |
+
} elseif ($helper->quoteIsFood() && $helper->getQuoteFoodType() == $helper::FOOD_TYPE_COOL_PRODUCTS) {
|
662 |
+
$options[] = self::EVENING_DELIVERY_OPTION;
|
663 |
+
|
664 |
+
return $options;
|
665 |
+
}
|
666 |
+
}
|
667 |
+
|
668 |
+
$sundayCutoffGapOptions = $this->_getSundayCutoffGapOptions();
|
669 |
+
if ($country == 'NL' && $sameDayDelivery && $dayOfWeek == 7 && $sundayCutoffGapOptions) {
|
670 |
+
return $sundayCutoffGapOptions;
|
671 |
}
|
672 |
|
673 |
$sundayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SUNDAY_DELIVERY, $storeId);
|
675 |
$options[] = self::SUNDAY_DELIVERY_OPTION;
|
676 |
}
|
677 |
|
678 |
+
if ($country == 'BE' && $for == 'pickup') {
|
679 |
+
$options[] = self::PICKUP_DELIVERY_OPTION;
|
680 |
+
} else {
|
681 |
+
$options[] = self::DOMESTIC_DELIVERY_OPTION;
|
682 |
+
}
|
683 |
|
684 |
if ($country == 'NL' && $helper->canUseEveningTimeframes()) {
|
685 |
$options[] = self::EVENING_DELIVERY_OPTION;
|
687 |
|
688 |
return $options;
|
689 |
}
|
690 |
+
|
691 |
+
/**
|
692 |
+
* @param DateTime $date
|
693 |
+
* @param $xpathCutoffTime
|
694 |
+
* @param $storeId
|
695 |
+
*
|
696 |
+
* @return DateTime
|
697 |
+
*/
|
698 |
+
protected function _getCutoff(DateTime $date, $xpathCutoffTime, $storeId = null)
|
699 |
+
{
|
700 |
+
if ($storeId === null) {
|
701 |
+
$storeId = $this->getStoreId();
|
702 |
+
}
|
703 |
+
|
704 |
+
$time = Mage::getStoreConfig($xpathCutoffTime, $storeId);
|
705 |
+
list($hour, $minute) = explode(':', $time);
|
706 |
+
|
707 |
+
$cutoff = clone $date;
|
708 |
+
$cutoff->setTime($hour, $minute);
|
709 |
+
|
710 |
+
return $cutoff;
|
711 |
+
}
|
712 |
+
|
713 |
+
protected function _getSundayCutoffGapOptions()
|
714 |
+
{
|
715 |
+
$storeId = $this->getStoreId();
|
716 |
+
|
717 |
+
$helper = $this->_getHelper('deliveryOptions');
|
718 |
+
$date = $helper->getDateTime('now');
|
719 |
+
$regularDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_CUTOFF_TIME, $storeId);
|
720 |
+
$sundayDeliveryCutoff = $this->_getCutoff($date, $helper::XPATH_SUNDAY_CUTOFF_TIME, $storeId);
|
721 |
+
|
722 |
+
if (
|
723 |
+
$date->getTimestamp() < $sundayDeliveryCutoff->getTimestamp() ||
|
724 |
+
$date->getTimestamp() > $regularDeliveryCutoff->getTimestamp()
|
725 |
+
) {
|
726 |
+
return false;
|
727 |
+
}
|
728 |
+
|
729 |
+
$sundayDelivery = Mage::getStoreConfig($helper::XPATH_ENABLE_SUNDAY_DELIVERY, $storeId);
|
730 |
+
if (!$sundayDelivery) {
|
731 |
+
return false;
|
732 |
+
}
|
733 |
+
|
734 |
+
if (!$helper->canUseEveningTimeframes()) {
|
735 |
+
return false;
|
736 |
+
}
|
737 |
+
|
738 |
+
return array(
|
739 |
+
self::SUNDAY_DELIVERY_OPTION,
|
740 |
+
self::SAMEDAY_DELIVERY_OPTION,
|
741 |
+
self::EVENING_DELIVERY_OPTION,
|
742 |
+
);
|
743 |
+
}
|
744 |
}
|
@@ -33,12 +33,17 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_GoMage_LightCheckout_Ajax
|
40 |
extends TIG_PostNL_Model_DeliveryOptions_Observer_ShippingMethodAvailable
|
41 |
{
|
|
|
|
|
|
|
|
|
|
|
42 |
/**
|
43 |
* Set a registry flag to prevent the PostNL Order from being reset unintentionally.
|
44 |
*
|
@@ -50,6 +55,55 @@ class TIG_PostNL_Model_DeliveryOptions_Observer_GoMage_LightCheckout_Ajax
|
|
50 |
{
|
51 |
Mage::unregister(self::IGNORE_POSTNL_ORDER_RESET_REGISTRY_KEY);
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
/** @var GoMage_Checkout_OnepageController $controller */
|
54 |
/** @noinspection PhpUndefinedMethodInspection */
|
55 |
$controller = $observer->getControllerAction();
|
@@ -57,10 +111,18 @@ class TIG_PostNL_Model_DeliveryOptions_Observer_GoMage_LightCheckout_Ajax
|
|
57 |
$request = $controller->getRequest();
|
58 |
$action = $request->getParam('action', false);
|
59 |
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
-
return $this;
|
65 |
}
|
66 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_GoMage_LightCheckout_Ajax
|
40 |
extends TIG_PostNL_Model_DeliveryOptions_Observer_ShippingMethodAvailable
|
41 |
{
|
42 |
+
/**
|
43 |
+
* @var null|TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck
|
44 |
+
*/
|
45 |
+
protected $_idCheckObserverModel = null;
|
46 |
+
|
47 |
/**
|
48 |
* Set a registry flag to prevent the PostNL Order from being reset unintentionally.
|
49 |
*
|
55 |
{
|
56 |
Mage::unregister(self::IGNORE_POSTNL_ORDER_RESET_REGISTRY_KEY);
|
57 |
|
58 |
+
$action = $this->getAction($observer);
|
59 |
+
if ($action == 'get_totals' || $action == 'discount') {
|
60 |
+
Mage::register(self::IGNORE_POSTNL_ORDER_RESET_REGISTRY_KEY, true);
|
61 |
+
}
|
62 |
+
|
63 |
+
return $this;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @param Varien_Event_Observer $observer
|
68 |
+
*
|
69 |
+
* @return $this
|
70 |
+
*/
|
71 |
+
public function validateIdCheck(Varien_Event_Observer $observer)
|
72 |
+
{
|
73 |
+
$action = $this->getAction($observer);
|
74 |
+
if ($action != 'save_payment_methods') {
|
75 |
+
return $this;
|
76 |
+
}
|
77 |
+
|
78 |
+
/** @var GoMage_Checkout_Model_Type_Onestep_Calculator $calculator */
|
79 |
+
$calculator = Mage::getModel('gomage_checkout/type_onestep_calculator', Mage::app()->getRequest());
|
80 |
+
|
81 |
+
/** @var TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck $observer */
|
82 |
+
$observer = $this->getIdCheckObserverModel();
|
83 |
+
|
84 |
+
$result = $observer->validate();
|
85 |
+
|
86 |
+
if ($result['error']) {
|
87 |
+
$calculator->result->error = true;
|
88 |
+
$calculator->result->message = $result['message'];
|
89 |
+
|
90 |
+
$calculator->prepareResult();
|
91 |
+
Mage::app()->getResponse()->setBody(json_encode($calculator->result));
|
92 |
+
return $this;
|
93 |
+
}
|
94 |
+
|
95 |
+
$observer->saveData();
|
96 |
+
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @param Varien_Event_Observer $observer
|
102 |
+
*
|
103 |
+
* @return mixed
|
104 |
+
*/
|
105 |
+
protected function getAction(Varien_Event_Observer $observer)
|
106 |
+
{
|
107 |
/** @var GoMage_Checkout_OnepageController $controller */
|
108 |
/** @noinspection PhpUndefinedMethodInspection */
|
109 |
$controller = $observer->getControllerAction();
|
111 |
$request = $controller->getRequest();
|
112 |
$action = $request->getParam('action', false);
|
113 |
|
114 |
+
return $action;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @return TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck
|
119 |
+
*/
|
120 |
+
protected function getIdCheckObserverModel()
|
121 |
+
{
|
122 |
+
if ($this->_idCheckObserverModel === null) {
|
123 |
+
$this->_idCheckObserverModel = Mage::getModel('postnl_deliveryoptions/observer_idCheck');
|
124 |
}
|
125 |
|
126 |
+
return $this->_idCheckObserverModel;
|
127 |
}
|
128 |
}
|
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @var array
|
43 |
+
*/
|
44 |
+
protected $_helpers = array();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @var null
|
48 |
+
*/
|
49 |
+
protected $_serviceModel = null;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var null|Mage_Sales_Model_Quote_Address
|
53 |
+
*/
|
54 |
+
protected $_validator = null;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Validates the ID Check data.
|
58 |
+
*
|
59 |
+
* @param $observer
|
60 |
+
*
|
61 |
+
* @return $this
|
62 |
+
*/
|
63 |
+
public function validate($observer = null)
|
64 |
+
{
|
65 |
+
/** @var Mage_Checkout_Model_Session $session */
|
66 |
+
$session = Mage::getSingleton('checkout/session');
|
67 |
+
$quote = $session->getQuote();
|
68 |
+
|
69 |
+
$shipmentType = $this->getHelper()->getQuoteIdCheckType($quote);
|
70 |
+
if (!$shipmentType) {
|
71 |
+
return array(
|
72 |
+
'error' => false,
|
73 |
+
'message' => null,
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
+
if ($observer !== null) {
|
78 |
+
/** @var Mage_Sales_Model_Quote_Address $validator */
|
79 |
+
$this->_validator = $observer->getAddress();
|
80 |
+
}
|
81 |
+
|
82 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
83 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
84 |
+
|
85 |
+
$post = Mage::app()->getRequest()->getPost('billing_postnl_idcheck');
|
86 |
+
if ($post !== null && $shipmentType == $deliveryOptionsHelper::IDCHECK_TYPE_ID) {
|
87 |
+
/**
|
88 |
+
* Check the document type.
|
89 |
+
*/
|
90 |
+
if (!isset($post['type']) || empty($post['type'])) {
|
91 |
+
return $this->error($this->getHelper()->__('Please provide a document type'));
|
92 |
+
} else {
|
93 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions_IDCheck $helper */
|
94 |
+
$helper = $this->getHelper('postnl/deliveryOptions_iDCheck');
|
95 |
+
|
96 |
+
if (!$helper->isValidOption($post['type'])) {
|
97 |
+
return $this->error($this->getHelper()->__('Please provide a valid document type'));
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Check the document number.
|
103 |
+
*/
|
104 |
+
if (!isset($post['number']) || empty($post['number'])) {
|
105 |
+
return $this->error($this->getHelper()->__('Please provide a document number'));
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Check the expiration date.
|
110 |
+
*/
|
111 |
+
if (!isset($post['expiration_date_full']) || empty($post['expiration_date_full'])) {
|
112 |
+
return $this->error($this->getHelper()->__('Please provide a expiration date'));
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
$customer = Mage::getSingleton('customer/session');
|
117 |
+
$post = Mage::app()->getRequest()->getPost('billing');
|
118 |
+
if (
|
119 |
+
$post !== null &&
|
120 |
+
$shipmentType == $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY &&
|
121 |
+
!$customer->isLoggedIn()
|
122 |
+
) {
|
123 |
+
if (
|
124 |
+
isset($post['day']) && !empty($post['day']) &&
|
125 |
+
isset($post['month']) && !empty($post['month']) &&
|
126 |
+
isset($post['year']) && !empty($post['year']) &&
|
127 |
+
(!isset($post['dob']) || empty($post['dob']))
|
128 |
+
) {
|
129 |
+
$post['dob'] = $post['year'] . '-' . $post['month'] . '-' . $post['year'];
|
130 |
+
}
|
131 |
+
|
132 |
+
if (!isset($post['dob']) || empty($post['dob'])) {
|
133 |
+
return $this->error($this->getHelper()->__('Please provide a valid birthday'));
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
return array(
|
138 |
+
'error' => false,
|
139 |
+
'message' => null,
|
140 |
+
);
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* @param $error
|
145 |
+
*
|
146 |
+
* @return $this|array
|
147 |
+
*/
|
148 |
+
public function error($error)
|
149 |
+
{
|
150 |
+
if ($this->_validator !== null) {
|
151 |
+
$this->_validator->addError($error);
|
152 |
+
|
153 |
+
return $this;
|
154 |
+
} else {
|
155 |
+
return array(
|
156 |
+
'error' => true,
|
157 |
+
'message' => $error,
|
158 |
+
);
|
159 |
+
}
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Saves some extra data after the saveBilling call.
|
164 |
+
*
|
165 |
+
* @return $this
|
166 |
+
*/
|
167 |
+
public function saveData()
|
168 |
+
{
|
169 |
+
/** @var Mage_Checkout_Model_Session $session */
|
170 |
+
$session = Mage::getSingleton('checkout/session');
|
171 |
+
$quote = $session->getQuote();
|
172 |
+
|
173 |
+
$shipmentType = $this->getHelper()->getQuoteIdCheckType($quote);
|
174 |
+
if (!$shipmentType) {
|
175 |
+
return $this;
|
176 |
+
}
|
177 |
+
|
178 |
+
$service = $this->getServiceModel();
|
179 |
+
|
180 |
+
/** @var TIG_PostNL_Model_Core_Order $postnlOrder */
|
181 |
+
$postnlOrder = $service->getPostnlOrder();
|
182 |
+
|
183 |
+
if (!$postnlOrder->getId()) {
|
184 |
+
$postnlOrder->setQuoteId($quote->getId())
|
185 |
+
->setOrderId(null)
|
186 |
+
->setIsActive(true)
|
187 |
+
->setIsPakjeGemak(false)
|
188 |
+
->setIsPakketautomaat(false)
|
189 |
+
->setProductCode(false)
|
190 |
+
->setMobilePhoneNumber(false, true)
|
191 |
+
->setType($shipmentType)
|
192 |
+
->setExpectedDeliveryTimeStart(false)
|
193 |
+
->setExpectedDeliveryTimeEnd(false);
|
194 |
+
}
|
195 |
+
|
196 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
197 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
198 |
+
if ($shipmentType == $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY) {
|
199 |
+
if (!Mage::getSingleton('eav/config')->getAttribute('customer', 'dob')->getIsVisible()) {
|
200 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
201 |
+
|
202 |
+
$data = Mage::app()->getRequest()->getPost('billing');
|
203 |
+
if (isset($data['dob'])) {
|
204 |
+
$post = $data;
|
205 |
+
}
|
206 |
+
|
207 |
+
if (!isset($post)) {
|
208 |
+
$post = Mage::app()->getRequest()->getPost();
|
209 |
+
}
|
210 |
+
|
211 |
+
if (isset($post['dob'])) {
|
212 |
+
$quote->setCustomerDob($post['dob']);
|
213 |
+
$quote->save();
|
214 |
+
|
215 |
+
if ($customer && $customer->getId()) {
|
216 |
+
$customer->setData('dob', $post['dob']);
|
217 |
+
$customer->save();
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
} elseif ($shipmentType == $deliveryOptionsHelper::IDCHECK_TYPE_ID) {
|
222 |
+
$post = Mage::app()->getRequest()->getPost('billing_postnl_idcheck');
|
223 |
+
|
224 |
+
$postnlOrder->setIdcheckType($post['type']);
|
225 |
+
$postnlOrder->setIdcheckNumber($post['number']);
|
226 |
+
$postnlOrder->setIdcheckExpirationDate($post['expiration_date_full']);
|
227 |
+
}
|
228 |
+
|
229 |
+
$postnlOrder->save();
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* @param Varien_Event_Observer $observer
|
234 |
+
*
|
235 |
+
* @return bool
|
236 |
+
*/
|
237 |
+
public function validateCustomerData(Varien_Event_Observer $observer)
|
238 |
+
{
|
239 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
240 |
+
if (!$customer || !$customer->getId()) {
|
241 |
+
return true;
|
242 |
+
}
|
243 |
+
|
244 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
245 |
+
$dob = $customer->getDob();
|
246 |
+
if (trim($dob) != '') {
|
247 |
+
return true;
|
248 |
+
}
|
249 |
+
|
250 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
251 |
+
$helper = $this->getHelper();
|
252 |
+
if (!$helper->quoteIsBirthdayCheck()) {
|
253 |
+
return true;
|
254 |
+
}
|
255 |
+
|
256 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
257 |
+
/** @var Mage_Checkout_OnepageController $controller */
|
258 |
+
$controller = $observer->getControllerAction();
|
259 |
+
Mage::getSingleton('customer/session')->addError($helper->__('The Date of Birth is required.'));
|
260 |
+
$controller->setRedirectWithCookieCheck('customer/account/edit');
|
261 |
+
$controller->setFlag('', $controller::FLAG_NO_DISPATCH, true);
|
262 |
+
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Mainly used for testing purposes.
|
268 |
+
*
|
269 |
+
* @param null $helper
|
270 |
+
*
|
271 |
+
* @return mixed
|
272 |
+
*/
|
273 |
+
protected function getHelper($helper = null)
|
274 |
+
{
|
275 |
+
if ($helper === null) {
|
276 |
+
$helper = 'postnl';
|
277 |
+
}
|
278 |
+
|
279 |
+
if (!array_key_exists($helper, $this->_helpers)) {
|
280 |
+
$this->_helpers[$helper] = Mage::helper($helper);
|
281 |
+
}
|
282 |
+
|
283 |
+
return $this->_helpers[$helper];
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Mainly used for testing purposes.
|
288 |
+
*
|
289 |
+
* @return TIG_PostNL_Model_DeliveryOptions_Service
|
290 |
+
*/
|
291 |
+
protected function getServiceModel()
|
292 |
+
{
|
293 |
+
if ($this->_serviceModel !== null) {
|
294 |
+
return $this->_serviceModel;
|
295 |
+
}
|
296 |
+
|
297 |
+
return Mage::getModel('postnl_deliveryoptions/service');
|
298 |
+
}
|
299 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_ShippingMethodAvailable extends Varien_Object
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_ShippingMethodAvailable extends Varien_Object
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_UpdateConfig {
|
@@ -133,4 +133,4 @@ class TIG_PostNL_Model_DeliveryOptions_Observer_UpdateConfig {
|
|
133 |
|
134 |
return $this;
|
135 |
}
|
136 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_UpdateConfig {
|
133 |
|
134 |
return $this;
|
135 |
}
|
136 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder
|
@@ -371,29 +371,10 @@ class TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder
|
|
371 |
/**
|
372 |
* Check if this order is being shipped to a domestic country.
|
373 |
*/
|
374 |
-
$domesticCountry = Mage::helper('postnl')->getDomesticCountry();
|
375 |
$shippingAddress = $order->getShippingAddress();
|
376 |
|
377 |
-
if (
|
378 |
-
|
379 |
-
$shippingAddress->getCountryId() != $domesticCountry
|
380 |
-
) {
|
381 |
-
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
382 |
-
$helper = Mage::helper('postnl/deliveryOptions');
|
383 |
-
$helper->setDomesticCountry($domesticCountry);
|
384 |
-
$canUseDutchProducts = $helper->canUseDutchProducts();
|
385 |
-
|
386 |
-
if (
|
387 |
-
$domesticCountry != 'BE' ||
|
388 |
-
$shippingAddress->getCountryId() != 'NL' ||
|
389 |
-
(
|
390 |
-
$domesticCountry == 'BE' &&
|
391 |
-
$shippingAddress->getCountryId() == 'NL' &&
|
392 |
-
!$canUseDutchProducts
|
393 |
-
)
|
394 |
-
) {
|
395 |
-
return false;
|
396 |
-
}
|
397 |
}
|
398 |
|
399 |
/**
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder
|
371 |
/**
|
372 |
* Check if this order is being shipped to a domestic country.
|
373 |
*/
|
|
|
374 |
$shippingAddress = $order->getShippingAddress();
|
375 |
|
376 |
+
if (!$shippingAddress) {
|
377 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
|
380 |
/**
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_IdcheckType
|
40 |
+
extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* Retrieve all attribute options
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
public function getAllOptions()
|
48 |
+
{
|
49 |
+
if ($this->_options) {
|
50 |
+
return $this->_options;
|
51 |
+
}
|
52 |
+
|
53 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
54 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
55 |
+
$helper = Mage::helper('postnl');
|
56 |
+
|
57 |
+
$options = array(
|
58 |
+
array(
|
59 |
+
'value' => 0,
|
60 |
+
'label' => $helper->__('None'),
|
61 |
+
),
|
62 |
+
array(
|
63 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_AGE,
|
64 |
+
'label' => $helper->__('Age Check'),
|
65 |
+
),
|
66 |
+
array(
|
67 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY,
|
68 |
+
'label' => $helper->__('Birthday Check'),
|
69 |
+
),
|
70 |
+
array(
|
71 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_ID,
|
72 |
+
'label' => $helper->__('ID Check'),
|
73 |
+
),
|
74 |
+
);
|
75 |
+
|
76 |
+
$this->_options = $options;
|
77 |
+
|
78 |
+
return $options;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Function referencing getAllOptions to be used in the PostNL configuration.
|
83 |
+
*
|
84 |
+
* @return array
|
85 |
+
*/
|
86 |
+
public function toOptionArray()
|
87 |
+
{
|
88 |
+
return $this->getAllOptions();
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* {@inheritdoc}
|
93 |
+
*/
|
94 |
+
public function getFlatColums()
|
95 |
+
{
|
96 |
+
$attributeCode = $this->getAttribute()->getAttributeCode();
|
97 |
+
$column = array(
|
98 |
+
'unsigned' => false,
|
99 |
+
'default' => null,
|
100 |
+
'extra' => null
|
101 |
+
);
|
102 |
+
|
103 |
+
if (Mage::helper('core')->useDbCompatibleMode()) {
|
104 |
+
$column['type'] = 'int(11)';
|
105 |
+
$column['is_null'] = true;
|
106 |
+
} else {
|
107 |
+
$column['type'] = Varien_Db_Ddl_Table::TYPE_INTEGER;
|
108 |
+
$column['length'] = 1;
|
109 |
+
$column['nullable'] = true;
|
110 |
+
$column['comment'] = $attributeCode . ' column';
|
111 |
+
}
|
112 |
+
|
113 |
+
return array($attributeCode => $column);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* {@inheritdoc}
|
118 |
+
*/
|
119 |
+
public function getFlatUpdateSelect($store)
|
120 |
+
{
|
121 |
+
return Mage::getResourceModel('eav/entity_attribute')
|
122 |
+
->getFlatUpdateSelect($this->getAttribute(), $store);
|
123 |
+
}
|
124 |
+
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ProductType
|
@@ -52,19 +52,34 @@ class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ProductType
|
|
52 |
|
53 |
$helper = Mage::helper('postnl');
|
54 |
|
|
|
|
|
|
|
55 |
$options = array(
|
56 |
array(
|
57 |
-
'label' => $helper->__('
|
58 |
'value' => 0,
|
59 |
),
|
60 |
array(
|
61 |
-
'value' =>
|
62 |
'label' => $helper->__('Dry & Groceries'),
|
63 |
),
|
64 |
array(
|
65 |
-
'value' =>
|
66 |
'label' => $helper->__('Cooled Products'),
|
67 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
);
|
69 |
|
70 |
$this->_options = $options;
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ProductType
|
52 |
|
53 |
$helper = Mage::helper('postnl');
|
54 |
|
55 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
56 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
57 |
+
|
58 |
$options = array(
|
59 |
array(
|
60 |
+
'label' => $helper->__('Regular'),
|
61 |
'value' => 0,
|
62 |
),
|
63 |
array(
|
64 |
+
'value' => $deliveryOptionsHelper::FOOD_TYPE_DRY_GROCERIES,
|
65 |
'label' => $helper->__('Dry & Groceries'),
|
66 |
),
|
67 |
array(
|
68 |
+
'value' => $deliveryOptionsHelper::FOOD_TYPE_COOL_PRODUCTS,
|
69 |
'label' => $helper->__('Cooled Products'),
|
70 |
),
|
71 |
+
array(
|
72 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_AGE,
|
73 |
+
'label' => $helper->__('Age Check'),
|
74 |
+
),
|
75 |
+
array(
|
76 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY,
|
77 |
+
'label' => $helper->__('Birthday Check'),
|
78 |
+
),
|
79 |
+
array(
|
80 |
+
'value' => $deliveryOptionsHelper::IDCHECK_TYPE_ID,
|
81 |
+
'label' => $helper->__('ID Check'),
|
82 |
+
),
|
83 |
);
|
84 |
|
85 |
$this->_options = $options;
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ShippingDuration
|
@@ -137,6 +137,7 @@ class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ShippingDuration
|
|
137 |
'type' => Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
138 |
'is_null' => true,
|
139 |
'comment' => $attributeCode . ' column',
|
|
|
140 |
);
|
141 |
|
142 |
$columnDefinition = array($attributeCode => $column);
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_ShippingDuration
|
137 |
'type' => Varien_Db_Ddl_Table::TYPE_VARCHAR,
|
138 |
'is_null' => true,
|
139 |
'comment' => $attributeCode . ' column',
|
140 |
+
'unsigned' => false,
|
141 |
);
|
142 |
|
143 |
$columnDefinition = array($attributeCode => $column);
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasQuote()
|
@@ -44,6 +44,8 @@
|
|
44 |
* @method TIG_PostNL_Model_DeliveryOptions_Service setShippingDuration(int $duration)
|
45 |
* @method boolean hasConfirmDate()
|
46 |
* @method TIG_PostNL_Model_DeliveryOptions_Service setConfirmDate(string $date)
|
|
|
|
|
47 |
*/
|
48 |
class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
49 |
{
|
@@ -130,9 +132,11 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
|
130 |
* @param StdClass[] $timeframes
|
131 |
* @param string $destinationCountry
|
132 |
*
|
|
|
|
|
133 |
* @return false|StdClass[]
|
134 |
*/
|
135 |
-
public function filterTimeframes($timeframes, $destinationCountry = 'NL')
|
136 |
{
|
137 |
/**
|
138 |
* If the time frames are not an array, something has gone wrong.
|
@@ -144,7 +148,7 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
|
144 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
145 |
$helper = Mage::helper('postnl/deliveryOptions');
|
146 |
|
147 |
-
return $helper->filterTimeFrames($timeframes, Mage::app()->getStore()->getId(), $destinationCountry);
|
148 |
}
|
149 |
|
150 |
/**
|
@@ -198,11 +202,14 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
|
198 |
*/
|
199 |
public function saveDeliveryOption($data)
|
200 |
{
|
|
|
|
|
|
|
201 |
/** @var TIG_PostNL_Helper_Date $helper */
|
202 |
-
$
|
203 |
|
204 |
if ($data['type'] == 'Sameday') {
|
205 |
-
$
|
206 |
}
|
207 |
|
208 |
$quote = $this->getQuote();
|
@@ -213,11 +220,16 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
|
213 |
$deliveryDate = DateTime::createFromFormat('d-m-Y', $data['date'], $amsterdamTimeZone);
|
214 |
$deliveryDate->setTimezone($utcTimeZone);
|
215 |
|
|
|
|
|
|
|
|
|
|
|
216 |
if ($data['type'] == 'Food' || $data['type'] == 'Cooledfood') {
|
217 |
$confirmDate = $deliveryDate;
|
218 |
} else {
|
219 |
$deliveryDateClone = clone $deliveryDate;
|
220 |
-
$confirmDate = $
|
221 |
}
|
222 |
|
223 |
/**
|
@@ -231,13 +243,33 @@ class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
|
231 |
->setIsPakketautomaat(false)
|
232 |
->setProductCode(false)
|
233 |
->setMobilePhoneNumber(false, true)
|
234 |
-
->setType($data['type'])
|
235 |
->setShipmentCosts($data['costs'])
|
236 |
->setDeliveryDate($deliveryDate->format('Y-m-d H:i:s'))
|
237 |
->setConfirmDate($confirmDate->format('Y-m-d H:i:s'))
|
238 |
->setExpectedDeliveryTimeStart(false)
|
239 |
->setExpectedDeliveryTimeEnd(false);
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
if ($data['type'] == 'PA') {
|
242 |
$postnlOrder->setIsPakketautomaat(true)
|
243 |
->setProductCode(3553)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method boolean hasQuote()
|
44 |
* @method TIG_PostNL_Model_DeliveryOptions_Service setShippingDuration(int $duration)
|
45 |
* @method boolean hasConfirmDate()
|
46 |
* @method TIG_PostNL_Model_DeliveryOptions_Service setConfirmDate(string $date)
|
47 |
+
* @method TIG_PostNL_Model_DeliveryOptions_Service setIdcheckType(string $value)
|
48 |
+
* @method TIG_PostNL_Model_DeliveryOptions_Service setIdcheckExpirationDate(string $value)
|
49 |
*/
|
50 |
class TIG_PostNL_Model_DeliveryOptions_Service extends Varien_Object
|
51 |
{
|
132 |
* @param StdClass[] $timeframes
|
133 |
* @param string $destinationCountry
|
134 |
*
|
135 |
+
* @param null $deliveryDate
|
136 |
+
*
|
137 |
* @return false|StdClass[]
|
138 |
*/
|
139 |
+
public function filterTimeframes($timeframes, $destinationCountry = 'NL', $deliveryDate = null)
|
140 |
{
|
141 |
/**
|
142 |
* If the time frames are not an array, something has gone wrong.
|
148 |
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
149 |
$helper = Mage::helper('postnl/deliveryOptions');
|
150 |
|
151 |
+
return $helper->filterTimeFrames($timeframes, Mage::app()->getStore()->getId(), $destinationCountry, $deliveryDate);
|
152 |
}
|
153 |
|
154 |
/**
|
202 |
*/
|
203 |
public function saveDeliveryOption($data)
|
204 |
{
|
205 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
206 |
+
$helper = Mage::helper('postnl');
|
207 |
+
|
208 |
/** @var TIG_PostNL_Helper_Date $helper */
|
209 |
+
$dateHelper = Mage::helper('postnl/date');
|
210 |
|
211 |
if ($data['type'] == 'Sameday') {
|
212 |
+
$dateHelper->setPostnlDeliveryDelay(0);
|
213 |
}
|
214 |
|
215 |
$quote = $this->getQuote();
|
220 |
$deliveryDate = DateTime::createFromFormat('d-m-Y', $data['date'], $amsterdamTimeZone);
|
221 |
$deliveryDate->setTimezone($utcTimeZone);
|
222 |
|
223 |
+
$isPGBE = false;
|
224 |
+
if ($data['type'] == 'PG' && $quote->getShippingAddress() !== null && $quote->getShippingAddress()->getCountryId() == 'BE') {
|
225 |
+
$isPGBE = true;
|
226 |
+
}
|
227 |
+
|
228 |
if ($data['type'] == 'Food' || $data['type'] == 'Cooledfood') {
|
229 |
$confirmDate = $deliveryDate;
|
230 |
} else {
|
231 |
$deliveryDateClone = clone $deliveryDate;
|
232 |
+
$confirmDate = $dateHelper->getShippingDateFromDeliveryDate($deliveryDateClone, $quote->getStoreId(), $isPGBE);
|
233 |
}
|
234 |
|
235 |
/**
|
243 |
->setIsPakketautomaat(false)
|
244 |
->setProductCode(false)
|
245 |
->setMobilePhoneNumber(false, true)
|
|
|
246 |
->setShipmentCosts($data['costs'])
|
247 |
->setDeliveryDate($deliveryDate->format('Y-m-d H:i:s'))
|
248 |
->setConfirmDate($confirmDate->format('Y-m-d H:i:s'))
|
249 |
->setExpectedDeliveryTimeStart(false)
|
250 |
->setExpectedDeliveryTimeEnd(false);
|
251 |
|
252 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
253 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Age, Birthday and ID don't have deliveryoptions, so default to their value.
|
257 |
+
*/
|
258 |
+
$newType = false;
|
259 |
+
if ($helper->quoteIsAgeCheck($quote)) {
|
260 |
+
$newType = $deliveryOptionsHelper::IDCHECK_TYPE_AGE;
|
261 |
+
} elseif ($helper->quoteIsBirthdayCheck($quote)) {
|
262 |
+
$newType = $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY;
|
263 |
+
} elseif ($helper->quoteIsIDCheck($quote)) {
|
264 |
+
$newType = $deliveryOptionsHelper::IDCHECK_TYPE_ID;
|
265 |
+
}
|
266 |
+
|
267 |
+
if ($newType) {
|
268 |
+
$postnlOrder->setType($newType);
|
269 |
+
} else {
|
270 |
+
$postnlOrder->setType($data['type']);
|
271 |
+
}
|
272 |
+
|
273 |
if ($data['type'] == 'PA') {
|
274 |
$postnlOrder->setIsPakketautomaat(true)
|
275 |
->setProductCode(3553)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee_SameDayDeliveryFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee_SameDayDeliveryFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee_SundayDeliveryFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee_SundayDeliveryFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_DeliveryDaysNumber
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_DeliveryDaysNumber
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_StockOptions
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_StockOptions
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_Themes extends Varien_Object
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Source_Themes extends Varien_Object
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Config
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Config
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Feed extends Mage_AdminNotification_Model_Feed
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Feed extends Mage_AdminNotification_Model_Feed
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Observer_Cron
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_ExtensionControl_Observer_Cron
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Primary webservices class. Contains all methods used to communicate with the extensioncontrol webservice.
|
@@ -41,7 +41,7 @@
|
|
41 |
* @category TIG
|
42 |
* @package TIG_PostNL
|
43 |
* @subpackage TIG_PostNL_ExtensionControl
|
44 |
-
* @copyright Copyright (c)
|
45 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
46 |
* @version v1.2.0
|
47 |
* @since v1.0.0
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Primary webservices class. Contains all methods used to communicate with the extensioncontrol webservice.
|
41 |
* @category TIG
|
42 |
* @package TIG_PostNL
|
43 |
* @subpackage TIG_PostNL_ExtensionControl
|
44 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
45 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
46 |
* @version v1.2.0
|
47 |
* @since v1.0.0
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_ExtensionControl_Webservices_Abstract extends Varien_Object
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_ExtensionControl_Webservices_Abstract extends Varien_Object
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.3.0 This class has been moved to TIG_PostNL_Model_Admin_Inbox. A dummy class has been left behind to
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated 1.3.0 This class has been moved to TIG_PostNL_Model_Admin_Inbox. A dummy class has been left behind to
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Mijnpakket_Cif extends TIG_PostNL_Model_Checkout_Cif
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Mijnpakket_Cif extends TIG_PostNL_Model_Checkout_Cif
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Mijnpakket_Service extends Varien_Object
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Mijnpakket_Service extends Varien_Object
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Parcelware_Export setIsGlobal(boolean $value)
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method TIG_PostNL_Model_Parcelware_Export setIsGlobal(boolean $value)
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
@@ -48,6 +48,11 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
48 |
*/
|
49 |
const XPATH_COD_FEE = 'payment/postnl_cod/fee';
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
* This payment method's unique code.
|
53 |
*
|
@@ -156,6 +161,16 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
156 |
*/
|
157 |
protected $_canManageRecurringProfiles = false;
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
/**
|
160 |
* @var boolean
|
161 |
*/
|
@@ -182,7 +197,7 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
182 |
public function isAvailable($quote = null)
|
183 |
{
|
184 |
/** @var TIG_PostNL_Helper_Payment $helper */
|
185 |
-
$helper =
|
186 |
|
187 |
/**
|
188 |
* Make sure the quote is available.
|
@@ -232,7 +247,7 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
232 |
}
|
233 |
|
234 |
/** @var TIG_PostNL_Helper_Carrier $carrierHelper */
|
235 |
-
$carrierHelper =
|
236 |
if (!$carrierHelper->isPostnlShippingMethod($shippingMethod)) {
|
237 |
$helper->log(
|
238 |
$helper->__('PostNL COD is not available, because the chosen shipping method is not PostNL.')
|
@@ -283,7 +298,7 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
283 |
* Check if the delivery type is not a Sunday Delivery, since COD is not available for Sunday delivery
|
284 |
*/
|
285 |
/** @var TIG_PostNL_Model_Core_Order $postnlOrder */
|
286 |
-
$postnlOrder =
|
287 |
if ($postnlOrder->getType() == 'Sunday') {
|
288 |
$helper->log(
|
289 |
$helper->__('PostNL Cod is not available, because COD is not allowed in combination with Sunday Delivery.')
|
@@ -291,6 +306,16 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
291 |
return false;
|
292 |
}
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
/**
|
295 |
* Finally, perform Magento's own checks.
|
296 |
*/
|
@@ -407,4 +432,70 @@ class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
|
407 |
$title = sprintf($title, $fee);
|
408 |
return $title;
|
409 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Cod extends Mage_Payment_Model_Method_Abstract
|
48 |
*/
|
49 |
const XPATH_COD_FEE = 'payment/postnl_cod/fee';
|
50 |
|
51 |
+
/**
|
52 |
+
* Xpath to the 'allow_for_buspakje' configuration setting.
|
53 |
+
*/
|
54 |
+
const XPATH_ALLOW_FOR_BUSPAKJE = 'payment/postnl_cod/allow_for_buspakje';
|
55 |
+
|
56 |
/**
|
57 |
* This payment method's unique code.
|
58 |
*
|
161 |
*/
|
162 |
protected $_canManageRecurringProfiles = false;
|
163 |
|
164 |
+
/**
|
165 |
+
* @var array
|
166 |
+
*/
|
167 |
+
protected $_helpers = array();
|
168 |
+
|
169 |
+
/**
|
170 |
+
* @var array
|
171 |
+
*/
|
172 |
+
protected $_models = array();
|
173 |
+
|
174 |
/**
|
175 |
* @var boolean
|
176 |
*/
|
197 |
public function isAvailable($quote = null)
|
198 |
{
|
199 |
/** @var TIG_PostNL_Helper_Payment $helper */
|
200 |
+
$helper = $this->getHelper('postnl/payment');
|
201 |
|
202 |
/**
|
203 |
* Make sure the quote is available.
|
247 |
}
|
248 |
|
249 |
/** @var TIG_PostNL_Helper_Carrier $carrierHelper */
|
250 |
+
$carrierHelper = $this->getHelper('postnl/carrier');
|
251 |
if (!$carrierHelper->isPostnlShippingMethod($shippingMethod)) {
|
252 |
$helper->log(
|
253 |
$helper->__('PostNL COD is not available, because the chosen shipping method is not PostNL.')
|
298 |
* Check if the delivery type is not a Sunday Delivery, since COD is not available for Sunday delivery
|
299 |
*/
|
300 |
/** @var TIG_PostNL_Model_Core_Order $postnlOrder */
|
301 |
+
$postnlOrder = $this->getModel('postnl_core/order')->load($quote->getId(), 'quote_id');
|
302 |
if ($postnlOrder->getType() == 'Sunday') {
|
303 |
$helper->log(
|
304 |
$helper->__('PostNL Cod is not available, because COD is not allowed in combination with Sunday Delivery.')
|
306 |
return false;
|
307 |
}
|
308 |
|
309 |
+
/**
|
310 |
+
* Check if COD is available in combination with Buspakje.
|
311 |
+
*/
|
312 |
+
if (!$this->canShowForBuspakje()) {
|
313 |
+
$helper->log(
|
314 |
+
$helper->__('PostNL Cod is not for Buspakje shipments.')
|
315 |
+
);
|
316 |
+
return false;
|
317 |
+
}
|
318 |
+
|
319 |
/**
|
320 |
* Finally, perform Magento's own checks.
|
321 |
*/
|
432 |
$title = sprintf($title, $fee);
|
433 |
return $title;
|
434 |
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Check if the PostNL COD payment method may be shown for letter box parcel orders.
|
438 |
+
*
|
439 |
+
* @return boolean
|
440 |
+
*/
|
441 |
+
protected function canShowForBuspakje()
|
442 |
+
{
|
443 |
+
/**
|
444 |
+
* Check the configuration setting.
|
445 |
+
*/
|
446 |
+
$showForBuspakje = Mage::getStoreConfigFlag(self::XPATH_ALLOW_FOR_BUSPAKJE, Mage::app()->getStore()->getId());
|
447 |
+
if ($showForBuspakje) {
|
448 |
+
return true;
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Check if the buspakje calculation mode is set to automatic.
|
453 |
+
*/
|
454 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
455 |
+
$helper = Mage::helper('postnl');
|
456 |
+
$calculationMode = $helper->getBuspakjeCalculationMode();
|
457 |
+
if ($calculationMode != 'automatic') {
|
458 |
+
return true;
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* Check if the current quote fits as a letter box parcel.
|
463 |
+
*/
|
464 |
+
/** @var Mage_Checkout_Model_Session $session */
|
465 |
+
$session = Mage::getSingleton('checkout/session');
|
466 |
+
$quote = $session->getQuote();
|
467 |
+
if (!$helper->fitsAsBuspakje($quote->getAllItems())) {
|
468 |
+
return true;
|
469 |
+
}
|
470 |
+
|
471 |
+
return false;
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* @param $helper
|
476 |
+
*
|
477 |
+
* @return Mage_Core_Helper_Data
|
478 |
+
*/
|
479 |
+
protected function getHelper($helper)
|
480 |
+
{
|
481 |
+
if (!array_key_exists($helper, $this->_helpers)) {
|
482 |
+
$this->_helpers[$helper] = Mage::helper($helper);
|
483 |
+
}
|
484 |
+
|
485 |
+
return $this->_helpers[$helper];
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* @param $model
|
490 |
+
*
|
491 |
+
* @return Mage_Core_Model_Abstract
|
492 |
+
*/
|
493 |
+
protected function getModel($model)
|
494 |
+
{
|
495 |
+
if (!array_key_exists($model, $this->_models)) {
|
496 |
+
$this->_models[$model] = Mage::getModel($model);
|
497 |
+
}
|
498 |
+
|
499 |
+
return $this->_models[$model];
|
500 |
+
}
|
501 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Observer_Cod
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Observer_Cod
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFee_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFee_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFeeTax
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Creditmemo_Total_CodFeeTax
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_CodFee extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_CodFee extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_CodFeeTax extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_CodFeeTax extends Mage_Sales_Model_Order_Invoice_Total_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Order_Invoice_Total_Subtotal
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Order_Invoice_Total_Subtotal
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method int|string getFontSize()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method int|string getFontSize()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Sales_Model_Order getOrder()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Sales_Model_Order getOrder()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Sales_Model_Order getOrder()
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @method Mage_Sales_Model_Order getOrder()
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFee
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFee
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFee_Abstract extends Mage_Tax_Model_Sales_Total_Quote_Tax
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFee_Abstract extends Mage_Tax_Model_Sales_Total_Quote_Tax
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFeeTax
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Quote_Address_Total_CodFeeTax
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Service
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_Service
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_System_Config_Source_CodFeeTaxClass
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Payment_System_Config_Source_CodFeeTaxClass
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Catalog_Product extends Mage_Catalog_Model_Resource_Product
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Catalog_Product extends Mage_Catalog_Model_Resource_Product
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Resource_Db_Abstract extends Mage_Core_Model_Resource_Db_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
abstract class TIG_PostNL_Model_Resource_Db_Abstract extends Mage_Core_Model_Resource_Db_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Db_Collection_Postnl extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Db_Collection_Postnl extends Mage_Core_Model_Resource_Db_Collection_Abstract
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Grid_Collection extends Mage_Sales_Model_Resource_Order_Grid_Collection
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Grid_Collection extends Mage_Sales_Model_Resource_Order_Grid_Collection
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Shipment extends Mage_Sales_Model_Resource_Order_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Shipment extends Mage_Sales_Model_Resource_Order_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Shipment_Grid_Collection extends Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Order_Shipment_Grid_Collection extends Mage_Sales_Model_Resource_Order_Shipment_Grid_Collection
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_System_Config_Backend_Checkbox extends Mage_Core_Model_Config_Data
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_Model_System_Config_Backend_Checkbox extends Mage_Core_Model_Config_Data
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -0,0 +1 @@
|
|
|
1 |
+
service_name: travis-pro
|
@@ -1,119 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* ___________ __ __
|
4 |
-
* \__ ___/____ _/ |_ _____ | |
|
5 |
-
* | | / _ \\ __\\__ \ | |
|
6 |
-
* | | | |_| || | / __ \_| |__
|
7 |
-
* |____| \____/ |__| (____ /|____/
|
8 |
-
* \/
|
9 |
-
* ___ __ __
|
10 |
-
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
-
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
-
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
-
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
-
* \/ \/
|
15 |
-
* ________
|
16 |
-
* / _____/_______ ____ __ __ ______
|
17 |
-
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
-
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
-
* \______ /|__| \____/ |____/ | __/
|
20 |
-
* \/ |__|
|
21 |
-
*
|
22 |
-
* NOTICE OF LICENSE
|
23 |
-
*
|
24 |
-
* This source file is subject to the Creative Commons License.
|
25 |
-
* It is available through the world-wide-web at this URL:
|
26 |
-
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
-
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
-
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
-
*
|
30 |
-
* DISCLAIMER
|
31 |
-
*
|
32 |
-
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
-
* versions in the future. If you wish to customize this module for your
|
34 |
-
* needs please contact servicedesk@tig.nl for more information.
|
35 |
-
*
|
36 |
-
* @copyright Copyright (c) 2015 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
-
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
-
*/
|
39 |
-
class TIG_PostNL_Test_Block_DeliveryOptions_JsTest extends TIG_PostNL_Test_Framework_TIG_Test_TestCase
|
40 |
-
{
|
41 |
-
protected $_class = 'TIG_PostNL_Block_DeliveryOptions_Js';
|
42 |
-
|
43 |
-
protected function _getInstance()
|
44 |
-
{
|
45 |
-
return new $this->_class;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @test
|
50 |
-
*/
|
51 |
-
public function apiKeyShouldBeReturned()
|
52 |
-
{
|
53 |
-
$block = $this->_getInstance();
|
54 |
-
|
55 |
-
$block->setApiKey('test');
|
56 |
-
|
57 |
-
$this->assertEquals('test', $block->getApiKey());
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @test
|
62 |
-
*/
|
63 |
-
public function apiKeyShouldBeReturnedFromConfig()
|
64 |
-
{
|
65 |
-
$storeCode = Mage::app()->getStore()->getCode();
|
66 |
-
Mage::app()->getConfig()->setNode("stores/{$storeCode}/postnl/google_maps/api_key", 'keyTest');
|
67 |
-
|
68 |
-
$block = $this->_getInstance();
|
69 |
-
|
70 |
-
$this->assertEquals('keyTest', $block->getApiKey());
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* @test
|
75 |
-
*
|
76 |
-
* @dataProvider trueAndFalse
|
77 |
-
*/
|
78 |
-
public function shouldOnlyRenderIfDeliveryOptionsAreAvailable($returnValue)
|
79 |
-
{
|
80 |
-
$this->markTestSkipped('Skip this test');
|
81 |
-
|
82 |
-
$this->registerMockSessions(array('checkout'));
|
83 |
-
|
84 |
-
$mockQuote = $this->getMock('Mage_Sales_Model_Quote');
|
85 |
-
|
86 |
-
$mockSession = Mage::getSingleton('checkout/session');
|
87 |
-
$mockSession->expects($this->once())
|
88 |
-
->method('getQuote')
|
89 |
-
->will($this->returnValue($mockQuote));
|
90 |
-
|
91 |
-
$mockHelper = $this->getMock('TIG_PostNL_Helper_DeliveryOptions', array('canUseDeliveryOptions'));
|
92 |
-
$mockHelper->expects($this->once())
|
93 |
-
->method('canUseDeliveryOptions')
|
94 |
-
->withAnyParameters()
|
95 |
-
->will($this->returnValue($returnValue));
|
96 |
-
|
97 |
-
$this->setHelperMock('postnl/deliveryOptions', $mockHelper);
|
98 |
-
|
99 |
-
$html = $this->_getInstance()->toHtml();
|
100 |
-
|
101 |
-
if ($returnValue === false) {
|
102 |
-
$this->assertTrue(empty($html), 'Expected script to not render');
|
103 |
-
} else {
|
104 |
-
$rendered = strpos($html, '<script');
|
105 |
-
$this->assertTrue($rendered !== false, 'Expected script to render');
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* @return array
|
111 |
-
*/
|
112 |
-
public function trueAndFalse()
|
113 |
-
{
|
114 |
-
return array(
|
115 |
-
array(true),
|
116 |
-
array(false),
|
117 |
-
);
|
118 |
-
}
|
119 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,1,agecheck,20,*
|
3 |
+
NLD,*,*,0,0,2,age check,40,*
|
4 |
+
NLD,*,*,0,0,3,age-check,60,*
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,7,birthday,0,*
|
3 |
+
NLD,*,*,0,0,8,birth day,0,*
|
4 |
+
NLD,*,*,0,0,9,birth-day,0,*
|
5 |
+
NLD,*,*,0,0,10,birthdaycheck,0,*
|
6 |
+
NLD,*,*,0,0,11,birthday check,0,*
|
7 |
+
NLD,*,*,0,0,12,birth day check,0,*
|
8 |
+
NLD,*,*,0,0,13,birth day-check,0,*
|
9 |
+
NLD,*,*,0,0,14,birth-day check,0,*
|
10 |
+
NLD,*,*,0,0,15,birth-day-check,0,*
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,1,food,1,*
|
3 |
+
NLD,*,*,0,0,2,voedsel,2,*
|
4 |
+
NLD,*,*,0,0,3,eten,3,*
|
5 |
+
NLD,*,*,0,0,4,coolfood,4,*
|
6 |
+
NLD,*,*,0,0,5,cooledfood,5,*
|
7 |
+
NLD,*,*,0,0,6,gekoeld,6,*
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,4,idcheck,0,*
|
3 |
+
NLD,*,*,0,0,5,id check,0,*
|
4 |
+
NLD,*,*,0,0,6,id-check,0,*
|
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,0,buspakje,2.5,* We raden u aan om bij verzendkosten de tarieven in te vullen die corresponderen met uw contract.
|
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
Land,Provincie/staat,Postcode,Gewicht (en hoger),Bedrag (en hoger),Hoeveelheid (en hoger),pakkettype,prijs,Instructies
|
2 |
+
NLD,*,*,0,0,0,pakket,5,* Om voor internationale verzendingen gebruik te maken van Magento's tablerates raden we u aan om de gewichten van uw producten (catalogus->beheer producten->gewenste product) correct te configureren.
|
@@ -1,225 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* ___________ __ __
|
4 |
-
* \__ ___/____ _/ |_ _____ | |
|
5 |
-
* | | / _ \\ __\\__ \ | |
|
6 |
-
* | | | |_| || | / __ \_| |__
|
7 |
-
* |____| \____/ |__| (____ /|____/
|
8 |
-
* \/
|
9 |
-
* ___ __ __
|
10 |
-
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
-
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
-
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
-
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
-
* \/ \/
|
15 |
-
* ________
|
16 |
-
* / _____/_______ ____ __ __ ______
|
17 |
-
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
-
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
-
* \______ /|__| \____/ |____/ | __/
|
20 |
-
* \/ |__|
|
21 |
-
*
|
22 |
-
* NOTICE OF LICENSE
|
23 |
-
*
|
24 |
-
* This source file is subject to the Creative Commons License.
|
25 |
-
* It is available through the world-wide-web at this URL:
|
26 |
-
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
-
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
-
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
-
*
|
30 |
-
* DISCLAIMER
|
31 |
-
*
|
32 |
-
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
-
* versions in the future. If you wish to customize this module for your
|
34 |
-
* needs please contact servicedesk@tig.nl for more information.
|
35 |
-
*
|
36 |
-
* @copyright Copyright (c) 2015 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
-
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
-
*/
|
39 |
-
class TIG_PostNL_Test_Helper_DeliveryOptionsTest extends TIG_PostNL_Test_Framework_TIG_Test_TestCase
|
40 |
-
{
|
41 |
-
/**
|
42 |
-
* @return TIG_PostNL_Helper_DeliveryOptions
|
43 |
-
*/
|
44 |
-
protected function _getInstance()
|
45 |
-
{
|
46 |
-
return Mage::helper('postnl/deliveryOptions');
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @test
|
51 |
-
*/
|
52 |
-
public function shouldBeOfTheRightInstance()
|
53 |
-
{
|
54 |
-
$helper = $this->_getInstance();
|
55 |
-
$this->assertInstanceOf('TIG_PostNL_Helper_DeliveryOptions', $helper);
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @test
|
60 |
-
*/
|
61 |
-
public function shouldAllowSundaySorting()
|
62 |
-
{
|
63 |
-
$this->markTestSkipped('Skip this test');
|
64 |
-
|
65 |
-
Mage::app()->getStore()->setConfig('postnl/cif_labels_and_confirming/allow_sunday_sorting', true);
|
66 |
-
|
67 |
-
$helper = $this->_getInstance();
|
68 |
-
|
69 |
-
$this->assertTrue($helper->canUseSundaySorting());
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* @test
|
74 |
-
*/
|
75 |
-
public function shouldDisallowSundaySorting()
|
76 |
-
{
|
77 |
-
$this->markTestSkipped('Skip this test');
|
78 |
-
|
79 |
-
$this->resetMagento();
|
80 |
-
|
81 |
-
Mage::app()->getStore()->setConfig('postnl/cif_labels_and_confirming/allow_sunday_sorting', false);
|
82 |
-
|
83 |
-
$helper = $this->_getInstance();
|
84 |
-
|
85 |
-
$this->assertTrue(!$helper->canUseSundaySorting());
|
86 |
-
}
|
87 |
-
|
88 |
-
public function testCanUseDutchProductsByCountryDataProvder()
|
89 |
-
{
|
90 |
-
return array(
|
91 |
-
array(
|
92 |
-
'country' => 'BE',
|
93 |
-
'shouldPass' => true,
|
94 |
-
),
|
95 |
-
array(
|
96 |
-
'country' => 'NL',
|
97 |
-
'shouldPass' => true,
|
98 |
-
),
|
99 |
-
array(
|
100 |
-
'country' => 'DE',
|
101 |
-
'shouldPass' => false,
|
102 |
-
),
|
103 |
-
);
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* @param $country
|
108 |
-
* @param $shouldPass
|
109 |
-
*
|
110 |
-
* @dataProvider testCanUseDutchProductsByCountryDataProvder
|
111 |
-
*/
|
112 |
-
public function testCanUseDutchProductsByCountry($country, $shouldPass)
|
113 |
-
{
|
114 |
-
$helper = $this->_getInstance();
|
115 |
-
|
116 |
-
$this->setProperty('_canUseDutchProducts', null);
|
117 |
-
$this->setProperty('_domesticCountry', $country);
|
118 |
-
|
119 |
-
Mage::app()->getStore()->setConfig($helper::XPATH_USE_DUTCH_PRODUCTS, '1');
|
120 |
-
|
121 |
-
$this->assertEquals($shouldPass, $helper->canUseDutchProducts());
|
122 |
-
}
|
123 |
-
|
124 |
-
public function testCanUseDutchProductsWhenDisabledProvder()
|
125 |
-
{
|
126 |
-
return array(
|
127 |
-
array(
|
128 |
-
'country' => 'BE',
|
129 |
-
'shouldPass' => false,
|
130 |
-
),
|
131 |
-
array(
|
132 |
-
'country' => 'NL',
|
133 |
-
'shouldPass' => true,
|
134 |
-
),
|
135 |
-
array(
|
136 |
-
'country' => 'DE',
|
137 |
-
'shouldPass' => false,
|
138 |
-
),
|
139 |
-
);
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* @param $country
|
144 |
-
* @param $shouldPass
|
145 |
-
*
|
146 |
-
* @dataProvider testCanUseDutchProductsWhenDisabledProvder
|
147 |
-
*/
|
148 |
-
public function testCanUseDutchProductsWhenDisabled($country, $shouldPass)
|
149 |
-
{
|
150 |
-
$helper = $this->_getInstance();
|
151 |
-
|
152 |
-
$this->setProperty('_canUseDutchProducts', null);
|
153 |
-
$this->setProperty('_domesticCountry', $country);
|
154 |
-
|
155 |
-
Mage::app()->getStore()->setConfig($helper::XPATH_USE_DUTCH_PRODUCTS, '0');
|
156 |
-
|
157 |
-
$this->assertEquals($shouldPass, $helper->canUseDutchProducts());
|
158 |
-
}
|
159 |
-
|
160 |
-
public function testCanUseDutchProductsUsesCache()
|
161 |
-
{
|
162 |
-
$value = uniqid();
|
163 |
-
$this->setProperty('_canUseDutchProducts', $value);
|
164 |
-
|
165 |
-
$this->assertEquals($value, $this->_getInstance()->canUseDutchProducts());
|
166 |
-
}
|
167 |
-
|
168 |
-
public function testCanUseDeliveryOptionsForQuoteIsVirtual()
|
169 |
-
{
|
170 |
-
$helper = $this->_getInstance();
|
171 |
-
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
172 |
-
|
173 |
-
$quote->expects($this->once())
|
174 |
-
->method('isVirtual')
|
175 |
-
->willReturn(true);
|
176 |
-
|
177 |
-
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
178 |
-
|
179 |
-
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
180 |
-
$this->assertEquals('POSTNL-0104', $error[0]['code']);
|
181 |
-
}
|
182 |
-
|
183 |
-
public function testCanUseDeliveryOptionsForQuoteIsBuspakje()
|
184 |
-
{
|
185 |
-
$helper = $this->_getInstance();
|
186 |
-
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
187 |
-
|
188 |
-
$quote->expects($this->once())
|
189 |
-
->method('isVirtual')
|
190 |
-
->willReturn(false);
|
191 |
-
|
192 |
-
$quote->expects($this->any())
|
193 |
-
->method('getId')
|
194 |
-
->willReturn(1);
|
195 |
-
|
196 |
-
$this->setRegistryKey('is_buspakje_config_applicable_to_quote_1', true);
|
197 |
-
|
198 |
-
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
199 |
-
|
200 |
-
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
201 |
-
$this->assertEquals('POSTNL-0190', $error[0]['code']);
|
202 |
-
}
|
203 |
-
|
204 |
-
public function testCanUseDeliveryOptionsForQuoteIsBuspakjeEnabled()
|
205 |
-
{
|
206 |
-
$helper = $this->_getInstance();
|
207 |
-
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
208 |
-
|
209 |
-
$quote->expects($this->once())
|
210 |
-
->method('isVirtual')
|
211 |
-
->willReturn(false);
|
212 |
-
|
213 |
-
$quote->expects($this->any())
|
214 |
-
->method('getId')
|
215 |
-
->willReturn(1);
|
216 |
-
|
217 |
-
$this->setRegistryKey('is_buspakje_config_applicable_to_quote_1', true);
|
218 |
-
$this->setRegistryKey('can_show_options_for_buspakje_1', false);
|
219 |
-
|
220 |
-
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
221 |
-
|
222 |
-
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
223 |
-
$this->assertEquals('POSTNL-0190', $error[0]['code']);
|
224 |
-
}
|
225 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env bash
|
2 |
+
|
3 |
+
set -e
|
4 |
+
set -x
|
5 |
+
|
6 |
+
if [ "$CODE_COVERAGE" = "true" ]; then
|
7 |
+
sed -i -e "s|/tmp/magento/public/.modman/project/|${TRAVIS_BUILD_DIR}/|g" ${TRAVIS_BUILD_DIR}/build/logs/clover.xml
|
8 |
+
|
9 |
+
coveralls -vvv --config app/code/community/TIG/PostNL/Test/.coveralls.yml
|
10 |
+
fi
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
#set -e
|
4 |
+
set -x
|
5 |
+
|
6 |
+
COMPOSER_REQUIRE="";
|
7 |
+
|
8 |
+
which n98-magerun
|
9 |
+
if [ $? != "0" ]; then
|
10 |
+
COMPOSER_REQUIRE="${COMPOSER_REQUIRE} n98/magerun"
|
11 |
+
fi
|
12 |
+
|
13 |
+
which modman
|
14 |
+
if [ $? != "0" ]; then
|
15 |
+
COMPOSER_REQUIRE="${COMPOSER_REQUIRE} colinmollenhour/modman"
|
16 |
+
fi
|
17 |
+
|
18 |
+
which modman
|
19 |
+
if [ $? != "0" ] && [ "${CODE_COVERAGE}" = "true" ]; then
|
20 |
+
COMPOSER_REQUIRE="${COMPOSER_REQUIRE} satooshi/php-coveralls"
|
21 |
+
fi
|
22 |
+
|
23 |
+
if [ ! -z "${COMPOSER_REQUIRE}" ]; then
|
24 |
+
composer global require ${COMPOSER_REQUIRE}
|
25 |
+
else
|
26 |
+
echo "All dependencies installed"
|
27 |
+
fi
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
set -e
|
3 |
+
set -x
|
4 |
+
|
5 |
+
if [ -z $MAGENTO_DB_HOST ]; then MAGENTO_DB_HOST="localhost"; fi
|
6 |
+
if [ -z $MAGENTO_DB_PORT ]; then MAGENTO_DB_PORT="3306"; fi
|
7 |
+
if [ -z $MAGENTO_DB_USER ]; then MAGENTO_DB_USER="root"; fi
|
8 |
+
if [ -z $MAGENTO_DB_PASS ]; then MAGENTO_DB_PASS=""; fi
|
9 |
+
if [ -z $MAGENTO_DB_NAME ]; then MAGENTO_DB_NAME="magento"; fi
|
10 |
+
|
11 |
+
CURRENT_DIR=`pwd`
|
12 |
+
BUILDENV="/tmp/magento"
|
13 |
+
mkdir -p ${BUILDENV}
|
14 |
+
PUBLIC_DIR="${BUILDENV}/public/"
|
15 |
+
|
16 |
+
mkdir -p "${PUBLIC_DIR}"
|
17 |
+
|
18 |
+
echo "Using build directory ${BUILDENV}"
|
19 |
+
|
20 |
+
echo "Installing Magento version ${MAGENTO_VERSION}"
|
21 |
+
|
22 |
+
# Create main database
|
23 |
+
MYSQLPASS=""
|
24 |
+
if [ ! -z $MAGENTO_DB_PASS ]; then MYSQLPASS="-p${MAGENTO_DB_PASS}"; fi
|
25 |
+
mysql -u${MAGENTO_DB_USER} ${MYSQLPASS} -h${MAGENTO_DB_HOST} -P${MAGENTO_DB_PORT} -e "DROP DATABASE IF EXISTS \`${MAGENTO_DB_NAME}\`; CREATE DATABASE \`${MAGENTO_DB_NAME}\`;"
|
26 |
+
|
27 |
+
n98-magerun install \
|
28 |
+
--dbHost="${MAGENTO_DB_HOST}" --dbUser="${MAGENTO_DB_USER}" --dbPass="${MAGENTO_DB_PASS}" --dbName="${MAGENTO_DB_NAME}" --dbPort="${MAGENTO_DB_PORT}" \
|
29 |
+
--installSampleData=no \
|
30 |
+
--useDefaultConfigParams=yes \
|
31 |
+
--magentoVersionByName="${MAGENTO_VERSION}" \
|
32 |
+
--installationFolder="${PUBLIC_DIR}" \
|
33 |
+
--baseUrl="http://magento.local/" || { echo "Installing Magento failed"; exit 1; }
|
34 |
+
|
35 |
+
mkdir -p "${PUBLIC_DIR}/.modman/project"
|
36 |
+
|
37 |
+
cp -rf . "${PUBLIC_DIR}/.modman/project"
|
38 |
+
|
39 |
+
cd "${PUBLIC_DIR}"
|
40 |
+
|
41 |
+
modman deploy-all
|
42 |
+
n98-magerun config:set dev/template/allow_symlink 1
|
43 |
+
n98-magerun sys:setup:run
|
44 |
+
|
45 |
+
if [ -z $ENABLE_FLAT_CATALOG ] || [ $ENABLE_FLAT_CATALOG == false ]; then
|
46 |
+
n98-magerun config:set catalog/frontend/flat_catalog_category 0
|
47 |
+
n98-magerun config:set catalog/frontend/flat_catalog_product 0
|
48 |
+
else
|
49 |
+
n98-magerun config:set catalog/frontend/flat_catalog_category 1
|
50 |
+
n98-magerun config:set catalog/frontend/flat_catalog_product 1
|
51 |
+
n98-magerun index:reindex:all
|
52 |
+
fi
|
53 |
+
|
54 |
+
cd "${PUBLIC_DIR}/.modman/project";
|
55 |
+
mkdir -p "${PUBLIC_DIR}var/session";
|
56 |
+
chmod -R 777 "${PUBLIC_DIR}var/session";
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Block_Checkout_Widget_DobTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
protected $_class = 'TIG_PostNL_Block_Checkout_Widget_Dob';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @var null|TIG_PostNL_Helper_DeliveryOptions|PHPUnit_Framework_MockObject_MockObject
|
45 |
+
*/
|
46 |
+
protected $_helper = null;
|
47 |
+
|
48 |
+
protected function setUp()
|
49 |
+
{
|
50 |
+
$this->_helper = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* @return TIG_PostNL_Block_Checkout_Widget_Dob
|
55 |
+
*/
|
56 |
+
protected function _getInstance()
|
57 |
+
{
|
58 |
+
$class = new $this->_class();
|
59 |
+
$this->setProperty('_helper', $this->_helper, $class);
|
60 |
+
|
61 |
+
return $class;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function dataProvider()
|
65 |
+
{
|
66 |
+
return array(
|
67 |
+
array('isEnabled', 'opt', true, true, true),
|
68 |
+
array('isEnabled', 'opt', false, true, true),
|
69 |
+
array('isEnabled', 'opt', false, false, true),
|
70 |
+
array('isEnabled', 'opt', true, false, true),
|
71 |
+
|
72 |
+
array('isEnabled', 'req', true, true, true),
|
73 |
+
array('isEnabled', 'req', false, true, true),
|
74 |
+
array('isEnabled', 'req', false, false, true),
|
75 |
+
array('isEnabled', 'req', true, false, true),
|
76 |
+
|
77 |
+
array('isEnabled', '', true, true, true),
|
78 |
+
array('isEnabled', '', false, true, false),
|
79 |
+
array('isEnabled', '', false, false, false),
|
80 |
+
array('isEnabled', '', true, false, false),
|
81 |
+
|
82 |
+
array('isRequired', 'opt', true, true, true),
|
83 |
+
array('isRequired', 'opt', false, true, false),
|
84 |
+
array('isRequired', 'opt', false, false, false),
|
85 |
+
array('isRequired', 'opt', true, false, false),
|
86 |
+
|
87 |
+
array('isRequired', 'req', true, true, true),
|
88 |
+
array('isRequired', 'req', false, true, true),
|
89 |
+
array('isRequired', 'req', false, false, true),
|
90 |
+
array('isRequired', 'req', true, false, true),
|
91 |
+
|
92 |
+
array('isRequired', '', true, true, true),
|
93 |
+
array('isRequired', '', false, true, false),
|
94 |
+
array('isRequired', '', false, false, false),
|
95 |
+
array('isRequired', '', true, false, false),
|
96 |
+
);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @dataProvider dataProvider
|
101 |
+
*/
|
102 |
+
public function testIsEnabled(
|
103 |
+
$method,
|
104 |
+
$dobValue,
|
105 |
+
$canUseBirthdayCheckDelivery,
|
106 |
+
$quoteIsBirthdayCheck,
|
107 |
+
$result
|
108 |
+
) {
|
109 |
+
Mage::app()->getStore()->setConfig('customer/address/dob_show', $dobValue);
|
110 |
+
|
111 |
+
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'dob');
|
112 |
+
$attribute->setData('is_visible', $dobValue != '' ? '1' : '0');
|
113 |
+
$attribute->setData('is_required', $dobValue == 'req' ? '1' : '0');
|
114 |
+
|
115 |
+
$this->_helper->expects($this->any())
|
116 |
+
->method('canUseBirthdayCheckDelivery')
|
117 |
+
->willReturn($canUseBirthdayCheckDelivery);
|
118 |
+
|
119 |
+
$this->_helper->expects($this->any())
|
120 |
+
->method('quoteIsBirthdayCheck')
|
121 |
+
->willReturn($quoteIsBirthdayCheck);
|
122 |
+
|
123 |
+
$this->assertEquals(
|
124 |
+
$result,
|
125 |
+
$this->_getInstance()->$method(),
|
126 |
+
'Check that ' . $method . ' with' . PHP_EOL .
|
127 |
+
'$dobValue on "' . $dobValue . '"' . PHP_EOL .
|
128 |
+
'$canUseBirthdayCheckDelivery on ' . ($canUseBirthdayCheckDelivery ? 'true' : 'false') . PHP_EOL .
|
129 |
+
'$quoteIsBirthdayCheck on ' . ($quoteIsBirthdayCheck ? 'true' : 'false') . PHP_EOL .
|
130 |
+
'will return ' . ($result ? 'true' : 'false')
|
131 |
+
);
|
132 |
+
}
|
133 |
+
}
|
@@ -33,10 +33,11 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
|
|
40 |
{
|
41 |
protected $_class = 'TIG_PostNL_Block_DeliveryOptions_Checkout_AddPhoneNumber';
|
42 |
|
@@ -163,8 +164,6 @@ class TIG_PostNL_Test_Block_DeliveryOptions_Checkout_AddPhoneNumberTest extends
|
|
163 |
*/
|
164 |
public function shouldGetQuoteFromSession()
|
165 |
{
|
166 |
-
$this->markTestSkipped('Skip this test');
|
167 |
-
|
168 |
$block = $this->_getInstance();
|
169 |
|
170 |
$this->registerMockSessions(array('checkout'));
|
@@ -178,4 +177,4 @@ class TIG_PostNL_Test_Block_DeliveryOptions_Checkout_AddPhoneNumberTest extends
|
|
178 |
|
179 |
$this->assertInstanceOf('Mage_Sales_Model_Quote', $block->getQuote());
|
180 |
}
|
181 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Block_DeliveryOptions_Checkout_AddPhoneNumberTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
{
|
42 |
protected $_class = 'TIG_PostNL_Block_DeliveryOptions_Checkout_AddPhoneNumber';
|
43 |
|
164 |
*/
|
165 |
public function shouldGetQuoteFromSession()
|
166 |
{
|
|
|
|
|
167 |
$block = $this->_getInstance();
|
168 |
|
169 |
$this->registerMockSessions(array('checkout'));
|
177 |
|
178 |
$this->assertInstanceOf('Mage_Sales_Model_Quote', $block->getQuote());
|
179 |
}
|
180 |
+
}
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Block_DeliveryOptions_Checkout_DeliveryOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
protected function _getInstance()
|
43 |
+
{
|
44 |
+
return new TIG_PostNL_Block_DeliveryOptions_Checkout_DeliveryOptions();
|
45 |
+
}
|
46 |
+
|
47 |
+
public function _getDeliveryDateProvider()
|
48 |
+
{
|
49 |
+
return array(
|
50 |
+
array('', 'BE', 'delivery', null, true, true, 'POSTNL-0131', 'Invalid postcode supplied for GetDeliveryDate request: Postcodes may only contain 4 numbers.'),
|
51 |
+
array('aa', 'BE', 'delivery', null, true, true, 'POSTNL-0131', 'Invalid postcode supplied for GetDeliveryDate request: AA Postcodes may only contain 4 numbers.'),
|
52 |
+
array('', 'NL', 'delivery', null, true, true, 'POSTNL-0131', 'Invalid postcode supplied for GetDeliveryDate request: Postcodes may only contain 4 numbers and 2 letters.'),
|
53 |
+
array('aa', 'NL', 'delivery', null, true, true, 'POSTNL-0131', 'Invalid postcode supplied for GetDeliveryDate request: AA Postcodes may only contain 4 numbers and 2 letters.'),
|
54 |
+
array('1234ab', 'US', 'delivery', null, true, true, 'POSTNL-0235', 'Invalid country supplied for GetDeliveryDate request: US. Only "NL" and "BE" are allowed.'),
|
55 |
+
|
56 |
+
array('1234AB', 'NL', 'delivery', '01-01-2001', true, true, null, null, '01-01-2001'),
|
57 |
+
array('1234AB', 'NL', 'pickup', '01-01-2001', true, false, null, null, '01-01-2001'),
|
58 |
+
array('1234AB', 'NL', 'pickup', '01-01-2001', true, true, null, null, '02-01-2001'),
|
59 |
+
array('1234AB', 'BE', 'pickup', '01-01-2001', true, true, null, null, '01-01-2001'),
|
60 |
+
array('1234AB', 'NL', 'pickup', '01-01-2001', false, true, null, null, '01-01-2001'),
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @param $postcode
|
66 |
+
* @param $country
|
67 |
+
* @param $for
|
68 |
+
* @param $cifResponse
|
69 |
+
* @param $canUseSamedayDelivery
|
70 |
+
* @param $isPastCutoff
|
71 |
+
* @param $errorCode
|
72 |
+
* @param $errorMessage
|
73 |
+
*
|
74 |
+
* @param $expected
|
75 |
+
*
|
76 |
+
* @throws Exception
|
77 |
+
* @throws TIG_PostNL_Exception
|
78 |
+
* @dataProvider _getDeliveryDateProvider
|
79 |
+
*/
|
80 |
+
public function test_getDeliveryDate(
|
81 |
+
$postcode,
|
82 |
+
$country,
|
83 |
+
$for,
|
84 |
+
$cifResponse,
|
85 |
+
$canUseSamedayDelivery,
|
86 |
+
$isPastCutoff,
|
87 |
+
$errorCode,
|
88 |
+
$errorMessage,
|
89 |
+
$expected = null
|
90 |
+
)
|
91 |
+
{
|
92 |
+
$instance = $this->_getInstance();
|
93 |
+
|
94 |
+
$quoteMock = $this->getMock('Mage_Sales_Model_Quote');
|
95 |
+
|
96 |
+
$cifModelMock = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Cif', array('setStoreId', 'getDeliveryDate'));
|
97 |
+
|
98 |
+
$cifModelMock->expects($this->any())
|
99 |
+
->method('setStoreId')
|
100 |
+
->withAnyParameters()
|
101 |
+
->willReturnSelf();
|
102 |
+
|
103 |
+
$cifModelMock->expects($this->any())
|
104 |
+
->method('getDeliveryDate')
|
105 |
+
->with($postcode, $country, $quoteMock, $for)
|
106 |
+
->willReturn($cifResponse);
|
107 |
+
|
108 |
+
$deliverOptionsHelperMock = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
109 |
+
|
110 |
+
$deliverOptionsHelperMock->expects($this->any())
|
111 |
+
->method('canUseSameDayDelivery')
|
112 |
+
->willReturn($canUseSamedayDelivery);
|
113 |
+
|
114 |
+
$dateHelperMock = $this->getMock('TIG_PostNL_Helper_Date');
|
115 |
+
|
116 |
+
$dateHelperMock->expects($this->any())
|
117 |
+
->method('isPastCutOff')
|
118 |
+
->willReturn($isPastCutoff);
|
119 |
+
|
120 |
+
$dateHelperMock->expects($this->any())
|
121 |
+
->method('getDeliveryDateCorrection')
|
122 |
+
->willReturn(0);
|
123 |
+
|
124 |
+
$this->setProperty('_models', array('postnl_deliveryoptions/cif' => $cifModelMock), $instance);
|
125 |
+
$this->setProperty('_helpers', array(
|
126 |
+
'postnl/deliveryOptions' => $deliverOptionsHelperMock,
|
127 |
+
'postnl/date' => $dateHelperMock,
|
128 |
+
), $instance);
|
129 |
+
|
130 |
+
try {
|
131 |
+
$method = new ReflectionMethod(get_class($instance), '_getDeliveryDate');
|
132 |
+
$method->setAccessible(true);
|
133 |
+
$result = $method->invokeArgs($instance, array(
|
134 |
+
$postcode,
|
135 |
+
$country,
|
136 |
+
$quoteMock,
|
137 |
+
$for,
|
138 |
+
));
|
139 |
+
|
140 |
+
$this->assertEquals($expected, $result, 'Check the result returned by _getDeliveryDate');
|
141 |
+
} catch (TIG_PostNL_Exception $e) {
|
142 |
+
if ($errorCode !== null) {
|
143 |
+
$this->assertEquals($errorCode, $e->getCode(), 'The retrieved exception has the same code');
|
144 |
+
$this->assertEquals($errorMessage, $e->getMessage(), 'The retrieved exception has the same message');
|
145 |
+
} else {
|
146 |
+
throw $e;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
150 |
+
}
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Block_DeliveryOptions_Checkout_IdCheckTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
protected $_class = 'TIG_PostNL_Block_DeliveryOptions_Checkout_IdCheck';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @return TIG_PostNL_Block_DeliveryOptions_Checkout_IdCheck
|
46 |
+
*/
|
47 |
+
protected function _getInstance()
|
48 |
+
{
|
49 |
+
return new $this->_class();
|
50 |
+
}
|
51 |
+
|
52 |
+
public function testBlockShouldBeTheRightInstance()
|
53 |
+
{
|
54 |
+
$block = $this->_getInstance();
|
55 |
+
|
56 |
+
$this->assertInstanceOf($this->_class, $block);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function testGetMonthList()
|
60 |
+
{
|
61 |
+
$block = $this->_getInstance();
|
62 |
+
|
63 |
+
$this->assertEquals(12, count($block->getMonthList()));
|
64 |
+
}
|
65 |
+
|
66 |
+
public function testGetPostnlOrder()
|
67 |
+
{
|
68 |
+
$block = $this->_getInstance();
|
69 |
+
$this->setProperty('_order', 'customclass', $block);
|
70 |
+
|
71 |
+
$this->assertEquals('customclass', $block->getPostnlOrder());
|
72 |
+
}
|
73 |
+
}
|
@@ -33,49 +33,40 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
-
|
42 |
-
|
43 |
-
*/
|
44 |
protected function _getInstance()
|
45 |
{
|
46 |
-
return
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
* @test
|
51 |
*/
|
52 |
-
public function
|
53 |
{
|
54 |
-
$
|
55 |
|
56 |
-
$
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* @test
|
61 |
*/
|
62 |
-
public function
|
63 |
{
|
64 |
-
$
|
65 |
-
|
66 |
-
$mockPostnlOrder = $this->getMock('TIG_PostNL_Model_Core_Order');
|
67 |
-
$mockPostnlOrder->expects($this->once())
|
68 |
-
->method('getId')
|
69 |
-
->will($this->returnValue(1));
|
70 |
-
$mockPostnlOrder->expects($this->once())
|
71 |
-
->method('getIsActive')
|
72 |
-
->will($this->returnValue(true));
|
73 |
-
$mockPostnlOrder->expects($this->once())
|
74 |
-
->method('getShipmentCosts')
|
75 |
-
->will($this->returnValue(5));
|
76 |
|
77 |
-
$
|
78 |
|
79 |
-
$this->assertEquals($
|
80 |
}
|
81 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Block_DeliveryOptions_JsTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
+
protected $_class = 'TIG_PostNL_Block_DeliveryOptions_Js';
|
42 |
+
|
|
|
43 |
protected function _getInstance()
|
44 |
{
|
45 |
+
return new $this->_class;
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
* @test
|
50 |
*/
|
51 |
+
public function apiKeyShouldBeReturned()
|
52 |
{
|
53 |
+
$block = $this->_getInstance();
|
54 |
|
55 |
+
$block->setApiKey('test');
|
56 |
+
|
57 |
+
$this->assertEquals('test', $block->getApiKey());
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
* @test
|
62 |
*/
|
63 |
+
public function apiKeyShouldBeReturnedFromConfig()
|
64 |
{
|
65 |
+
$storeCode = Mage::app()->getStore()->getCode();
|
66 |
+
Mage::app()->getConfig()->setNode("stores/{$storeCode}/postnl/google_maps/api_key", 'keyTest');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
+
$block = $this->_getInstance();
|
69 |
|
70 |
+
$this->assertEquals('keyTest', $block->getApiKey());
|
71 |
}
|
72 |
+
}
|
@@ -33,16 +33,17 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
|
|
40 |
{
|
41 |
protected $_class = 'TIG_PostNL_AddressValidationController';
|
42 |
|
43 |
public static function setUpBeforeClass()
|
44 |
{
|
45 |
-
require_once(__DIR__ . '
|
46 |
}
|
47 |
|
48 |
protected function _getInstance($data = array())
|
@@ -158,4 +159,4 @@ class TIG_PostNL_Test_Controllers_AddressValidationControllerTest extends TIG_Po
|
|
158 |
|
159 |
$this->assertTrue(!$valid, 'Failed to invalidate result');
|
160 |
}
|
161 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Controllers_AddressValidationControllerTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
{
|
42 |
protected $_class = 'TIG_PostNL_AddressValidationController';
|
43 |
|
44 |
public static function setUpBeforeClass()
|
45 |
{
|
46 |
+
require_once(__DIR__ . '/../../../controllers/AddressValidationController.php');
|
47 |
}
|
48 |
|
49 |
protected function _getInstance($data = array())
|
159 |
|
160 |
$this->assertTrue(!$valid, 'Failed to invalidate result');
|
161 |
}
|
162 |
+
}
|
@@ -33,16 +33,49 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
protected $_class = 'TIG_PostNL_DeliveryOptionsController';
|
42 |
|
|
|
|
|
|
|
|
|
43 |
public static function setUpBeforeClass()
|
44 |
{
|
45 |
-
require_once(__DIR__ . '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
/**
|
@@ -123,25 +156,6 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
123 |
$this->assertTrue($dataMissing !== false, 'Check AJAX fails!');
|
124 |
}
|
125 |
|
126 |
-
/**
|
127 |
-
* @test
|
128 |
-
*
|
129 |
-
* @depends saveSelectedOptionActionShouldBeCallable
|
130 |
-
*/
|
131 |
-
public function shouldRejextSaveSelectedOptionActionIfUnableToUseDeliveryOptions()
|
132 |
-
{
|
133 |
-
$this->markTestSkipped('Skip this test');
|
134 |
-
|
135 |
-
$controller = $this->_getInstance(array('isAjax' => true));
|
136 |
-
$controller->setCanUseDeliveryOptions(false);
|
137 |
-
$controller->saveSelectedOptionAction();
|
138 |
-
|
139 |
-
$body = Mage::app()->getResponse()->getBody();
|
140 |
-
$dataMissing = strpos($body, 'not_allowed');
|
141 |
-
|
142 |
-
$this->assertTrue($dataMissing !== false);
|
143 |
-
}
|
144 |
-
|
145 |
/**
|
146 |
* @param $data
|
147 |
* @param $success
|
@@ -154,8 +168,6 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
154 |
*/
|
155 |
public function shouldValidatePostDataWithoutAnAddress($data, $success)
|
156 |
{
|
157 |
-
$this->markTestSkipped('Skip this test');
|
158 |
-
|
159 |
$controller = $this->_getInstance($data);
|
160 |
|
161 |
$mockService = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Service');
|
@@ -256,6 +268,30 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
256 |
$this->assertTrue($isCallable);
|
257 |
}
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
/**
|
260 |
* @test
|
261 |
*
|
@@ -263,8 +299,6 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
263 |
*/
|
264 |
public function shouldRejectSaveOptionCostsActionWithoutAjax()
|
265 |
{
|
266 |
-
$this->markTestSkipped('Skip this test');
|
267 |
-
|
268 |
$controller = $this->_getInstance();
|
269 |
$controller->setCanUseDeliveryOptions(true);
|
270 |
$controller->saveOptionCostsAction();
|
@@ -282,8 +316,6 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
282 |
*/
|
283 |
public function shouldRejectSaveOptionCostsActionIfUnableToUseDeliveryOptions()
|
284 |
{
|
285 |
-
$this->markTestSkipped('Skip this test');
|
286 |
-
|
287 |
$controller = $this->_getInstance(array('isAjax' => true));
|
288 |
$controller->setCanUseDeliveryOptions(false);
|
289 |
$controller->saveOptionCostsAction();
|
@@ -303,8 +335,6 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
303 |
*/
|
304 |
public function shouldValidatePostDataForSaveOptionCostsAction($data, $success)
|
305 |
{
|
306 |
-
$this->markTestSkipped('Skip this test');
|
307 |
-
|
308 |
$controller = $this->_getInstance($data);
|
309 |
|
310 |
$mockService = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Service');
|
@@ -556,4 +586,4 @@ class TIG_PostNL_Test_Controllers_DeliveryOptionsControllerTest extends TIG_Post
|
|
556 |
),
|
557 |
);
|
558 |
}
|
559 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Controllers_DeliveryOptionsControllerTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
protected $_class = 'TIG_PostNL_DeliveryOptionsController';
|
42 |
|
43 |
+
protected $mockHelper = false;
|
44 |
+
|
45 |
+
protected $mockedHelpers = array();
|
46 |
+
|
47 |
public static function setUpBeforeClass()
|
48 |
{
|
49 |
+
require_once(__DIR__ . '/../../../controllers/DeliveryOptionsController.php');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @param string $helperClass
|
54 |
+
* @param object $mock
|
55 |
+
*
|
56 |
+
* @return TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
57 |
+
*/
|
58 |
+
public function setHelperMock($helperClass, $mock)
|
59 |
+
{
|
60 |
+
$this->mockedHelpers[$helperClass] = $mock;
|
61 |
+
|
62 |
+
return parent::setHelperMock($helperClass, $mock);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Reset the helpers back to the original.
|
67 |
+
*
|
68 |
+
* @return $this
|
69 |
+
*/
|
70 |
+
public function breakDown()
|
71 |
+
{
|
72 |
+
if ($this->mockHelper) {
|
73 |
+
foreach ($this->mockedHelpers as $helper => $instance) {
|
74 |
+
parent::setHelperMock($helper, $instance);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
return $this;
|
79 |
}
|
80 |
|
81 |
/**
|
156 |
$this->assertTrue($dataMissing !== false, 'Check AJAX fails!');
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
/**
|
160 |
* @param $data
|
161 |
* @param $success
|
168 |
*/
|
169 |
public function shouldValidatePostDataWithoutAnAddress($data, $success)
|
170 |
{
|
|
|
|
|
171 |
$controller = $this->_getInstance($data);
|
172 |
|
173 |
$mockService = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Service');
|
268 |
$this->assertTrue($isCallable);
|
269 |
}
|
270 |
|
271 |
+
public function shouldValidateAddressDataDataProvider()
|
272 |
+
{
|
273 |
+
return array(
|
274 |
+
array(
|
275 |
+
'',
|
276 |
+
'POSTNL-0139',
|
277 |
+
false,
|
278 |
+
),
|
279 |
+
array(
|
280 |
+
array(
|
281 |
+
'City' => 'ANTWERPEN',
|
282 |
+
'Countrycode' => 'BE',
|
283 |
+
'HouseNr' => '2',
|
284 |
+
'HouseNrExt' => '3',
|
285 |
+
'Street' => 'BRESSTRAAT',
|
286 |
+
'Zipcode' => '2018',
|
287 |
+
'Name' => 'DE STER',
|
288 |
+
),
|
289 |
+
null,
|
290 |
+
true,
|
291 |
+
),
|
292 |
+
);
|
293 |
+
}
|
294 |
+
|
295 |
/**
|
296 |
* @test
|
297 |
*
|
299 |
*/
|
300 |
public function shouldRejectSaveOptionCostsActionWithoutAjax()
|
301 |
{
|
|
|
|
|
302 |
$controller = $this->_getInstance();
|
303 |
$controller->setCanUseDeliveryOptions(true);
|
304 |
$controller->saveOptionCostsAction();
|
316 |
*/
|
317 |
public function shouldRejectSaveOptionCostsActionIfUnableToUseDeliveryOptions()
|
318 |
{
|
|
|
|
|
319 |
$controller = $this->_getInstance(array('isAjax' => true));
|
320 |
$controller->setCanUseDeliveryOptions(false);
|
321 |
$controller->saveOptionCostsAction();
|
335 |
*/
|
336 |
public function shouldValidatePostDataForSaveOptionCostsAction($data, $success)
|
337 |
{
|
|
|
|
|
338 |
$controller = $this->_getInstance($data);
|
339 |
|
340 |
$mockService = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Service');
|
586 |
),
|
587 |
);
|
588 |
}
|
589 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
/**
|
42 |
* @var array
|
@@ -106,4 +106,4 @@ class TIG_PostNL_Test_Framework_TIG_Test_Config extends Mage_Core_Model_Config
|
|
106 |
|
107 |
return parent::getResourceModelInstance($modelClass, $constructArguments);
|
108 |
}
|
109 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Framework_TIG_Test_Config extends Mage_Core_Model_Config
|
40 |
{
|
41 |
/**
|
42 |
* @var array
|
106 |
|
107 |
return parent::getResourceModelInstance($modelClass, $constructArguments);
|
108 |
}
|
109 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
/**
|
42 |
* @var bool
|
@@ -92,4 +92,4 @@ class TIG_PostNL_Test_Framework_TIG_Test_Http_Response extends Mage_Core_Control
|
|
92 |
return $this;
|
93 |
}
|
94 |
|
95 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Framework_TIG_Test_Http_Response extends Mage_Core_Controller_Response_Http
|
40 |
{
|
41 |
/**
|
42 |
* @var bool
|
92 |
return $this;
|
93 |
}
|
94 |
|
95 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
/**
|
42 |
* Resets and restarts Magento.
|
@@ -45,14 +45,14 @@ class TIG_PostNL_Test_Framework_TIG_Test_TestCase extends PHPUnit_Framework_Test
|
|
45 |
{
|
46 |
Mage::reset();
|
47 |
|
48 |
-
Mage::setIsDeveloperMode(
|
49 |
Mage::app(
|
50 |
'admin',
|
51 |
'store',
|
52 |
array(
|
53 |
-
'config_model' => '
|
54 |
)
|
55 |
-
)->setResponse(new
|
56 |
|
57 |
$handler = set_error_handler(function() {});
|
58 |
|
@@ -216,7 +216,7 @@ class TIG_PostNL_Test_Framework_TIG_Test_TestCase extends PHPUnit_Framework_Test
|
|
216 |
* @param string $helperClass
|
217 |
* @param object $mock
|
218 |
*
|
219 |
-
* @return
|
220 |
*/
|
221 |
public function setHelperMock($helperClass, $mock)
|
222 |
{
|
@@ -261,12 +261,51 @@ class TIG_PostNL_Test_Framework_TIG_Test_TestCase extends PHPUnit_Framework_Test
|
|
261 |
$instance = $this->_getInstance();
|
262 |
}
|
263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
$reflection = new ReflectionObject($instance);
|
265 |
$property = $reflection->getProperty($property);
|
266 |
$property->setAccessible(true);
|
267 |
-
$property->setValue($instance, $value);
|
268 |
|
269 |
-
return $
|
270 |
}
|
271 |
|
272 |
/**
|
@@ -277,11 +316,14 @@ class TIG_PostNL_Test_Framework_TIG_Test_TestCase extends PHPUnit_Framework_Test
|
|
277 |
*
|
278 |
* @return $this
|
279 |
*/
|
280 |
-
public function setRegistryKey($key, $value)
|
281 |
{
|
282 |
Mage::unregister($key);
|
283 |
-
|
|
|
|
|
|
|
284 |
|
285 |
return $this;
|
286 |
}
|
287 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase extends PHPUnit_Framework_TestCase
|
40 |
{
|
41 |
/**
|
42 |
* Resets and restarts Magento.
|
45 |
{
|
46 |
Mage::reset();
|
47 |
|
48 |
+
Mage::setIsDeveloperMode(false);
|
49 |
Mage::app(
|
50 |
'admin',
|
51 |
'store',
|
52 |
array(
|
53 |
+
'config_model' => 'TIG_PostNL_Test_Unit_Framework_TIG_Test_Config'
|
54 |
)
|
55 |
+
)->setResponse(new TIG_PostNL_Test_Unit_Framework_TIG_Test_Http_Response());
|
56 |
|
57 |
$handler = set_error_handler(function() {});
|
58 |
|
216 |
* @param string $helperClass
|
217 |
* @param object $mock
|
218 |
*
|
219 |
+
* @return $this
|
220 |
*/
|
221 |
public function setHelperMock($helperClass, $mock)
|
222 |
{
|
261 |
$instance = $this->_getInstance();
|
262 |
}
|
263 |
|
264 |
+
$property = $this->_getProperty($property, $instance);
|
265 |
+
$property->setValue($instance, $value);
|
266 |
+
|
267 |
+
return $this;
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Get the value of a protected property using reflection.
|
272 |
+
*
|
273 |
+
* @param $property
|
274 |
+
*
|
275 |
+
* @param $instance
|
276 |
+
*
|
277 |
+
* @return mixed
|
278 |
+
*/
|
279 |
+
public function getProtectedPropertyValue($property, $instance = null)
|
280 |
+
{
|
281 |
+
if (is_null($instance)) {
|
282 |
+
$instance = $this->_getInstance();
|
283 |
+
}
|
284 |
+
|
285 |
+
$property = $this->_getProperty($property, $instance);
|
286 |
+
|
287 |
+
return $property->getValue($instance);
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Retrieve the ReflectionProperty object, and set the visibility to public.
|
292 |
+
*
|
293 |
+
* @param $property
|
294 |
+
* @param null $instance
|
295 |
+
*
|
296 |
+
* @return ReflectionProperty
|
297 |
+
*/
|
298 |
+
protected function _getProperty($property, $instance = null)
|
299 |
+
{
|
300 |
+
if ($instance === null) {
|
301 |
+
$instance = $this->_getInstance();
|
302 |
+
}
|
303 |
+
|
304 |
$reflection = new ReflectionObject($instance);
|
305 |
$property = $reflection->getProperty($property);
|
306 |
$property->setAccessible(true);
|
|
|
307 |
|
308 |
+
return $property;
|
309 |
}
|
310 |
|
311 |
/**
|
316 |
*
|
317 |
* @return $this
|
318 |
*/
|
319 |
+
public function setRegistryKey($key, $value = null)
|
320 |
{
|
321 |
Mage::unregister($key);
|
322 |
+
|
323 |
+
if ($value !== null) {
|
324 |
+
Mage::register($key, $value);
|
325 |
+
}
|
326 |
|
327 |
return $this;
|
328 |
}
|
329 |
+
}
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Helper_DataTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return TIG_PostNL_Helper_Data
|
43 |
+
*/
|
44 |
+
public function _getInstance()
|
45 |
+
{
|
46 |
+
return Mage::helper('postnl');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @param $type
|
51 |
+
*
|
52 |
+
* @return mixed
|
53 |
+
* @throws Exception
|
54 |
+
*/
|
55 |
+
protected function convertIDCheckType($type)
|
56 |
+
{
|
57 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
58 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
59 |
+
|
60 |
+
if ($type === 'AgeCheck') {
|
61 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_AGE;
|
62 |
+
} elseif ($type === 'BirthdayCheck') {
|
63 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY;
|
64 |
+
} elseif ($type === 'IDCheck') {
|
65 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_ID;
|
66 |
+
}
|
67 |
+
|
68 |
+
return $type;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function canUsePakjegemakNotInsuredDataProvider()
|
72 |
+
{
|
73 |
+
return array(
|
74 |
+
array(true, true),
|
75 |
+
array(false, false),
|
76 |
+
);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @dataProvider canUsePakjegemakNotInsuredDataProvider
|
81 |
+
*/
|
82 |
+
public function testCanUsePakjegemakNotInsured($enabled, $result)
|
83 |
+
{
|
84 |
+
$instance = $this->_getInstance();
|
85 |
+
$instance->setCache(false);
|
86 |
+
|
87 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_Data::XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED, $enabled);
|
88 |
+
|
89 |
+
$this->assertEquals($result, $instance->canUsePakjeGemakBeNotInsured());
|
90 |
+
}
|
91 |
+
|
92 |
+
public function testCanUsePakjegemakNotInsuredUsesCache()
|
93 |
+
{
|
94 |
+
$value = uniqid();
|
95 |
+
$instance = $this->_getInstance();
|
96 |
+
|
97 |
+
$cacheMock = $this->getMock('TIG_PostNL_Model_Core_Cache', array(
|
98 |
+
'hasPostnlCoreCanUsePakjegemakNotInsured',
|
99 |
+
'getPostnlCoreCanUsePakjegemakNotInsured',
|
100 |
+
));
|
101 |
+
|
102 |
+
$cacheMock
|
103 |
+
->expects($this->once())
|
104 |
+
->method('hasPostnlCoreCanUsePakjegemakNotInsured')
|
105 |
+
->willReturn(true);
|
106 |
+
|
107 |
+
$cacheMock
|
108 |
+
->expects($this->once())
|
109 |
+
->method('getPostnlCoreCanUsePakjegemakNotInsured')
|
110 |
+
->willReturn($value);
|
111 |
+
|
112 |
+
$this->setProperty('_cache', $cacheMock);
|
113 |
+
|
114 |
+
$cache = $instance->getCache();
|
115 |
+
$cache->setPostnlCoreCanUsePakjegemakNotInsured($value);
|
116 |
+
|
117 |
+
$result = $instance->canUsePakjeGemakBeNotInsured();
|
118 |
+
$this->assertEquals($value, $result);
|
119 |
+
}
|
120 |
+
|
121 |
+
public function testCanUsePakjegemakNotInsuredSavesCache()
|
122 |
+
{
|
123 |
+
$value = true;
|
124 |
+
$instance = $this->_getInstance();
|
125 |
+
|
126 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_Data::XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED, $value);
|
127 |
+
|
128 |
+
$cacheMock = $this->getMock('TIG_PostNL_Model_Core_Cache', array(
|
129 |
+
'hasPostnlCoreCanUsePakjegemakNotInsured',
|
130 |
+
'setPostnlCoreCanUsePakjegemakNotInsured',
|
131 |
+
));
|
132 |
+
|
133 |
+
$cacheMock
|
134 |
+
->expects($this->once())
|
135 |
+
->method('hasPostnlCoreCanUsePakjegemakNotInsured')
|
136 |
+
->willReturn(false);
|
137 |
+
|
138 |
+
$cacheMock
|
139 |
+
->expects($this->once())
|
140 |
+
->method('setPostnlCoreCanUsePakjegemakNotInsured')
|
141 |
+
->with($value)
|
142 |
+
->willReturnSelf();
|
143 |
+
|
144 |
+
$this->setProperty('_cache', $cacheMock);
|
145 |
+
|
146 |
+
$result = $instance->canUsePakjeGemakBeNotInsured();
|
147 |
+
$this->assertEquals($value, $result);
|
148 |
+
}
|
149 |
+
|
150 |
+
public function checkIsQuoteProvider()
|
151 |
+
{
|
152 |
+
return array(
|
153 |
+
array('quoteIsAgeCheck', 'AgeCheck', true),
|
154 |
+
array('quoteIsAgeCheck', 'BirthdayCheck', false),
|
155 |
+
array('quoteIsAgeCheck', 'IDCheck', false),
|
156 |
+
array('quoteIsAgeCheck', 0, false),
|
157 |
+
array('quoteIsAgeCheck', '0', false),
|
158 |
+
array('quoteIsAgeCheck', '', false),
|
159 |
+
array('quoteIsBirthdayCheck', 'AgeCheck', false),
|
160 |
+
array('quoteIsBirthdayCheck', 'BirthdayCheck', true),
|
161 |
+
array('quoteIsBirthdayCheck', 'IDCheck', false),
|
162 |
+
array('quoteIsBirthdayCheck', 0, false),
|
163 |
+
array('quoteIsBirthdayCheck', '0', false),
|
164 |
+
array('quoteIsBirthdayCheck', '', false),
|
165 |
+
array('quoteIsIDCheck', 'AgeCheck', false),
|
166 |
+
array('quoteIsIDCheck', 'BirthdayCheck', false),
|
167 |
+
array('quoteIsIDCheck', 'IDCheck', true),
|
168 |
+
array('quoteIsIDCheck', 0, false),
|
169 |
+
array('quoteIsIDCheck', '0', false),
|
170 |
+
array('quoteIsIDCheck', '', false),
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* @dataProvider checkIsQuoteProvider
|
176 |
+
*
|
177 |
+
* @param $method
|
178 |
+
* @param $oldType
|
179 |
+
* @param $result
|
180 |
+
*
|
181 |
+
* @throws Exception
|
182 |
+
*/
|
183 |
+
public function testQuoteIsCheck($method, $oldType, $result)
|
184 |
+
{
|
185 |
+
$type = $this->convertIDCheckType($oldType);
|
186 |
+
|
187 |
+
/** @var PHPUnit_Framework_MockObject_MockObject $item */
|
188 |
+
$item = $this->getMock('Mage_Sales_Model_Quote_Item', array('getPostnlProductType'));
|
189 |
+
|
190 |
+
$item->expects($this->once())
|
191 |
+
->method('getPostnlProductType')
|
192 |
+
->willReturn($type);
|
193 |
+
|
194 |
+
/** @var Mage_Sales_Model_Quote|PHPUnit_Framework_MockObject_MockObject $quote */
|
195 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote', array('getId', 'getAllItems', 'getProduct'));
|
196 |
+
|
197 |
+
$quote->expects($this->once())
|
198 |
+
->method('getId')
|
199 |
+
->willReturn(1);
|
200 |
+
|
201 |
+
$quote->expects($this->once())
|
202 |
+
->method('getAllItems')
|
203 |
+
->willReturn(array($quote));
|
204 |
+
|
205 |
+
$quote->expects($this->once())
|
206 |
+
->method('getProduct')
|
207 |
+
->willReturn($item);
|
208 |
+
|
209 |
+
$this->setRegistryKey('postnl_quote_is_age_check_' . 1);
|
210 |
+
$this->setRegistryKey('postnl_quote_is_birthday_check_' . 1);
|
211 |
+
$this->setRegistryKey('postnl_quote_is_id_check_' . 1);
|
212 |
+
|
213 |
+
$instance = $this->_getInstance();
|
214 |
+
$this->assertEquals(
|
215 |
+
$result,
|
216 |
+
$instance->$method($quote),
|
217 |
+
'Check ' . $method . ' with type ' . $type
|
218 |
+
);
|
219 |
+
}
|
220 |
+
|
221 |
+
public function getQuoteIdCheckTypeProvider()
|
222 |
+
{
|
223 |
+
return array(
|
224 |
+
array(true, false, false, 'AgeCheck'),
|
225 |
+
array(false, true, false, 'IDCheck'),
|
226 |
+
array(false, false, true, 'BirthdayCheck'),
|
227 |
+
);
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* @param $ageCheck
|
232 |
+
* @param $idCheck
|
233 |
+
* @param $birthdayCheck
|
234 |
+
* @param $oldResult
|
235 |
+
*
|
236 |
+
* @dataProvider getQuoteIdCheckTypeProvider
|
237 |
+
*/
|
238 |
+
public function testGetQuoteIdCheckType($ageCheck, $idCheck, $birthdayCheck, $oldResult)
|
239 |
+
{
|
240 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
241 |
+
|
242 |
+
$quote->expects($this->any())
|
243 |
+
->method('getId')
|
244 |
+
->willReturn(1);
|
245 |
+
|
246 |
+
$this->setRegistryKey('postnl_quote_is_age_check_1', $ageCheck);
|
247 |
+
$this->setRegistryKey('postnl_quote_is_birthday_check_1', $birthdayCheck);
|
248 |
+
$this->setRegistryKey('postnl_quote_is_id_check_1', $idCheck);
|
249 |
+
|
250 |
+
$instance = $this->_getInstance();
|
251 |
+
|
252 |
+
$result = $this->convertIDCheckType($oldResult);
|
253 |
+
$this->assertEquals($result, $instance->getQuoteIdCheckType($quote), 'The result should be ' . $result);
|
254 |
+
}
|
255 |
+
|
256 |
+
public function isIdevOscProvider()
|
257 |
+
{
|
258 |
+
return array(
|
259 |
+
array('magento_onepagecheckout', false),
|
260 |
+
array('idev_onestepcheckout', true),
|
261 |
+
array('gomage_lightcheckout', false),
|
262 |
+
array('other', false),
|
263 |
+
);
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* @dataProvider isIdevOscProvider
|
268 |
+
*/
|
269 |
+
public function testIsIdevOsc($value, $result)
|
270 |
+
{
|
271 |
+
$helper = $this->_getInstance();
|
272 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_CHECKOUT_EXTENSION, $value);
|
273 |
+
|
274 |
+
$this->assertEquals($result, $helper->isIdevOsc());
|
275 |
+
}
|
276 |
+
|
277 |
+
public function quoteHasIDCheckProductsProvider()
|
278 |
+
{
|
279 |
+
return array(
|
280 |
+
array(null, false, false, false, false),
|
281 |
+
array(null, true, false, false, true),
|
282 |
+
array(null, false, true, false, true),
|
283 |
+
array(null, false, false, true, true),
|
284 |
+
array(false, false, false, false, false),
|
285 |
+
array(false, true, false, false, false),
|
286 |
+
array(false, false, true, false, false),
|
287 |
+
array(false, false, false, true, false),
|
288 |
+
);
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* @param $cacheValue
|
293 |
+
* @param $isAgeCheck
|
294 |
+
* @param $isBirthdayCheck
|
295 |
+
* @param $isIDCheck
|
296 |
+
* @param $expected
|
297 |
+
*
|
298 |
+
* @dataProvider quoteHasIDCheckProductsProvider
|
299 |
+
*/
|
300 |
+
public function testQuoteHasIDCheckProducts($cacheValue, $isAgeCheck, $isBirthdayCheck, $isIDCheck, $expected)
|
301 |
+
{
|
302 |
+
$quote_id = rand(0, 2000);
|
303 |
+
|
304 |
+
$quoteMock = $this->getMock('Mage_Sales_Model_Quote');
|
305 |
+
|
306 |
+
$getIdExpected = $quoteMock->expects($this->any());
|
307 |
+
$getIdExpected->method('getId');
|
308 |
+
$getIdExpected->willReturn($quote_id);
|
309 |
+
|
310 |
+
$this->setRegistryKey('postnl_quote_has_id_check_products_' . $quote_id, $cacheValue);
|
311 |
+
$this->setRegistryKey('postnl_quote_is_age_check_' . $quote_id, $isAgeCheck);
|
312 |
+
$this->setRegistryKey('postnl_quote_is_birthday_check_' . $quote_id, $isBirthdayCheck);
|
313 |
+
$this->setRegistryKey('postnl_quote_is_id_check_' . $quote_id, $isIDCheck);
|
314 |
+
|
315 |
+
$instance = $this->_getInstance();
|
316 |
+
$result = $instance->quoteHasIDCheckProducts($quoteMock);
|
317 |
+
|
318 |
+
$this->assertEquals($result, $expected);
|
319 |
+
}
|
320 |
+
}
|
@@ -0,0 +1,549 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Helper_DeliveryOptionsTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return TIG_PostNL_Helper_DeliveryOptions
|
43 |
+
*/
|
44 |
+
protected function _getInstance()
|
45 |
+
{
|
46 |
+
return Mage::helper('postnl/deliveryOptions');
|
47 |
+
}
|
48 |
+
|
49 |
+
public function testBeOfTheRightInstance()
|
50 |
+
{
|
51 |
+
$helper = $this->_getInstance();
|
52 |
+
$this->assertInstanceOf('TIG_PostNL_Helper_DeliveryOptions', $helper);
|
53 |
+
}
|
54 |
+
|
55 |
+
public function disallowSundaySortingProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('NL', true, true, true),
|
59 |
+
array('BE', true, true, true),
|
60 |
+
array('NL', false, true, true),
|
61 |
+
array('BE', false, true, true),
|
62 |
+
array('NL', true, false, true),
|
63 |
+
array('BE', true, false, true),
|
64 |
+
array('NL', false, false, false),
|
65 |
+
array('BE', false, false, false),
|
66 |
+
);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @dataProvider disallowSundaySortingProvider
|
71 |
+
*/
|
72 |
+
public function testDisallowSundaySorting($country, $nl, $be, $result)
|
73 |
+
{
|
74 |
+
$helper = $this->_getInstance();
|
75 |
+
$helper->setCache(false);
|
76 |
+
|
77 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_SENDER_COUNTRY, $country);
|
78 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_ALLOW_SUNDAY_SORTING, $nl);
|
79 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_ALLOW_SUNDAY_SORTING_BE, $be);
|
80 |
+
|
81 |
+
$this->assertEquals($result, $helper->canUseSundaySorting(), 'Can use sunday sorting');
|
82 |
+
}
|
83 |
+
|
84 |
+
public function canUseDutchProductsByCountryDataProvider()
|
85 |
+
{
|
86 |
+
return array(
|
87 |
+
array(
|
88 |
+
'country' => 'BE',
|
89 |
+
'shouldPass' => true,
|
90 |
+
),
|
91 |
+
array(
|
92 |
+
'country' => 'NL',
|
93 |
+
'shouldPass' => true,
|
94 |
+
),
|
95 |
+
array(
|
96 |
+
'country' => 'DE',
|
97 |
+
'shouldPass' => false,
|
98 |
+
),
|
99 |
+
);
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @param $country
|
104 |
+
* @param $shouldPass
|
105 |
+
*
|
106 |
+
* @dataProvider canUseDutchProductsByCountryDataProvider
|
107 |
+
*/
|
108 |
+
public function testCanUseDutchProductsByCountry($country, $shouldPass)
|
109 |
+
{
|
110 |
+
$helper = $this->_getInstance();
|
111 |
+
|
112 |
+
Mage::unregister('can_use_dutch_products');
|
113 |
+
$this->setProperty('_domesticCountry', $country);
|
114 |
+
|
115 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_USE_DUTCH_PRODUCTS, '1');
|
116 |
+
|
117 |
+
$this->assertEquals($shouldPass, $helper->canUseDutchProducts(false));
|
118 |
+
}
|
119 |
+
|
120 |
+
public function canUseDutchProductsWhenDisabledProvider()
|
121 |
+
{
|
122 |
+
return array(
|
123 |
+
array('BE', true, true, 1),
|
124 |
+
array('BE', true, false, 1),
|
125 |
+
array('BE', true, true, 0),
|
126 |
+
array('BE', false, false, 0),
|
127 |
+
array('BE', false, false, 0),
|
128 |
+
array('NL', true, true, 1),
|
129 |
+
array('NL', true, false, 1),
|
130 |
+
array('DE', false, false, 0),
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* @param $country
|
136 |
+
* @param $shouldPass
|
137 |
+
* @param $useQuote
|
138 |
+
* @param $useDutchProducts
|
139 |
+
*
|
140 |
+
* @dataProvider canUseDutchProductsWhenDisabledProvider
|
141 |
+
*/
|
142 |
+
public function testCanUseDutchProductsWhenDisabled($country, $shouldPass, $useQuote, $useDutchProducts)
|
143 |
+
{
|
144 |
+
$helper = $this->_getInstance();
|
145 |
+
|
146 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote', array('getCountryId', 'getShippingAddress'));
|
147 |
+
|
148 |
+
$quote->expects($this->any())
|
149 |
+
->method('getShippingAddress')
|
150 |
+
->willReturnSelf();
|
151 |
+
|
152 |
+
$quote->expects($this->any())
|
153 |
+
->method('getCountryId')
|
154 |
+
->willReturn($country);
|
155 |
+
|
156 |
+
$this->setProperty('_quote', $quote);
|
157 |
+
$this->setProperty('_domesticCountry', $country);
|
158 |
+
Mage::unregister('can_use_dutch_products');
|
159 |
+
|
160 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_USE_DUTCH_PRODUCTS, $useDutchProducts);
|
161 |
+
|
162 |
+
$this->assertEquals($shouldPass, $helper->canUseDutchProducts($useQuote));
|
163 |
+
}
|
164 |
+
|
165 |
+
public function testCanUseDeliveryOptionsForQuoteIsVirtual()
|
166 |
+
{
|
167 |
+
$helper = $this->_getInstance();
|
168 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
169 |
+
|
170 |
+
$quote->expects($this->once())
|
171 |
+
->method('isVirtual')
|
172 |
+
->willReturn(true);
|
173 |
+
|
174 |
+
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
175 |
+
|
176 |
+
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
177 |
+
$this->assertEquals('POSTNL-0104', $error[0]['code']);
|
178 |
+
}
|
179 |
+
|
180 |
+
public function testCanUseDeliveryOptionsForQuoteIsBuspakje()
|
181 |
+
{
|
182 |
+
$helper = $this->_getInstance();
|
183 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
184 |
+
|
185 |
+
$quote->expects($this->once())
|
186 |
+
->method('isVirtual')
|
187 |
+
->willReturn(false);
|
188 |
+
|
189 |
+
$quote->expects($this->any())
|
190 |
+
->method('getId')
|
191 |
+
->willReturn(1);
|
192 |
+
|
193 |
+
$this->setRegistryKey('is_buspakje_config_applicable_to_quote_1', true);
|
194 |
+
|
195 |
+
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
196 |
+
|
197 |
+
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
198 |
+
$this->assertEquals('POSTNL-0190', $error[0]['code']);
|
199 |
+
}
|
200 |
+
|
201 |
+
public function testCanUseDeliveryOptionsForQuoteIsBuspakjeEnabled()
|
202 |
+
{
|
203 |
+
$helper = $this->_getInstance();
|
204 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
205 |
+
|
206 |
+
$quote->expects($this->once())
|
207 |
+
->method('isVirtual')
|
208 |
+
->willReturn(false);
|
209 |
+
|
210 |
+
$quote->expects($this->any())
|
211 |
+
->method('getId')
|
212 |
+
->willReturn(1);
|
213 |
+
|
214 |
+
$this->setRegistryKey('is_buspakje_config_applicable_to_quote_1', true);
|
215 |
+
$this->setRegistryKey('can_show_options_for_buspakje_1', false);
|
216 |
+
|
217 |
+
$this->assertFalse($helper->canUseDeliveryOptionsForQuote($quote));
|
218 |
+
|
219 |
+
$error = Mage::registry('postnl_delivery_options_can_use_delivery_options_errors');
|
220 |
+
$this->assertEquals('POSTNL-0190', $error[0]['code']);
|
221 |
+
}
|
222 |
+
|
223 |
+
public function isDeliveryOptionsActiveDataProvider()
|
224 |
+
{
|
225 |
+
return array(
|
226 |
+
array(true, true, 'magento_onepagecheckout', true),
|
227 |
+
array(true, true, 'idev_onestepcheckout', true),
|
228 |
+
array(true, true, 'gomage_lightcheckout', true),
|
229 |
+
array(true, true, 'other', false),
|
230 |
+
|
231 |
+
array(true, false, 'magento_onepagecheckout', true),
|
232 |
+
array(true, false, 'idev_onestepcheckout', true),
|
233 |
+
array(true, false, 'gomage_lightcheckout', true),
|
234 |
+
array(true, false, 'other', false),
|
235 |
+
|
236 |
+
array(false, true, 'magento_onepagecheckout', true),
|
237 |
+
array(false, true, 'idev_onestepcheckout', true),
|
238 |
+
array(false, true, 'gomage_lightcheckout', true),
|
239 |
+
array(false, true, 'other', false),
|
240 |
+
|
241 |
+
array(false, false, 'magento_onepagecheckout', false),
|
242 |
+
array(false, false, 'idev_onestepcheckout', false),
|
243 |
+
array(false, false, 'gomage_lightcheckout', false),
|
244 |
+
array(false, false, 'other', false),
|
245 |
+
);
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* @dataProvider isDeliveryOptionsActiveDataProvider
|
250 |
+
*
|
251 |
+
* @param $enableNL
|
252 |
+
* @param $enableBE
|
253 |
+
* @param $result
|
254 |
+
*/
|
255 |
+
public function testIsDeliveryOptionsActive($enableNL, $enableBE, $extension, $result)
|
256 |
+
{
|
257 |
+
$helper = $this->_getInstance();
|
258 |
+
|
259 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_DELIVERY_OPTIONS_ACTIVE, $enableNL);
|
260 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_DELIVERY_OPTIONS_BE_ACTIVE, $enableBE);
|
261 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_AddressValidation::XPATH_CHECKOUT_EXTENSION, $extension);
|
262 |
+
|
263 |
+
$this->assertEquals($result, $helper->isDeliveryOptionsActive());
|
264 |
+
}
|
265 |
+
|
266 |
+
public function createTimeframesFormat(DateTime $now, $data)
|
267 |
+
{
|
268 |
+
$timeframes = array();
|
269 |
+
foreach ($data as $day => $contents) {
|
270 |
+
$timeframe = array();
|
271 |
+
$timeframe['Date'] = date('d-m-Y', strtotime('next ' . $day, $now->getTimestamp()));
|
272 |
+
|
273 |
+
$timeframe['Timeframes'] = array();
|
274 |
+
|
275 |
+
foreach ($contents as $timeframeData) {
|
276 |
+
$timeframe['Timeframes'][] = array(
|
277 |
+
'TimeframeTimeFrame' => array(
|
278 |
+
'To' => $timeframeData['To'],
|
279 |
+
'From' => $timeframeData['From'],
|
280 |
+
'Options' => $timeframeData['Options'],
|
281 |
+
),
|
282 |
+
);
|
283 |
+
};
|
284 |
+
|
285 |
+
$timeframes[] = json_decode(json_encode($timeframe), false);
|
286 |
+
}
|
287 |
+
|
288 |
+
return $timeframes;
|
289 |
+
}
|
290 |
+
|
291 |
+
public function filterTimeFramesProvider()
|
292 |
+
{
|
293 |
+
return array(
|
294 |
+
array(
|
295 |
+
range(0, 7),
|
296 |
+
'next monday',
|
297 |
+
true,
|
298 |
+
true,
|
299 |
+
array(
|
300 |
+
'Tuesday' => array(
|
301 |
+
array(
|
302 |
+
'From' => '10:00:00',
|
303 |
+
'To' => '17:30:00',
|
304 |
+
'Options' => array('Daytime'),
|
305 |
+
),
|
306 |
+
array(
|
307 |
+
'From' => '18:00:00',
|
308 |
+
'To' => '21:30:00',
|
309 |
+
'Options' => array('Sameday', 'Evening'),
|
310 |
+
),
|
311 |
+
),
|
312 |
+
'Wednesday' => array(
|
313 |
+
array(
|
314 |
+
'From' => '13:30:00',
|
315 |
+
'To' => '17:00:00',
|
316 |
+
'Options' => array('Daytime'),
|
317 |
+
),
|
318 |
+
array(
|
319 |
+
'From' => '18:00:00',
|
320 |
+
'To' => '21:30:00',
|
321 |
+
'Options' => array('Sameday', 'Evening'),
|
322 |
+
),
|
323 |
+
),
|
324 |
+
'Thursday' => array(
|
325 |
+
array(
|
326 |
+
'From' => '14:00:00',
|
327 |
+
'To' => '16:00:00',
|
328 |
+
'Options' => array('Daytime'),
|
329 |
+
),
|
330 |
+
array(
|
331 |
+
'From' => '18:00:00',
|
332 |
+
'To' => '21:30:00',
|
333 |
+
'Options' => array('Sameday', 'Evening'),
|
334 |
+
),
|
335 |
+
),
|
336 |
+
)
|
337 |
+
,
|
338 |
+
'NL',
|
339 |
+
'10-10-2010',
|
340 |
+
array(
|
341 |
+
'Tuesday' => array(
|
342 |
+
array(
|
343 |
+
'From' => '10:00:00',
|
344 |
+
'To' => '17:30:00',
|
345 |
+
'Options' => array('Daytime'),
|
346 |
+
),
|
347 |
+
array(
|
348 |
+
'From' => '18:00:00',
|
349 |
+
'To' => '21:30:00',
|
350 |
+
'Options' => array('Sameday', 'Evening'),
|
351 |
+
),
|
352 |
+
),
|
353 |
+
'Wednesday' => array(
|
354 |
+
array(
|
355 |
+
'From' => '13:30:00',
|
356 |
+
'To' => '17:00:00',
|
357 |
+
'Options' => array('Daytime'),
|
358 |
+
),
|
359 |
+
array(
|
360 |
+
'From' => '18:00:00',
|
361 |
+
'To' => '21:30:00',
|
362 |
+
'Options' => array('Sameday', 'Evening'),
|
363 |
+
),
|
364 |
+
),
|
365 |
+
'Thursday' => array(
|
366 |
+
array(
|
367 |
+
'From' => '14:00:00',
|
368 |
+
'To' => '16:00:00',
|
369 |
+
'Options' => array('Daytime'),
|
370 |
+
),
|
371 |
+
array(
|
372 |
+
'From' => '18:00:00',
|
373 |
+
'To' => '21:30:00',
|
374 |
+
'Options' => array('Sameday', 'Evening'),
|
375 |
+
),
|
376 |
+
),
|
377 |
+
)
|
378 |
+
),
|
379 |
+
);
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* @param $enableSundayDelivery
|
384 |
+
* @param $enableSundaySorting
|
385 |
+
* @param $timeframes
|
386 |
+
* @param string $destinationCountry
|
387 |
+
* @param null $firstDeliveryDate
|
388 |
+
* @param $expected
|
389 |
+
*
|
390 |
+
* @dataProvider filterTimeFramesProvider
|
391 |
+
*/
|
392 |
+
public function testFilterTimeFrames(
|
393 |
+
$deliveryDays,
|
394 |
+
$now,
|
395 |
+
$enableSundayDelivery,
|
396 |
+
$enableSundaySorting,
|
397 |
+
$timeframes,
|
398 |
+
$destinationCountry,
|
399 |
+
$firstDeliveryDate,
|
400 |
+
$expected
|
401 |
+
)
|
402 |
+
{
|
403 |
+
$this->markTestIncomplete('Creating test is in progress');
|
404 |
+
|
405 |
+
$now = new DateTime($now);
|
406 |
+
$timeframes = $this->createTimeframesFormat($now, $timeframes);
|
407 |
+
$expected = $this->createTimeframesFormat($now, $expected);
|
408 |
+
|
409 |
+
$instance = $this->_getInstance();
|
410 |
+
|
411 |
+
$oldHelper = Mage::helper('postnl/date');
|
412 |
+
$dateHelperMock = $this->getMock('TIG_PostNL_Helper_Date');
|
413 |
+
|
414 |
+
$dateHelperMock->expects($this->any())
|
415 |
+
->method('getValidDeliveryDaysArray')
|
416 |
+
->willReturn($deliveryDays);
|
417 |
+
|
418 |
+
$dateHelperMock->expects($this->any())
|
419 |
+
->method('getUtcDateTime')
|
420 |
+
->willReturn($now);
|
421 |
+
|
422 |
+
Mage::app()->getStore()->setConfig($instance::XPATH_ENABLE_SUNDAY_DELIVERY, $enableSundayDelivery);
|
423 |
+
Mage::app()->getStore()->setConfig($instance::XPATH_ALLOW_SUNDAY_SORTING, $enableSundaySorting);
|
424 |
+
|
425 |
+
$this->setRegistryKey('_helper/postnl/date', $dateHelperMock);
|
426 |
+
$this->setProperty('_dates', array('now' => $now), $instance);
|
427 |
+
|
428 |
+
$result = $instance->filterTimeFrames(
|
429 |
+
$timeframes,
|
430 |
+
Mage::app()->getStore()->getId(),
|
431 |
+
$destinationCountry,
|
432 |
+
$firstDeliveryDate
|
433 |
+
);
|
434 |
+
|
435 |
+
$this->assertEquals($expected, $result);
|
436 |
+
|
437 |
+
$this->setRegistryKey('_helper/postnl/date', $oldHelper);
|
438 |
+
}
|
439 |
+
|
440 |
+
public function canShowOnlyStatedAddressOptionForQuoteProvider()
|
441 |
+
{
|
442 |
+
return array(
|
443 |
+
array('NL', 'BE', true, false, false, true),
|
444 |
+
array('NL', 'BE', false, false, false, false),
|
445 |
+
array('NL', 'NL', true, false, false, true),
|
446 |
+
array('NL', 'NL', true, true, false, false),
|
447 |
+
array('NL', 'NL', true, false, true, false),
|
448 |
+
array('BE', 'BE', true, false, false, false),
|
449 |
+
array('BE', 'BE', true, true, false, false),
|
450 |
+
array('BE', 'BE', true, true, true, false),
|
451 |
+
);
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* @param $country
|
456 |
+
* @param $domesticCountry
|
457 |
+
* @param $canUseDutchProducts
|
458 |
+
* @param $isBuspakje
|
459 |
+
* @param $isFood
|
460 |
+
* @param $expected
|
461 |
+
*
|
462 |
+
* @dataProvider canShowOnlyStatedAddressOptionForQuoteProvider
|
463 |
+
*/
|
464 |
+
public function testCanShowOnlyStatedAddressOptionForQuote(
|
465 |
+
$country,
|
466 |
+
$domesticCountry,
|
467 |
+
$canUseDutchProducts,
|
468 |
+
$isBuspakje,
|
469 |
+
$isFood,
|
470 |
+
$expected
|
471 |
+
)
|
472 |
+
{
|
473 |
+
$quoteMock = $this->getMock('Mage_Sales_Model_Quote', array('getShippingAddress', 'getCountryId', 'getId'));
|
474 |
+
|
475 |
+
$quoteMock->expects($this->any())
|
476 |
+
->method('getShippingAddress')
|
477 |
+
->willReturnSelf();
|
478 |
+
|
479 |
+
$quoteMock->expects($this->any())
|
480 |
+
->method('getCountryId')
|
481 |
+
->willReturn($country);
|
482 |
+
|
483 |
+
$quoteMock->expects($this->any())
|
484 |
+
->method('getId')
|
485 |
+
->willReturn(15);
|
486 |
+
|
487 |
+
$instance = $this->_getInstance();
|
488 |
+
|
489 |
+
$this->setProperty('_quote', $quoteMock);
|
490 |
+
$this->setProperty('_domesticCountry', $domesticCountry);
|
491 |
+
|
492 |
+
$method = new ReflectionMethod($instance, '_canShowOnlyStatedAddressOptionForQuote');
|
493 |
+
$method->setAccessible(true);
|
494 |
+
|
495 |
+
Mage::unregister('can_show_only_stated_address_option_for_quote_15');
|
496 |
+
$this->setRegistryKey('can_use_dutch_products_15', $canUseDutchProducts);
|
497 |
+
$this->setRegistryKey('is_buspakje_config_applicable_to_quote_15', $isBuspakje);
|
498 |
+
$this->setRegistryKey('postnl_quote_is_food15', $isFood);
|
499 |
+
|
500 |
+
$result = $method->invoke($instance);
|
501 |
+
$this->assertEquals($expected, $result);
|
502 |
+
}
|
503 |
+
|
504 |
+
public function canUseSundayDeliveryProvider()
|
505 |
+
{
|
506 |
+
return array(
|
507 |
+
array(false, false, false, false, false),
|
508 |
+
array(true, false, false, false, true),
|
509 |
+
array(true, true, false, false, false),
|
510 |
+
array(true, false, true, false, false),
|
511 |
+
array(true, false, false, true, false),
|
512 |
+
);
|
513 |
+
}
|
514 |
+
|
515 |
+
/**
|
516 |
+
* @param $enabled
|
517 |
+
* @param $isAgeCheck
|
518 |
+
* @param $isBirthdayCheck
|
519 |
+
* @param $isIDCheck
|
520 |
+
* @param $expected
|
521 |
+
*
|
522 |
+
* @dataProvider canUseSundayDeliveryProvider
|
523 |
+
*/
|
524 |
+
public function testCanUseSundayDelivery($enabled, $isAgeCheck, $isBirthdayCheck, $isIDCheck, $expected)
|
525 |
+
{
|
526 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_DeliveryOptions::XPATH_ENABLE_SUNDAY_DELIVERY, $enabled);
|
527 |
+
|
528 |
+
$quote_id = rand(0, 20000);
|
529 |
+
|
530 |
+
$this->setRegistryKey('postnl_quote_is_age_check_' . $quote_id, $isAgeCheck);
|
531 |
+
$this->setRegistryKey('postnl_quote_is_birthday_check_' . $quote_id, $isBirthdayCheck);
|
532 |
+
$this->setRegistryKey('postnl_quote_is_id_check_' . $quote_id, $isIDCheck);
|
533 |
+
|
534 |
+
$quoteMock = $this->getMock('Mage_Sales_Model_Quote');
|
535 |
+
|
536 |
+
$getIdExpects = $quoteMock->expects($this->any());
|
537 |
+
$getIdExpects->method('getId');
|
538 |
+
$getIdExpects->willReturn($quote_id);
|
539 |
+
|
540 |
+
$instance = $this->_getInstance();
|
541 |
+
$instance->setCache(false);
|
542 |
+
|
543 |
+
$this->setProperty('_quote', $quoteMock);
|
544 |
+
|
545 |
+
$result = $instance->canUseSundayDelivery();
|
546 |
+
|
547 |
+
$this->assertEquals($expected, $result);
|
548 |
+
}
|
549 |
+
}
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Install_V12Test extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
const XPATH_SUPPORTED_PRODUCT_OPTIONS = 'postnl/grid/supported_product_options';
|
42 |
+
|
43 |
+
/*public function attributesProvider()
|
44 |
+
{
|
45 |
+
return array(
|
46 |
+
array('postnl_idcheck_type'),
|
47 |
+
);
|
48 |
+
}*/
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @param $attribute
|
52 |
+
*
|
53 |
+
* @throws Mage_Core_Exception
|
54 |
+
* @dataProvider attributesProvider
|
55 |
+
*/
|
56 |
+
/*public function testIfAttributesExists($attribute)
|
57 |
+
{
|
58 |
+
$attr = Mage::getResourceModel('catalog/eav_attribute')->loadByCode('catalog_product', $attribute);
|
59 |
+
|
60 |
+
$this->assertNotNull($attr->getId(), 'Check that the attribute ' .$attribute . ' does exists');
|
61 |
+
}*/
|
62 |
+
|
63 |
+
public function columnsProvider()
|
64 |
+
{
|
65 |
+
return array(
|
66 |
+
array('postnl_core/order', 'idcheck_type', 'varchar'),
|
67 |
+
array('postnl_core/order', 'idcheck_number', 'text'),
|
68 |
+
array('postnl_core/order', 'idcheck_expiration_date', 'date'),
|
69 |
+
|
70 |
+
array('postnl_core/shipment', 'idcheck_type', 'varchar'),
|
71 |
+
array('postnl_core/shipment', 'idcheck_number', 'text'),
|
72 |
+
array('postnl_core/shipment', 'idcheck_expiration_date', 'date'),
|
73 |
+
);
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @dataProvider columnsProvider
|
78 |
+
*/
|
79 |
+
public function testIfColumnsExists($model, $column, $type)
|
80 |
+
{
|
81 |
+
$tableName = Mage::getSingleton('core/resource')->getTableName($model);
|
82 |
+
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
83 |
+
|
84 |
+
$fields = $read->query('DESCRIBE `' . $tableName . '`')->fetchAll();
|
85 |
+
|
86 |
+
foreach ($fields as $field) {
|
87 |
+
if ($field['Field'] == $column) {
|
88 |
+
$this->assertNotFalse(strpos($field['Type'], $type));
|
89 |
+
return $this;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
$this->fail('Column ' . $column . ' not found in ' . $tableName . ' (' . $model . ')');
|
94 |
+
}
|
95 |
+
|
96 |
+
public function hasProductOptionsSelectedProvider()
|
97 |
+
{
|
98 |
+
return array(
|
99 |
+
array('3440'),
|
100 |
+
array('3444'),
|
101 |
+
array('3447'),
|
102 |
+
array('3450'),
|
103 |
+
array('3442'),
|
104 |
+
array('3445'),
|
105 |
+
array('3448'),
|
106 |
+
array('3451'),
|
107 |
+
array('3437'),
|
108 |
+
array('3438'),
|
109 |
+
array('3443'),
|
110 |
+
array('3446'),
|
111 |
+
array('3449'),
|
112 |
+
array('3571'),
|
113 |
+
array('3572'),
|
114 |
+
array('3573'),
|
115 |
+
array('3574'),
|
116 |
+
array('3575'),
|
117 |
+
array('3576'),
|
118 |
+
array('3581'),
|
119 |
+
array('3582'),
|
120 |
+
array('3583'),
|
121 |
+
array('3584'),
|
122 |
+
array('3585'),
|
123 |
+
array('3586'),
|
124 |
+
);
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @dataProvider hasProductOptionsSelectedProvider
|
129 |
+
*/
|
130 |
+
public function testHasProductOptionsSelected($productCode)
|
131 |
+
{
|
132 |
+
$options = Mage::getStoreConfig(self::XPATH_SUPPORTED_PRODUCT_OPTIONS);
|
133 |
+
$optionsArray = explode(',', $options);
|
134 |
+
|
135 |
+
$this->assertTrue(in_array($productCode, $optionsArray));
|
136 |
+
}
|
137 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
@@ -59,4 +59,4 @@ class TIG_PostNL_Test_Model_Adminhtml_Observer_OrderGridTest extends TIG_PostNL_
|
|
59 |
$isCallable = is_callable(array($observer, 'modifyColumns'));
|
60 |
$this->assertTrue($isCallable, 'ModifyColumns is not callable');
|
61 |
}
|
62 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Adminhtml_Observer_OrderGridTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
59 |
$isCallable = is_callable(array($observer, 'modifyColumns'));
|
60 |
$this->assertTrue($isCallable, 'ModifyColumns is not callable');
|
61 |
}
|
62 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
@@ -59,4 +59,4 @@ class TIG_PostNL_Test_Model_Adminhtml_Observer_ShipmentGridTest extends TIG_Post
|
|
59 |
$isCallable = is_callable(array($observer, 'modifyColumns'));
|
60 |
$this->assertTrue($isCallable, 'ModifyColumns is not callable');
|
61 |
}
|
62 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Adminhtml_Observer_ShipmentGridTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
59 |
$isCallable = is_callable(array($observer, 'modifyColumns'));
|
60 |
$this->assertTrue($isCallable, 'ModifyColumns is not callable');
|
61 |
}
|
62 |
+
}
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Carrier_PostnlTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return TIG_PostNL_Model_Carrier_Postnl
|
43 |
+
*/
|
44 |
+
protected function _getInstance()
|
45 |
+
{
|
46 |
+
return Mage::getModel('postnl_carrier/postnl');
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @test
|
51 |
+
*/
|
52 |
+
public function itShouldBeOfTheProperInstance()
|
53 |
+
{
|
54 |
+
$carrier = $this->_getInstance();
|
55 |
+
|
56 |
+
$this->assertInstanceOf('TIG_PostNL_Model_Carrier_Postnl', $carrier);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function collectRatesProvider()
|
60 |
+
{
|
61 |
+
$foodErrorMessage = 'Food shipments can only be delivered within the Netherlands.';
|
62 |
+
$idCheckErrorMessage = 'ID Check shipments can only be delivered within the Netherlands.';
|
63 |
+
|
64 |
+
return array(
|
65 |
+
/** Is Active */
|
66 |
+
array(false, null, null, null, null, false),
|
67 |
+
|
68 |
+
/** Country ID */
|
69 |
+
array(true, 'NL', 'NL', null, null, false),
|
70 |
+
|
71 |
+
/** Food error */
|
72 |
+
array(true, null, 'BE', true, 'food', $foodErrorMessage),
|
73 |
+
|
74 |
+
/** IDCHeck error */
|
75 |
+
array(true, null, 'BE', true, 'agecheck', $idCheckErrorMessage),
|
76 |
+
array(true, null, 'BE', true, 'birthdaycheck', $idCheckErrorMessage),
|
77 |
+
array(true, null, 'BE', true, 'idcheck', $idCheckErrorMessage),
|
78 |
+
|
79 |
+
array(true, null, null, false, 'idcheck', true),
|
80 |
+
);
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @param $isActive
|
85 |
+
* @param $domesticCountry
|
86 |
+
* @param $shippingCountry
|
87 |
+
* @param $hasError
|
88 |
+
* @param $shipmentType
|
89 |
+
* @param $expected
|
90 |
+
*
|
91 |
+
* @dataProvider collectRatesProvider
|
92 |
+
*/
|
93 |
+
public function testCollectRates(
|
94 |
+
$isActive,
|
95 |
+
$domesticCountry,
|
96 |
+
$shippingCountry,
|
97 |
+
$hasError,
|
98 |
+
$shipmentType,
|
99 |
+
$expected
|
100 |
+
)
|
101 |
+
{
|
102 |
+
$carrier = $this->_getInstance();
|
103 |
+
|
104 |
+
$requestMock = $this->getMock('Mage_Shipping_Model_Rate_Request', array('getDestCountryId', 'getParcelType'));
|
105 |
+
$helperMock = $this->getMock('TIG_PostNL_Helper_Carrier', array(
|
106 |
+
'getDomesticCountry',
|
107 |
+
'canUseStandard',
|
108 |
+
'canUseEps'
|
109 |
+
));
|
110 |
+
$carrier->setData('helper', $helperMock);
|
111 |
+
|
112 |
+
$destCountryId = $requestMock->expects($this->any());
|
113 |
+
$destCountryId->method('getDestCountryId');
|
114 |
+
$destCountryId->willReturn($shippingCountry);
|
115 |
+
|
116 |
+
Mage::app()->getStore()->setConfig('carriers/postnl/active', $isActive);
|
117 |
+
|
118 |
+
$domesticCountryExpects = $helperMock->expects($this->any());
|
119 |
+
$domesticCountryExpects->method('getDomesticCountry');
|
120 |
+
$domesticCountryExpects->willReturn($domesticCountry);
|
121 |
+
|
122 |
+
$canUseStandard = $helperMock->expects($this->any());
|
123 |
+
$canUseStandard->method('canUseStandard');
|
124 |
+
$canUseStandard->willReturn(false);
|
125 |
+
|
126 |
+
$canUseStandard = $helperMock->expects($this->any());
|
127 |
+
$canUseStandard->method('canUseEps');
|
128 |
+
$canUseStandard->willReturn(true);
|
129 |
+
|
130 |
+
$getParcelType = $requestMock->expects($this->any());
|
131 |
+
$getParcelType->method('getParcelType');
|
132 |
+
$getParcelType->willReturn($shipmentType);
|
133 |
+
|
134 |
+
$result = $carrier->collectRates($requestMock);
|
135 |
+
|
136 |
+
if ($hasError) {
|
137 |
+
/** @var Mage_Shipping_Model_Rate_Result $result */
|
138 |
+
$this->assertInstanceOf('Mage_Shipping_Model_Rate_Result', $result);
|
139 |
+
|
140 |
+
$rates = $result->getAllRates();
|
141 |
+
|
142 |
+
/** @var Mage_Shipping_Model_Rate_Result_Error $errorRate */
|
143 |
+
$errorRate = $rates[0];
|
144 |
+
|
145 |
+
$this->assertInstanceOf('Mage_Shipping_Model_Rate_Result_Error', $errorRate);
|
146 |
+
|
147 |
+
$this->assertEquals($expected, $errorRate->getErrorMessage());
|
148 |
+
} elseif($expected === false) {
|
149 |
+
$this->assertEquals($expected, $result);
|
150 |
+
} else {
|
151 |
+
/** @var Mage_Shipping_Model_Rate_Result $result */
|
152 |
+
$this->assertInstanceOf('Mage_Shipping_Model_Rate_Result', $result);
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Carrier_Resource_MatrixrateTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return TIG_PostNL_Model_Carrier_Resource_Matrixrate
|
43 |
+
*/
|
44 |
+
protected function getInstance()
|
45 |
+
{
|
46 |
+
return Mage::getResourceModel('postnl_carrier/matrixrate');
|
47 |
+
}
|
48 |
+
|
49 |
+
public function uploadAndImportProvider()
|
50 |
+
{
|
51 |
+
$path = realpath(dirname(__FILE__) . '/../../../../Fixtures/Matrixrate');
|
52 |
+
|
53 |
+
$output = array();
|
54 |
+
$files = glob($path . '/*.csv');
|
55 |
+
foreach ($files as $file) {
|
56 |
+
$output[] = array(
|
57 |
+
$file,
|
58 |
+
str_replace('.csv', '', basename($file)),
|
59 |
+
);
|
60 |
+
}
|
61 |
+
|
62 |
+
return $output;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @param $file
|
67 |
+
* @param $type
|
68 |
+
*
|
69 |
+
* @throws Exception
|
70 |
+
* @dataProvider uploadAndImportProvider
|
71 |
+
*/
|
72 |
+
public function testUploadAndImport($file, $type)
|
73 |
+
{
|
74 |
+
// Delete all existing records
|
75 |
+
/** @var TIG_PostNL_Model_Carrier_Resource_Matrixrate_Collection $collection */
|
76 |
+
$collection = Mage::getModel('postnl_carrier/matrixrate')->getCollection();
|
77 |
+
foreach ($collection as $model) {
|
78 |
+
$model->delete();
|
79 |
+
}
|
80 |
+
|
81 |
+
$_FILES['groups']['tmp_name']['postnl']['fields']['matrix_import']['value'] = $file;
|
82 |
+
|
83 |
+
$object = new Varien_Object;
|
84 |
+
$object->setData('scope_id', 1);
|
85 |
+
|
86 |
+
$instance = $this->getInstance();
|
87 |
+
$instance->uploadAndImport($object);
|
88 |
+
|
89 |
+
/** @var TIG_PostNL_Model_Carrier_Resource_Matrixrate $collection */
|
90 |
+
$collection = Mage::getModel('postnl_carrier/matrixrate')->getCollection();
|
91 |
+
$collection->addFieldToFilter('parcel_type', $type);
|
92 |
+
|
93 |
+
$fileContents = file_get_contents($file);
|
94 |
+
$lines = count(explode("\n", trim($fileContents))) - 1; // Don't count the header
|
95 |
+
$count = $collection->count();
|
96 |
+
$this->assertEquals($lines, $count, 'Expect that the file ' . $type . ' has ' . $lines . ' lines');
|
97 |
+
}
|
98 |
+
}
|
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
/**
|
5 |
-
* @return
|
6 |
*/
|
7 |
protected function _getInstance()
|
8 |
{
|
@@ -127,99 +127,6 @@ class TIG_PostNL_Test_Model_Core_Cif_AbstractTest extends TIG_PostNL_Test_Framew
|
|
127 |
);
|
128 |
}
|
129 |
|
130 |
-
/**
|
131 |
-
* @test
|
132 |
-
*
|
133 |
-
* @expectedException TIG_PostNL_Exception
|
134 |
-
* @expectedExceptionCode POSTNL-0052
|
135 |
-
*/
|
136 |
-
public function callShouldFailWithoutAUsernameOrPassword()
|
137 |
-
{
|
138 |
-
$this->markTestSkipped('Skip this test');
|
139 |
-
|
140 |
-
$this->resetMagento();
|
141 |
-
|
142 |
-
$instance = $this->_getInstance();
|
143 |
-
$instance->setTestMode(true);
|
144 |
-
|
145 |
-
$storeCode = Mage::app()->getStore()->getCode();
|
146 |
-
$xPath = $instance::XPATH_TEST_PASSWORD;
|
147 |
-
|
148 |
-
Mage::getConfig()->setNode("stores/{$storeCode}/{$xPath}", '');
|
149 |
-
|
150 |
-
$instance->call('barcode', '');
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @test
|
155 |
-
*/
|
156 |
-
public function soapCallShouldReturnAStdClassObject()
|
157 |
-
{
|
158 |
-
$this->markTestSkipped('Skip this test');
|
159 |
-
|
160 |
-
$clientMock = $this->getMockBuilder('zend_Soap_Client')
|
161 |
-
->disableOriginalConstructor()
|
162 |
-
->setMethods(array('testMethod', 'getLastResponse'))
|
163 |
-
->getMock();
|
164 |
-
|
165 |
-
$clientMock->expects($this->once())
|
166 |
-
->method('testMethod')
|
167 |
-
->with(array())
|
168 |
-
->will($this->returnValue(new StdClass()));
|
169 |
-
$clientMock->expects($this->once())
|
170 |
-
->method('getLastResponse')
|
171 |
-
->will($this->returnValue('<?xml version="1.0" encoding="UTF-8"?><test></test>'));
|
172 |
-
|
173 |
-
$helperMock = $this->getMock('TIG_PostNL_Helper_Cif');
|
174 |
-
$helperMock->expects($this->once())
|
175 |
-
->method('logCifCall')
|
176 |
-
->withAnyParameters()
|
177 |
-
->will($this->returnSelf());
|
178 |
-
|
179 |
-
$this->setHelperMock('postnl/cif', $helperMock);
|
180 |
-
|
181 |
-
$cif = $this->_getInstance();
|
182 |
-
$cif->setSoapClient($clientMock);
|
183 |
-
|
184 |
-
$cif->setTestMode(true);
|
185 |
-
|
186 |
-
$response = $cif->call('barcode', 'testMethod', array(), 'testUser', 'testPass');
|
187 |
-
$this->assertInstanceOf('StdClass', $response);
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* @param $wsdlType
|
192 |
-
*
|
193 |
-
* @test
|
194 |
-
*
|
195 |
-
* @dataProvider barcodeTypeProvider
|
196 |
-
*/
|
197 |
-
public function getSoapClientShouldReturnAZendSoapClientInstance($wsdlType)
|
198 |
-
{
|
199 |
-
$instance = $this->_getInstance();
|
200 |
-
$client = $instance->getSoapClient($wsdlType);
|
201 |
-
|
202 |
-
$this->assertInstanceOf(
|
203 |
-
'SoapClient',
|
204 |
-
$client,
|
205 |
-
'Unable to get a SoapClient instance for wsdl type: ' . $wsdlType
|
206 |
-
);
|
207 |
-
}
|
208 |
-
|
209 |
-
public function barcodeTypeProvider()
|
210 |
-
{
|
211 |
-
return array(
|
212 |
-
array('barcode'),
|
213 |
-
array('confirming'),
|
214 |
-
array('labelling'),
|
215 |
-
array('shippingstatus'),
|
216 |
-
array('checkout'),
|
217 |
-
array('deliverydate'),
|
218 |
-
array('timeframe'),
|
219 |
-
array('location'),
|
220 |
-
);
|
221 |
-
}
|
222 |
-
|
223 |
/**
|
224 |
* @test
|
225 |
*
|
1 |
<?php
|
2 |
+
class TIG_PostNL_Test_Unit_Model_Core_Cif_AbstractTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
3 |
{
|
4 |
/**
|
5 |
+
* @return TIG_PostNL_Model_Core_Cif_Abstract
|
6 |
*/
|
7 |
protected function _getInstance()
|
8 |
{
|
127 |
);
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
* @test
|
132 |
*
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
@@ -112,4 +112,28 @@ class TIG_PostNL_Test_Model_Core_OrderTest extends TIG_PostNL_Test_Framework_TIG
|
|
112 |
$instance = $this->_getInstance();
|
113 |
$instance->setMobilePhoneNumber('testNumber');
|
114 |
}
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_OrderTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
protected function _getInstance()
|
42 |
{
|
112 |
$instance = $this->_getInstance();
|
113 |
$instance->setMobilePhoneNumber('testNumber');
|
114 |
}
|
115 |
+
|
116 |
+
public function isCheckProvider()
|
117 |
+
{
|
118 |
+
return array(
|
119 |
+
array('AgeCheck', true),
|
120 |
+
array('BirthdayCheck', true),
|
121 |
+
array('IDCheck', true),
|
122 |
+
array(3, true),
|
123 |
+
array(4, true),
|
124 |
+
array(5, true),
|
125 |
+
array('wrong', false),
|
126 |
+
);
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* @dataProvider isCheckProvider
|
131 |
+
*/
|
132 |
+
public function testIsIDCheck($type, $response)
|
133 |
+
{
|
134 |
+
$model = Mage::getModel('postnl_core/order');
|
135 |
+
$model->setType($type);
|
136 |
+
|
137 |
+
$this->assertEquals($response, $model->isIDCheck());
|
138 |
+
}
|
139 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
/**
|
42 |
* @var null|TIG_PostNL_Model_Core_Shipment
|
@@ -71,17 +71,6 @@ class ShipmentTest extends TIG_PostNL_Test_Framework_TIG_Test_TestCase
|
|
71 |
return $this;
|
72 |
}
|
73 |
|
74 |
-
public function testCanGenerateReturnBarcodeWhenBuspakje()
|
75 |
-
{
|
76 |
-
$this->_getInstance()->setIsDomesticShipment(false);
|
77 |
-
$this->_getInstance()->setIsBuspakjeShipment(false);
|
78 |
-
|
79 |
-
$this->_getInstance()->setShipmentId(false);
|
80 |
-
$this->_getInstance()->setShipment(false);
|
81 |
-
|
82 |
-
$this->assertFalse($this->_getInstance()->canGenerateReturnBarcode());
|
83 |
-
}
|
84 |
-
|
85 |
public function testCanGenerateReturnBarcodeWhenFood()
|
86 |
{
|
87 |
$this->_getInstance()->setIsDomesticShipment(true);
|
@@ -156,4 +145,85 @@ class ShipmentTest extends TIG_PostNL_Test_Framework_TIG_Test_TestCase
|
|
156 |
|
157 |
$this->assertEquals($result, $this->_getInstance()->canGenerateReturnBarcode());
|
158 |
}
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_ShipmentTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
/**
|
42 |
* @var null|TIG_PostNL_Model_Core_Shipment
|
71 |
return $this;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
public function testCanGenerateReturnBarcodeWhenFood()
|
75 |
{
|
76 |
$this->_getInstance()->setIsDomesticShipment(true);
|
145 |
|
146 |
$this->assertEquals($result, $this->_getInstance()->canGenerateReturnBarcode());
|
147 |
}
|
148 |
+
|
149 |
+
public function testHasPakjegemakBeNotInsuredConfig()
|
150 |
+
{
|
151 |
+
$value = Mage::app()->getStore()
|
152 |
+
->getConfig(TIG_PostNL_Model_Core_Shipment::XPATH_DEFAULT_PAKJEGEMAK_BE_NOT_INSURED_PRODUCT_OPTION);
|
153 |
+
|
154 |
+
$this->assertNotEmpty($value);
|
155 |
+
}
|
156 |
+
|
157 |
+
public function isDomesticShipmentProvider()
|
158 |
+
{
|
159 |
+
return array(
|
160 |
+
/** All check fail */
|
161 |
+
array(false, true, 'NL', 'BE', false, false),
|
162 |
+
|
163 |
+
/** Can use Dutch products */
|
164 |
+
array(false, true, 'NL', 'BE', true, true),
|
165 |
+
|
166 |
+
/** Can use Dutch products but is not BE */
|
167 |
+
array(false, true, 'NL', 'US', true, false),
|
168 |
+
|
169 |
+
/** Domestic and Shipping country are the same */
|
170 |
+
array(false, true, 'NL', 'NL', null, true),
|
171 |
+
|
172 |
+
/** Has no shipping address */
|
173 |
+
array(false, false, null, null, null, false),
|
174 |
+
|
175 |
+
/** The shipment is already marked as domestic. */
|
176 |
+
array(true, null, null, null, null, true),
|
177 |
+
);
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* @param $isDomesticShipment
|
182 |
+
* @param $hasShippingAddress
|
183 |
+
* @param $country
|
184 |
+
* @param $domesticCountry
|
185 |
+
* @param $canUseDutchProducts
|
186 |
+
* @param $expected
|
187 |
+
*
|
188 |
+
* @internal param $canUseDutchProduct
|
189 |
+
* @dataProvider isDomesticShipmentProvider
|
190 |
+
*/
|
191 |
+
public function testIsDomesticShipment(
|
192 |
+
$isDomesticShipment,
|
193 |
+
$hasShippingAddress,
|
194 |
+
$country,
|
195 |
+
$domesticCountry,
|
196 |
+
$canUseDutchProducts,
|
197 |
+
$expected
|
198 |
+
)
|
199 |
+
{
|
200 |
+
$instance = $this->_getInstance();
|
201 |
+
|
202 |
+
/** @noinspection PhpUndefinedMethodInspection */
|
203 |
+
$instance->setIsDomesticShipment($isDomesticShipment);
|
204 |
+
|
205 |
+
if ($hasShippingAddress) {
|
206 |
+
$shippingAddressMock = $this->getMock('Mage_Sales_Model_Order_Address', array('getCountryId'));
|
207 |
+
|
208 |
+
$shippingAddressMock->expects($this->once())->method('getCountryId')->willReturn($country);
|
209 |
+
|
210 |
+
$instance->setData('shipping_address', $shippingAddressMock);
|
211 |
+
}
|
212 |
+
|
213 |
+
$dataHelperMock = $this->getMock('TIG_PostNL_Helper_Data');
|
214 |
+
$dataHelperMockExpectation = $dataHelperMock->expects($this->any());
|
215 |
+
$dataHelperMockExpectation->method('getDomesticCountry');
|
216 |
+
$dataHelperMockExpectation->willReturn($domesticCountry);
|
217 |
+
|
218 |
+
$deliveryOptionsHelperMock = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
219 |
+
$deliveryOptionsHelperMockExpectation = $deliveryOptionsHelperMock->expects($this->any());
|
220 |
+
$deliveryOptionsHelperMockExpectation->method('canUseDutchProducts');
|
221 |
+
$deliveryOptionsHelperMockExpectation->willReturn($canUseDutchProducts);
|
222 |
+
|
223 |
+
$instance->setData('helper_data', $dataHelperMock);
|
224 |
+
$instance->setData('helper_deliveryOptions', $deliveryOptionsHelperMock);
|
225 |
+
|
226 |
+
$result = $this->_getInstance()->isDomesticShipment();
|
227 |
+
$this->assertEquals($expected, $result);
|
228 |
+
}
|
229 |
+
}
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_AgeCheckPakjegemakProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_AgeCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_AgeCheckPakjegemakProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasAgeCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3571'),
|
59 |
+
array('3574'),
|
60 |
+
array('3581'),
|
61 |
+
array('3584'),
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @dataProvider hasAgeCheckProductCodesDataProvider
|
67 |
+
* @param $productCode
|
68 |
+
*/
|
69 |
+
public function testHasAgeCheckProductCodes($productCode)
|
70 |
+
{
|
71 |
+
$hasOption = false;
|
72 |
+
$options = $this->_instance->getOptions();
|
73 |
+
|
74 |
+
foreach ($options as $option) {
|
75 |
+
if ($option['value'] == $productCode) {
|
76 |
+
$hasOption = true;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->assertTrue($hasOption);
|
82 |
+
}
|
83 |
+
}
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_AgeCheckProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_AgeCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_AgeCheckProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasAgeCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3438'),
|
59 |
+
array('3446'),
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @dataProvider hasAgeCheckProductCodesDataProvider
|
65 |
+
* @param $productCode
|
66 |
+
*/
|
67 |
+
public function testHasAgeCheckProductCodes($productCode)
|
68 |
+
{
|
69 |
+
$hasOption = false;
|
70 |
+
$options = $this->_instance->getOptions();
|
71 |
+
|
72 |
+
foreach ($options as $option) {
|
73 |
+
if ($option['value'] == $productCode) {
|
74 |
+
$hasOption = true;
|
75 |
+
break;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
$this->assertTrue($hasOption);
|
80 |
+
}
|
81 |
+
}
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_AllProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions|null
|
44 |
+
*/
|
45 |
+
protected $_instance = null;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @return TIG_PostNL_Model_Core_System_Config_Source_AllProductOptions
|
49 |
+
*/
|
50 |
+
public function _getInstance()
|
51 |
+
{
|
52 |
+
if ($this->_instance === null) {
|
53 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_allProductOptions');
|
54 |
+
}
|
55 |
+
|
56 |
+
return $this->_instance;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function hasPakjegemakBeProductCodesDataProvider()
|
60 |
+
{
|
61 |
+
return array(
|
62 |
+
array('4878'),
|
63 |
+
array('4880'),
|
64 |
+
);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @dataProvider hasPakjegemakBeProductCodesDataProvider
|
69 |
+
*/
|
70 |
+
public function testHasPakjegemakBeProductCodes($productCode)
|
71 |
+
{
|
72 |
+
$options = $this->getProtectedPropertyValue('_options');
|
73 |
+
|
74 |
+
$this->assertArrayHasKey($productCode, $options);
|
75 |
+
}
|
76 |
+
|
77 |
+
public function hasPakjegemakNotInsuredDataProvider()
|
78 |
+
{
|
79 |
+
return array(
|
80 |
+
array(true, true),
|
81 |
+
array(false, false),
|
82 |
+
array(true, true, array('isBelgiumOnly' => true)),
|
83 |
+
array(true, false, array('isBelgiumOnly' => false)),
|
84 |
+
array(true, false, array('isExtraCover' => true)),
|
85 |
+
array(true, true, array('isExtraCover' => false)),
|
86 |
+
array(true, true, array('countryLimitation' => 'NL')),
|
87 |
+
array(true, false, array('countryLimitation' => 'BE')),
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* @dataProvider hasPakjegemakNotInsuredDataProvider
|
93 |
+
*
|
94 |
+
* @param $enabled
|
95 |
+
* @param $available
|
96 |
+
* @param array $flags
|
97 |
+
*/
|
98 |
+
public function testHasPakjegemakNotInsured($enabled, $available, $flags = array())
|
99 |
+
{
|
100 |
+
$helper = Mage::helper('postnl');
|
101 |
+
$cache = $helper->getCache();
|
102 |
+
$helper->setCache(false);
|
103 |
+
|
104 |
+
$this->setProperty('_helper', $helper);
|
105 |
+
|
106 |
+
Mage::app()->getStore()->setConfig('postnl/cif_address/country', 'NL');
|
107 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_Data::XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED, $enabled);
|
108 |
+
|
109 |
+
$hasOption = false;
|
110 |
+
$options = $this->_getInstance()->getOptions($flags);
|
111 |
+
foreach ($options as $option) {
|
112 |
+
if ($option['value'] == 4936) {
|
113 |
+
$hasOption = true;
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
$this->assertEquals($available, $hasOption);
|
119 |
+
$helper->setCache($cache);
|
120 |
+
}
|
121 |
+
}
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_BirthdayCheckPakjegemakProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_BirthdayCheckPakjegemakProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasBirtdayCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3572'),
|
59 |
+
array('3575'),
|
60 |
+
array('3582'),
|
61 |
+
array('3585'),
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @dataProvider hasBirtdayCheckProductCodesDataProvider
|
67 |
+
* @param $productCode
|
68 |
+
*/
|
69 |
+
public function testHasBirthdayCheckProductCodes($productCode)
|
70 |
+
{
|
71 |
+
$hasOption = false;
|
72 |
+
$options = $this->_instance->getOptions();
|
73 |
+
|
74 |
+
foreach ($options as $option) {
|
75 |
+
if ($option['value'] == $productCode) {
|
76 |
+
$hasOption = true;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->assertTrue($hasOption);
|
82 |
+
}
|
83 |
+
}
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_BirthdayCheckProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_BirthdayCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_BirthdayCheckProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasBirtdayCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3444'),
|
59 |
+
array('3440'),
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @dataProvider hasBirtdayCheckProductCodesDataProvider
|
65 |
+
* @param $productCode
|
66 |
+
*/
|
67 |
+
public function testHasBirthdayCheckProductCodes($productCode)
|
68 |
+
{
|
69 |
+
$hasOption = false;
|
70 |
+
$options = $this->_instance->getOptions();
|
71 |
+
|
72 |
+
foreach ($options as $option) {
|
73 |
+
if ($option['value'] == $productCode) {
|
74 |
+
$hasOption = true;
|
75 |
+
break;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
$this->assertTrue($hasOption);
|
80 |
+
}
|
81 |
+
}
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_IdCheckPakjegemakProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_IdCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_IdCheckPakjegemakProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasIdCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3573'),
|
59 |
+
array('3576'),
|
60 |
+
array('3583'),
|
61 |
+
array('3586'),
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @dataProvider hasIdCheckProductCodesDataProvider
|
67 |
+
* @param $productCode
|
68 |
+
*/
|
69 |
+
public function testHasIdCheckProductCodes($productCode)
|
70 |
+
{
|
71 |
+
$hasOption = false;
|
72 |
+
$options = $this->_instance->getOptions();
|
73 |
+
|
74 |
+
foreach ($options as $option) {
|
75 |
+
if ($option['value'] == $productCode) {
|
76 |
+
$hasOption = true;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->assertTrue($hasOption);
|
82 |
+
}
|
83 |
+
}
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_IdCheckProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_IdCheckProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_IdCheckProductOptions');
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return array
|
54 |
+
*/
|
55 |
+
public function hasIdCheckProductCodesDataProvider()
|
56 |
+
{
|
57 |
+
return array(
|
58 |
+
array('3442'),
|
59 |
+
array('3445'),
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @dataProvider hasIdCheckProductCodesDataProvider
|
65 |
+
* @param $productCode
|
66 |
+
*/
|
67 |
+
public function testHasIdCheckProductCodes($productCode)
|
68 |
+
{
|
69 |
+
$hasOption = false;
|
70 |
+
$options = $this->_instance->getOptions();
|
71 |
+
|
72 |
+
foreach ($options as $option) {
|
73 |
+
if ($option['value'] == $productCode) {
|
74 |
+
$hasOption = true;
|
75 |
+
break;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
$this->assertTrue($hasOption);
|
80 |
+
}
|
81 |
+
}
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Core_System_Config_Source_PakjeGemakProductOptionsTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions
|
44 |
+
*/
|
45 |
+
protected $_instance;
|
46 |
+
|
47 |
+
public function setUp()
|
48 |
+
{
|
49 |
+
/** @var TIG_PostNL_Model_Core_System_Config_Source_PakjeGemakProductOptions _instance */
|
50 |
+
$this->_instance = Mage::getSingleton('postnl_core/system_config_source_pakjeGemakProductOptions');
|
51 |
+
|
52 |
+
$helper = Mage::helper('postnl');
|
53 |
+
$helper->setCache(false);
|
54 |
+
|
55 |
+
$this->setProperty('_helper', $helper, $this->_instance);
|
56 |
+
}
|
57 |
+
|
58 |
+
public function hasPakjegemakBeProductCodesDataProvider()
|
59 |
+
{
|
60 |
+
return array(
|
61 |
+
array('4878'),
|
62 |
+
array('4880'),
|
63 |
+
);
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @dataProvider hasPakjegemakBeProductCodesDataProvider
|
68 |
+
*/
|
69 |
+
public function testHasPakjegemakBeProductCodes($productCode)
|
70 |
+
{
|
71 |
+
$hasOption = false;
|
72 |
+
$options = $this->_instance->getOptions();
|
73 |
+
|
74 |
+
foreach ($options as $option) {
|
75 |
+
if ($option['value'] == $productCode) {
|
76 |
+
$hasOption = true;
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->assertTrue($hasOption);
|
82 |
+
}
|
83 |
+
|
84 |
+
public function hasPakjegemakNotInsuredDataProvider()
|
85 |
+
{
|
86 |
+
return array(
|
87 |
+
array(true, true),
|
88 |
+
array(false, false),
|
89 |
+
array(true, true, array('isBelgiumOnly' => true)),
|
90 |
+
array(true, false, array('isBelgiumOnly' => false)),
|
91 |
+
array(true, false, array('isExtraCover' => true)),
|
92 |
+
array(true, true, array('isExtraCover' => false)),
|
93 |
+
array(true, false, array('isCod' => true)),
|
94 |
+
array(true, true, array('isCod' => false)),
|
95 |
+
array(true, false, array('isPge' => true)),
|
96 |
+
array(true, true, array('isPge' => false)),
|
97 |
+
);
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @dataProvider hasPakjegemakNotInsuredDataProvider
|
102 |
+
*/
|
103 |
+
public function testHasPakjegemakNotInsured($enabled, $available, $flags = array())
|
104 |
+
{
|
105 |
+
$helper = Mage::helper('postnl');
|
106 |
+
$cache = $helper->getCache();
|
107 |
+
$helper->setCache(false);
|
108 |
+
|
109 |
+
$this->setProperty('_helper', $helper, $this->_instance);
|
110 |
+
|
111 |
+
Mage::app()->getStore()->setConfig(TIG_PostNL_Helper_Data::XPATH_ALLOW_PAKJEGEMAK_NOT_INSURED, $enabled);
|
112 |
+
|
113 |
+
$hasOption = false;
|
114 |
+
$options = $this->_instance->getOptions($flags);
|
115 |
+
foreach ($options as $option) {
|
116 |
+
if ($option['value'] == 4936) {
|
117 |
+
$hasOption = true;
|
118 |
+
break;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
$this->assertEquals($available, $hasOption);
|
123 |
+
$helper->setCache($cache);
|
124 |
+
}
|
125 |
+
|
126 |
+
public function hasIDCheckPakjegemakProvider()
|
127 |
+
{
|
128 |
+
return array(
|
129 |
+
array('getAgeCheckOptions'),
|
130 |
+
array('getBirthdayCheckOptions'),
|
131 |
+
array('getIDCheckOptions'),
|
132 |
+
);
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @dataProvider hasIDCheckPakjegemakProvider
|
137 |
+
*/
|
138 |
+
public function testHasIDCheckPakjegemak($method)
|
139 |
+
{
|
140 |
+
$options = $this->_instance->$method();
|
141 |
+
$this->assertNotEquals(0, count($options), 'Assert that the getIDCheckOptions method returns options');
|
142 |
+
}
|
143 |
+
}
|
@@ -0,0 +1,539 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_CifTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @var null|TIG_PostNL_Model_DeliveryOptions_Cif
|
43 |
+
*/
|
44 |
+
protected $_instance = null;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @var null|SoapClient
|
48 |
+
*/
|
49 |
+
protected $_soapClient = null;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @var null|Mage_Sales_Model_Quote
|
53 |
+
*/
|
54 |
+
protected $_quote = null;
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return TIG_PostNL_Model_DeliveryOptions_Cif
|
58 |
+
*/
|
59 |
+
public function _getInstance()
|
60 |
+
{
|
61 |
+
if ($this->_instance === null) {
|
62 |
+
$this->_instance = Mage::getModel('postnl_deliveryoptions/cif');
|
63 |
+
}
|
64 |
+
|
65 |
+
return $this->_instance;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* @return SoapClient
|
70 |
+
*/
|
71 |
+
public function _getSoapClient()
|
72 |
+
{
|
73 |
+
if ($this->_soapClient === null) {
|
74 |
+
$this->_soapClient = $this->getMockBuilder('SoapClient')
|
75 |
+
->disableOriginalConstructor()
|
76 |
+
->setMethods(array('GetDeliveryDate'))
|
77 |
+
->getMock();
|
78 |
+
}
|
79 |
+
|
80 |
+
return $this->_soapClient;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* @return Mage_Sales_Model_Quote
|
85 |
+
*/
|
86 |
+
public function _getQuote()
|
87 |
+
{
|
88 |
+
if ($this->_quote === null)
|
89 |
+
{
|
90 |
+
$mockCollection = $this->getMockBuilder('Mage_Eav_Model_Entity_Collection_Abstract')
|
91 |
+
->disableOriginalConstructor()
|
92 |
+
->getMock();
|
93 |
+
|
94 |
+
$mockCollection->expects($this->once())
|
95 |
+
->method('getIterator')
|
96 |
+
->willReturn(new ArrayIterator());
|
97 |
+
|
98 |
+
$mockCollection->expects($this->once())
|
99 |
+
->method('getColumnValues')
|
100 |
+
->will($this->returnValue(array()));
|
101 |
+
|
102 |
+
$mockQuote = $this->getMock('Mage_Sales_Model_Quote');
|
103 |
+
$mockQuote->expects($this->any())
|
104 |
+
->method('getStoreId')
|
105 |
+
->will($this->returnValue(1));
|
106 |
+
|
107 |
+
$mockQuote->expects($this->once())
|
108 |
+
->method('getItemsCollection')
|
109 |
+
->will($this->returnValue($mockCollection));
|
110 |
+
|
111 |
+
$this->_quote = $mockQuote;
|
112 |
+
}
|
113 |
+
|
114 |
+
return $this->_quote;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @test
|
119 |
+
*
|
120 |
+
* @expectedException TIG_PostNL_Exception
|
121 |
+
*/
|
122 |
+
public function shouldThrowAnExceptionIfInvalidResponse()
|
123 |
+
{
|
124 |
+
$instance = $this->_getInstance();
|
125 |
+
$quote = $this->_getQuote();
|
126 |
+
$mockSoapClient = $this->_getSoapClient();
|
127 |
+
|
128 |
+
$instance->setSoapClient($mockSoapClient);
|
129 |
+
$instance->getDeliveryDate('1014 BA', 'NL', $quote);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @test
|
134 |
+
*/
|
135 |
+
public function shouldReturnCorrectDeliveryDate()
|
136 |
+
{
|
137 |
+
$dateTomorrow = new DateTime('now + 1day');
|
138 |
+
$expectedDateTime = $dateTomorrow->format('d-m-Y');
|
139 |
+
|
140 |
+
$soapResponse = new stdClass();
|
141 |
+
$soapResponse->DeliveryDate = $expectedDateTime;
|
142 |
+
|
143 |
+
$mockSoapClient = $this->_getSoapClient();
|
144 |
+
$mockSoapClient->expects($this->once())
|
145 |
+
->method('GetDeliveryDate')
|
146 |
+
->willReturn($soapResponse);
|
147 |
+
|
148 |
+
$quote = $this->_getQuote();
|
149 |
+
$instance = $this->_getInstance();
|
150 |
+
$instance->setSoapClient($mockSoapClient);
|
151 |
+
$deliveryDate = $instance->getDeliveryDate('1014 BA', 'NL', $quote);
|
152 |
+
|
153 |
+
$this->assertEquals($expectedDateTime, $deliveryDate);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function differentOptionsForBelgiumDataProvider()
|
157 |
+
{
|
158 |
+
return array(
|
159 |
+
array('NL', 'pickup', false),
|
160 |
+
array('BE', 'pickup', true),
|
161 |
+
array('NL', 'delivery', false),
|
162 |
+
array('BE', 'delivery', false),
|
163 |
+
);
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* @dataProvider differentOptionsForBelgiumDataProvider
|
168 |
+
*/
|
169 |
+
public function testDifferentOptionsForBelgium($country, $type, $shouldContainPickup)
|
170 |
+
{
|
171 |
+
$dateTomorrow = new DateTime('now + 1day');
|
172 |
+
$expectedDateTime = $dateTomorrow->format('d-m-Y');
|
173 |
+
|
174 |
+
$soapResponse = new stdClass();
|
175 |
+
$soapResponse->DeliveryDate = $expectedDateTime;
|
176 |
+
|
177 |
+
$mockSoapClient = $this->_getSoapClient();
|
178 |
+
$mockSoapClient->expects($this->once())
|
179 |
+
->method('GetDeliveryDate')
|
180 |
+
->with( $this->callback( function ($arguments) use ($shouldContainPickup) {
|
181 |
+
if ($shouldContainPickup) {
|
182 |
+
return in_array('Pickup', $arguments['GetDeliveryDate']['Options']);
|
183 |
+
} else {
|
184 |
+
return !in_array('Pickup', $arguments['GetDeliveryDate']['Options']);
|
185 |
+
}
|
186 |
+
}))
|
187 |
+
->willReturn($soapResponse);
|
188 |
+
|
189 |
+
$quote = $this->_getQuote();
|
190 |
+
$instance = $this->_getInstance();
|
191 |
+
$instance->setSoapClient($mockSoapClient);
|
192 |
+
$instance->getDeliveryDate('2000', $country, $quote, $type);
|
193 |
+
}
|
194 |
+
|
195 |
+
public function getDeliveryDateOptionsArrayProvider()
|
196 |
+
{
|
197 |
+
return array(
|
198 |
+
/**
|
199 |
+
* Sameday tests
|
200 |
+
*/
|
201 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
202 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
203 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
204 |
+
array('next friday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
205 |
+
array('next friday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
206 |
+
array('next friday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
207 |
+
array('next friday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
208 |
+
|
209 |
+
array('next friday 10:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
210 |
+
array('next friday 10:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
211 |
+
array('next friday 10:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
212 |
+
array('next friday 13:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Evening')),
|
213 |
+
array('next friday 23:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Evening')),
|
214 |
+
|
215 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
216 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
217 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
218 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
219 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
220 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
221 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
222 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
223 |
+
|
224 |
+
array('next thursday 10:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
225 |
+
array('next thursday 10:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
226 |
+
array('next thursday 10:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
227 |
+
array('next thursday 13:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Evening')),
|
228 |
+
array('next thursday 23:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Sameday', 'Evening')),
|
229 |
+
array('next thursday 23:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
230 |
+
array('next thursday 23:00', 'Cooled', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
231 |
+
|
232 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
233 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
234 |
+
array('next friday 10:00', 'Regular', 0, 'NL', 'delivery', false, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
235 |
+
array('next friday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
236 |
+
array('next friday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
237 |
+
array('next friday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
238 |
+
array('next friday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
239 |
+
|
240 |
+
array('next friday 10:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
241 |
+
array('next friday 13:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Evening')),
|
242 |
+
array('next friday 23:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Evening')),
|
243 |
+
|
244 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
245 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
246 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
247 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
248 |
+
|
249 |
+
array('next thursday 10:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
250 |
+
array('next thursday 13:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Evening')),
|
251 |
+
array('next thursday 23:00', 'Cooled', 0, 'NL', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Sameday', 'Evening')),
|
252 |
+
|
253 |
+
/**
|
254 |
+
* BE
|
255 |
+
*/
|
256 |
+
array('next thursday 10:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime')),
|
257 |
+
array('next thursday 13:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime')),
|
258 |
+
array('next thursday 23:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '1', true, array('Daytime')),
|
259 |
+
array('next thursday 10:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime')),
|
260 |
+
array('next thursday 13:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime')),
|
261 |
+
array('next thursday 23:00', 'Regular', 0, 'BE', 'delivery', true, '10:30', '22:00', 0, '0', true, array('Daytime')),
|
262 |
+
|
263 |
+
/**
|
264 |
+
* BE Pickup
|
265 |
+
*/
|
266 |
+
array('next thursday 10:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Pickup')),
|
267 |
+
array('next thursday 13:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Pickup')),
|
268 |
+
array('next thursday 23:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Pickup')),
|
269 |
+
array('next thursday 10:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Pickup')),
|
270 |
+
array('next thursday 13:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Pickup')),
|
271 |
+
array('next thursday 23:00', 'Regular', 0, 'BE', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Pickup')),
|
272 |
+
|
273 |
+
/**
|
274 |
+
* NL Pickup
|
275 |
+
*/
|
276 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
277 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
278 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
279 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
280 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', true, array('Daytime', 'Evening')),
|
281 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '0', false, array('Daytime')),
|
282 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
283 |
+
array('next thursday 10:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
284 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
285 |
+
array('next thursday 13:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
286 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Daytime', 'Evening', 'Sunday')),
|
287 |
+
array('next thursday 23:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', false, array('Daytime', 'Sunday')),
|
288 |
+
|
289 |
+
'after_sunday_cutoff_before regular_cutoff' => array('next sunday 15:00', 'Regular', 0, 'NL', 'pickup', true, '10:30', '22:00', 0, '1', true, array('Sunday', 'Sameday', 'Evening')),
|
290 |
+
);
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* @param $timeStamp
|
295 |
+
* @param $shipmentType
|
296 |
+
* @param $shippingDuration
|
297 |
+
* @param $country
|
298 |
+
* @param $for
|
299 |
+
* @param $enableSameDayDelivery
|
300 |
+
* @param $sameDayDeliveryCutoff
|
301 |
+
* @param $regularCutoff
|
302 |
+
* @param $shippingDurationConfig
|
303 |
+
* @param $enableSundayDelivery
|
304 |
+
* @param $canUseEveningTimeframes
|
305 |
+
* @param $expectedResult
|
306 |
+
*
|
307 |
+
* @dataProvider getDeliveryDateOptionsArrayProvider
|
308 |
+
*/
|
309 |
+
public function testGetDeliveryDateOptionsArray(
|
310 |
+
$timeStamp,
|
311 |
+
$shipmentType,
|
312 |
+
$shippingDuration,
|
313 |
+
$country,
|
314 |
+
$for,
|
315 |
+
$enableSameDayDelivery,
|
316 |
+
$sameDayDeliveryCutoff,
|
317 |
+
$regularCutoff,
|
318 |
+
$shippingDurationConfig,
|
319 |
+
$enableSundayDelivery,
|
320 |
+
$canUseEveningTimeframes,
|
321 |
+
$expectedResult
|
322 |
+
)
|
323 |
+
{
|
324 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
325 |
+
$helper = Mage::helper('postnl/deliveryOptions');
|
326 |
+
|
327 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_ENABLE_SAMEDAY_DELIVERY, $enableSameDayDelivery);
|
328 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_SAMEDAY_CUTOFF_TIME, $sameDayDeliveryCutoff);
|
329 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_CUTOFF_TIME, $regularCutoff);
|
330 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_SHIPPING_DURATION, $shippingDurationConfig);
|
331 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_ENABLE_SUNDAY_DELIVERY, $enableSundayDelivery);
|
332 |
+
|
333 |
+
$helperMock = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
334 |
+
|
335 |
+
$helperMock->expects($this->any())
|
336 |
+
->method('quoteIsFood')
|
337 |
+
->willReturn($shipmentType == 'Cooled');
|
338 |
+
|
339 |
+
$helperMock->expects($this->any())
|
340 |
+
->method('getQuoteFoodType')
|
341 |
+
->willReturn($shipmentType == 'Cooled' ? 2 : 0);
|
342 |
+
|
343 |
+
$helperMock->expects($this->any())
|
344 |
+
->method('canUseEveningTimeframes')
|
345 |
+
->willReturn($canUseEveningTimeframes);
|
346 |
+
|
347 |
+
$helperMock->expects($this->any())
|
348 |
+
->method('getDateTime')
|
349 |
+
->willReturn(new DateTime($timeStamp));
|
350 |
+
|
351 |
+
$instance = $this->_getInstance();
|
352 |
+
$this->setProperty('_helpers', array('postnl/deliveryOptions' => $helperMock));
|
353 |
+
|
354 |
+
$method = new ReflectionMethod(get_class($instance), '_getDeliveryDateOptionsArray');
|
355 |
+
$method->setAccessible(true);
|
356 |
+
|
357 |
+
$result = $method->invokeArgs($instance, array($shippingDuration, $country, $for));
|
358 |
+
|
359 |
+
$this->assertEquals($expectedResult, $result, 'Compare the contents of the array', 0.0, 10, true);
|
360 |
+
$this->assertEquals(count($expectedResult), count($result));
|
361 |
+
}
|
362 |
+
|
363 |
+
public function cutoffTimesProvider()
|
364 |
+
{
|
365 |
+
return array(
|
366 |
+
array('next thursday 10:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
367 |
+
array('next thursday 10:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
368 |
+
array('next thursday 15:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '22:00:00', '15:00:00'),
|
369 |
+
array('next thursday 23:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
370 |
+
array('next thursday 23:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
371 |
+
|
372 |
+
array('next thursday 10:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
373 |
+
array('next thursday 10:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
374 |
+
array('next thursday 15:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '22:00:00', '15:00:00'),
|
375 |
+
array('next thursday 23:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
376 |
+
array('next thursday 23:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
377 |
+
|
378 |
+
array('next friday 10:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
379 |
+
array('next friday 10:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
380 |
+
array('next friday 15:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '22:00:00', '15:00:00'),
|
381 |
+
array('next friday 23:00', 'Regular', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '22:00:00', '15:00:00'),
|
382 |
+
|
383 |
+
array('next friday 10:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
384 |
+
array('next friday 10:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
385 |
+
array('next friday 15:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
386 |
+
array('next friday 15:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
387 |
+
array('next friday 23:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', true, /* Response --> */ '10:30:00', '15:00:00'),
|
388 |
+
array('next friday 23:00', 'Cooled', '22:00:00', '15:00:00', '10:30:00', false, /* Response --> */ '22:00:00', '15:00:00'),
|
389 |
+
);
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* @dataProvider cutoffTimesProvider
|
394 |
+
*
|
395 |
+
* @param $timestamp
|
396 |
+
* @param $shipmentType
|
397 |
+
* @param $regularDeliveryCutoff
|
398 |
+
* @param $sundayDeliveryCutoff
|
399 |
+
* @param $sameDayDeliveryCutoff
|
400 |
+
* @param $enableSameDayDelivery
|
401 |
+
* @param $monSatCutoff
|
402 |
+
* @param $sundayCutoff
|
403 |
+
*
|
404 |
+
* @internal param $expectedResult
|
405 |
+
*/
|
406 |
+
public function testCutoffTimes(
|
407 |
+
$timestamp,
|
408 |
+
$shipmentType,
|
409 |
+
$regularDeliveryCutoff,
|
410 |
+
$sundayDeliveryCutoff,
|
411 |
+
$sameDayDeliveryCutoff,
|
412 |
+
$enableSameDayDelivery,
|
413 |
+
$monSatCutoff,
|
414 |
+
$sundayCutoff
|
415 |
+
) {
|
416 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $helper */
|
417 |
+
$helper = Mage::helper('postnl/deliveryOptions');
|
418 |
+
|
419 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_CUTOFF_TIME, $regularDeliveryCutoff);
|
420 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_SUNDAY_CUTOFF_TIME, $sundayDeliveryCutoff);
|
421 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_SAMEDAY_CUTOFF_TIME, $sameDayDeliveryCutoff);
|
422 |
+
Mage::app()->getStore()->setConfig($helper::XPATH_ENABLE_SAMEDAY_DELIVERY, $enableSameDayDelivery);
|
423 |
+
|
424 |
+
$helperMock = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
425 |
+
|
426 |
+
$helperMock->expects($this->any())
|
427 |
+
->method('quoteIsFood')
|
428 |
+
->willReturn($shipmentType == 'Cooled');
|
429 |
+
|
430 |
+
$helperMock->expects($this->any())
|
431 |
+
->method('getQuoteFoodType')
|
432 |
+
->willReturn($shipmentType == 'Cooled' ? 2 : 0);
|
433 |
+
|
434 |
+
$helperMock->expects($this->any())
|
435 |
+
->method('getDateTime')
|
436 |
+
->willReturn(new DateTime($timestamp));
|
437 |
+
|
438 |
+
$instance = $this->_getInstance();
|
439 |
+
$this->setProperty('_helpers', array('postnl/deliveryOptions' => $helperMock));
|
440 |
+
|
441 |
+
$method = new ReflectionMethod(get_class($instance), '_getCutOffTimes');
|
442 |
+
$method->setAccessible(true);
|
443 |
+
|
444 |
+
$result = $method->invokeArgs($instance, array(null));
|
445 |
+
|
446 |
+
foreach ($result as $cutoff) {
|
447 |
+
if ($cutoff['Day'] == '00') {
|
448 |
+
$this->assertEquals($monSatCutoff, $cutoff['Time'], 'Assert that mon-sat has a cutoff of ' . $monSatCutoff);
|
449 |
+
} elseif ($cutoff['Day'] == '07') {
|
450 |
+
$this->assertEquals($sundayCutoff, $cutoff['Time'], 'Assert that sunday has a cutoff of ' . $sundayCutoff);
|
451 |
+
}
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
/**
|
456 |
+
* @todo Expanded test cases, includes different countries and sunday sorting.
|
457 |
+
* @return array
|
458 |
+
*/
|
459 |
+
public function getDeliveryTimeframesOptionsArrayProvider()
|
460 |
+
{
|
461 |
+
return array(
|
462 |
+
array('Regular', 'NL', true, true, true, false, array('Daytime', 'Sameday', 'Evening')),
|
463 |
+
array('Regular', 'NL', true, true, true, true, array('Daytime', 'Sameday', 'Evening', 'Sunday')),
|
464 |
+
array('Regular', 'NL', false, false, true, false, array('Daytime', 'Evening')),
|
465 |
+
array('Regular', 'NL', false, false, false, false, array('Daytime')),
|
466 |
+
array('Regular', 'NL', true, false, false, false, array('Daytime')),
|
467 |
+
array('Regular', 'NL', true, true, false, false, array('Daytime', 'Sameday', 'Evening')),
|
468 |
+
|
469 |
+
array('Cooled', 'NL', true, true, true, false, array('Sameday', 'Evening')),
|
470 |
+
array('Cooled', 'NL', true, true, true, true, array('Sameday', 'Evening')),
|
471 |
+
array('Cooled', 'NL', false, false, true, false, array('Daytime', 'Evening')),
|
472 |
+
array('Cooled', 'NL', false, false, false, false, array('Daytime')),
|
473 |
+
array('Cooled', 'NL', true, false, false, false, array('Sameday', 'Evening')),
|
474 |
+
array('Cooled', 'NL', true, true, false, false, array('Sameday', 'Evening')),
|
475 |
+
);
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* @dataProvider getDeliveryTimeframesOptionsArrayProvider
|
480 |
+
*
|
481 |
+
* @param $shipmentType
|
482 |
+
* @param $country
|
483 |
+
* @param $canUseFoodDelivery
|
484 |
+
* @param $canUseSameDayDelivery
|
485 |
+
* @param $canUseEveningTimeframes
|
486 |
+
* @param $canUseSundayDelivery
|
487 |
+
* @param $expectedResult
|
488 |
+
*/
|
489 |
+
public function testGetDeliveryTimeframesOptionsArray(
|
490 |
+
$shipmentType,
|
491 |
+
$country,
|
492 |
+
$canUseFoodDelivery,
|
493 |
+
$canUseSameDayDelivery,
|
494 |
+
$canUseEveningTimeframes,
|
495 |
+
$canUseSundayDelivery,
|
496 |
+
$expectedResult
|
497 |
+
)
|
498 |
+
{
|
499 |
+
$helperMock = $this->getMock('TIG_PostNL_Helper_DeliveryOptions');
|
500 |
+
|
501 |
+
$helperMock->expects($this->any())
|
502 |
+
->method('quoteIsFood')
|
503 |
+
->willReturn($shipmentType == 'Cooled');
|
504 |
+
|
505 |
+
$helperMock->expects($this->any())
|
506 |
+
->method('getQuoteFoodType')
|
507 |
+
->willReturn($shipmentType == 'Cooled' ? 2 : 0);
|
508 |
+
|
509 |
+
$helperMock->expects($this->any())
|
510 |
+
->method('canUseFoodDelivery')
|
511 |
+
->willReturn($canUseFoodDelivery);
|
512 |
+
|
513 |
+
$helperMock->expects($this->any())
|
514 |
+
->method('canUseSameDayDelivery')
|
515 |
+
->willReturn($canUseSameDayDelivery);
|
516 |
+
|
517 |
+
$helperMock->expects($this->any())
|
518 |
+
->method('canUseEveningTimeframes')
|
519 |
+
->willReturn($canUseEveningTimeframes);
|
520 |
+
|
521 |
+
$helperMock->expects($this->any())
|
522 |
+
->method('getCache')
|
523 |
+
->willReturn(null);
|
524 |
+
|
525 |
+
$helperMock->expects($this->any())
|
526 |
+
->method('canUseSundayDelivery')
|
527 |
+
->willReturn($canUseSundayDelivery);
|
528 |
+
|
529 |
+
$instance = $this->_getInstance();
|
530 |
+
$this->setProperty('_helpers', array('postnl/deliveryOptions' => $helperMock));
|
531 |
+
|
532 |
+
$method = new ReflectionMethod(get_class($instance), '_getDeliveryTimeframesOptionsArray');
|
533 |
+
$method->setAccessible(true);
|
534 |
+
|
535 |
+
$result = $method->invokeArgs($instance, array($country));
|
536 |
+
|
537 |
+
$this->assertEquals($expectedResult, $result);
|
538 |
+
}
|
539 |
+
}
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_Observer_GoMage_LightCheckout_AjaxTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
protected function observerMock($action = 'save_payment_methods')
|
43 |
+
{
|
44 |
+
$observer = $this->getMock('Varien_Event_Observer', array('getControllerAction', 'getRequest', 'getParam'));
|
45 |
+
|
46 |
+
$observer->expects($this->once())
|
47 |
+
->method('getControllerAction')
|
48 |
+
->willReturnSelf();
|
49 |
+
|
50 |
+
$observer->expects($this->once())
|
51 |
+
->method('getRequest')
|
52 |
+
->willReturnSelf();
|
53 |
+
|
54 |
+
$observer->expects($this->once())
|
55 |
+
->method('getParam')
|
56 |
+
->with('action', false)
|
57 |
+
->willReturn($action);
|
58 |
+
|
59 |
+
return $observer;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function validateIdCheckProvider()
|
63 |
+
{
|
64 |
+
return array(
|
65 |
+
array('save_payment_methods', '{"test":true}', array('error' => false, 'message' => null)),
|
66 |
+
array('save_payment_methods', '{"error":true,"message":"got an error"}', array('error' => true, 'message' => 'got an error')),
|
67 |
+
array('get_totals', '{"test":true}', false),
|
68 |
+
);
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* @param $action
|
73 |
+
* @param $expected
|
74 |
+
* @param $validate
|
75 |
+
*
|
76 |
+
* @dataProvider validateIdCheckProvider
|
77 |
+
*/
|
78 |
+
public function testValidateIdCheck($action, $expected, $validate)
|
79 |
+
{
|
80 |
+
$observerMock = $this->observerMock($action);
|
81 |
+
|
82 |
+
$idCheckMock = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck');
|
83 |
+
|
84 |
+
$idCheckMock->expects($this->any())
|
85 |
+
->method('validate')
|
86 |
+
->willReturn($validate);
|
87 |
+
|
88 |
+
$idCheckMock->expects($this->any())
|
89 |
+
->method('saveData');
|
90 |
+
|
91 |
+
Mage::app()->getResponse()->setBody('{"test":true}');
|
92 |
+
|
93 |
+
$instance = new TIG_PostNL_Model_DeliveryOptions_Observer_GoMage_LightCheckout_Ajax;
|
94 |
+
$this->setProperty('_idCheckObserverModel', $idCheckMock, $instance);
|
95 |
+
$instance->validateIdCheck($observerMock);
|
96 |
+
|
97 |
+
$result = Mage::app()->getResponse()->getBody();
|
98 |
+
$this->assertEquals($expected, $result);
|
99 |
+
}
|
100 |
+
}
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_Observer_IdCheckTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
/**
|
43 |
+
* @return TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck
|
44 |
+
*/
|
45 |
+
protected function _getInstance()
|
46 |
+
{
|
47 |
+
return new TIG_PostNL_Model_DeliveryOptions_Observer_IdCheck();
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @param $type
|
52 |
+
*
|
53 |
+
* @return mixed
|
54 |
+
* @throws Exception
|
55 |
+
*/
|
56 |
+
protected function convertIDCheckType($type)
|
57 |
+
{
|
58 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
59 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
60 |
+
|
61 |
+
if ($type === 'AgeCheck') {
|
62 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_AGE;
|
63 |
+
} elseif ($type === 'BirthdayCheck') {
|
64 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY;
|
65 |
+
} elseif ($type === 'IDCheck') {
|
66 |
+
return $deliveryOptionsHelper::IDCHECK_TYPE_ID;
|
67 |
+
}
|
68 |
+
|
69 |
+
return $type;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function validateProvider()
|
73 |
+
{
|
74 |
+
return array(
|
75 |
+
array(
|
76 |
+
true,
|
77 |
+
'IDCheck',
|
78 |
+
array(),
|
79 |
+
false,
|
80 |
+
false
|
81 |
+
),
|
82 |
+
|
83 |
+
array(
|
84 |
+
true,
|
85 |
+
'IDCheck',
|
86 |
+
array(
|
87 |
+
'billing_postnl_idcheck' => array(
|
88 |
+
),
|
89 |
+
),
|
90 |
+
false,
|
91 |
+
'Please provide a document type'
|
92 |
+
),
|
93 |
+
|
94 |
+
array(
|
95 |
+
true,
|
96 |
+
'IDCheck',
|
97 |
+
array(
|
98 |
+
'billing_postnl_idcheck' => array(
|
99 |
+
'type' => 'wrong',
|
100 |
+
),
|
101 |
+
),
|
102 |
+
false,
|
103 |
+
'Please provide a valid document type'
|
104 |
+
),
|
105 |
+
|
106 |
+
array(
|
107 |
+
true,
|
108 |
+
'IDCheck',
|
109 |
+
array(
|
110 |
+
'billing_postnl_idcheck' => array(
|
111 |
+
'type' => '03',
|
112 |
+
'number' => '',
|
113 |
+
),
|
114 |
+
),
|
115 |
+
false,
|
116 |
+
'Please provide a document number',
|
117 |
+
),
|
118 |
+
|
119 |
+
array(
|
120 |
+
true,
|
121 |
+
'IDCheck',
|
122 |
+
array(
|
123 |
+
'billing_postnl_idcheck' => array(
|
124 |
+
'type' => '03',
|
125 |
+
'number' => '1234',
|
126 |
+
'expiration_date_full' => '',
|
127 |
+
),
|
128 |
+
),
|
129 |
+
false,
|
130 |
+
'Please provide a expiration date',
|
131 |
+
),
|
132 |
+
|
133 |
+
array(
|
134 |
+
true,
|
135 |
+
'IDCheck',
|
136 |
+
array(
|
137 |
+
'billing_postnl_idcheck' => array(
|
138 |
+
'type' => '03',
|
139 |
+
'number' => '1234',
|
140 |
+
'expiration_date_full' => '12-04-2112',
|
141 |
+
),
|
142 |
+
),
|
143 |
+
false,
|
144 |
+
false
|
145 |
+
),
|
146 |
+
array(true, 'AgeCheck', array(), false, false),
|
147 |
+
array(true, 'BirthdayCheck', array(), false, false),
|
148 |
+
array(true, 'BirthdayCheck', array('billing'=>array()), false, 'Please provide a valid birthday'),
|
149 |
+
array(true, 'BirthdayCheck', array('billing'=>array('dob' => '29-09-1999')), false, false),
|
150 |
+
array(false, 'BirthdayCheck', array('billing'=>array('dob' => '29-09-1999')), false, false),
|
151 |
+
array(false, 'BirthdayCheck', array('billing'=>array('day' => '29', 'month' => '09', 'year' => '1999')), false, false),
|
152 |
+
array(false, 'BirthdayCheck', array('billing'=>array()), true, false),
|
153 |
+
);
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* @param $useObserver
|
158 |
+
* @param $oldShipmentType
|
159 |
+
* @param $postData
|
160 |
+
* @param $customerIsLoggedIn
|
161 |
+
* @param $error
|
162 |
+
*
|
163 |
+
* @dataProvider validateProvider
|
164 |
+
*/
|
165 |
+
public function testValidate($useObserver, $oldShipmentType, $postData, $customerIsLoggedIn, $error)
|
166 |
+
{
|
167 |
+
$shipmentType = $this->convertIDCheckType($oldShipmentType);
|
168 |
+
|
169 |
+
if (version_compare(Mage::getVersion(), '1.9.0.0', '<=')) {
|
170 |
+
$this->markTestIncomplete('No support for 1.8.0 and lower');
|
171 |
+
}
|
172 |
+
|
173 |
+
$_POST = $postData;
|
174 |
+
|
175 |
+
$mockHelper = $this->getMock('TIG_PostNL_Helper_Data', array('getQuoteIdCheckType'));
|
176 |
+
$mockHelper->expects($this->once())
|
177 |
+
->method('getQuoteIdCheckType')
|
178 |
+
->willReturn($shipmentType);
|
179 |
+
|
180 |
+
$observer = null;
|
181 |
+
if ($useObserver) {
|
182 |
+
$addressMock = $this->getMock('Mage_Sales_Model_Quote_Address');
|
183 |
+
|
184 |
+
if ($error) {
|
185 |
+
$addressMock->expects($this->once())
|
186 |
+
->method('addError')
|
187 |
+
->with($error);
|
188 |
+
} else {
|
189 |
+
$addressMock->expects($this->never())
|
190 |
+
->method('addError');
|
191 |
+
}
|
192 |
+
|
193 |
+
$observer = $this->getMock('Varien_Event_Object', array('getAddress'));
|
194 |
+
$observer->expects($this->once())
|
195 |
+
->method('getAddress')
|
196 |
+
->willReturn($addressMock);
|
197 |
+
}
|
198 |
+
|
199 |
+
$this->registerMockSessions(array('customer'));
|
200 |
+
$sessionMock = Mage::getSingleton('customer/session');
|
201 |
+
|
202 |
+
$isLoggedInExpects = $sessionMock->expects($this->any());
|
203 |
+
$isLoggedInExpects->method('isLoggedIn');
|
204 |
+
$isLoggedInExpects->willReturn($customerIsLoggedIn);
|
205 |
+
|
206 |
+
$instance = $this->_getInstance();
|
207 |
+
$this->setProperty('_helpers', array('postnl' => $mockHelper), $instance);
|
208 |
+
|
209 |
+
$response = $instance->validate($observer);
|
210 |
+
|
211 |
+
if (!$useObserver) {
|
212 |
+
$result = array(
|
213 |
+
'error' => (bool)$error,
|
214 |
+
'message' => $error,
|
215 |
+
);
|
216 |
+
$this->assertEquals($result, $response);
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
public function saveDataProvider()
|
221 |
+
{
|
222 |
+
return array(
|
223 |
+
array(
|
224 |
+
'IDCheck',
|
225 |
+
true,
|
226 |
+
false,
|
227 |
+
array(
|
228 |
+
'billing_billing_postnl_idcheck' => array(
|
229 |
+
'type' => 'abroud_passport',
|
230 |
+
'number' => '12345',
|
231 |
+
'expiration_date_full' => '12-12-2112',
|
232 |
+
),
|
233 |
+
)
|
234 |
+
),
|
235 |
+
array('AgeCheck', true, false, array()),
|
236 |
+
array('BirthdayCheck', true, false, array('billing'=>array('dob'=>'29-09-1999'))),
|
237 |
+
array('BirthdayCheck', false, false, array('billing'=>array('dob'=>'29-09-1999'))),
|
238 |
+
array('BirthdayCheck', false, true, array('dob'=>'29-09-1999')),
|
239 |
+
);
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* @dataProvider saveDataProvider
|
244 |
+
*
|
245 |
+
* @param $oldShipmentType
|
246 |
+
* @param $dobIsVisible
|
247 |
+
* @param $isLoggedIn
|
248 |
+
* @param $postData
|
249 |
+
*/
|
250 |
+
public function testSaveData($oldShipmentType, $dobIsVisible, $isLoggedIn, $postData)
|
251 |
+
{
|
252 |
+
$shipmentType = $this->convertIDCheckType($oldShipmentType);
|
253 |
+
|
254 |
+
$_POST = $postData;
|
255 |
+
|
256 |
+
$mockHelper = $this->getMock('TIG_PostNL_Helper_Data');
|
257 |
+
|
258 |
+
$mockHelper->expects($this->once())
|
259 |
+
->method('getQuoteIdCheckType')
|
260 |
+
->willReturn($shipmentType);
|
261 |
+
|
262 |
+
$mockOrder = $this->getMock('TIG_PostNL_Model_Core_Order', array(
|
263 |
+
'setIdcheckType',
|
264 |
+
'setIdcheckNumber',
|
265 |
+
'setIdcheckExpirationDate',
|
266 |
+
));
|
267 |
+
|
268 |
+
$mockService = $this->getMock('TIG_PostNL_Model_DeliveryOptions_Service');
|
269 |
+
|
270 |
+
$mockService->expects($this->any())
|
271 |
+
->method('getPostnlOrder')
|
272 |
+
->willReturn($mockOrder);
|
273 |
+
|
274 |
+
$this->registerMockSessions(array('checkout', 'customer'));
|
275 |
+
$mockQuote = $this->getMock('Mage_Sales_Model_Quote', array('setCustomerDob'));
|
276 |
+
|
277 |
+
Mage::getSingleton('eav/config')->getAttribute('customer', 'dob')->setIsVisible($dobIsVisible);
|
278 |
+
|
279 |
+
if ($shipmentType == 'BirthdayCheck' && !$dobIsVisible) {
|
280 |
+
$value = isset($postData['billing']) ? $postData['billing']['dob'] : $postData['dob'];
|
281 |
+
$mockQuote->expects($this->once())
|
282 |
+
->method('setCustomerDob')
|
283 |
+
->with($value);
|
284 |
+
} elseif ($shipmentType == 'IDCheck') {
|
285 |
+
$mockOrder->expects($this->once())
|
286 |
+
->method('setIdcheckType')
|
287 |
+
->with($postData['billing_postnl_idcheck']['type']);
|
288 |
+
|
289 |
+
$mockOrder->expects($this->once())
|
290 |
+
->method('setIdcheckNumber')
|
291 |
+
->with($postData['billing_postnl_idcheck']['number']);
|
292 |
+
|
293 |
+
$mockOrder->expects($this->once())
|
294 |
+
->method('setIdcheckExpirationDate')
|
295 |
+
->with($postData['billing_postnl_idcheck']['expiration_date_full']);
|
296 |
+
}
|
297 |
+
|
298 |
+
if ($isLoggedIn) {
|
299 |
+
$customerMock = $this->getMock('Mage_Customer_Model_Customer');
|
300 |
+
|
301 |
+
$customerMock->expects($this->once())
|
302 |
+
->method('getId')
|
303 |
+
->willReturn(12);
|
304 |
+
|
305 |
+
$customerMock->expects($this->once())
|
306 |
+
->method('setData')
|
307 |
+
->with('dob', '29-09-1999');
|
308 |
+
|
309 |
+
$customerMock->expects($this->once())
|
310 |
+
->method('save');
|
311 |
+
|
312 |
+
$customerSessionMock = Mage::getSingleton('customer/session');
|
313 |
+
|
314 |
+
$customerSessionMock->expects($this->once())
|
315 |
+
->method('getCustomer')
|
316 |
+
->willReturn($customerMock);
|
317 |
+
}
|
318 |
+
|
319 |
+
$mockSession = Mage::getSingleton('checkout/session');
|
320 |
+
$mockSession->expects($this->any())
|
321 |
+
->method('getQuote')
|
322 |
+
->will($this->returnValue($mockQuote));
|
323 |
+
|
324 |
+
$instance = $this->_getInstance();
|
325 |
+
$this->setProperty('_helpers', array('postnl' => $mockHelper), $instance);
|
326 |
+
$this->setProperty('_serviceModel', $mockService, $instance);
|
327 |
+
|
328 |
+
$observer = $this->getMock('Varien_Event_Object');
|
329 |
+
|
330 |
+
$instance->saveData($observer);
|
331 |
+
}
|
332 |
+
|
333 |
+
public function validateCustomerDataProvider()
|
334 |
+
{
|
335 |
+
return array(
|
336 |
+
array(false, null, null, null, true),
|
337 |
+
array(true, '', false, false, true),
|
338 |
+
array(true, '', true, true, false),
|
339 |
+
array(true, '19-11-2016', false, true, true),
|
340 |
+
);
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* @dataProvider validateCustomerDataProvider
|
345 |
+
*
|
346 |
+
* @param $isLoggedIn
|
347 |
+
* @param $customerDob
|
348 |
+
* @param $hasError
|
349 |
+
* @param $isBirthdayCheckShipment
|
350 |
+
* @param $expected
|
351 |
+
*/
|
352 |
+
public function testValidateCustomerData(
|
353 |
+
$isLoggedIn,
|
354 |
+
$customerDob,
|
355 |
+
$hasError,
|
356 |
+
$isBirthdayCheckShipment,
|
357 |
+
$expected
|
358 |
+
)
|
359 |
+
{
|
360 |
+
$controllerMock = $this
|
361 |
+
->getMockBuilder('Mage_Core_Controller_Varien_Action')
|
362 |
+
->disableOriginalConstructor()
|
363 |
+
->getMock();
|
364 |
+
|
365 |
+
/** @var PHPUnit_Framework_MockObject_MockObject|Varien_Event_Observer $observerMock */
|
366 |
+
$observerMock = $this->getMock('Varien_Event_Observer', array('getControllerAction'));
|
367 |
+
|
368 |
+
$observerMockControllerAction = $observerMock->expects($this->any());
|
369 |
+
$observerMockControllerAction->method('getControllerAction');
|
370 |
+
$observerMockControllerAction->willReturn($controllerMock);
|
371 |
+
|
372 |
+
if ($hasError) {
|
373 |
+
$redirect = $controllerMock->expects($this->once());
|
374 |
+
$redirect->method('setRedirectWithCookieCheck');
|
375 |
+
$redirect->with('customer/account/edit');
|
376 |
+
|
377 |
+
$setFlag = $controllerMock->expects($this->once());
|
378 |
+
$setFlag->method('setFlag');
|
379 |
+
$setFlag->with('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);
|
380 |
+
}
|
381 |
+
|
382 |
+
/** @var PHPUnit_Framework_MockObject_MockObject|Mage_Customer_Model_Customer $observerMock */
|
383 |
+
$customerMock = $this->getMock('Mage_Customer_Model_Customer', array('getId', 'getDob'));
|
384 |
+
|
385 |
+
if ($isLoggedIn) {
|
386 |
+
$customerMockGetId = $customerMock->expects($this->once());
|
387 |
+
$customerMockGetId->method('getId');
|
388 |
+
$customerMockGetId->willReturn(10);
|
389 |
+
|
390 |
+
$customerMockGetDob = $customerMock->expects($this->once());
|
391 |
+
$customerMockGetDob->method('getDob');
|
392 |
+
$customerMockGetDob->willReturn($customerDob);
|
393 |
+
}
|
394 |
+
|
395 |
+
$this->registerMockSessions(array('customer'));
|
396 |
+
|
397 |
+
/** @var PHPUnit_Framework_MockObject_MockObject|Mage_Customer_Model_Session $customerSession */
|
398 |
+
$customerSession = Mage::getSingleton('customer/session');
|
399 |
+
|
400 |
+
$getCustomer = $customerSession->expects($this->once());
|
401 |
+
$getCustomer->method('getCustomer');
|
402 |
+
$getCustomer->willReturn($customerMock);
|
403 |
+
|
404 |
+
if ($hasError) {
|
405 |
+
$customerSessionAddError = $customerSession->expects($this->once());
|
406 |
+
$customerSessionAddError->method('addError');
|
407 |
+
$customerSessionAddError->with('The Date of Birth is required.');
|
408 |
+
}
|
409 |
+
|
410 |
+
$helperMock = $this->getMock('TIG_PostNL_Helper_Data', array('quoteIsBirthdayCheck'));
|
411 |
+
|
412 |
+
$quoteIsBirthdayCheck = $helperMock->expects($this->any());
|
413 |
+
$quoteIsBirthdayCheck->method('quoteIsBirthdayCheck');
|
414 |
+
$quoteIsBirthdayCheck->willReturn($isBirthdayCheckShipment);
|
415 |
+
|
416 |
+
$instance = $this->_getInstance();
|
417 |
+
|
418 |
+
$this->setProperty('_helpers', array('postnl' => $helperMock), $instance);
|
419 |
+
|
420 |
+
$result = $instance->validateCustomerData($observerMock);
|
421 |
+
|
422 |
+
$this->assertEquals($expected, $result);
|
423 |
+
}
|
424 |
+
}
|
@@ -33,10 +33,11 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
|
|
40 |
{
|
41 |
/**
|
42 |
* @return TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder
|
@@ -46,34 +47,13 @@ class TIG_PostNL_Test_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest exten
|
|
46 |
return new TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder();
|
47 |
}
|
48 |
|
49 |
-
/**
|
50 |
-
* @test
|
51 |
-
*/
|
52 |
-
public function shouldGetTheOrderFromTheObserver()
|
53 |
-
{
|
54 |
-
$this->markTestSkipped('Test is not working at this moment');
|
55 |
-
|
56 |
-
$mockObserver = $this->getMock('Varien_Event_Observer', array('getOrder'));
|
57 |
-
$mockObserver->expects($this->once())
|
58 |
-
->method('getOrder')
|
59 |
-
->will($this->returnValue(null));
|
60 |
-
|
61 |
-
$observer = $this->_getInstance($mockObserver);
|
62 |
-
$this->assertInstanceOf(
|
63 |
-
'TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder',
|
64 |
-
$observer->updatePostnlOrder($mockObserver)
|
65 |
-
);
|
66 |
-
}
|
67 |
-
|
68 |
/**
|
69 |
* @test
|
70 |
*/
|
71 |
public function shouldGetAPostnlOrder()
|
72 |
{
|
73 |
-
$this->markTestSkipped('Skip this test');
|
74 |
-
|
75 |
$mockOrder = $this->getMock('Mage_Sales_Model_Order', array('getQuoteId'));
|
76 |
-
$mockOrder->expects($this->
|
77 |
->method('getQuoteId')
|
78 |
->will($this->returnValue(1));
|
79 |
|
@@ -82,7 +62,7 @@ class TIG_PostNL_Test_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest exten
|
|
82 |
->method('load')
|
83 |
->with(1, 'quote_id')
|
84 |
->will($this->returnSelf());
|
85 |
-
$mockPostnlOrder->expects($this->
|
86 |
->method('getId')
|
87 |
->will($this->returnValue(null));
|
88 |
|
@@ -105,15 +85,10 @@ class TIG_PostNL_Test_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest exten
|
|
105 |
*/
|
106 |
public function shouldUpdateThePostnlOrder()
|
107 |
{
|
108 |
-
$this->markTestSkipped('Skip this test');
|
109 |
-
|
110 |
$mockOrder = $this->getMock('Mage_Sales_Model_Order', array('getQuoteId', 'getId'));
|
111 |
-
$mockOrder->expects($this->
|
112 |
->method('getQuoteId')
|
113 |
->will($this->returnValue(1));
|
114 |
-
$mockOrder->expects($this->once())
|
115 |
-
->method('getId')
|
116 |
-
->will($this->returnValue(3));
|
117 |
|
118 |
$mockPostnlOrder = $this->getMock(
|
119 |
'TIG_PostNL_Model_Core_Order',
|
@@ -123,22 +98,9 @@ class TIG_PostNL_Test_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest exten
|
|
123 |
->method('load')
|
124 |
->with(1, 'quote_id')
|
125 |
->will($this->returnSelf());
|
126 |
-
$mockPostnlOrder->expects($this->
|
127 |
->method('getId')
|
128 |
->will($this->returnValue(2));
|
129 |
-
$mockPostnlOrder->expects($this->once())
|
130 |
-
->method('getOrderId')
|
131 |
-
->will($this->returnValue(false));
|
132 |
-
$mockPostnlOrder->expects($this->once())
|
133 |
-
->method('setOrderId')
|
134 |
-
->with(3)
|
135 |
-
->will($this->returnSelf());
|
136 |
-
$mockPostnlOrder->expects($this->once())
|
137 |
-
->method('save')
|
138 |
-
->will($this->returnSelf());
|
139 |
-
$mockPostnlOrder->expects($this->once())
|
140 |
-
->method('getIsPakjeGemak')
|
141 |
-
->will($this->returnValue(false));
|
142 |
|
143 |
$mockObserver = $this->getMock('Varien_Event_Observer', array('getOrder'));
|
144 |
$mockObserver->expects($this->once())
|
@@ -153,4 +115,4 @@ class TIG_PostNL_Test_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest exten
|
|
153 |
$observer->updatePostnlOrder($mockObserver)
|
154 |
);
|
155 |
}
|
156 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_Observer_UpdatePostnlOrderTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
{
|
42 |
/**
|
43 |
* @return TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder
|
47 |
return new TIG_PostNL_Model_DeliveryOptions_Observer_UpdatePostnlOrder();
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* @test
|
52 |
*/
|
53 |
public function shouldGetAPostnlOrder()
|
54 |
{
|
|
|
|
|
55 |
$mockOrder = $this->getMock('Mage_Sales_Model_Order', array('getQuoteId'));
|
56 |
+
$mockOrder->expects($this->any())
|
57 |
->method('getQuoteId')
|
58 |
->will($this->returnValue(1));
|
59 |
|
62 |
->method('load')
|
63 |
->with(1, 'quote_id')
|
64 |
->will($this->returnSelf());
|
65 |
+
$mockPostnlOrder->expects($this->any())
|
66 |
->method('getId')
|
67 |
->will($this->returnValue(null));
|
68 |
|
85 |
*/
|
86 |
public function shouldUpdateThePostnlOrder()
|
87 |
{
|
|
|
|
|
88 |
$mockOrder = $this->getMock('Mage_Sales_Model_Order', array('getQuoteId', 'getId'));
|
89 |
+
$mockOrder->expects($this->any())
|
90 |
->method('getQuoteId')
|
91 |
->will($this->returnValue(1));
|
|
|
|
|
|
|
92 |
|
93 |
$mockPostnlOrder = $this->getMock(
|
94 |
'TIG_PostNL_Model_Core_Order',
|
98 |
->method('load')
|
99 |
->with(1, 'quote_id')
|
100 |
->will($this->returnSelf());
|
101 |
+
$mockPostnlOrder->expects($this->any())
|
102 |
->method('getId')
|
103 |
->will($this->returnValue(2));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
$mockObserver = $this->getMock('Varien_Event_Observer', array('getOrder'));
|
106 |
$mockObserver->expects($this->once())
|
115 |
$observer->updatePostnlOrder($mockObserver)
|
116 |
);
|
117 |
}
|
118 |
+
}
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_Product_Attribute_Source_ProductTypeTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
+
{
|
42 |
+
public function types()
|
43 |
+
{
|
44 |
+
/** @var TIG_PostNL_Helper_DeliveryOptions $deliveryOptionsHelper */
|
45 |
+
$deliveryOptionsHelper = Mage::app()->getConfig()->getHelperClassName('postnl/deliveryOptions');
|
46 |
+
|
47 |
+
return array(
|
48 |
+
array($deliveryOptionsHelper::FOOD_TYPE_DRY_GROCERIES),
|
49 |
+
array($deliveryOptionsHelper::FOOD_TYPE_COOL_PRODUCTS),
|
50 |
+
array($deliveryOptionsHelper::IDCHECK_TYPE_AGE),
|
51 |
+
array($deliveryOptionsHelper::IDCHECK_TYPE_BIRTHDAY),
|
52 |
+
array($deliveryOptionsHelper::IDCHECK_TYPE_ID),
|
53 |
+
);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @dataProvider types
|
58 |
+
*/
|
59 |
+
public function testHasAllTheOptions($type)
|
60 |
+
{
|
61 |
+
/** @var TIG_PostNL_Model_DeliveryOptions_Product_Attribute_Source_IdcheckType $model */
|
62 |
+
$model = Mage::getModel('postnl_deliveryoptions/product_attribute_source_productType');
|
63 |
+
|
64 |
+
$options = $model->getAllOptions();
|
65 |
+
|
66 |
+
foreach ($options as $option) {
|
67 |
+
if ($option['value'] === $type) {
|
68 |
+
$this->assertEquals($type, $option['value']);
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
$this->fail('Option ' . $type . ' not found');
|
74 |
+
}
|
75 |
+
}
|
@@ -33,10 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
{
|
41 |
/**
|
42 |
* @return TIG_PostNL_Model_DeliveryOptions_Service
|
@@ -87,12 +87,10 @@ class TIG_PostNL_Test_Model_DeliveryOptions_ServiceTest extends TIG_PostNL_Test_
|
|
87 |
*/
|
88 |
public function getPostnlOrderShouldReturnAPostnlOrderFromAQuote()
|
89 |
{
|
90 |
-
$this->markTestSkipped('Skip this test');
|
91 |
-
|
92 |
$instance = $this->_getInstance();
|
93 |
|
94 |
$mockQuote = $this->getMock('Mage_Sales_Model_Quote');
|
95 |
-
$mockQuote->expects($this->
|
96 |
->method('getId');
|
97 |
|
98 |
$instance->setQuote($mockQuote);
|
@@ -134,27 +132,6 @@ class TIG_PostNL_Test_Model_DeliveryOptions_ServiceTest extends TIG_PostNL_Test_
|
|
134 |
$this->assertTrue($isCallable);
|
135 |
}
|
136 |
|
137 |
-
/**
|
138 |
-
* @test
|
139 |
-
*
|
140 |
-
* @dataProvider confirmDateProvider
|
141 |
-
*
|
142 |
-
* @param $deliveryDate
|
143 |
-
* @param $shippingDuration
|
144 |
-
* @param $expected
|
145 |
-
*/
|
146 |
-
public function getConfirmDateShouldReturnTheCorrectDate($deliveryDate, $shippingDuration, $expected)
|
147 |
-
{
|
148 |
-
$this->markTestSkipped('Skip this test');
|
149 |
-
|
150 |
-
$instance = $this->_getInstance();
|
151 |
-
$instance->setShippingDuration($shippingDuration);
|
152 |
-
|
153 |
-
$confirmDate = $instance->getConfirmDate($deliveryDate);
|
154 |
-
|
155 |
-
$this->assertEquals($expected, $confirmDate);
|
156 |
-
}
|
157 |
-
|
158 |
/**
|
159 |
* @return array
|
160 |
*/
|
@@ -271,4 +248,4 @@ class TIG_PostNL_Test_Model_DeliveryOptions_ServiceTest extends TIG_PostNL_Test_
|
|
271 |
|
272 |
$instance->saveMobilePhoneNumber('testNumber');
|
273 |
}
|
274 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_ServiceTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
{
|
41 |
/**
|
42 |
* @return TIG_PostNL_Model_DeliveryOptions_Service
|
87 |
*/
|
88 |
public function getPostnlOrderShouldReturnAPostnlOrderFromAQuote()
|
89 |
{
|
|
|
|
|
90 |
$instance = $this->_getInstance();
|
91 |
|
92 |
$mockQuote = $this->getMock('Mage_Sales_Model_Quote');
|
93 |
+
$mockQuote->expects($this->any())
|
94 |
->method('getId');
|
95 |
|
96 |
$instance->setQuote($mockQuote);
|
132 |
$this->assertTrue($isCallable);
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
/**
|
136 |
* @return array
|
137 |
*/
|
248 |
|
249 |
$instance->saveMobilePhoneNumber('testNumber');
|
250 |
}
|
251 |
+
}
|
@@ -33,11 +33,11 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
-
class
|
40 |
-
extends
|
41 |
{
|
42 |
/**
|
43 |
* @return TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee
|
@@ -59,37 +59,6 @@ class TIG_PostNL_Test_Model_DeliveryOptions_System_Config_Backend_ValidateFeeTes
|
|
59 |
$this->assertTrue($isCallable);
|
60 |
}
|
61 |
|
62 |
-
/**
|
63 |
-
* @param $fee
|
64 |
-
* @param $includingTax
|
65 |
-
* @param $expected
|
66 |
-
*
|
67 |
-
* @test
|
68 |
-
*
|
69 |
-
* @dataProvider validateFeeprovider
|
70 |
-
*/
|
71 |
-
public function shouldValidateFee($fee, $includingTax, $expected)
|
72 |
-
{
|
73 |
-
$this->markTestSkipped('Skip this test');
|
74 |
-
|
75 |
-
$this->registerMockSessions(array('customer'));
|
76 |
-
|
77 |
-
Mage::getSingleton('tax/config')->setShippingPriceIncludeTax(false);
|
78 |
-
|
79 |
-
$instance = new TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFeeFake();
|
80 |
-
$instance->setIsIncludingTax($includingTax);
|
81 |
-
|
82 |
-
if (!$expected) {
|
83 |
-
$this->setExpectedException('TIG_PostNL_Exception');
|
84 |
-
}
|
85 |
-
|
86 |
-
$isValid = $instance->validateFee($fee);
|
87 |
-
|
88 |
-
if ($expected) {
|
89 |
-
$this->assertSame($expected, $isValid);
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
/**
|
94 |
* @return array
|
95 |
*/
|
@@ -148,22 +117,6 @@ class TIG_PostNL_Test_Model_DeliveryOptions_System_Config_Backend_ValidateFeeTes
|
|
148 |
),
|
149 |
);
|
150 |
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* @test
|
154 |
-
*
|
155 |
-
* @expectedException TIG_PostNL_Exception
|
156 |
-
* @expectedExceptionCode POSTNL-0153
|
157 |
-
*/
|
158 |
-
public function shouldThrowAnExceptionIfAnInvalidFeeIsEntered()
|
159 |
-
{
|
160 |
-
$this->markTestSkipped('Skip this test');
|
161 |
-
|
162 |
-
$instance = new TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFeeFake();
|
163 |
-
|
164 |
-
$instance->setValue('invalid_fee');
|
165 |
-
$instance->beforeSave();
|
166 |
-
}
|
167 |
}
|
168 |
|
169 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFeeFake extends TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee
|
@@ -172,4 +125,4 @@ class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFeeFake ext
|
|
172 |
{
|
173 |
$this->_beforeSave();
|
174 |
}
|
175 |
-
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_DeliveryOptions_System_Config_Backend_ValidateFeeTest
|
40 |
+
extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
41 |
{
|
42 |
/**
|
43 |
* @return TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee
|
59 |
$this->assertTrue($isCallable);
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
/**
|
63 |
* @return array
|
64 |
*/
|
117 |
),
|
118 |
);
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
|
122 |
class TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFeeFake extends TIG_PostNL_Model_DeliveryOptions_System_Config_Backend_ValidateFee
|
125 |
{
|
126 |
$this->_beforeSave();
|
127 |
}
|
128 |
+
}
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
class TIG_PostNL_Test_Unit_Model_Payment_CodTest extends TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* @return TIG_PostNL_Model_Payment_Cod
|
43 |
+
*/
|
44 |
+
protected function _getInstance()
|
45 |
+
{
|
46 |
+
return Mage::getModel('postnl_payment/cod');
|
47 |
+
}
|
48 |
+
|
49 |
+
public function isAvailableDataProvider()
|
50 |
+
{
|
51 |
+
return array(
|
52 |
+
array(false, false, false, false, false, false, false, false, 'NL', false, 'PostNL COD is not available, because the quote is empty.'),
|
53 |
+
array(true, false, false, false, false, false, false, false, 'NL', false, false),
|
54 |
+
array(true, true, false, false, false, false, false, false, 'NL', false, false),
|
55 |
+
array(true, true, true, false, false, false, false, false, 'NL', false, 'PostNL COD is not available, because the order is virtual.'),
|
56 |
+
array(true, true, false, true, false, false, false, false, 'NL', false, false),
|
57 |
+
array(true, true, false, false, true, false, false, false, 'NL', false, 'PostNL COD is not available, because required fields are missing.'),
|
58 |
+
array(true, true, false, false, true, true, false, false, 'US', false, 'PostNL COD is not available, because the shipping destination country is not allowed.'),
|
59 |
+
array(true, true, false, false, true, true, true, false, 'NL', false, 'PostNL COD is not available, because the shipping address is a P.O. box.'),
|
60 |
+
array(true, true, false, false, true, true, false, true, 'NL', false, 'PostNL Cod is not available, because COD is not allowed in combination with Sunday Delivery.'),
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* @param $useQuote
|
66 |
+
* @param $isActive
|
67 |
+
* @param $isVirtual
|
68 |
+
* @param $isFood
|
69 |
+
* @param $allowForNonPostNL
|
70 |
+
* @param $codSettings
|
71 |
+
* @param $isPostbus
|
72 |
+
* @param $isSunday
|
73 |
+
* @param $country
|
74 |
+
* @param $expected
|
75 |
+
* @param $logMessage
|
76 |
+
*
|
77 |
+
* @internal param $result
|
78 |
+
*
|
79 |
+
* @dataProvider isAvailableDataProvider
|
80 |
+
*/
|
81 |
+
public function testIsAvailable(
|
82 |
+
$useQuote,
|
83 |
+
$isActive,
|
84 |
+
$isVirtual,
|
85 |
+
$isFood,
|
86 |
+
$allowForNonPostNL,
|
87 |
+
$codSettings,
|
88 |
+
$isPostbus,
|
89 |
+
$isSunday,
|
90 |
+
$country,
|
91 |
+
$expected,
|
92 |
+
$logMessage
|
93 |
+
)
|
94 |
+
{
|
95 |
+
$quote_id = 69;
|
96 |
+
$models = array();
|
97 |
+
$helpers = array();
|
98 |
+
$store = Mage::app()->getStore();
|
99 |
+
|
100 |
+
$quote = null;
|
101 |
+
if ($useQuote) {
|
102 |
+
$shippingAddress = $this->getMock('Mage_Sales_Model_Quote_Address');
|
103 |
+
|
104 |
+
$shippingAddress->expects($this->any())
|
105 |
+
->method('getStreetFull')
|
106 |
+
->willReturn($isPostbus ? 'thisisapostbuslocation' : 'kabelweg');
|
107 |
+
|
108 |
+
$shippingAddress->expects($this->any())
|
109 |
+
->method('getCountry')
|
110 |
+
->willReturn($country);
|
111 |
+
|
112 |
+
$quote = $this->getMock('Mage_Sales_Model_Quote');
|
113 |
+
|
114 |
+
$quote->expects($this->atLeastOnce())
|
115 |
+
->method('getStoreId')
|
116 |
+
->willReturn($store->getId());
|
117 |
+
|
118 |
+
$quote->expects($this->any())
|
119 |
+
->method('getId')
|
120 |
+
->willReturn($quote_id);
|
121 |
+
|
122 |
+
$quote->expects($this->any())
|
123 |
+
->method('isVirtual')
|
124 |
+
->willReturn($isVirtual);
|
125 |
+
|
126 |
+
$quote->expects($this->any())
|
127 |
+
->method('getShippingAddress')
|
128 |
+
->willReturn($shippingAddress);
|
129 |
+
}
|
130 |
+
|
131 |
+
$paymentHelper = $this->getMock('TIG_PostNL_Helper_Payment');
|
132 |
+
$helpers['postnl/payment'] = $paymentHelper;
|
133 |
+
|
134 |
+
$paymentHelper->expects($this->any())
|
135 |
+
->method('quoteIsFood')
|
136 |
+
->willReturn($isFood);
|
137 |
+
|
138 |
+
if ($logMessage) {
|
139 |
+
$paymentHelper->expects($this->once())
|
140 |
+
->method('__')
|
141 |
+
->with($logMessage);
|
142 |
+
|
143 |
+
}
|
144 |
+
|
145 |
+
$postnlOrder = $this->getMock('TIG_PostNL_Core_Order', array('load', 'getType'));
|
146 |
+
$models['postnl_core/order'] = $postnlOrder;
|
147 |
+
|
148 |
+
$postnlOrder->expects($this->any())
|
149 |
+
->method('load')
|
150 |
+
->with($quote_id, 'quote_id')
|
151 |
+
->willReturnSelf();
|
152 |
+
|
153 |
+
$postnlOrder->expects($this->any())
|
154 |
+
->method('getType')
|
155 |
+
->willReturn($isSunday ? 'Sunday' : 'Other');
|
156 |
+
|
157 |
+
Mage::app()->getStore()->setConfig('payment/postnl_cod/allowspecific', 1);
|
158 |
+
Mage::app()->getStore()->setConfig('payment/postnl_cod/active', $isActive);
|
159 |
+
Mage::app()->getStore()->setConfig('payment/postnl_cod/allow_for_non_postnl', $allowForNonPostNL);
|
160 |
+
Mage::app()->getStore()->setConfig('payment/postnl_cod/specificcountry', 'NL,BE');
|
161 |
+
|
162 |
+
if ($codSettings) {
|
163 |
+
Mage::app()->getStore()->setConfig('postnl/cod/bic', 'bicnumber');
|
164 |
+
Mage::app()->getStore()->setConfig('postnl/cod/iban', 'ibannumber');
|
165 |
+
Mage::app()->getStore()->setConfig('postnl/cod/account_name', 'accountnumber');
|
166 |
+
|
167 |
+
Mage::app()->getStore()->setConfig('postnl/cod', array(
|
168 |
+
'bic' => 'bicnumber',
|
169 |
+
'iban' => 'ibannumber',
|
170 |
+
'account_name' => 'accountnumber',
|
171 |
+
));
|
172 |
+
}
|
173 |
+
|
174 |
+
$instance = $this->_getInstance();
|
175 |
+
$this->setProperty('_models', $models, $instance);
|
176 |
+
$this->setProperty('_helpers', $helpers, $instance);
|
177 |
+
$result = $instance->isAvailable($quote);
|
178 |
+
|
179 |
+
$this->assertEquals($expected, $result);
|
180 |
+
}
|
181 |
+
}
|
@@ -8,4 +8,4 @@ if (strpos(__DIR__, '.modman') !== false) {
|
|
8 |
|
9 |
ini_set('display_errors', true);
|
10 |
error_reporting(-1);
|
11 |
-
|
8 |
|
9 |
ini_set('display_errors', true);
|
10 |
error_reporting(-1);
|
11 |
+
TIG_PostNL_Test_Unit_Framework_TIG_Test_TestCase::resetMagento();
|
@@ -4,13 +4,17 @@
|
|
4 |
colors="true">
|
5 |
|
6 |
<testsuites>
|
7 |
-
<testsuite>
|
8 |
-
<directory
|
|
|
|
|
|
|
|
|
9 |
</testsuite>
|
10 |
</testsuites>
|
11 |
|
12 |
<filter>
|
13 |
-
<whitelist>
|
14 |
<directory>../../PostNL/Block</directory>
|
15 |
<directory>../../PostNL/controllers</directory>
|
16 |
<directory>../../PostNL/Helper</directory>
|
@@ -18,4 +22,4 @@
|
|
18 |
<file>../../PostNL/Exception.php</file>
|
19 |
</whitelist>
|
20 |
</filter>
|
21 |
-
</phpunit>
|
4 |
colors="true">
|
5 |
|
6 |
<testsuites>
|
7 |
+
<testsuite name="unit">
|
8 |
+
<directory>Unit</directory>
|
9 |
+
<exclude>Unit/Model/DeliveryOptions/Observer/GoMage</exclude>
|
10 |
+
</testsuite>
|
11 |
+
<testsuite name="gomage">
|
12 |
+
<directory>Unit/Model/DeliveryOptions/Observer/GoMage</directory>
|
13 |
</testsuite>
|
14 |
</testsuites>
|
15 |
|
16 |
<filter>
|
17 |
+
<whitelist addUncoveredFilesFromWhiteList="true">
|
18 |
<directory>../../PostNL/Block</directory>
|
19 |
<directory>../../PostNL/controllers</directory>
|
20 |
<directory>../../PostNL/Helper</directory>
|
22 |
<file>../../PostNL/Exception.php</file>
|
23 |
</whitelist>
|
24 |
</filter>
|
25 |
+
</phpunit>
|
@@ -1,86 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
set -e
|
3 |
-
set -x
|
4 |
-
|
5 |
-
TMPNAME=`openssl rand -base64 32 | tr -cd '[:alnum:]' | head -c8`;
|
6 |
-
|
7 |
-
if [ -z $MAGENTO_DB_HOST ]; then MAGENTO_DB_HOST="localhost"; fi
|
8 |
-
if [ -z $MAGENTO_DB_PORT ]; then MAGENTO_DB_PORT="3306"; fi
|
9 |
-
if [ -z $MAGENTO_DB_USER ]; then MAGENTO_DB_USER="root"; fi
|
10 |
-
if [ -z $MAGENTO_DB_PASS ]; then MAGENTO_DB_PASS=""; fi
|
11 |
-
if [ -z $MAGENTO_DB_ALLOWSAME ]; then MAGENTO_DB_ALLOWSAME="0"; fi
|
12 |
-
if [ ! -z $PHP_VERSION ]; then phpenv global $PHP_VERSION; fi
|
13 |
-
if [ -z $MAGENTO_DB_NAME ]; then
|
14 |
-
MAGENTO_DB_NAME="magento_${TMPNAME}";
|
15 |
-
fi
|
16 |
-
|
17 |
-
|
18 |
-
CURRENT_DIR=`pwd`
|
19 |
-
BUILDENV="/tmp/magento.${TMPNAME}"
|
20 |
-
mkdir -p ${BUILDENV}
|
21 |
-
TOOLS="${CURRENT_DIR}/tools"
|
22 |
-
PUBLIC_DIR="${BUILDENV}/public/"
|
23 |
-
|
24 |
-
mkdir -p "${TOOLS}"
|
25 |
-
mkdir -p "${PUBLIC_DIR}"
|
26 |
-
|
27 |
-
if [ ! -f "${TOOLS}/n98-magerun" ]; then
|
28 |
-
curl https://files.magerun.net/n98-magerun.phar -o "${TOOLS}/n98-magerun"
|
29 |
-
chmod +x "${TOOLS}/n98-magerun"
|
30 |
-
fi
|
31 |
-
|
32 |
-
if [ ! -f "${TOOLS}/modman" ]; then
|
33 |
-
curl https://raw.githubusercontent.com/colinmollenhour/modman/master/modman -o "${TOOLS}/modman"
|
34 |
-
chmod +x "${TOOLS}/modman"
|
35 |
-
fi
|
36 |
-
|
37 |
-
if [ ! -f "${TOOLS}/phpunit" ]; then
|
38 |
-
wget https://phar.phpunit.de/phpunit-old.phar -O "${TOOLS}/phpunit"
|
39 |
-
chmod +x "${TOOLS}/phpunit"
|
40 |
-
fi
|
41 |
-
|
42 |
-
echo "Using build directory ${BUILDENV}"
|
43 |
-
|
44 |
-
echo "Installing Magento version ${MAGENTO_VERSION}"
|
45 |
-
|
46 |
-
# Create main database
|
47 |
-
MYSQLPASS=""
|
48 |
-
if [ ! -z $MAGENTO_DB_PASS ]; then MYSQLPASS="-p${MAGENTO_DB_PASS}"; fi
|
49 |
-
mysql -u${MAGENTO_DB_USER} ${MYSQLPASS} -h${MAGENTO_DB_HOST} -P${MAGENTO_DB_PORT} -e "DROP DATABASE IF EXISTS \`${MAGENTO_DB_NAME}\`; CREATE DATABASE \`${MAGENTO_DB_NAME}\`;"
|
50 |
-
|
51 |
-
"${TOOLS}/n98-magerun" install \
|
52 |
-
--dbHost="${MAGENTO_DB_HOST}" --dbUser="${MAGENTO_DB_USER}" --dbPass="${MAGENTO_DB_PASS}" --dbName="${MAGENTO_DB_NAME}" --dbPort="${MAGENTO_DB_PORT}" \
|
53 |
-
--installSampleData=no \
|
54 |
-
--useDefaultConfigParams=yes \
|
55 |
-
--magentoVersionByName="${MAGENTO_VERSION}" \
|
56 |
-
--installationFolder="${PUBLIC_DIR}" \
|
57 |
-
--baseUrl="http://magento.local/" || { echo "Installing Magento failed"; exit 1; }
|
58 |
-
|
59 |
-
mkdir -p "${PUBLIC_DIR}/.modman/project"
|
60 |
-
|
61 |
-
cp -rf . "${PUBLIC_DIR}/.modman/project"
|
62 |
-
|
63 |
-
cd "${PUBLIC_DIR}"
|
64 |
-
|
65 |
-
"${TOOLS}/modman" deploy-all
|
66 |
-
"${TOOLS}/n98-magerun" config:set dev/template/allow_symlink 1
|
67 |
-
"${TOOLS}/n98-magerun" sys:setup:run
|
68 |
-
|
69 |
-
if [ -z $ENABLE_FLAT_CATALOG ] || [ $ENABLE_FLAT_CATALOG == false ]; then
|
70 |
-
"${TOOLS}/n98-magerun" config:set catalog/frontend/flat_catalog_category 0
|
71 |
-
"${TOOLS}/n98-magerun" config:set catalog/frontend/flat_catalog_product 0
|
72 |
-
else
|
73 |
-
"${TOOLS}/n98-magerun" config:set catalog/frontend/flat_catalog_category 1
|
74 |
-
"${TOOLS}/n98-magerun" config:set catalog/frontend/flat_catalog_product 1
|
75 |
-
"${TOOLS}/n98-magerun" index:reindex:all
|
76 |
-
fi
|
77 |
-
|
78 |
-
cd "${PUBLIC_DIR}/.modman/project";
|
79 |
-
mkdir -p "${PUBLIC_DIR}var/session";
|
80 |
-
chmod -R 777 "${PUBLIC_DIR}var/session";
|
81 |
-
|
82 |
-
"${TOOLS}/phpunit" -c "${PUBLIC_DIR}/app/code/community/TIG/PostNL/Test/phpunit.xml"
|
83 |
-
|
84 |
-
mysql -u${MAGENTO_DB_USER} ${MYSQLPASS} -h${MAGENTO_DB_HOST} -P${MAGENTO_DB_PORT} -e "DROP DATABASE IF EXISTS \`${MAGENTO_DB_NAME}\`;"
|
85 |
-
echo "Deleting ${BUILDENV}"
|
86 |
-
rm -rf "${BUILDENV}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_AddressValidationController extends Mage_Core_Controller_Front_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_AddressValidationController extends Mage_Core_Controller_Front_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_CheckoutController extends Mage_Core_Controller_Front_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Action
|
@@ -395,7 +395,7 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
|
|
395 |
/**
|
396 |
* Filter out unavailable time frames.
|
397 |
*/
|
398 |
-
$timeframes = $this->getService()->filterTimeframes($response, $data['country']);
|
399 |
|
400 |
if (!$timeframes) {
|
401 |
$this->getResponse()
|
@@ -1310,11 +1310,37 @@ class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Ac
|
|
1310 |
);
|
1311 |
}
|
1312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1313 |
$data = array(
|
1314 |
'postcode' => $postcode,
|
1315 |
'street' => $street,
|
1316 |
'country' => $country,
|
1317 |
'deliveryDate' => $deliveryDate,
|
|
|
|
|
1318 |
);
|
1319 |
return $data;
|
1320 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_DeliveryOptionsController extends Mage_Core_Controller_Front_Action
|
395 |
/**
|
396 |
* Filter out unavailable time frames.
|
397 |
*/
|
398 |
+
$timeframes = $this->getService()->filterTimeframes($response, $data['country'], $data['deliveryDate']);
|
399 |
|
400 |
if (!$timeframes) {
|
401 |
$this->getResponse()
|
1310 |
);
|
1311 |
}
|
1312 |
|
1313 |
+
$housenumber = $postData['housenumber'];
|
1314 |
+
$housenumberValidator = new Zend_Validate_Digits();
|
1315 |
+
if (!$housenumberValidator->isValid($housenumber)) {
|
1316 |
+
throw new TIG_PostNL_Exception(
|
1317 |
+
$this->__(
|
1318 |
+
'Invalid housenumber supplied for getNearestLocations request: %s',
|
1319 |
+
$housenumber
|
1320 |
+
),
|
1321 |
+
'POSTNL-0242'
|
1322 |
+
);
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
$city = $postData['city'];
|
1326 |
+
$cityValidator = new Zend_Validate_Regex(array('pattern' => self::CITY_NAME_REGEX));
|
1327 |
+
if (!$cityValidator->isValid($city)) {
|
1328 |
+
throw new TIG_PostNL_Exception(
|
1329 |
+
$this->__(
|
1330 |
+
'Invalid city supplied for getNearestLocations request: %s',
|
1331 |
+
$city
|
1332 |
+
),
|
1333 |
+
'POSTNL-0242'
|
1334 |
+
);
|
1335 |
+
}
|
1336 |
+
|
1337 |
$data = array(
|
1338 |
'postcode' => $postcode,
|
1339 |
'street' => $street,
|
1340 |
'country' => $country,
|
1341 |
'deliveryDate' => $deliveryDate,
|
1342 |
+
'housenumber' => $housenumber,
|
1343 |
+
'city' => $city,
|
1344 |
);
|
1345 |
return $data;
|
1346 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_GuestController extends TIG_PostNL_Controller_Sales
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_GuestController extends TIG_PostNL_Controller_Sales
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_MijnpakketController extends Mage_Core_Controller_Front_Action
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_MijnpakketController extends Mage_Core_Controller_Front_Action
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_OrderController extends TIG_PostNL_Controller_Sales
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_OrderController extends TIG_PostNL_Controller_Sales
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ConfigController extends TIG_PostNL_Controller_Adminhtml_Config
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ConfigController extends TIG_PostNL_Controller_Adminhtml_Config
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ExtensionControlController extends TIG_PostNL_Controller_Adminhtml_Config
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ExtensionControlController extends TIG_PostNL_Controller_Adminhtml_Config
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ReturnsController extends Mage_Adminhtml_Controller_Sales_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ReturnsController extends Mage_Adminhtml_Controller_Sales_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ShipmentController extends TIG_PostNL_Controller_Adminhtml_Shipment
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
class TIG_PostNL_PostnlAdminhtml_ShipmentController extends TIG_PostNL_Controller_Adminhtml_Shipment
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @var TIG_PostNL_Model_Resource_Setup $installer
|
42 |
+
*/
|
43 |
+
$installer = $this;
|
44 |
+
|
45 |
+
$installer->addSupportedProductCode(
|
46 |
+
array(
|
47 |
+
'3571',
|
48 |
+
'3574',
|
49 |
+
'3581',
|
50 |
+
'3584',
|
51 |
+
'3573',
|
52 |
+
'3576',
|
53 |
+
'3583',
|
54 |
+
'3586',
|
55 |
+
'3572',
|
56 |
+
'3575',
|
57 |
+
'3582',
|
58 |
+
'3585',
|
59 |
+
'3442',
|
60 |
+
'3445',
|
61 |
+
'3448',
|
62 |
+
'3451',
|
63 |
+
'3440',
|
64 |
+
'3444',
|
65 |
+
'3447',
|
66 |
+
'3450',
|
67 |
+
'3438',
|
68 |
+
'3443',
|
69 |
+
'3446',
|
70 |
+
'3449',
|
71 |
+
'3437',
|
72 |
+
)
|
73 |
+
)->clearConfigCache();
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated This file has been superseded by the data-upgrade-1.2.2-1.4.0.php file.
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @deprecated This file has been superseded by the data-upgrade-1.2.2-1.4.0.php file.
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*
|
40 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*
|
40 |
* @var TIG_PostNL_Model_Resource_Setup $installer
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @var TIG_PostNL_Model_Resource_Setup $installer
|
42 |
+
*/
|
43 |
+
$installer = $this;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* These xpaths have been changed.
|
47 |
+
*/
|
48 |
+
$updatedXpaths = array(
|
49 |
+
'postnl/delivery_options/delivery_options_be_active' => 'postnl/delivery_options_int/delivery_options_be_active',
|
50 |
+
'postnl/delivery_options/enable_pakjegemak_be' => 'postnl/delivery_options_int/enable_pakjegemak_be',
|
51 |
+
'postnl/delivery_options/enable_delivery_days_be' => 'postnl/delivery_options_int/enable_delivery_days_be',
|
52 |
+
'postnl/delivery_options/allow_sunday_sorting_be' => 'postnl/delivery_options_int/allow_sunday_sorting_be',
|
53 |
+
'postnl/delivery_options/delivery_days_number_be' => 'postnl/delivery_options_int/delivery_days_number_be',
|
54 |
+
);
|
55 |
+
|
56 |
+
foreach ($updatedXpaths as $oldXpath => $newXpath) {
|
57 |
+
$installer->moveConfigSettingInDb(
|
58 |
+
$oldXpath,
|
59 |
+
$newXpath
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
$installer->clearConfigCache();
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
It's very simple: just add the 'postnl/cif_product_options/allow_pakjegemak_not_insured' cpath to the core_config_data
|
2 |
+
table with a value of '1'. Or edit the config.xml default values accordingly.
|
3 |
+
|
4 |
+
Then just clear the cache, select the option in the 'allowed options' setting in the shop's configuration and you're
|
5 |
+
done.
|
@@ -1,27 +0,0 @@
|
|
1 |
-
app/code/community/TIG/PostNL/
|
2 |
-
app/design/adminhtml/default/default/layout/TIG/postnl.xml
|
3 |
-
app/design/adminhtml/default/default/template/TIG/PostNL/
|
4 |
-
app/design/adminhtml/default/magento2/template/TIG/PostNL/
|
5 |
-
app/design/frontend/base/default/layout/TIG/postnl.xml
|
6 |
-
app/design/frontend/base/default/template/TIG/PostNL/
|
7 |
-
app/design/frontend/enterprise/default/template/TIG/PostNL/
|
8 |
-
app/design/frontend/rwd/default/layout/TIG/postnl.xml
|
9 |
-
app/design/frontend/rwd/default/template/TIG/PostNL/
|
10 |
-
app/etc/modules/TIG_PostNL.xml
|
11 |
-
app/locale/en_US/template/email/TIG/PostNL/
|
12 |
-
app/locale/en_US/TIG_PostNL.csv
|
13 |
-
app/locale/nl_NL/template/email/TIG/PostNL/
|
14 |
-
app/locale/nl_NL/TIG_PostNL.csv
|
15 |
-
lib/TIG/PostNL/
|
16 |
-
skin/adminhtml/default/default/css/TIG/PostNL/
|
17 |
-
skin/adminhtml/default/default/images/TIG/PostNL/
|
18 |
-
skin/adminhtml/default/default/js/TIG/PostNL/
|
19 |
-
skin/adminhtml/default/magento2/css/TIG/PostNL/
|
20 |
-
skin/adminhtml/default/magento2/images/TIG/PostNL/
|
21 |
-
skin/frontend/base/default/css/TIG/PostNL/
|
22 |
-
skin/frontend/base/default/images/TIG/PostNL/
|
23 |
-
skin/frontend/base/default/js/TIG/PostNL/
|
24 |
-
skin/frontend/enterprise/default/css/TIG/PostNL/
|
25 |
-
skin/frontend/enterprise/default/images/TIG/PostNL/
|
26 |
-
skin/frontend/rwd/default/css/TIG/PostNL/
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
/**
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
/**
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -34,14 +34,14 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
41 |
<config>
|
42 |
<modules>
|
43 |
<TIG_PostNL>
|
44 |
-
<version>1.
|
45 |
</TIG_PostNL>
|
46 |
</modules>
|
47 |
|
@@ -72,6 +72,11 @@
|
|
72 |
<postnl_addressvalidation>
|
73 |
<class>TIG_PostNL_Block_AddressValidation</class>
|
74 |
</postnl_addressvalidation>
|
|
|
|
|
|
|
|
|
|
|
75 |
</blocks>
|
76 |
<helpers>
|
77 |
<postnl>
|
@@ -604,8 +609,94 @@
|
|
604 |
<class>postnl_deliveryoptions/observer_goMage_lightCheckout_ajax</class>
|
605 |
<method>setRegistryFlag</method>
|
606 |
</set_registry_flag>
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
</observers>
|
608 |
</controller_action_predispatch_gomage_checkout_onepage_ajax>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
</events>
|
610 |
</frontend>
|
611 |
|
@@ -793,6 +884,7 @@
|
|
793 |
<handling_fee/>
|
794 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> <!-- Method not available message -->
|
795 |
<foodspecificerrmsg>Food shipments can only be delivered within the Netherlands.</foodspecificerrmsg> <!-- Food method not available message -->
|
|
|
796 |
<sallowspecific>1</sallowspecific> <!-- Allow only specific countries -->
|
797 |
<specificcountry>NL,BE,BG,DK,DE,EE,FI,FR,GB,HU,IE,IT,LV,LT,LU,AT,PL,PT,RO,SI,SK,ES,CZ,SE,MT</specificcountry> <!-- Allow the Netherlands and all EPS countries -->
|
798 |
<showmethod>1</showmethod> <!-- Show the shipping method if unavailable -->
|
@@ -872,7 +964,6 @@
|
|
872 |
<stock_options>in_stock</stock_options> <!-- Do not show delivery options if the order is not in stock -->
|
873 |
<enable_delivery_days>1</enable_delivery_days> <!-- Delivery days are allowed -->
|
874 |
<delivery_days_number>7</delivery_days_number> <!-- Show up to 7 delivery days -->
|
875 |
-
<delivery_days_number_be>7</delivery_days_number_be> <!-- Show up to 7 delivery days for Belgium -->
|
876 |
<enable_timeframes>1</enable_timeframes> <!-- Timeframes are allowed -->
|
877 |
<enable_evening_timeframes>1</enable_evening_timeframes> <!-- Evening timeframes are enabled -->
|
878 |
<evening_timeframe_fee>2</evening_timeframe_fee> <!-- Evening timeframes cost 2 {base currency} extra -->
|
@@ -897,6 +988,9 @@
|
|
897 |
<sameday_delivery_cutoff_time>14:00:00</sameday_delivery_cutoff_time> <!-- Only allow same day delivery when ordering before 14:00 P.M. -->
|
898 |
<enable_food_delivery>0</enable_food_delivery> <!-- Disable food delivery -->
|
899 |
<food_delivery_default_product_type>0</food_delivery_default_product_type> <!-- By default products are considered non-food. -->
|
|
|
|
|
|
|
900 |
<delivery_options_be_active>0</delivery_options_be_active> <!-- Delivery options are disabled for Belgium -->
|
901 |
<enable_delivery_days_be>1</enable_delivery_days_be> <!-- Delivery days are allowed for Belgium -->
|
902 |
<allow_sunday_sorting_be>0</allow_sunday_sorting_be> <!-- Sunday sorting is disabled for Belgium -->
|
@@ -910,17 +1004,25 @@
|
|
910 |
<buspakje_calculation_mode>manual</buspakje_calculation_mode> <!-- Manually determine if a shipment is a buspakje shipment -->
|
911 |
<create_account_base_url>https://mijnpakket.postnl.nl/Register/RegisterFromWebshop?</create_account_base_url> <!-- Base URl for create MijnPakket account link -->
|
912 |
<mijnpakket_live_base_url>https://mijnpakket.postnl.nl/</mijnpakket_live_base_url> <!-- Base URL for MijnPakket in live mode -->
|
913 |
-
<mijnpakket_test_base_url>https://
|
914 |
<mijnpakket_login_js_path>Checkout2/Login.js</mijnpakket_login_js_path> <!-- Path to MijnPakket login JS file -->
|
915 |
<mijnpakket_checkout_premium_js_path>Checkout2/CheckoutPremium.js</mijnpakket_checkout_premium_js_path> <!-- Path to MijnPakket Checkout premium JS file -->
|
916 |
<mijnpakket_login_btn_live_base_url>checkout.postnl.nl/</mijnpakket_login_btn_live_base_url> <!-- Base URL for MijnPakket login button in live mode -->
|
917 |
-
<mijnpakket_login_btn_test_base_url>
|
918 |
<mijnpakket_login_btn_url_path>Button/PremiumLogin</mijnpakket_login_btn_url_path> <!-- Path to MijnPakket login button -->
|
919 |
<default_pakketautomaat_product_option>3553</default_pakketautomaat_product_option> <!-- Parcel dispenser -->
|
920 |
<default_food_product_option>3083</default_food_product_option> <!-- Food Delivery -->
|
921 |
<default_cooled_product_option>3084</default_cooled_product_option> <!-- Cooled Food delivery -->
|
922 |
<ajax_timeout>5</ajax_timeout> <!-- Delivery options AJAX calls will timeout after 5 seconds -->
|
923 |
</delivery_options>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
924 |
<cif>
|
925 |
<mode>0</mode> <!-- The extension is disabled by default -->
|
926 |
<customer_number>11223344</customer_number> <!-- Demo customer number -->
|
@@ -1027,11 +1129,11 @@
|
|
1027 |
<agree_conditions>1</agree_conditions> <!-- Customers must first agree to the webshop's terms and conditions -->
|
1028 |
<contact_url/>
|
1029 |
<service_url/>
|
1030 |
-
<checkout_button_test_base_url>https://
|
1031 |
<checkout_button_live_base_url>https://checkout.postnl.nl/Button/Checkout</checkout_button_live_base_url> <!-- Base URL for PostNl Checkout button -->
|
1032 |
-
<test_checkout_js_url>https://
|
1033 |
<live_checkout_js_url>https://mijnpakket.postnl.nl/Checkout2/Scripts/Checkout.js</live_checkout_js_url> <!-- URL for PostNL Checkout JS file -->
|
1034 |
-
<test_checkout_premium_js_url>https://
|
1035 |
<live_checkout_premium_js_url>https://mijnpakket.postnl.nl/Checkout2/CheckoutPremium.js</live_checkout_premium_js_url> <!-- URL for PostNL Checkout premium JS file -->
|
1036 |
</checkout>
|
1037 |
<checkout_payment_methods>
|
@@ -1076,8 +1178,8 @@
|
|
1076 |
<order_grid_massaction_default>postnl_create_shipments</order_grid_massaction_default> <!-- Select the create shipments mass action by default -->
|
1077 |
<shipping_grid_columns>shipment_type,confirm_date,confirm_status,labels_printed,barcode,shipping_phase</shipping_grid_columns> <!-- Show the shipping description, shipment type, label-printed and shipping phase columns -->
|
1078 |
<shipping_grid_massaction_default>postnl_print_labels_and_confirm</shipping_grid_massaction_default> <!-- 'Print labels and confirm shipment' massaction -->
|
1079 |
-
<supported_product_options>3085,3086,3091,3093,3097,3087,3094,3189,3089,3389,3096,3090,3385,3390,3535,3545,3536,3546,3534,3544,3533,3543,4952,4945,3553,2928,2828,4970,4971,4972,4973,4974,4975,4976,4932</supported_product_options> <!-- all possible options except for EPS BE only -->
|
1080 |
-
<supported_product_options_be>3085,3086,3091,3093,3097,3087,3094,3189,3089,3389,3096,3090,3385,3390,4970,4971,4972,4973,4974,4975,4976,3535,3545,3536,3546,3534,3544,3533,3543,4952,4945,3553,2828,2928</supported_product_options_be> <!-- all possible options for BE -->
|
1081 |
<default_product_option>3085</default_product_option> <!-- standard shipment -->
|
1082 |
<default_product_option_netherlands>3085</default_product_option_netherlands> <!-- standard shipment when use dutch products is enabled and the domestic country is BE -->
|
1083 |
<use_alternative_default>0</use_alternative_default> <!-- Do not use an alternative default -->
|
@@ -1085,7 +1187,9 @@
|
|
1085 |
<alternative_default_option>3189</alternative_default_option> <!-- Signature on delivery -->
|
1086 |
<default_evening_product_option>3385</default_evening_product_option> <!-- Deliver to stated address only -->
|
1087 |
<default_pakjegemak_product_option>3544</default_pakjegemak_product_option> <!-- Post Office + Signature on Delivery + Notification -->
|
1088 |
-
<
|
|
|
|
|
1089 |
<default_pge_product_option>3544</default_pge_product_option> <!-- Post Office + Signature on Delivery + Notification -->
|
1090 |
<default_buspakje_product_option>2928</default_buspakje_product_option> <!-- Buspakje Extra -->
|
1091 |
<default_stated_address_only_product_option>3385</default_stated_address_only_product_option> <!-- Deliver to stated address only -->
|
@@ -1093,6 +1197,12 @@
|
|
1093 |
<default_sameday_product_option>3385</default_sameday_product_option> <!-- Deliver to stated address only -->
|
1094 |
<default_eu_product_option>4952</default_eu_product_option> <!-- EU Pack Special to consumer (combilabel) -->
|
1095 |
<default_eu_be_product_option>4955</default_eu_be_product_option> <!-- EU Pack Standard (Belgium only, no signature) (combilabel) -->
|
|
|
|
|
|
|
|
|
|
|
|
|
1096 |
<valid_shipping_duration_days>1,2,3,4,5,6,7</valid_shipping_duration_days> <!-- all days of the week -->
|
1097 |
</grid>
|
1098 |
<cif_product_options>
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
41 |
<config>
|
42 |
<modules>
|
43 |
<TIG_PostNL>
|
44 |
+
<version>1.12.0</version>
|
45 |
</TIG_PostNL>
|
46 |
</modules>
|
47 |
|
72 |
<postnl_addressvalidation>
|
73 |
<class>TIG_PostNL_Block_AddressValidation</class>
|
74 |
</postnl_addressvalidation>
|
75 |
+
<customer>
|
76 |
+
<rewrite>
|
77 |
+
<widget_dob>TIG_PostNL_Block_Checkout_Widget_Dob</widget_dob>
|
78 |
+
</rewrite>
|
79 |
+
</customer>
|
80 |
</blocks>
|
81 |
<helpers>
|
82 |
<postnl>
|
609 |
<class>postnl_deliveryoptions/observer_goMage_lightCheckout_ajax</class>
|
610 |
<method>setRegistryFlag</method>
|
611 |
</set_registry_flag>
|
612 |
+
<!-- Saves the data for the ID Check -->
|
613 |
+
<save_idcheck_data>
|
614 |
+
<type>singleton</type>
|
615 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
616 |
+
<method>saveData</method>
|
617 |
+
</save_idcheck_data>
|
618 |
</observers>
|
619 |
</controller_action_predispatch_gomage_checkout_onepage_ajax>
|
620 |
+
<controller_action_postdispatch_gomage_checkout_onepage_ajax>
|
621 |
+
<observers>
|
622 |
+
<!-- Set a registry flag to prevent the PostNL order from being reset. -->
|
623 |
+
<validate_idcheck_data>
|
624 |
+
<type>model</type>
|
625 |
+
<class>postnl_deliveryoptions/observer_goMage_lightCheckout_ajax</class>
|
626 |
+
<method>validateIdCheck</method>
|
627 |
+
</validate_idcheck_data>
|
628 |
+
</observers>
|
629 |
+
</controller_action_postdispatch_gomage_checkout_onepage_ajax>
|
630 |
+
<controller_action_postdispatch_checkout_onepage_savebilling>
|
631 |
+
<observers>
|
632 |
+
<!-- Saves the data for the ID Check -->
|
633 |
+
<save_idcheck_data>
|
634 |
+
<type>singleton</type>
|
635 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
636 |
+
<method>saveData</method>
|
637 |
+
</save_idcheck_data>
|
638 |
+
</observers>
|
639 |
+
</controller_action_postdispatch_checkout_onepage_savebilling>
|
640 |
+
<controller_action_postdispatch_customer_account_editPost>
|
641 |
+
<observers>
|
642 |
+
<!-- Saves the data for the ID Check -->
|
643 |
+
<save_idcheck_data>
|
644 |
+
<type>singleton</type>
|
645 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
646 |
+
<method>saveData</method>
|
647 |
+
</save_idcheck_data>
|
648 |
+
</observers>
|
649 |
+
</controller_action_postdispatch_customer_account_editPost>
|
650 |
+
<customer_address_validation_after>
|
651 |
+
<observers>
|
652 |
+
<!-- Saves the data for the ID Check -->
|
653 |
+
<validate_idcheck_data>
|
654 |
+
<type>singleton</type>
|
655 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
656 |
+
<method>validate</method>
|
657 |
+
</validate_idcheck_data>
|
658 |
+
</observers>
|
659 |
+
</customer_address_validation_after>
|
660 |
+
<controller_action_postdispatch_onestepcheckout_ajax_save_billing>
|
661 |
+
<observers>
|
662 |
+
<!-- Saves the data for the ID Check -->
|
663 |
+
<save_idcheck_data>
|
664 |
+
<type>singleton</type>
|
665 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
666 |
+
<method>saveData</method>
|
667 |
+
</save_idcheck_data>
|
668 |
+
</observers>
|
669 |
+
</controller_action_postdispatch_onestepcheckout_ajax_save_billing>
|
670 |
+
<controller_action_predispatch_checkout_onepage_index>
|
671 |
+
<observers>
|
672 |
+
<!-- Make sure that a loggedin user has a date of birth available -->
|
673 |
+
<check_idcheck_requirements>
|
674 |
+
<type>singleton</type>
|
675 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
676 |
+
<method>validateCustomerData</method>
|
677 |
+
</check_idcheck_requirements>
|
678 |
+
</observers>
|
679 |
+
</controller_action_predispatch_checkout_onepage_index>
|
680 |
+
<controller_action_predispatch_onestepcheckout_index_index>
|
681 |
+
<observers>
|
682 |
+
<!-- Make sure that a loggedin user has a date of birth available -->
|
683 |
+
<check_idcheck_requirements>
|
684 |
+
<type>singleton</type>
|
685 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
686 |
+
<method>validateCustomerData</method>
|
687 |
+
</check_idcheck_requirements>
|
688 |
+
</observers>
|
689 |
+
</controller_action_predispatch_onestepcheckout_index_index>
|
690 |
+
<controller_action_predispatch_gomage_checkout_onepage_index>
|
691 |
+
<observers>
|
692 |
+
<!-- Make sure that a loggedin user has a date of birth available -->
|
693 |
+
<check_idcheck_requirements>
|
694 |
+
<type>singleton</type>
|
695 |
+
<class>postnl_deliveryoptions/observer_idCheck</class>
|
696 |
+
<method>validateCustomerData</method>
|
697 |
+
</check_idcheck_requirements>
|
698 |
+
</observers>
|
699 |
+
</controller_action_predispatch_gomage_checkout_onepage_index>
|
700 |
</events>
|
701 |
</frontend>
|
702 |
|
884 |
<handling_fee/>
|
885 |
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> <!-- Method not available message -->
|
886 |
<foodspecificerrmsg>Food shipments can only be delivered within the Netherlands.</foodspecificerrmsg> <!-- Food method not available message -->
|
887 |
+
<idcheckspecificerrmsg>ID Check shipments can only be delivered within the Netherlands.</idcheckspecificerrmsg> <!-- ID Check method not available message -->
|
888 |
<sallowspecific>1</sallowspecific> <!-- Allow only specific countries -->
|
889 |
<specificcountry>NL,BE,BG,DK,DE,EE,FI,FR,GB,HU,IE,IT,LV,LT,LU,AT,PL,PT,RO,SI,SK,ES,CZ,SE,MT</specificcountry> <!-- Allow the Netherlands and all EPS countries -->
|
890 |
<showmethod>1</showmethod> <!-- Show the shipping method if unavailable -->
|
964 |
<stock_options>in_stock</stock_options> <!-- Do not show delivery options if the order is not in stock -->
|
965 |
<enable_delivery_days>1</enable_delivery_days> <!-- Delivery days are allowed -->
|
966 |
<delivery_days_number>7</delivery_days_number> <!-- Show up to 7 delivery days -->
|
|
|
967 |
<enable_timeframes>1</enable_timeframes> <!-- Timeframes are allowed -->
|
968 |
<enable_evening_timeframes>1</enable_evening_timeframes> <!-- Evening timeframes are enabled -->
|
969 |
<evening_timeframe_fee>2</evening_timeframe_fee> <!-- Evening timeframes cost 2 {base currency} extra -->
|
988 |
<sameday_delivery_cutoff_time>14:00:00</sameday_delivery_cutoff_time> <!-- Only allow same day delivery when ordering before 14:00 P.M. -->
|
989 |
<enable_food_delivery>0</enable_food_delivery> <!-- Disable food delivery -->
|
990 |
<food_delivery_default_product_type>0</food_delivery_default_product_type> <!-- By default products are considered non-food. -->
|
991 |
+
<enable_id_check_delivery>0</enable_id_check_delivery> <!-- Disable ID check delivery -->
|
992 |
+
<enable_birthday_check_delivery>0</enable_birthday_check_delivery> <!-- Disable birthday check delivery -->
|
993 |
+
<enable_age_check_delivery>0</enable_age_check_delivery><!-- Disable age check delivery -->
|
994 |
<delivery_options_be_active>0</delivery_options_be_active> <!-- Delivery options are disabled for Belgium -->
|
995 |
<enable_delivery_days_be>1</enable_delivery_days_be> <!-- Delivery days are allowed for Belgium -->
|
996 |
<allow_sunday_sorting_be>0</allow_sunday_sorting_be> <!-- Sunday sorting is disabled for Belgium -->
|
1004 |
<buspakje_calculation_mode>manual</buspakje_calculation_mode> <!-- Manually determine if a shipment is a buspakje shipment -->
|
1005 |
<create_account_base_url>https://mijnpakket.postnl.nl/Register/RegisterFromWebshop?</create_account_base_url> <!-- Base URl for create MijnPakket account link -->
|
1006 |
<mijnpakket_live_base_url>https://mijnpakket.postnl.nl/</mijnpakket_live_base_url> <!-- Base URL for MijnPakket in live mode -->
|
1007 |
+
<mijnpakket_test_base_url>https://mijnpakket.postnl.nl/</mijnpakket_test_base_url> <!-- Base URL for MijnPakket in test mode -->
|
1008 |
<mijnpakket_login_js_path>Checkout2/Login.js</mijnpakket_login_js_path> <!-- Path to MijnPakket login JS file -->
|
1009 |
<mijnpakket_checkout_premium_js_path>Checkout2/CheckoutPremium.js</mijnpakket_checkout_premium_js_path> <!-- Path to MijnPakket Checkout premium JS file -->
|
1010 |
<mijnpakket_login_btn_live_base_url>checkout.postnl.nl/</mijnpakket_login_btn_live_base_url> <!-- Base URL for MijnPakket login button in live mode -->
|
1011 |
+
<mijnpakket_login_btn_test_base_url>checkout.postnl.nl/</mijnpakket_login_btn_test_base_url> <!-- Base URL for MijnPakket login button in test mode -->
|
1012 |
<mijnpakket_login_btn_url_path>Button/PremiumLogin</mijnpakket_login_btn_url_path> <!-- Path to MijnPakket login button -->
|
1013 |
<default_pakketautomaat_product_option>3553</default_pakketautomaat_product_option> <!-- Parcel dispenser -->
|
1014 |
<default_food_product_option>3083</default_food_product_option> <!-- Food Delivery -->
|
1015 |
<default_cooled_product_option>3084</default_cooled_product_option> <!-- Cooled Food delivery -->
|
1016 |
<ajax_timeout>5</ajax_timeout> <!-- Delivery options AJAX calls will timeout after 5 seconds -->
|
1017 |
</delivery_options>
|
1018 |
+
<delivery_options_int>
|
1019 |
+
<delivery_options_be_active>0</delivery_options_be_active> <!-- Delivery options are disabled for Belgium -->
|
1020 |
+
<delivery_days_number_be>7</delivery_days_number_be> <!-- Show up to 7 delivery days for Belgium -->
|
1021 |
+
<enable_delivery_days_be>1</enable_delivery_days_be> <!-- Delivery days are allowed for Belgium -->
|
1022 |
+
<allow_sunday_sorting_be>0</allow_sunday_sorting_be> <!-- Sunday sorting is disabled for Belgium -->
|
1023 |
+
<delivery_days_number_be>7</delivery_days_number_be> <!-- Show up to 7 delivery days for Belgium -->
|
1024 |
+
<enable_pakjegemak_be>0</enable_pakjegemak_be> <!-- PakjeGemak locations are not allowed for Belgium -->
|
1025 |
+
</delivery_options_int>
|
1026 |
<cif>
|
1027 |
<mode>0</mode> <!-- The extension is disabled by default -->
|
1028 |
<customer_number>11223344</customer_number> <!-- Demo customer number -->
|
1129 |
<agree_conditions>1</agree_conditions> <!-- Customers must first agree to the webshop's terms and conditions -->
|
1130 |
<contact_url/>
|
1131 |
<service_url/>
|
1132 |
+
<checkout_button_test_base_url>https://checkout.postnl.nl/Button/Checkout</checkout_button_test_base_url> <!-- Base URL for PostNl Checkout button in test mode -->
|
1133 |
<checkout_button_live_base_url>https://checkout.postnl.nl/Button/Checkout</checkout_button_live_base_url> <!-- Base URL for PostNl Checkout button -->
|
1134 |
+
<test_checkout_js_url>https://mijnpakket.postnl.nl/Checkout2/Scripts/Checkout.js</test_checkout_js_url> <!-- URL for PostNL Checkout JS file in test mode -->
|
1135 |
<live_checkout_js_url>https://mijnpakket.postnl.nl/Checkout2/Scripts/Checkout.js</live_checkout_js_url> <!-- URL for PostNL Checkout JS file -->
|
1136 |
+
<test_checkout_premium_js_url>https://mijnpakket.postnl.nl/Checkout2/CheckoutPremium.js</test_checkout_premium_js_url> <!-- URL for PostNL Checkout premium JS file in test mode -->
|
1137 |
<live_checkout_premium_js_url>https://mijnpakket.postnl.nl/Checkout2/CheckoutPremium.js</live_checkout_premium_js_url> <!-- URL for PostNL Checkout premium JS file -->
|
1138 |
</checkout>
|
1139 |
<checkout_payment_methods>
|
1178 |
<order_grid_massaction_default>postnl_create_shipments</order_grid_massaction_default> <!-- Select the create shipments mass action by default -->
|
1179 |
<shipping_grid_columns>shipment_type,confirm_date,confirm_status,labels_printed,barcode,shipping_phase</shipping_grid_columns> <!-- Show the shipping description, shipment type, label-printed and shipping phase columns -->
|
1180 |
<shipping_grid_massaction_default>postnl_print_labels_and_confirm</shipping_grid_massaction_default> <!-- 'Print labels and confirm shipment' massaction -->
|
1181 |
+
<supported_product_options>3085,3086,3091,3093,3097,3087,3094,3189,3089,3389,3096,3090,3385,3390,3535,3545,3536,3546,3534,3544,3533,3543,4952,4945,3553,2928,2828,4970,4971,4972,4973,4974,4975,4976,4878,4880,4932,4936,3440,3444,3447,3450,3442,3445,3448,3451,3437,3438,3443,3446,3449,3571,3572,3573,3574,3575,3576,3581,3582,3583,3584,3585,3586</supported_product_options> <!-- all possible options except for EPS BE only -->
|
1182 |
+
<supported_product_options_be>3085,3086,3091,3093,3097,3087,3094,3189,3089,3389,3096,3090,3385,3390,4970,4971,4972,4973,4974,4975,4976,3535,3545,3536,3546,3534,3544,3533,3543,4952,4945,3553,2828,2928,4878,4880,4932,4936</supported_product_options_be> <!-- all possible options for BE -->
|
1183 |
<default_product_option>3085</default_product_option> <!-- standard shipment -->
|
1184 |
<default_product_option_netherlands>3085</default_product_option_netherlands> <!-- standard shipment when use dutch products is enabled and the domestic country is BE -->
|
1185 |
<use_alternative_default>0</use_alternative_default> <!-- Do not use an alternative default -->
|
1187 |
<alternative_default_option>3189</alternative_default_option> <!-- Signature on delivery -->
|
1188 |
<default_evening_product_option>3385</default_evening_product_option> <!-- Deliver to stated address only -->
|
1189 |
<default_pakjegemak_product_option>3544</default_pakjegemak_product_option> <!-- Post Office + Signature on Delivery + Notification -->
|
1190 |
+
<default_pakjegemak_nl_be_product_option>4932</default_pakjegemak_nl_be_product_option> <!-- Post Office (Belgium). Netherlands -> Belgium flow -->
|
1191 |
+
<default_pakjegemak_be_be_product_option>4878</default_pakjegemak_be_be_product_option> <!-- Post Office (Belgium). Belgium -> Belgium flow -->
|
1192 |
+
<default_pakjegemak_be_not_insured_product_option>4936</default_pakjegemak_be_not_insured_product_option> <!-- Post Office (Belgium) -->
|
1193 |
<default_pge_product_option>3544</default_pge_product_option> <!-- Post Office + Signature on Delivery + Notification -->
|
1194 |
<default_buspakje_product_option>2928</default_buspakje_product_option> <!-- Buspakje Extra -->
|
1195 |
<default_stated_address_only_product_option>3385</default_stated_address_only_product_option> <!-- Deliver to stated address only -->
|
1197 |
<default_sameday_product_option>3385</default_sameday_product_option> <!-- Deliver to stated address only -->
|
1198 |
<default_eu_product_option>4952</default_eu_product_option> <!-- EU Pack Special to consumer (combilabel) -->
|
1199 |
<default_eu_be_product_option>4955</default_eu_be_product_option> <!-- EU Pack Standard (Belgium only, no signature) (combilabel) -->
|
1200 |
+
<default_id_check_delivery_product_option>3442</default_id_check_delivery_product_option>
|
1201 |
+
<default_id_check_pickup_product_option>3573</default_id_check_pickup_product_option>
|
1202 |
+
<default_age_check_delivery_product_option>3438</default_age_check_delivery_product_option>
|
1203 |
+
<default_age_check_pickup_product_option>3571</default_age_check_pickup_product_option>
|
1204 |
+
<default_birthday_check_delivery_product_option>3440</default_birthday_check_delivery_product_option>
|
1205 |
+
<default_birthday_check_pickup_product_option>3572</default_birthday_check_pickup_product_option>
|
1206 |
<valid_shipping_duration_days>1,2,3,4,5,6,7</valid_shipping_duration_days> <!-- all days of the week -->
|
1207 |
</grid>
|
1208 |
<cif_product_options>
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -159,4 +159,7 @@
|
|
159 |
<food_delivery_not_possible_postalcode translate="message" module="postnl">
|
160 |
<message>Food products delivery is not possible for this postal code. Please choose a different address.</message>
|
161 |
</food_delivery_not_possible_postalcode>
|
|
|
|
|
|
|
162 |
</jstranslator>
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
159 |
<food_delivery_not_possible_postalcode translate="message" module="postnl">
|
160 |
<message>Food products delivery is not possible for this postal code. Please choose a different address.</message>
|
161 |
</food_delivery_not_possible_postalcode>
|
162 |
+
<please_enter_future_date translate="message" module="postnl">
|
163 |
+
<message>Please enter a date that is in the future.</message>
|
164 |
+
</please_enter_future_date>
|
165 |
</jstranslator>
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -1046,10 +1046,23 @@
|
|
1046 |
<use_sender_address>0</use_sender_address>
|
1047 |
</depends>
|
1048 |
</alternative_sender_region>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
<save_and_continue translate="label" module="postnl">
|
1050 |
<label>Save and continue</label>
|
1051 |
<frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
|
1052 |
-
<sort_order>
|
1053 |
<show_in_default>1</show_in_default>
|
1054 |
<show_in_website>1</show_in_website>
|
1055 |
<show_in_store>1</show_in_store>
|
@@ -2093,13 +2106,55 @@
|
|
2093 |
</country>
|
2094 |
</depends>
|
2095 |
</allow_streetview>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2096 |
<show_options_for_buspakje translate="label tooltip" module="postnl">
|
2097 |
<label>Show PostNL delivery options for letter box parcel orders</label>
|
2098 |
<tooltip>By default delivery options are not shown for shipments sent as a letterbox parcel. If you choose to show delivery options nonetheless, you might be forced to process an order as a regular package even though the package complies with the weight and size of a letterbox parcel.</tooltip>
|
2099 |
<frontend_type>checkbox</frontend_type>
|
2100 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2101 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2102 |
-
<sort_order>
|
2103 |
<show_in_default>1</show_in_default>
|
2104 |
<show_in_website>1</show_in_website>
|
2105 |
<show_in_store>1</show_in_store>
|
@@ -2128,7 +2183,7 @@
|
|
2128 |
<frontend_type>checkbox</frontend_type>
|
2129 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2130 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2131 |
-
<sort_order>
|
2132 |
<show_in_default>1</show_in_default>
|
2133 |
<show_in_website>1</show_in_website>
|
2134 |
<show_in_store>1</show_in_store>
|
@@ -2157,7 +2212,7 @@
|
|
2157 |
<frontend_type>checkbox</frontend_type>
|
2158 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2159 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2160 |
-
<sort_order>
|
2161 |
<show_in_default>1</show_in_default>
|
2162 |
<show_in_website>1</show_in_website>
|
2163 |
<show_in_store>1</show_in_store>
|
@@ -2189,7 +2244,7 @@
|
|
2189 |
<frontend_type>checkbox</frontend_type>
|
2190 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2191 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2192 |
-
<sort_order>
|
2193 |
<show_in_default>1</show_in_default>
|
2194 |
<show_in_website>1</show_in_website>
|
2195 |
<show_in_store>1</show_in_store>
|
@@ -2221,7 +2276,7 @@
|
|
2221 |
<frontend_type>checkbox</frontend_type>
|
2222 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2223 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2224 |
-
<sort_order>
|
2225 |
<show_in_default>1</show_in_default>
|
2226 |
<show_in_website>1</show_in_website>
|
2227 |
<show_in_store>1</show_in_store>
|
@@ -2250,7 +2305,7 @@
|
|
2250 |
<stated_address_header translate="label" module="postnl">
|
2251 |
<label>Only stated address</label>
|
2252 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2253 |
-
<sort_order>
|
2254 |
<show_in_default>1</show_in_default>
|
2255 |
<show_in_website>1</show_in_website>
|
2256 |
<show_in_store>1</show_in_store>
|
@@ -2277,7 +2332,7 @@
|
|
2277 |
<frontend_type>checkbox</frontend_type>
|
2278 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2279 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2280 |
-
<sort_order>
|
2281 |
<show_in_default>1</show_in_default>
|
2282 |
<show_in_website>1</show_in_website>
|
2283 |
<show_in_store>1</show_in_store>
|
@@ -2303,7 +2358,7 @@
|
|
2303 |
<frontend_type>checkbox</frontend_type>
|
2304 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2305 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2306 |
-
<sort_order>
|
2307 |
<show_in_default>1</show_in_default>
|
2308 |
<show_in_website>1</show_in_website>
|
2309 |
<show_in_store>1</show_in_store>
|
@@ -2329,7 +2384,7 @@
|
|
2329 |
<label>Stated address only fee</label>
|
2330 |
<frontend_type>text</frontend_type>
|
2331 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2332 |
-
<sort_order>
|
2333 |
<show_in_default>1</show_in_default>
|
2334 |
<show_in_website>1</show_in_website>
|
2335 |
<show_in_store>1</show_in_store>
|
@@ -2354,7 +2409,7 @@
|
|
2354 |
<premium_delivery_options_header translate="label" module="postnl">
|
2355 |
<label>Delivery options based on contractual agreements</label>
|
2356 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2357 |
-
<sort_order>
|
2358 |
<show_in_default>1</show_in_default>
|
2359 |
<show_in_website>1</show_in_website>
|
2360 |
<show_in_store>1</show_in_store>
|
@@ -2378,7 +2433,7 @@
|
|
2378 |
<premium_delivery_options_info translate="comment" module="postnl">
|
2379 |
<comment>Please note: these delivery options require specific contractual agreements with PostNL. Please contact your PostNL account manager if you wish to use monday, sunday or same day delivery.</comment>
|
2380 |
<frontend_model>postnl_adminhtml/system_config_form_field_infoBox</frontend_model>
|
2381 |
-
<sort_order>
|
2382 |
<show_in_default>1</show_in_default>
|
2383 |
<show_in_website>1</show_in_website>
|
2384 |
<show_in_store>1</show_in_store>
|
@@ -2406,14 +2461,13 @@
|
|
2406 |
<frontend_type>checkbox</frontend_type>
|
2407 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2408 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2409 |
-
<sort_order>
|
2410 |
<show_in_default>1</show_in_default>
|
2411 |
<show_in_website>1</show_in_website>
|
2412 |
<show_in_store>1</show_in_store>
|
2413 |
<depends>
|
2414 |
<delivery_options_active>1</delivery_options_active>
|
2415 |
<enable_delivery_days>1</enable_delivery_days>
|
2416 |
-
<enable_timeframes>1</enable_timeframes>
|
2417 |
<checkout_extension>
|
2418 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2419 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
@@ -2436,14 +2490,13 @@
|
|
2436 |
<frontend_type>checkbox</frontend_type>
|
2437 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2438 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2439 |
-
<sort_order>
|
2440 |
<show_in_default>1</show_in_default>
|
2441 |
<show_in_website>1</show_in_website>
|
2442 |
<show_in_store>1</show_in_store>
|
2443 |
<depends>
|
2444 |
<delivery_options_active>1</delivery_options_active>
|
2445 |
<enable_delivery_days>1</enable_delivery_days>
|
2446 |
-
<enable_timeframes>1</enable_timeframes>
|
2447 |
<checkout_extension>
|
2448 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2449 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
@@ -2464,7 +2517,7 @@
|
|
2464 |
<tooltip>Additional costs for sunday delivery in the store's base currency. This fee will be added to the shipping costs. Leave this field empty to charge no extra fee for sunday delivery.</tooltip>
|
2465 |
<frontend_type>text</frontend_type>
|
2466 |
<backend_model>postnl_deliveryoptions/system_config_backend_validateFee_sundayDeliveryFee</backend_model>
|
2467 |
-
<sort_order>
|
2468 |
<show_in_default>1</show_in_default>
|
2469 |
<show_in_website>1</show_in_website>
|
2470 |
<show_in_store>1</show_in_store>
|
@@ -2495,14 +2548,13 @@
|
|
2495 |
<frontend_type>checkbox</frontend_type>
|
2496 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2497 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2498 |
-
<sort_order>
|
2499 |
<show_in_default>1</show_in_default>
|
2500 |
<show_in_website>1</show_in_website>
|
2501 |
<show_in_store>1</show_in_store>
|
2502 |
<depends>
|
2503 |
<delivery_options_active>1</delivery_options_active>
|
2504 |
<enable_delivery_days>1</enable_delivery_days>
|
2505 |
-
<enable_timeframes>1</enable_timeframes>
|
2506 |
<checkout_extension>
|
2507 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2508 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
@@ -2523,7 +2575,7 @@
|
|
2523 |
<tooltip>Additional costs for same day delivery in the store's base currency. This fee will be added to the shipping costs. Leave this field empty to charge no extra fee for same day delivery.</tooltip>
|
2524 |
<frontend_type>text</frontend_type>
|
2525 |
<backend_model>postnl_deliveryoptions/system_config_backend_validateFee_sameDayDeliveryFee</backend_model>
|
2526 |
-
<sort_order>
|
2527 |
<show_in_default>1</show_in_default>
|
2528 |
<show_in_website>1</show_in_website>
|
2529 |
<show_in_store>1</show_in_store>
|
@@ -2554,7 +2606,7 @@
|
|
2554 |
<frontend_model>postnl_adminhtml/system_config_form_field_hourMinute</frontend_model>
|
2555 |
<source_model>postnl_core/system_config_source_hourMinute</source_model>
|
2556 |
<backend_model>postnl_core/system_config_backend_hourMinute</backend_model>
|
2557 |
-
<sort_order>
|
2558 |
<show_in_default>1</show_in_default>
|
2559 |
<show_in_website>1</show_in_website>
|
2560 |
<show_in_store>1</show_in_store>
|
@@ -2583,6 +2635,7 @@
|
|
2583 |
<backend_model>postnl_adminhtml/system_config_form_foodWarnings</backend_model>
|
2584 |
<show_in_default>1</show_in_default>
|
2585 |
<show_in_store>1</show_in_store>
|
|
|
2586 |
<depends>
|
2587 |
<enable_food_delivery>1</enable_food_delivery>
|
2588 |
<delivery_options_active>1</delivery_options_active>
|
@@ -2595,7 +2648,6 @@
|
|
2595 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2596 |
</country>
|
2597 |
</depends>
|
2598 |
-
<sort_order>370</sort_order>
|
2599 |
</food_delivery_warnings>
|
2600 |
<enable_food_delivery>
|
2601 |
<label>Enable food delivery</label>
|
@@ -2604,7 +2656,7 @@
|
|
2604 |
<frontend_type>checkbox</frontend_type>
|
2605 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2606 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2607 |
-
<sort_order>
|
2608 |
<show_in_default>1</show_in_default>
|
2609 |
<show_in_store>1</show_in_store>
|
2610 |
<depends>
|
@@ -2633,7 +2685,7 @@
|
|
2633 |
<frontend_type>select</frontend_type>
|
2634 |
<backend_model>postnl_core/system_config_backend_productType</backend_model>
|
2635 |
<source_model>postnl_deliveryoptions/product_attribute_source_productType</source_model>
|
2636 |
-
<sort_order>
|
2637 |
<show_in_default>1</show_in_default>
|
2638 |
<show_in_website>1</show_in_website>
|
2639 |
<show_in_store>1</show_in_store>
|
@@ -2650,10 +2702,10 @@
|
|
2650 |
</country>
|
2651 |
</depends>
|
2652 |
</food_delivery_default_product_type>
|
2653 |
-
|
2654 |
-
<label>PostNL
|
2655 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2656 |
-
<sort_order>
|
2657 |
<show_in_default>1</show_in_default>
|
2658 |
<show_in_website>1</show_in_website>
|
2659 |
<show_in_store>1</show_in_store>
|
@@ -2664,147 +2716,134 @@
|
|
2664 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2665 |
<separator>||</separator>
|
2666 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
2667 |
<country>
|
2668 |
<fieldset>cif_address</fieldset>
|
2669 |
-
<
|
2670 |
</country>
|
2671 |
</depends>
|
2672 |
-
</
|
2673 |
-
|
2674 |
-
<label>Enable PostNL
|
|
|
2675 |
<frontend_type>checkbox</frontend_type>
|
2676 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2677 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2678 |
-
<sort_order>
|
2679 |
<show_in_default>1</show_in_default>
|
2680 |
<show_in_website>1</show_in_website>
|
2681 |
<show_in_store>1</show_in_store>
|
2682 |
<depends>
|
|
|
2683 |
<checkout_extension>
|
2684 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2685 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2686 |
<separator>||</separator>
|
2687 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
2688 |
<country>
|
2689 |
<fieldset>cif_address</fieldset>
|
2690 |
-
<
|
2691 |
</country>
|
2692 |
-
<delivery_options_active>1</delivery_options_active>
|
2693 |
</depends>
|
2694 |
-
</
|
2695 |
-
|
2696 |
-
<label>
|
2697 |
-
<tooltip>
|
2698 |
<frontend_type>checkbox</frontend_type>
|
2699 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2700 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2701 |
-
<sort_order>
|
2702 |
<show_in_default>1</show_in_default>
|
2703 |
<show_in_website>1</show_in_website>
|
2704 |
<show_in_store>1</show_in_store>
|
2705 |
<depends>
|
2706 |
<delivery_options_active>1</delivery_options_active>
|
2707 |
-
<delivery_options_be_active>1</delivery_options_be_active>
|
2708 |
<checkout_extension>
|
2709 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2710 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2711 |
<separator>||</separator>
|
2712 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
2713 |
<country>
|
2714 |
<fieldset>cif_address</fieldset>
|
2715 |
-
<
|
2716 |
</country>
|
2717 |
</depends>
|
2718 |
-
</
|
2719 |
-
|
2720 |
-
<label>
|
2721 |
-
<
|
2722 |
-
<tooltip>Activate monday delivery (also known as sunday sorting) for your customers. Note: this only applies to home deliveries. Postal office deliveries will not take place on Monday.</tooltip>
|
2723 |
<frontend_type>checkbox</frontend_type>
|
2724 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2725 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2726 |
-
<sort_order>
|
2727 |
<show_in_default>1</show_in_default>
|
2728 |
<show_in_website>1</show_in_website>
|
2729 |
<show_in_store>1</show_in_store>
|
2730 |
<depends>
|
2731 |
<delivery_options_active>1</delivery_options_active>
|
2732 |
-
<
|
2733 |
-
<enable_delivery_days_be>1</enable_delivery_days_be>
|
2734 |
-
<enable_timeframes>1</enable_timeframes>
|
2735 |
<checkout_extension>
|
2736 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2737 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2738 |
<separator>||</separator>
|
2739 |
</checkout_extension>
|
2740 |
-
<
|
2741 |
-
<fieldset>cif_address</fieldset>
|
2742 |
-
<value>NL</value>
|
2743 |
-
</country>
|
2744 |
-
</depends>
|
2745 |
-
</allow_sunday_sorting_be>
|
2746 |
-
<delivery_days_number_be translate="label tooltip" module="postnl">
|
2747 |
-
<label>Maximum number of delivery days for Belgium</label>
|
2748 |
-
<tooltip>Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.</tooltip>
|
2749 |
-
<frontend_type>select</frontend_type>
|
2750 |
-
<source_model>postnl_deliveryoptions/system_config_source_deliveryDaysNumber</source_model>
|
2751 |
-
<sort_order>440</sort_order>
|
2752 |
-
<show_in_default>1</show_in_default>
|
2753 |
-
<show_in_website>1</show_in_website>
|
2754 |
-
<show_in_store>1</show_in_store>
|
2755 |
-
<depends>
|
2756 |
-
<delivery_options_active>1</delivery_options_active>
|
2757 |
-
<delivery_options_be_active>1</delivery_options_be_active>
|
2758 |
-
<enable_delivery_days_be>1</enable_delivery_days_be>
|
2759 |
-
<checkout_extension>
|
2760 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2761 |
-
<
|
2762 |
-
|
2763 |
-
</checkout_extension>
|
2764 |
<country>
|
2765 |
<fieldset>cif_address</fieldset>
|
2766 |
-
<
|
2767 |
</country>
|
2768 |
</depends>
|
2769 |
-
</
|
2770 |
-
<!--<
|
2771 |
-
<label>
|
2772 |
-
<tooltip>
|
2773 |
<frontend_type>checkbox</frontend_type>
|
2774 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2775 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2776 |
-
<sort_order>
|
2777 |
<show_in_default>1</show_in_default>
|
2778 |
<show_in_website>1</show_in_website>
|
2779 |
<show_in_store>1</show_in_store>
|
2780 |
<depends>
|
2781 |
<delivery_options_active>1</delivery_options_active>
|
2782 |
-
<
|
2783 |
<checkout_extension>
|
2784 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2785 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2786 |
<separator>||</separator>
|
2787 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
2788 |
<country>
|
2789 |
<fieldset>cif_address</fieldset>
|
2790 |
-
<
|
2791 |
</country>
|
2792 |
</depends>
|
2793 |
-
</
|
2794 |
-
<
|
2795 |
-
<label>
|
2796 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2797 |
-
<sort_order>
|
2798 |
<show_in_default>1</show_in_default>
|
2799 |
-
<show_in_website>
|
2800 |
-
<show_in_store>
|
2801 |
<depends>
|
2802 |
-
<delivery_options_active>1</delivery_options_active>
|
2803 |
-
<checkout_extension>
|
2804 |
-
<fieldset>cif_labels_and_confirming</fieldset>
|
2805 |
-
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2806 |
-
<separator>||</separator>
|
2807 |
-
</checkout_extension>
|
2808 |
<use_dutch_products>
|
2809 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2810 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
@@ -2814,24 +2853,40 @@
|
|
2814 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2815 |
</country>
|
2816 |
</depends>
|
2817 |
-
</
|
2818 |
-
<
|
2819 |
-
<label>
|
2820 |
-
<tooltip
|
2821 |
<frontend_type>checkbox</frontend_type>
|
2822 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2823 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2824 |
-
<sort_order>
|
2825 |
<show_in_default>1</show_in_default>
|
2826 |
-
<show_in_website>
|
2827 |
-
<show_in_store>
|
2828 |
<depends>
|
2829 |
-
<
|
2830 |
-
<checkout_extension>
|
2831 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2832 |
-
<
|
2833 |
-
|
2834 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2835 |
<use_dutch_products>
|
2836 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2837 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
@@ -2841,168 +2896,187 @@
|
|
2841 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2842 |
</country>
|
2843 |
</depends>
|
2844 |
-
</
|
2845 |
-
<
|
2846 |
-
<label>
|
2847 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2848 |
<frontend_type>checkbox</frontend_type>
|
2849 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2850 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2851 |
-
<sort_order>
|
2852 |
<show_in_default>1</show_in_default>
|
2853 |
<show_in_website>1</show_in_website>
|
2854 |
<show_in_store>1</show_in_store>
|
2855 |
<depends>
|
2856 |
-
<delivery_options_active>1</delivery_options_active>
|
2857 |
<checkout_extension>
|
2858 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2859 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2860 |
<separator>||</separator>
|
2861 |
</checkout_extension>
|
2862 |
-
<use_dutch_products>
|
2863 |
-
<fieldset>cif_labels_and_confirming</fieldset>
|
2864 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2865 |
-
</use_dutch_products>
|
2866 |
-
<country>
|
2867 |
-
<fieldset>cif_address</fieldset>
|
2868 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2869 |
-
</country>
|
2870 |
</depends>
|
2871 |
-
</
|
2872 |
-
<
|
2873 |
-
<label>
|
2874 |
-
<tooltip>
|
2875 |
<frontend_type>checkbox</frontend_type>
|
2876 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2877 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2878 |
-
<sort_order>
|
2879 |
<show_in_default>1</show_in_default>
|
2880 |
<show_in_website>1</show_in_website>
|
2881 |
<show_in_store>1</show_in_store>
|
2882 |
<depends>
|
2883 |
-
<
|
2884 |
-
<mijnpakket_notification>1</mijnpakket_notification>
|
2885 |
<checkout_extension>
|
2886 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2887 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2888 |
<separator>||</separator>
|
2889 |
</checkout_extension>
|
2890 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2891 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2892 |
-
<
|
2893 |
-
|
2894 |
-
|
2895 |
-
<fieldset>cif_address</fieldset>
|
2896 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2897 |
-
</country>
|
2898 |
</depends>
|
2899 |
-
</
|
2900 |
-
<
|
2901 |
-
<label>
|
2902 |
-
<tooltip>
|
2903 |
<frontend_type>checkbox</frontend_type>
|
2904 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2905 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2906 |
-
<sort_order>
|
2907 |
<show_in_default>1</show_in_default>
|
2908 |
<show_in_website>1</show_in_website>
|
2909 |
<show_in_store>1</show_in_store>
|
2910 |
<depends>
|
2911 |
-
<
|
2912 |
-
<mijnpakket_notification>1</mijnpakket_notification>
|
2913 |
<checkout_extension>
|
2914 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2915 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2916 |
<separator>||</separator>
|
2917 |
</checkout_extension>
|
2918 |
-
<use_dutch_products>
|
2919 |
-
<fieldset>cif_labels_and_confirming</fieldset>
|
2920 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2921 |
-
</use_dutch_products>
|
2922 |
-
<country>
|
2923 |
-
<fieldset>cif_address</fieldset>
|
2924 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2925 |
-
</country>
|
2926 |
</depends>
|
2927 |
-
</
|
2928 |
-
<
|
2929 |
-
<label>
|
2930 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2931 |
-
<sort_order>
|
2932 |
<show_in_default>1</show_in_default>
|
2933 |
-
<show_in_website>
|
2934 |
-
<show_in_store>
|
2935 |
<depends>
|
2936 |
-
<
|
|
|
2937 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2938 |
-
<
|
2939 |
-
|
2940 |
-
|
2941 |
-
<fieldset>cif_address</fieldset>
|
2942 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2943 |
-
</country>
|
2944 |
</depends>
|
2945 |
-
</
|
2946 |
-
<
|
2947 |
-
<
|
2948 |
-
<
|
2949 |
-
<
|
2950 |
-
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2951 |
-
<source_model>postnl/system_config_source_yesno</source_model>
|
2952 |
-
<sort_order>520</sort_order>
|
2953 |
<show_in_default>1</show_in_default>
|
2954 |
-
<show_in_website>
|
2955 |
-
<show_in_store>
|
2956 |
<depends>
|
2957 |
-
<
|
|
|
2958 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2959 |
-
<
|
2960 |
-
|
2961 |
-
|
2962 |
-
<fieldset>cif_address</fieldset>
|
2963 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2964 |
-
</country>
|
2965 |
</depends>
|
2966 |
-
</
|
2967 |
-
<
|
2968 |
-
<label>
|
2969 |
-
<comment><![CDATA[You can read more about
|
2970 |
-
<tooltip>
|
2971 |
-
<frontend_type>
|
2972 |
-
<
|
2973 |
-
<
|
|
|
2974 |
<show_in_default>1</show_in_default>
|
2975 |
-
<show_in_website>
|
2976 |
-
<show_in_store>
|
2977 |
<depends>
|
2978 |
-
<
|
2979 |
-
<
|
|
|
2980 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2981 |
-
<
|
2982 |
-
|
2983 |
-
|
2984 |
-
<fieldset>cif_address</fieldset>
|
2985 |
-
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2986 |
-
</country>
|
2987 |
</depends>
|
2988 |
-
</
|
2989 |
<save_and_continue translate="label" module="postnl">
|
2990 |
<label>Save and continue</label>
|
2991 |
<frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
|
2992 |
-
<sort_order>
|
2993 |
<show_in_default>1</show_in_default>
|
2994 |
<show_in_website>1</show_in_website>
|
2995 |
<show_in_store>1</show_in_store>
|
2996 |
<next_step_rel>postnl_cif</next_step_rel>
|
2997 |
</save_and_continue>
|
2998 |
</fields>
|
2999 |
-
</
|
3000 |
<cif translate="label comment" module="postnl">
|
3001 |
<label>Account Settings</label>
|
3002 |
<comment><![CDATA[Here you can configure your PostNL account.</p><p>In order to use this extension you need to <a href='http://www.postnl.nl/zakelijk/e-commerce/flexibele-bezorgopties' target='_blank' title='Register'>register</a> yourself with PostNL. You will then receive all necessary information in order to configure the extension. If you cannot find the email containing this information, please contact your PostNL account manager.</p><p>If you want to test the extension, but don't have any test mode credentials you can use the account credentials found <a href="http://kb.tig.nl/topic/55404467" title="Test mode account credentials" target="_blank">here</a>.]]></comment>
|
3003 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3004 |
<frontend_class>postnl-wizard</frontend_class>
|
3005 |
-
<sort_order>
|
3006 |
<show_in_default>1</show_in_default>
|
3007 |
<show_in_website>1</show_in_website>
|
3008 |
<show_in_store>1</show_in_store>
|
@@ -3116,7 +3190,8 @@
|
|
3116 |
<show_in_store>0</show_in_store>
|
3117 |
<validate>validate-digits validate-length minimum-length-6 maximum-length-6 postnl-validate-empty</validate>
|
3118 |
</collection_location>
|
3119 |
-
|
|
|
3120 |
<label>Webshop ID</label>
|
3121 |
<frontend_type>obscure</frontend_type>
|
3122 |
<frontend_model>postnl_adminhtml/system_config_form_field_obscure</frontend_model>
|
@@ -3134,7 +3209,7 @@
|
|
3134 |
<show_in_default>1</show_in_default>
|
3135 |
<show_in_website>1</show_in_website>
|
3136 |
<show_in_store>0</show_in_store>
|
3137 |
-
</public_webshop_id
|
3138 |
<dutch_customer_number translate="label tooltip" module="postnl">
|
3139 |
<label>Customer Number used for shipments to the Netherlands</label>
|
3140 |
<frontend_type>text</frontend_type>
|
@@ -3204,7 +3279,7 @@
|
|
3204 |
<label>Label, Packing Slip and Weight Settings</label>
|
3205 |
<comment>Here you decide which information you would like to show on shipping labels and packing slips. The weight unit and the maximum weight of a package are also configured from here.</comment>
|
3206 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3207 |
-
<sort_order>
|
3208 |
<show_in_default>1</show_in_default>
|
3209 |
<show_in_website>1</show_in_website>
|
3210 |
<show_in_store>1</show_in_store>
|
@@ -3474,7 +3549,7 @@
|
|
3474 |
<label>Track & Trace</label>
|
3475 |
<comment>You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.</comment>
|
3476 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3477 |
-
<sort_order>
|
3478 |
<show_in_default>1</show_in_default>
|
3479 |
<show_in_website>1</show_in_website>
|
3480 |
<show_in_store>1</show_in_store>
|
@@ -3549,7 +3624,7 @@
|
|
3549 |
<returns translate="label comment" module="postnl">
|
3550 |
<label>Returns</label>
|
3551 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3552 |
-
<sort_order>
|
3553 |
<show_in_default>1</show_in_default>
|
3554 |
<show_in_website>1</show_in_website>
|
3555 |
<show_in_store>1</show_in_store>
|
@@ -3750,7 +3825,7 @@
|
|
3750 |
</params>
|
3751 |
</comment_url>
|
3752 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3753 |
-
<sort_order>
|
3754 |
<show_in_default>1</show_in_default>
|
3755 |
<show_in_website>1</show_in_website>
|
3756 |
<show_in_store>0</show_in_store>
|
@@ -3888,7 +3963,7 @@
|
|
3888 |
<label>Worldwide Shipping</label>
|
3889 |
<comment>Are you planning to ship outside of the EU? Activate GlobalPack with the details you have received from PostNL. You can ignore the GlobalPack settings for domestic shipping and shipping within the EU.</comment>
|
3890 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3891 |
-
<sort_order>
|
3892 |
<show_in_default>1</show_in_default>
|
3893 |
<show_in_website>1</show_in_website>
|
3894 |
<show_in_store>0</show_in_store>
|
@@ -4094,11 +4169,11 @@
|
|
4094 |
</product_sorting_direction>
|
4095 |
</fields>
|
4096 |
</cif_globalpack_settings>
|
4097 |
-
|
4098 |
<label>PostNL Checkout Settings</label>
|
4099 |
<comment><![CDATA[PostNL Checkout is a method alongside your own order process that allows your customers to choose where, when and how to receive their order. Please note: Use the Delivery Options to configure the PostNL settings in your own checkout. Use the settings below to configure the settings for the PostNL Checkout.<br/><br/>Does the PostNL Checkout button stay gray? Click <a href="http://kb.tig.nl/topic/39102986" target="_blank">here</a> for possible causes and solutions.]]></comment>
|
4100 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
4101 |
-
<sort_order>
|
4102 |
<show_in_default>1</show_in_default>
|
4103 |
<show_in_website>1</show_in_website>
|
4104 |
<show_in_store>1</show_in_store>
|
@@ -4391,12 +4466,12 @@
|
|
4391 |
</depends>
|
4392 |
</service_url>
|
4393 |
</fields>
|
4394 |
-
</checkout
|
4395 |
-
|
4396 |
<label>PostNL Checkout Payment Settings</label>
|
4397 |
<comment>This is where you specify which payment options will be presented to your customers in PostNL Checkout. At least one of these must be activated for PostNL Checkout to work.</comment>
|
4398 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
4399 |
-
<sort_order>
|
4400 |
<show_in_default>1</show_in_default>
|
4401 |
<show_in_website>1</show_in_website>
|
4402 |
<show_in_store>1</show_in_store>
|
@@ -4441,7 +4516,7 @@
|
|
4441 |
</country>
|
4442 |
</depends>
|
4443 |
</postnl_checkout_inactive_header>
|
4444 |
-
|
4445 |
<ideal_header translate="label" module="postnl">
|
4446 |
<label>iDEAL</label>
|
4447 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4508,7 +4583,7 @@
|
|
4508 |
</show_summary_page>
|
4509 |
</depends>
|
4510 |
</ideal_option_field>
|
4511 |
-
|
4512 |
<creditcard_header translate="label" module="postnl">
|
4513 |
<label>Credit Card</label>
|
4514 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4575,7 +4650,7 @@
|
|
4575 |
</show_summary_page>
|
4576 |
</depends>
|
4577 |
</creditcard_option_field>
|
4578 |
-
|
4579 |
<creckpay_header translate="label" module="postnl">
|
4580 |
<label>Checkpay</label>
|
4581 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4622,7 +4697,7 @@
|
|
4622 |
</active>
|
4623 |
</depends>
|
4624 |
</checkpay_method>
|
4625 |
-
|
4626 |
<paypal_header translate="label" module="postnl">
|
4627 |
<label>PayPal</label>
|
4628 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4669,7 +4744,7 @@
|
|
4669 |
</active>
|
4670 |
</depends>
|
4671 |
</paypal_method>
|
4672 |
-
|
4673 |
<directdebit_header translate="label" module="postnl">
|
4674 |
<label>Direct Debit</label>
|
4675 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4716,7 +4791,7 @@
|
|
4716 |
</active>
|
4717 |
</depends>
|
4718 |
</directdebit_method>
|
4719 |
-
|
4720 |
<acceptgiro_header translate="label" module="postnl">
|
4721 |
<label>Acceptgiro</label>
|
4722 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4763,7 +4838,7 @@
|
|
4763 |
</active>
|
4764 |
</depends>
|
4765 |
</acceptgiro_method>
|
4766 |
-
|
4767 |
<vooraf_betalen_header translate="label" module="postnl">
|
4768 |
<label>Vooraf Betalen</label>
|
4769 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4810,7 +4885,7 @@
|
|
4810 |
</active>
|
4811 |
</depends>
|
4812 |
</vooraf_betalen_method>
|
4813 |
-
|
4814 |
<termijnen_header translate="label" module="postnl">
|
4815 |
<label>Betaling in Termijnen</label>
|
4816 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4857,7 +4932,7 @@
|
|
4857 |
</active>
|
4858 |
</depends>
|
4859 |
</termijnen_method>
|
4860 |
-
|
4861 |
<giftcard_header translate="label" module="postnl">
|
4862 |
<label>Giftcard</label>
|
4863 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4904,7 +4979,7 @@
|
|
4904 |
</active>
|
4905 |
</depends>
|
4906 |
</giftcard_method>
|
4907 |
-
|
4908 |
<rabobank_internetkassa_header translate="label" module="postnl">
|
4909 |
<label>Rabobank Internetkassa</label>
|
4910 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4951,7 +5026,7 @@
|
|
4951 |
</active>
|
4952 |
</depends>
|
4953 |
</rabobank_internetkassa_method>
|
4954 |
-
|
4955 |
<afterpay_header translate="label" module="postnl">
|
4956 |
<label>AfterPay</label>
|
4957 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -4998,7 +5073,7 @@
|
|
4998 |
</active>
|
4999 |
</depends>
|
5000 |
</afterpay_method>
|
5001 |
-
|
5002 |
<klarna_header translate="label" module="postnl">
|
5003 |
<label>Klarna</label>
|
5004 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
@@ -5046,12 +5121,12 @@
|
|
5046 |
</depends>
|
5047 |
</klarna_method>
|
5048 |
</fields>
|
5049 |
-
</checkout_payment_methods
|
5050 |
<parcelware_export translate="label comment" module="postnl">
|
5051 |
<label>Parcelware Settings</label>
|
5052 |
<comment><![CDATA[This is where you can configure your Parcelware export. You can find more information about configuring these settings <a href="http://kb.tig.nl/topic/94906903" target="_blank" title="More info">here</a>.]]></comment>
|
5053 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5054 |
-
<sort_order>
|
5055 |
<show_in_default>1</show_in_default>
|
5056 |
<show_in_website>1</show_in_website>
|
5057 |
<show_in_store>1</show_in_store>
|
@@ -5141,7 +5216,7 @@
|
|
5141 |
<label>User Settings</label>
|
5142 |
<comment>From this menu you can add columns containing PostNL specific information to the orders and shipments grid. Here you can also define default values for actions.</comment>
|
5143 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5144 |
-
<sort_order>
|
5145 |
<show_in_default>1</show_in_default>
|
5146 |
<show_in_website>0</show_in_website>
|
5147 |
<show_in_store>0</show_in_store>
|
@@ -5388,6 +5463,162 @@
|
|
5388 |
</country>
|
5389 |
</depends>
|
5390 |
</default_sunday_product_option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5391 |
<default_sameday_product_option translate="label tooltip" module="postnl">
|
5392 |
<label>Default same day delivery shipping option</label>
|
5393 |
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
@@ -5395,7 +5626,7 @@
|
|
5395 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5396 |
<source_model>postnl_core/system_config_source_standardProductOptions::getAvailableSameDayOptions</source_model>
|
5397 |
<multidimensional>true</multidimensional>
|
5398 |
-
<sort_order>
|
5399 |
<show_in_default>1</show_in_default>
|
5400 |
<show_in_website>0</show_in_website>
|
5401 |
<show_in_store>0</show_in_store>
|
@@ -5425,7 +5656,7 @@
|
|
5425 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5426 |
<source_model>postnl_core/system_config_source_pakjeGemakProductOptions::getAvailableOptions</source_model>
|
5427 |
<multidimensional>true</multidimensional>
|
5428 |
-
<sort_order>
|
5429 |
<show_in_default>1</show_in_default>
|
5430 |
<show_in_website>0</show_in_website>
|
5431 |
<show_in_store>0</show_in_store>
|
@@ -5451,7 +5682,7 @@
|
|
5451 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5452 |
<source_model>postnl_core/system_config_source_pakjeGemakProductOptions::getAvailablePgeOptions</source_model>
|
5453 |
<multidimensional>true</multidimensional>
|
5454 |
-
<sort_order>
|
5455 |
<show_in_default>1</show_in_default>
|
5456 |
<show_in_website>0</show_in_website>
|
5457 |
<show_in_store>0</show_in_store>
|
@@ -5481,7 +5712,7 @@
|
|
5481 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5482 |
<source_model>postnl_core/system_config_source_buspakjeProductOptions::getAvailableOptions</source_model>
|
5483 |
<multidimensional>true</multidimensional>
|
5484 |
-
<sort_order>
|
5485 |
<show_in_default>1</show_in_default>
|
5486 |
<show_in_website>0</show_in_website>
|
5487 |
<show_in_store>0</show_in_store>
|
@@ -5503,7 +5734,7 @@
|
|
5503 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5504 |
<source_model>postnl_core/system_config_source_standardProductOptions::getAvailableStatedAddressOnlyOptions</source_model>
|
5505 |
<multidimensional>true</multidimensional>
|
5506 |
-
<sort_order>
|
5507 |
<show_in_default>1</show_in_default>
|
5508 |
<show_in_website>0</show_in_website>
|
5509 |
<show_in_store>0</show_in_store>
|
@@ -5535,7 +5766,7 @@
|
|
5535 |
<label>Technical Settings</label>
|
5536 |
<comment>These settings are intended for advanced users only! If you're not 100% sure what you're doing, please do not touch these settings.</comment>
|
5537 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5538 |
-
<sort_order>
|
5539 |
<show_in_default>1</show_in_default>
|
5540 |
<show_in_website>0</show_in_website>
|
5541 |
<show_in_store>0</show_in_store>
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
1046 |
<use_sender_address>0</use_sender_address>
|
1047 |
</depends>
|
1048 |
</alternative_sender_region>
|
1049 |
+
<alternative_sender_country translate="label" module="postnl">
|
1050 |
+
<label>Country</label>
|
1051 |
+
<frontend_type>select</frontend_type>
|
1052 |
+
<source_model>postnl_core/system_config_source_senderCountry</source_model>
|
1053 |
+
<backend_model>postnl_core/system_config_backend_senderCountry</backend_model>
|
1054 |
+
<sort_order>380</sort_order>
|
1055 |
+
<show_in_default>1</show_in_default>
|
1056 |
+
<show_in_website>1</show_in_website>
|
1057 |
+
<show_in_store>1</show_in_store>
|
1058 |
+
<depends>
|
1059 |
+
<use_sender_address>0</use_sender_address>
|
1060 |
+
</depends>
|
1061 |
+
</alternative_sender_country>
|
1062 |
<save_and_continue translate="label" module="postnl">
|
1063 |
<label>Save and continue</label>
|
1064 |
<frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
|
1065 |
+
<sort_order>390</sort_order>
|
1066 |
<show_in_default>1</show_in_default>
|
1067 |
<show_in_website>1</show_in_website>
|
1068 |
<show_in_store>1</show_in_store>
|
2106 |
</country>
|
2107 |
</depends>
|
2108 |
</allow_streetview>
|
2109 |
+
<enable_id_check_delivery>
|
2110 |
+
<label>Enable ID check delivery (based on ID-number)</label>
|
2111 |
+
<comment>With this product person verification is done based on the ID document number.</comment>
|
2112 |
+
<tooltip>Activate ID check delivery, if you have some product(s) were identification or age control is required, it is possible to let the deliverer check the ID at the door.</tooltip>
|
2113 |
+
<frontend_type>checkbox</frontend_type>
|
2114 |
+
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2115 |
+
<source_model>postnl/system_config_source_yesno</source_model>
|
2116 |
+
<sort_order>200</sort_order>
|
2117 |
+
<show_in_default>1</show_in_default>
|
2118 |
+
<show_in_store>1</show_in_store>
|
2119 |
+
<depends>
|
2120 |
+
<delivery_options_active>1</delivery_options_active>
|
2121 |
+
</depends>
|
2122 |
+
</enable_id_check_delivery>
|
2123 |
+
<enable_birthday_check_delivery>
|
2124 |
+
<label>Enable ID check delivery (based on date of birth)</label>
|
2125 |
+
<comment>With this product person verification is done based on date of birth.</comment>
|
2126 |
+
<tooltip>Activate ID check delivery, if you have some product(s) were identification or age control is required, it is possible to let the deliverer check the ID at the door.</tooltip>
|
2127 |
+
<frontend_type>checkbox</frontend_type>
|
2128 |
+
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2129 |
+
<source_model>postnl/system_config_source_yesno</source_model>
|
2130 |
+
<sort_order>210</sort_order>
|
2131 |
+
<show_in_default>1</show_in_default>
|
2132 |
+
<show_in_store>1</show_in_store>
|
2133 |
+
<depends>
|
2134 |
+
<delivery_options_active>1</delivery_options_active>
|
2135 |
+
</depends>
|
2136 |
+
</enable_birthday_check_delivery>
|
2137 |
+
<enable_age_check_delivery>
|
2138 |
+
<label>Enable Age check delivery</label>
|
2139 |
+
<comment>With this product is checked whether a person is older than 18 years.</comment>
|
2140 |
+
<tooltip>Activate ID check delivery, if you have some product(s) were identification or age control is required, it is possible to let the deliverer check the ID at the door.</tooltip>
|
2141 |
+
<frontend_type>checkbox</frontend_type>
|
2142 |
+
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2143 |
+
<source_model>postnl/system_config_source_yesno</source_model>
|
2144 |
+
<sort_order>220</sort_order>
|
2145 |
+
<show_in_default>1</show_in_default>
|
2146 |
+
<show_in_store>1</show_in_store>
|
2147 |
+
<depends>
|
2148 |
+
<delivery_options_active>1</delivery_options_active>
|
2149 |
+
</depends>
|
2150 |
+
</enable_age_check_delivery>
|
2151 |
<show_options_for_buspakje translate="label tooltip" module="postnl">
|
2152 |
<label>Show PostNL delivery options for letter box parcel orders</label>
|
2153 |
<tooltip>By default delivery options are not shown for shipments sent as a letterbox parcel. If you choose to show delivery options nonetheless, you might be forced to process an order as a regular package even though the package complies with the weight and size of a letterbox parcel.</tooltip>
|
2154 |
<frontend_type>checkbox</frontend_type>
|
2155 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2156 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2157 |
+
<sort_order>230</sort_order>
|
2158 |
<show_in_default>1</show_in_default>
|
2159 |
<show_in_website>1</show_in_website>
|
2160 |
<show_in_store>1</show_in_store>
|
2183 |
<frontend_type>checkbox</frontend_type>
|
2184 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2185 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2186 |
+
<sort_order>240</sort_order>
|
2187 |
<show_in_default>1</show_in_default>
|
2188 |
<show_in_website>1</show_in_website>
|
2189 |
<show_in_store>1</show_in_store>
|
2212 |
<frontend_type>checkbox</frontend_type>
|
2213 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2214 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2215 |
+
<sort_order>250</sort_order>
|
2216 |
<show_in_default>1</show_in_default>
|
2217 |
<show_in_website>1</show_in_website>
|
2218 |
<show_in_store>1</show_in_store>
|
2244 |
<frontend_type>checkbox</frontend_type>
|
2245 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2246 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2247 |
+
<sort_order>260</sort_order>
|
2248 |
<show_in_default>1</show_in_default>
|
2249 |
<show_in_website>1</show_in_website>
|
2250 |
<show_in_store>1</show_in_store>
|
2276 |
<frontend_type>checkbox</frontend_type>
|
2277 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2278 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2279 |
+
<sort_order>270</sort_order>
|
2280 |
<show_in_default>1</show_in_default>
|
2281 |
<show_in_website>1</show_in_website>
|
2282 |
<show_in_store>1</show_in_store>
|
2305 |
<stated_address_header translate="label" module="postnl">
|
2306 |
<label>Only stated address</label>
|
2307 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2308 |
+
<sort_order>280</sort_order>
|
2309 |
<show_in_default>1</show_in_default>
|
2310 |
<show_in_website>1</show_in_website>
|
2311 |
<show_in_store>1</show_in_store>
|
2332 |
<frontend_type>checkbox</frontend_type>
|
2333 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2334 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2335 |
+
<sort_order>290</sort_order>
|
2336 |
<show_in_default>1</show_in_default>
|
2337 |
<show_in_website>1</show_in_website>
|
2338 |
<show_in_store>1</show_in_store>
|
2358 |
<frontend_type>checkbox</frontend_type>
|
2359 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2360 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2361 |
+
<sort_order>300</sort_order>
|
2362 |
<show_in_default>1</show_in_default>
|
2363 |
<show_in_website>1</show_in_website>
|
2364 |
<show_in_store>1</show_in_store>
|
2384 |
<label>Stated address only fee</label>
|
2385 |
<frontend_type>text</frontend_type>
|
2386 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2387 |
+
<sort_order>310</sort_order>
|
2388 |
<show_in_default>1</show_in_default>
|
2389 |
<show_in_website>1</show_in_website>
|
2390 |
<show_in_store>1</show_in_store>
|
2409 |
<premium_delivery_options_header translate="label" module="postnl">
|
2410 |
<label>Delivery options based on contractual agreements</label>
|
2411 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2412 |
+
<sort_order>320</sort_order>
|
2413 |
<show_in_default>1</show_in_default>
|
2414 |
<show_in_website>1</show_in_website>
|
2415 |
<show_in_store>1</show_in_store>
|
2433 |
<premium_delivery_options_info translate="comment" module="postnl">
|
2434 |
<comment>Please note: these delivery options require specific contractual agreements with PostNL. Please contact your PostNL account manager if you wish to use monday, sunday or same day delivery.</comment>
|
2435 |
<frontend_model>postnl_adminhtml/system_config_form_field_infoBox</frontend_model>
|
2436 |
+
<sort_order>330</sort_order>
|
2437 |
<show_in_default>1</show_in_default>
|
2438 |
<show_in_website>1</show_in_website>
|
2439 |
<show_in_store>1</show_in_store>
|
2461 |
<frontend_type>checkbox</frontend_type>
|
2462 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2463 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2464 |
+
<sort_order>340</sort_order>
|
2465 |
<show_in_default>1</show_in_default>
|
2466 |
<show_in_website>1</show_in_website>
|
2467 |
<show_in_store>1</show_in_store>
|
2468 |
<depends>
|
2469 |
<delivery_options_active>1</delivery_options_active>
|
2470 |
<enable_delivery_days>1</enable_delivery_days>
|
|
|
2471 |
<checkout_extension>
|
2472 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2473 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2490 |
<frontend_type>checkbox</frontend_type>
|
2491 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2492 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2493 |
+
<sort_order>350</sort_order>
|
2494 |
<show_in_default>1</show_in_default>
|
2495 |
<show_in_website>1</show_in_website>
|
2496 |
<show_in_store>1</show_in_store>
|
2497 |
<depends>
|
2498 |
<delivery_options_active>1</delivery_options_active>
|
2499 |
<enable_delivery_days>1</enable_delivery_days>
|
|
|
2500 |
<checkout_extension>
|
2501 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2502 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2517 |
<tooltip>Additional costs for sunday delivery in the store's base currency. This fee will be added to the shipping costs. Leave this field empty to charge no extra fee for sunday delivery.</tooltip>
|
2518 |
<frontend_type>text</frontend_type>
|
2519 |
<backend_model>postnl_deliveryoptions/system_config_backend_validateFee_sundayDeliveryFee</backend_model>
|
2520 |
+
<sort_order>360</sort_order>
|
2521 |
<show_in_default>1</show_in_default>
|
2522 |
<show_in_website>1</show_in_website>
|
2523 |
<show_in_store>1</show_in_store>
|
2548 |
<frontend_type>checkbox</frontend_type>
|
2549 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2550 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2551 |
+
<sort_order>370</sort_order>
|
2552 |
<show_in_default>1</show_in_default>
|
2553 |
<show_in_website>1</show_in_website>
|
2554 |
<show_in_store>1</show_in_store>
|
2555 |
<depends>
|
2556 |
<delivery_options_active>1</delivery_options_active>
|
2557 |
<enable_delivery_days>1</enable_delivery_days>
|
|
|
2558 |
<checkout_extension>
|
2559 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2560 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2575 |
<tooltip>Additional costs for same day delivery in the store's base currency. This fee will be added to the shipping costs. Leave this field empty to charge no extra fee for same day delivery.</tooltip>
|
2576 |
<frontend_type>text</frontend_type>
|
2577 |
<backend_model>postnl_deliveryoptions/system_config_backend_validateFee_sameDayDeliveryFee</backend_model>
|
2578 |
+
<sort_order>380</sort_order>
|
2579 |
<show_in_default>1</show_in_default>
|
2580 |
<show_in_website>1</show_in_website>
|
2581 |
<show_in_store>1</show_in_store>
|
2606 |
<frontend_model>postnl_adminhtml/system_config_form_field_hourMinute</frontend_model>
|
2607 |
<source_model>postnl_core/system_config_source_hourMinute</source_model>
|
2608 |
<backend_model>postnl_core/system_config_backend_hourMinute</backend_model>
|
2609 |
+
<sort_order>390</sort_order>
|
2610 |
<show_in_default>1</show_in_default>
|
2611 |
<show_in_website>1</show_in_website>
|
2612 |
<show_in_store>1</show_in_store>
|
2635 |
<backend_model>postnl_adminhtml/system_config_form_foodWarnings</backend_model>
|
2636 |
<show_in_default>1</show_in_default>
|
2637 |
<show_in_store>1</show_in_store>
|
2638 |
+
<sort_order>400</sort_order>
|
2639 |
<depends>
|
2640 |
<enable_food_delivery>1</enable_food_delivery>
|
2641 |
<delivery_options_active>1</delivery_options_active>
|
2648 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2649 |
</country>
|
2650 |
</depends>
|
|
|
2651 |
</food_delivery_warnings>
|
2652 |
<enable_food_delivery>
|
2653 |
<label>Enable food delivery</label>
|
2656 |
<frontend_type>checkbox</frontend_type>
|
2657 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2658 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2659 |
+
<sort_order>410</sort_order>
|
2660 |
<show_in_default>1</show_in_default>
|
2661 |
<show_in_store>1</show_in_store>
|
2662 |
<depends>
|
2685 |
<frontend_type>select</frontend_type>
|
2686 |
<backend_model>postnl_core/system_config_backend_productType</backend_model>
|
2687 |
<source_model>postnl_deliveryoptions/product_attribute_source_productType</source_model>
|
2688 |
+
<sort_order>420</sort_order>
|
2689 |
<show_in_default>1</show_in_default>
|
2690 |
<show_in_website>1</show_in_website>
|
2691 |
<show_in_store>1</show_in_store>
|
2702 |
</country>
|
2703 |
</depends>
|
2704 |
</food_delivery_default_product_type>
|
2705 |
+
<!--<mijnpakket_header translate="label" module="postnl">
|
2706 |
+
<label>PostNL account</label>
|
2707 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2708 |
+
<sort_order>500</sort_order>
|
2709 |
<show_in_default>1</show_in_default>
|
2710 |
<show_in_website>1</show_in_website>
|
2711 |
<show_in_store>1</show_in_store>
|
2716 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2717 |
<separator>||</separator>
|
2718 |
</checkout_extension>
|
2719 |
+
<use_dutch_products>
|
2720 |
+
<fieldset>cif_labels_and_confirming</fieldset>
|
2721 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2722 |
+
</use_dutch_products>
|
2723 |
<country>
|
2724 |
<fieldset>cif_address</fieldset>
|
2725 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2726 |
</country>
|
2727 |
</depends>
|
2728 |
+
</mijnpakket_header>-->
|
2729 |
+
<!--<mijnpakket_login_active translate="label tooltip" module="postnl">
|
2730 |
+
<label>Enable PostNL account login</label>
|
2731 |
+
<tooltip>PostNL account login will only be available to customers who have a PostNL account. This will be automatically detected.</tooltip>
|
2732 |
<frontend_type>checkbox</frontend_type>
|
2733 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2734 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2735 |
+
<sort_order>510</sort_order>
|
2736 |
<show_in_default>1</show_in_default>
|
2737 |
<show_in_website>1</show_in_website>
|
2738 |
<show_in_store>1</show_in_store>
|
2739 |
<depends>
|
2740 |
+
<delivery_options_active>1</delivery_options_active>
|
2741 |
<checkout_extension>
|
2742 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2743 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2744 |
<separator>||</separator>
|
2745 |
</checkout_extension>
|
2746 |
+
<use_dutch_products>
|
2747 |
+
<fieldset>cif_labels_and_confirming</fieldset>
|
2748 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2749 |
+
</use_dutch_products>
|
2750 |
<country>
|
2751 |
<fieldset>cif_address</fieldset>
|
2752 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2753 |
</country>
|
|
|
2754 |
</depends>
|
2755 |
+
</mijnpakket_login_active>-->
|
2756 |
+
<!--<mijnpakket_notification translate="label tooltip" module="postnl">
|
2757 |
+
<label>Show PostNL account notification on the order success page</label>
|
2758 |
+
<tooltip>This will cause a notification to be shown to customers after they have placed their order. The message may either inform the customer about PostNL accounts or the PostNL app.</tooltip>
|
2759 |
<frontend_type>checkbox</frontend_type>
|
2760 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2761 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2762 |
+
<sort_order>520</sort_order>
|
2763 |
<show_in_default>1</show_in_default>
|
2764 |
<show_in_website>1</show_in_website>
|
2765 |
<show_in_store>1</show_in_store>
|
2766 |
<depends>
|
2767 |
<delivery_options_active>1</delivery_options_active>
|
|
|
2768 |
<checkout_extension>
|
2769 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2770 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2771 |
<separator>||</separator>
|
2772 |
</checkout_extension>
|
2773 |
+
<use_dutch_products>
|
2774 |
+
<fieldset>cif_labels_and_confirming</fieldset>
|
2775 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2776 |
+
</use_dutch_products>
|
2777 |
<country>
|
2778 |
<fieldset>cif_address</fieldset>
|
2779 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2780 |
</country>
|
2781 |
</depends>
|
2782 |
+
</mijnpakket_notification>-->
|
2783 |
+
<!--<show_create_mijnpakket_account_link translate="label tooltip" module="postnl">
|
2784 |
+
<label>Show create PostNL account link</label>
|
2785 |
+
<tooltip>If enabled, customers who do not yet have a PostNL account will be shown a link through which they can create a PostNL account without having to fully fill in the registration form.</tooltip>
|
|
|
2786 |
<frontend_type>checkbox</frontend_type>
|
2787 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2788 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2789 |
+
<sort_order>530</sort_order>
|
2790 |
<show_in_default>1</show_in_default>
|
2791 |
<show_in_website>1</show_in_website>
|
2792 |
<show_in_store>1</show_in_store>
|
2793 |
<depends>
|
2794 |
<delivery_options_active>1</delivery_options_active>
|
2795 |
+
<mijnpakket_notification>1</mijnpakket_notification>
|
|
|
|
|
2796 |
<checkout_extension>
|
2797 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2798 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2799 |
<separator>||</separator>
|
2800 |
</checkout_extension>
|
2801 |
+
<use_dutch_products>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2802 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2803 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2804 |
+
</use_dutch_products>
|
|
|
2805 |
<country>
|
2806 |
<fieldset>cif_address</fieldset>
|
2807 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2808 |
</country>
|
2809 |
</depends>
|
2810 |
+
</show_create_mijnpakket_account_link>-->
|
2811 |
+
<!--<show_mijnpakket_app_link translate="label tooltip" module="postnl">
|
2812 |
+
<label>Show PostNL app link</label>
|
2813 |
+
<tooltip>If enabled, customers who already have a PostNL account will be informed about the PostNL app with which they can easily track their order.</tooltip>
|
2814 |
<frontend_type>checkbox</frontend_type>
|
2815 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2816 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2817 |
+
<sort_order>540</sort_order>
|
2818 |
<show_in_default>1</show_in_default>
|
2819 |
<show_in_website>1</show_in_website>
|
2820 |
<show_in_store>1</show_in_store>
|
2821 |
<depends>
|
2822 |
<delivery_options_active>1</delivery_options_active>
|
2823 |
+
<mijnpakket_notification>1</mijnpakket_notification>
|
2824 |
<checkout_extension>
|
2825 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2826 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2827 |
<separator>||</separator>
|
2828 |
</checkout_extension>
|
2829 |
+
<use_dutch_products>
|
2830 |
+
<fieldset>cif_labels_and_confirming</fieldset>
|
2831 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2832 |
+
</use_dutch_products>
|
2833 |
<country>
|
2834 |
<fieldset>cif_address</fieldset>
|
2835 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2836 |
</country>
|
2837 |
</depends>
|
2838 |
+
</show_mijnpakket_app_link>-->
|
2839 |
+
<buspakje_header translate="label" module="postnl">
|
2840 |
+
<label>Letter box parcels</label>
|
2841 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2842 |
+
<sort_order>550</sort_order>
|
2843 |
<show_in_default>1</show_in_default>
|
2844 |
+
<show_in_website>0</show_in_website>
|
2845 |
+
<show_in_store>0</show_in_store>
|
2846 |
<depends>
|
|
|
|
|
|
|
|
|
|
|
|
|
2847 |
<use_dutch_products>
|
2848 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2849 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2853 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2854 |
</country>
|
2855 |
</depends>
|
2856 |
+
</buspakje_header>
|
2857 |
+
<use_buspakje translate="label tooltip" module="postnl">
|
2858 |
+
<label>Use letter box parcels</label>
|
2859 |
+
<tooltip><![CDATA[If you disable this field all shipments will be considered regular package shipments.<br/>It is very important that you have correctly configured all products when using letter box parcels. Orders weighing more than <strong>2kg</strong> or are larger than <strong>38 x 26.5 x 3.2 cm</strong> cannot be shipped as letter box parcels.]]></tooltip>
|
2860 |
<frontend_type>checkbox</frontend_type>
|
2861 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2862 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2863 |
+
<sort_order>560</sort_order>
|
2864 |
<show_in_default>1</show_in_default>
|
2865 |
+
<show_in_website>0</show_in_website>
|
2866 |
+
<show_in_store>0</show_in_store>
|
2867 |
<depends>
|
2868 |
+
<use_dutch_products>
|
|
|
2869 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2870 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2871 |
+
</use_dutch_products>
|
2872 |
+
<country>
|
2873 |
+
<fieldset>cif_address</fieldset>
|
2874 |
+
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2875 |
+
</country>
|
2876 |
+
</depends>
|
2877 |
+
</use_buspakje>
|
2878 |
+
<buspakje_calculation_mode translate="label comment tooltip" module="postnl">
|
2879 |
+
<label>Calculation mode</label>
|
2880 |
+
<comment><![CDATA[You can read more about the way the extension calculates whether or not an order is a letter box parcel <a href="http://kb.tig.nl/topic/94905773" target="_blank">here</a>.]]></comment>
|
2881 |
+
<tooltip>You can let the PostNL extension calculate automatically whether a shipment would fit in a mail slot or you can manually determine this when creating shipments in the backend. If set to 'automatic' the PostNL extension will check the 'Weight' and 'PostNL Max Qty For Letter Box Parcels' of all products in an order to determine whether the shipment would fit through a mail slot. You may always overrule this and manually set whether a shipment is a letter box parcel or not.</tooltip>
|
2882 |
+
<frontend_type>select</frontend_type>
|
2883 |
+
<source_model>postnl_core/system_config_source_manualAutomatic</source_model>
|
2884 |
+
<sort_order>570</sort_order>
|
2885 |
+
<show_in_default>1</show_in_default>
|
2886 |
+
<show_in_website>0</show_in_website>
|
2887 |
+
<show_in_store>0</show_in_store>
|
2888 |
+
<depends>
|
2889 |
+
<use_buspakje>1</use_buspakje>
|
2890 |
<use_dutch_products>
|
2891 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2892 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2896 |
<eval><![CDATA[($('postnl_cif_address_country').getValue() == 'NL' || ($('postnl_cif_address_country').getValue() != 'NL' && $('postnl_cif_labels_and_confirming_use_dutch_products').getValue() !== null))]]></eval>
|
2897 |
</country>
|
2898 |
</depends>
|
2899 |
+
</buspakje_calculation_mode>
|
2900 |
+
<save_and_continue translate="label" module="postnl">
|
2901 |
+
<label>Save and continue</label>
|
2902 |
+
<frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
|
2903 |
+
<sort_order>580</sort_order>
|
2904 |
+
<show_in_default>1</show_in_default>
|
2905 |
+
<show_in_website>1</show_in_website>
|
2906 |
+
<show_in_store>1</show_in_store>
|
2907 |
+
<next_step_rel>postnl_delivery_options_int</next_step_rel>
|
2908 |
+
</save_and_continue>
|
2909 |
+
</fields>
|
2910 |
+
</delivery_options>
|
2911 |
+
<delivery_options_int translate="label comment" module="postnl">
|
2912 |
+
<label>Delivery Options INT</label>
|
2913 |
+
<comment>Your customers choose when, where and how they would like to receive their orders with PostNL's delivery options. Let your customers pick a day and the extension will show the estimated time of delivery. On Tuesdays and Wednesdays PostNL also delivers in the evening. Maybe your customers prefer to pick up their orders from one of the 2000 Post offices? No problem, a growing number of locations even have the orders ready for pickup early in the morning.</comment>
|
2914 |
+
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
2915 |
+
<frontend_class>postnl-wizard</frontend_class>
|
2916 |
+
<sort_order>800</sort_order>
|
2917 |
+
<show_in_default>1</show_in_default>
|
2918 |
+
<show_in_website>1</show_in_website>
|
2919 |
+
<show_in_store>1</show_in_store>
|
2920 |
+
<fields>
|
2921 |
+
<delivery_options_in_belgium_header translate="label" module="postnl">
|
2922 |
+
<label>PostNL delivery options in Belgium</label>
|
2923 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
2924 |
+
<sort_order>10</sort_order>
|
2925 |
+
<show_in_default>1</show_in_default>
|
2926 |
+
<show_in_website>1</show_in_website>
|
2927 |
+
<show_in_store>1</show_in_store>
|
2928 |
+
<depends>
|
2929 |
+
<checkout_extension>
|
2930 |
+
<fieldset>cif_labels_and_confirming</fieldset>
|
2931 |
+
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2932 |
+
<separator>||</separator>
|
2933 |
+
</checkout_extension>
|
2934 |
+
</depends>
|
2935 |
+
</delivery_options_in_belgium_header>
|
2936 |
+
<delivery_options_be_active translate="label" module="postnl">
|
2937 |
+
<label>Enable PostNL delivery options in Belgium</label>
|
2938 |
<frontend_type>checkbox</frontend_type>
|
2939 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2940 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2941 |
+
<sort_order>20</sort_order>
|
2942 |
<show_in_default>1</show_in_default>
|
2943 |
<show_in_website>1</show_in_website>
|
2944 |
<show_in_store>1</show_in_store>
|
2945 |
<depends>
|
|
|
2946 |
<checkout_extension>
|
2947 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2948 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2949 |
<separator>||</separator>
|
2950 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2951 |
</depends>
|
2952 |
+
</delivery_options_be_active>
|
2953 |
+
<enable_delivery_days_be translate="label tooltip" module="postnl">
|
2954 |
+
<label>Enable delivery days for Belgium</label>
|
2955 |
+
<tooltip>Delivery days allow customers to choose on which date they want their order delivered.</tooltip>
|
2956 |
<frontend_type>checkbox</frontend_type>
|
2957 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2958 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2959 |
+
<sort_order>30</sort_order>
|
2960 |
<show_in_default>1</show_in_default>
|
2961 |
<show_in_website>1</show_in_website>
|
2962 |
<show_in_store>1</show_in_store>
|
2963 |
<depends>
|
2964 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
|
|
2965 |
<checkout_extension>
|
2966 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2967 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2968 |
<separator>||</separator>
|
2969 |
</checkout_extension>
|
2970 |
+
</depends>
|
2971 |
+
</enable_delivery_days_be>
|
2972 |
+
<delivery_days_number_be translate="label tooltip" module="postnl">
|
2973 |
+
<label>Maximum number of delivery days for Belgium</label>
|
2974 |
+
<tooltip>Submit how many days in the future after the first delivery moment your customers can choose to receive their orders.</tooltip>
|
2975 |
+
<frontend_type>select</frontend_type>
|
2976 |
+
<source_model>postnl_deliveryoptions/system_config_source_deliveryDaysNumber</source_model>
|
2977 |
+
<sort_order>40</sort_order>
|
2978 |
+
<show_in_default>1</show_in_default>
|
2979 |
+
<show_in_website>1</show_in_website>
|
2980 |
+
<show_in_store>1</show_in_store>
|
2981 |
+
<depends>
|
2982 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
2983 |
+
<enable_delivery_days_be>1</enable_delivery_days_be>
|
2984 |
+
<checkout_extension>
|
2985 |
<fieldset>cif_labels_and_confirming</fieldset>
|
2986 |
+
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
2987 |
+
<separator>||</separator>
|
2988 |
+
</checkout_extension>
|
|
|
|
|
|
|
2989 |
</depends>
|
2990 |
+
</delivery_days_number_be>
|
2991 |
+
<enable_pakjegemak_be translate="label tooltip" module="postnl">
|
2992 |
+
<label>Enable post office locations for Belgium</label>
|
2993 |
+
<tooltip>Whether or not customers may choose to have their order delivered to a nearby post office.</tooltip>
|
2994 |
<frontend_type>checkbox</frontend_type>
|
2995 |
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
2996 |
<source_model>postnl/system_config_source_yesno</source_model>
|
2997 |
+
<sort_order>50</sort_order>
|
2998 |
<show_in_default>1</show_in_default>
|
2999 |
<show_in_website>1</show_in_website>
|
3000 |
<show_in_store>1</show_in_store>
|
3001 |
<depends>
|
3002 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
|
|
3003 |
<checkout_extension>
|
3004 |
<fieldset>cif_labels_and_confirming</fieldset>
|
3005 |
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
3006 |
<separator>||</separator>
|
3007 |
</checkout_extension>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3008 |
</depends>
|
3009 |
+
</enable_pakjegemak_be>
|
3010 |
+
<premium_delivery_options_int_header translate="label" module="postnl">
|
3011 |
+
<label>Delivery options based on contractual agreements</label>
|
3012 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
3013 |
+
<sort_order>60</sort_order>
|
3014 |
<show_in_default>1</show_in_default>
|
3015 |
+
<show_in_website>1</show_in_website>
|
3016 |
+
<show_in_store>1</show_in_store>
|
3017 |
<depends>
|
3018 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
3019 |
+
<checkout_extension>
|
3020 |
<fieldset>cif_labels_and_confirming</fieldset>
|
3021 |
+
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
3022 |
+
<separator>||</separator>
|
3023 |
+
</checkout_extension>
|
|
|
|
|
|
|
3024 |
</depends>
|
3025 |
+
</premium_delivery_options_int_header>
|
3026 |
+
<premium_delivery_options_int_info translate="comment" module="postnl">
|
3027 |
+
<comment>Please note: these delivery options require specific contractual agreements with PostNL. Please contact your PostNL account manager if you wish to use Monday.</comment>
|
3028 |
+
<frontend_model>postnl_adminhtml/system_config_form_field_infoBox</frontend_model>
|
3029 |
+
<sort_order>70</sort_order>
|
|
|
|
|
|
|
3030 |
<show_in_default>1</show_in_default>
|
3031 |
+
<show_in_website>1</show_in_website>
|
3032 |
+
<show_in_store>1</show_in_store>
|
3033 |
<depends>
|
3034 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
3035 |
+
<checkout_extension>
|
3036 |
<fieldset>cif_labels_and_confirming</fieldset>
|
3037 |
+
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
3038 |
+
<separator>||</separator>
|
3039 |
+
</checkout_extension>
|
|
|
|
|
|
|
3040 |
</depends>
|
3041 |
+
</premium_delivery_options_int_info>
|
3042 |
+
<allow_sunday_sorting_be translate="label comment tooltip" module="postnl">
|
3043 |
+
<label>Enable monday delivery for Belgium</label>
|
3044 |
+
<comment><![CDATA[You can read more about monday delivery <a href="http://www.postnl.nl/zakelijke-oplossingen/webwinkels/bezorgopties-voor-mijn-klanten/maandagbezorging/" target="_blank" title="monday delivery">here</a>.]]></comment>
|
3045 |
+
<tooltip>Activate monday delivery (also known as sunday sorting) for your customers. Note: this only applies to home deliveries. Postal office deliveries will not take place on Monday.</tooltip>
|
3046 |
+
<frontend_type>checkbox</frontend_type>
|
3047 |
+
<backend_model>postnl/system_config_backend_checkbox</backend_model>
|
3048 |
+
<source_model>postnl/system_config_source_yesno</source_model>
|
3049 |
+
<sort_order>80</sort_order>
|
3050 |
<show_in_default>1</show_in_default>
|
3051 |
+
<show_in_website>1</show_in_website>
|
3052 |
+
<show_in_store>1</show_in_store>
|
3053 |
<depends>
|
3054 |
+
<delivery_options_be_active>1</delivery_options_be_active>
|
3055 |
+
<enable_delivery_days_be>1</enable_delivery_days_be>
|
3056 |
+
<checkout_extension>
|
3057 |
<fieldset>cif_labels_and_confirming</fieldset>
|
3058 |
+
<value>magento_onepagecheckout||idev_onestepcheckout||gomage_lightcheckout</value>
|
3059 |
+
<separator>||</separator>
|
3060 |
+
</checkout_extension>
|
|
|
|
|
|
|
3061 |
</depends>
|
3062 |
+
</allow_sunday_sorting_be>
|
3063 |
<save_and_continue translate="label" module="postnl">
|
3064 |
<label>Save and continue</label>
|
3065 |
<frontend_model>postnl_adminhtml/system_config_form_field_wizardSaveButton</frontend_model>
|
3066 |
+
<sort_order>500</sort_order>
|
3067 |
<show_in_default>1</show_in_default>
|
3068 |
<show_in_website>1</show_in_website>
|
3069 |
<show_in_store>1</show_in_store>
|
3070 |
<next_step_rel>postnl_cif</next_step_rel>
|
3071 |
</save_and_continue>
|
3072 |
</fields>
|
3073 |
+
</delivery_options_int>
|
3074 |
<cif translate="label comment" module="postnl">
|
3075 |
<label>Account Settings</label>
|
3076 |
<comment><![CDATA[Here you can configure your PostNL account.</p><p>In order to use this extension you need to <a href='http://www.postnl.nl/zakelijk/e-commerce/flexibele-bezorgopties' target='_blank' title='Register'>register</a> yourself with PostNL. You will then receive all necessary information in order to configure the extension. If you cannot find the email containing this information, please contact your PostNL account manager.</p><p>If you want to test the extension, but don't have any test mode credentials you can use the account credentials found <a href="http://kb.tig.nl/topic/55404467" title="Test mode account credentials" target="_blank">here</a>.]]></comment>
|
3077 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3078 |
<frontend_class>postnl-wizard</frontend_class>
|
3079 |
+
<sort_order>900</sort_order>
|
3080 |
<show_in_default>1</show_in_default>
|
3081 |
<show_in_website>1</show_in_website>
|
3082 |
<show_in_store>1</show_in_store>
|
3190 |
<show_in_store>0</show_in_store>
|
3191 |
<validate>validate-digits validate-length minimum-length-6 maximum-length-6 postnl-validate-empty</validate>
|
3192 |
</collection_location>
|
3193 |
+
<!-- These belong to the Mijn Checkout functionality. As it is deprecated we disabled this config option -->
|
3194 |
+
<!--<webshop_id translate="label" module="postnl">
|
3195 |
<label>Webshop ID</label>
|
3196 |
<frontend_type>obscure</frontend_type>
|
3197 |
<frontend_model>postnl_adminhtml/system_config_form_field_obscure</frontend_model>
|
3209 |
<show_in_default>1</show_in_default>
|
3210 |
<show_in_website>1</show_in_website>
|
3211 |
<show_in_store>0</show_in_store>
|
3212 |
+
</public_webshop_id>-->
|
3213 |
<dutch_customer_number translate="label tooltip" module="postnl">
|
3214 |
<label>Customer Number used for shipments to the Netherlands</label>
|
3215 |
<frontend_type>text</frontend_type>
|
3279 |
<label>Label, Packing Slip and Weight Settings</label>
|
3280 |
<comment>Here you decide which information you would like to show on shipping labels and packing slips. The weight unit and the maximum weight of a package are also configured from here.</comment>
|
3281 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3282 |
+
<sort_order>1000</sort_order>
|
3283 |
<show_in_default>1</show_in_default>
|
3284 |
<show_in_website>1</show_in_website>
|
3285 |
<show_in_store>1</show_in_store>
|
3549 |
<label>Track & Trace</label>
|
3550 |
<comment>You can choose to send a Track & Trace email automatically after an order is confirmed. From this menu you can also define how you would like to send Track & Trace emails.</comment>
|
3551 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3552 |
+
<sort_order>1100</sort_order>
|
3553 |
<show_in_default>1</show_in_default>
|
3554 |
<show_in_website>1</show_in_website>
|
3555 |
<show_in_store>1</show_in_store>
|
3624 |
<returns translate="label comment" module="postnl">
|
3625 |
<label>Returns</label>
|
3626 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3627 |
+
<sort_order>1200</sort_order>
|
3628 |
<show_in_default>1</show_in_default>
|
3629 |
<show_in_website>1</show_in_website>
|
3630 |
<show_in_store>1</show_in_store>
|
3825 |
</params>
|
3826 |
</comment_url>
|
3827 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3828 |
+
<sort_order>1300</sort_order>
|
3829 |
<show_in_default>1</show_in_default>
|
3830 |
<show_in_website>1</show_in_website>
|
3831 |
<show_in_store>0</show_in_store>
|
3963 |
<label>Worldwide Shipping</label>
|
3964 |
<comment>Are you planning to ship outside of the EU? Activate GlobalPack with the details you have received from PostNL. You can ignore the GlobalPack settings for domestic shipping and shipping within the EU.</comment>
|
3965 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
3966 |
+
<sort_order>1400</sort_order>
|
3967 |
<show_in_default>1</show_in_default>
|
3968 |
<show_in_website>1</show_in_website>
|
3969 |
<show_in_store>0</show_in_store>
|
4169 |
</product_sorting_direction>
|
4170 |
</fields>
|
4171 |
</cif_globalpack_settings>
|
4172 |
+
<!--<checkout translate="label comment" module="postnl">
|
4173 |
<label>PostNL Checkout Settings</label>
|
4174 |
<comment><![CDATA[PostNL Checkout is a method alongside your own order process that allows your customers to choose where, when and how to receive their order. Please note: Use the Delivery Options to configure the PostNL settings in your own checkout. Use the settings below to configure the settings for the PostNL Checkout.<br/><br/>Does the PostNL Checkout button stay gray? Click <a href="http://kb.tig.nl/topic/39102986" target="_blank">here</a> for possible causes and solutions.]]></comment>
|
4175 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
4176 |
+
<sort_order>1500</sort_order>
|
4177 |
<show_in_default>1</show_in_default>
|
4178 |
<show_in_website>1</show_in_website>
|
4179 |
<show_in_store>1</show_in_store>
|
4466 |
</depends>
|
4467 |
</service_url>
|
4468 |
</fields>
|
4469 |
+
</checkout>-->
|
4470 |
+
<!--<checkout_payment_methods translate="label comment" module="postnl">
|
4471 |
<label>PostNL Checkout Payment Settings</label>
|
4472 |
<comment>This is where you specify which payment options will be presented to your customers in PostNL Checkout. At least one of these must be activated for PostNL Checkout to work.</comment>
|
4473 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
4474 |
+
<sort_order>1600</sort_order>
|
4475 |
<show_in_default>1</show_in_default>
|
4476 |
<show_in_website>1</show_in_website>
|
4477 |
<show_in_store>1</show_in_store>
|
4516 |
</country>
|
4517 |
</depends>
|
4518 |
</postnl_checkout_inactive_header>
|
4519 |
+
<!– iDEAL –>
|
4520 |
<ideal_header translate="label" module="postnl">
|
4521 |
<label>iDEAL</label>
|
4522 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4583 |
</show_summary_page>
|
4584 |
</depends>
|
4585 |
</ideal_option_field>
|
4586 |
+
<!– Creditcard –>
|
4587 |
<creditcard_header translate="label" module="postnl">
|
4588 |
<label>Credit Card</label>
|
4589 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4650 |
</show_summary_page>
|
4651 |
</depends>
|
4652 |
</creditcard_option_field>
|
4653 |
+
<!– Checkpay –>
|
4654 |
<creckpay_header translate="label" module="postnl">
|
4655 |
<label>Checkpay</label>
|
4656 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4697 |
</active>
|
4698 |
</depends>
|
4699 |
</checkpay_method>
|
4700 |
+
<!– Paypal –>
|
4701 |
<paypal_header translate="label" module="postnl">
|
4702 |
<label>PayPal</label>
|
4703 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4744 |
</active>
|
4745 |
</depends>
|
4746 |
</paypal_method>
|
4747 |
+
<!– Machtiging –>
|
4748 |
<directdebit_header translate="label" module="postnl">
|
4749 |
<label>Direct Debit</label>
|
4750 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4791 |
</active>
|
4792 |
</depends>
|
4793 |
</directdebit_method>
|
4794 |
+
<!– Accept Giro –>
|
4795 |
<acceptgiro_header translate="label" module="postnl">
|
4796 |
<label>Acceptgiro</label>
|
4797 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4838 |
</active>
|
4839 |
</depends>
|
4840 |
</acceptgiro_method>
|
4841 |
+
<!– Betaling Vooraf –>
|
4842 |
<vooraf_betalen_header translate="label" module="postnl">
|
4843 |
<label>Vooraf Betalen</label>
|
4844 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4885 |
</active>
|
4886 |
</depends>
|
4887 |
</vooraf_betalen_method>
|
4888 |
+
<!– Termijnen –>
|
4889 |
<termijnen_header translate="label" module="postnl">
|
4890 |
<label>Betaling in Termijnen</label>
|
4891 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4932 |
</active>
|
4933 |
</depends>
|
4934 |
</termijnen_method>
|
4935 |
+
<!– Kadobon –>
|
4936 |
<giftcard_header translate="label" module="postnl">
|
4937 |
<label>Giftcard</label>
|
4938 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
4979 |
</active>
|
4980 |
</depends>
|
4981 |
</giftcard_method>
|
4982 |
+
<!– Rabobank Internet Kassa –>
|
4983 |
<rabobank_internetkassa_header translate="label" module="postnl">
|
4984 |
<label>Rabobank Internetkassa</label>
|
4985 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
5026 |
</active>
|
5027 |
</depends>
|
5028 |
</rabobank_internetkassa_method>
|
5029 |
+
<!– Afterpay –>
|
5030 |
<afterpay_header translate="label" module="postnl">
|
5031 |
<label>AfterPay</label>
|
5032 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
5073 |
</active>
|
5074 |
</depends>
|
5075 |
</afterpay_method>
|
5076 |
+
<!– Klarna –>
|
5077 |
<klarna_header translate="label" module="postnl">
|
5078 |
<label>Klarna</label>
|
5079 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
5121 |
</depends>
|
5122 |
</klarna_method>
|
5123 |
</fields>
|
5124 |
+
</checkout_payment_methods>-->
|
5125 |
<parcelware_export translate="label comment" module="postnl">
|
5126 |
<label>Parcelware Settings</label>
|
5127 |
<comment><![CDATA[This is where you can configure your Parcelware export. You can find more information about configuring these settings <a href="http://kb.tig.nl/topic/94906903" target="_blank" title="More info">here</a>.]]></comment>
|
5128 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5129 |
+
<sort_order>1700</sort_order>
|
5130 |
<show_in_default>1</show_in_default>
|
5131 |
<show_in_website>1</show_in_website>
|
5132 |
<show_in_store>1</show_in_store>
|
5216 |
<label>User Settings</label>
|
5217 |
<comment>From this menu you can add columns containing PostNL specific information to the orders and shipments grid. Here you can also define default values for actions.</comment>
|
5218 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5219 |
+
<sort_order>1800</sort_order>
|
5220 |
<show_in_default>1</show_in_default>
|
5221 |
<show_in_website>0</show_in_website>
|
5222 |
<show_in_store>0</show_in_store>
|
5463 |
</country>
|
5464 |
</depends>
|
5465 |
</default_sunday_product_option>
|
5466 |
+
<default_id_check_delivery_product_option translate="label tooltip" module="postnl">
|
5467 |
+
<label>Default ID check delivery shipping option</label>
|
5468 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5469 |
+
<frontend_type>select</frontend_type>
|
5470 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5471 |
+
<source_model>postnl_core/system_config_source_idCheckProductOptions::getAvailableOptions</source_model>
|
5472 |
+
<multidimensional>true</multidimensional>
|
5473 |
+
<sort_order>170</sort_order>
|
5474 |
+
<show_in_default>1</show_in_default>
|
5475 |
+
<show_in_website>0</show_in_website>
|
5476 |
+
<show_in_store>0</show_in_store>
|
5477 |
+
<depends>
|
5478 |
+
<delivery_options_active>
|
5479 |
+
<fieldset>delivery_options</fieldset>
|
5480 |
+
<value>1</value>
|
5481 |
+
</delivery_options_active>
|
5482 |
+
<enable_id_check_delivery>
|
5483 |
+
<fieldset>delivery_options</fieldset>
|
5484 |
+
<value>1</value>
|
5485 |
+
</enable_id_check_delivery>
|
5486 |
+
<country>
|
5487 |
+
<fieldset>cif_address</fieldset>
|
5488 |
+
<value>NL</value>
|
5489 |
+
</country>
|
5490 |
+
</depends>
|
5491 |
+
</default_id_check_delivery_product_option>
|
5492 |
+
<default_id_check_pickup_product_option translate="label tooltip" module="postnl">
|
5493 |
+
<label>Default ID check pickup option</label>
|
5494 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5495 |
+
<frontend_type>select</frontend_type>
|
5496 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5497 |
+
<source_model>postnl_core/system_config_source_pakjegemakProductOptions::getIDCheckOptions</source_model>
|
5498 |
+
<multidimensional>true</multidimensional>
|
5499 |
+
<sort_order>180</sort_order>
|
5500 |
+
<show_in_default>1</show_in_default>
|
5501 |
+
<show_in_website>0</show_in_website>
|
5502 |
+
<show_in_store>0</show_in_store>
|
5503 |
+
<depends>
|
5504 |
+
<delivery_options_active>
|
5505 |
+
<fieldset>delivery_options</fieldset>
|
5506 |
+
<value>1</value>
|
5507 |
+
</delivery_options_active>
|
5508 |
+
<enable_id_check_delivery>
|
5509 |
+
<fieldset>delivery_options</fieldset>
|
5510 |
+
<value>1</value>
|
5511 |
+
</enable_id_check_delivery>
|
5512 |
+
<country>
|
5513 |
+
<fieldset>cif_address</fieldset>
|
5514 |
+
<value>NL</value>
|
5515 |
+
</country>
|
5516 |
+
</depends>
|
5517 |
+
</default_id_check_pickup_product_option>
|
5518 |
+
<default_age_check_delivery_product_option translate="label tooltip" module="postnl">
|
5519 |
+
<label>Default Age check delivery shipping option</label>
|
5520 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5521 |
+
<frontend_type>select</frontend_type>
|
5522 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5523 |
+
<source_model>postnl_core/system_config_source_ageCheckProductOptions::getAvailableOptions</source_model>
|
5524 |
+
<multidimensional>true</multidimensional>
|
5525 |
+
<sort_order>190</sort_order>
|
5526 |
+
<show_in_default>1</show_in_default>
|
5527 |
+
<show_in_website>0</show_in_website>
|
5528 |
+
<show_in_store>0</show_in_store>
|
5529 |
+
<depends>
|
5530 |
+
<delivery_options_active>
|
5531 |
+
<fieldset>delivery_options</fieldset>
|
5532 |
+
<value>1</value>
|
5533 |
+
</delivery_options_active>
|
5534 |
+
<enable_age_check_delivery>
|
5535 |
+
<fieldset>delivery_options</fieldset>
|
5536 |
+
<value>1</value>
|
5537 |
+
</enable_age_check_delivery>
|
5538 |
+
<country>
|
5539 |
+
<fieldset>cif_address</fieldset>
|
5540 |
+
<value>NL</value>
|
5541 |
+
</country>
|
5542 |
+
</depends>
|
5543 |
+
</default_age_check_delivery_product_option>
|
5544 |
+
<default_age_check_pickup_product_option translate="label tooltip" module="postnl">
|
5545 |
+
<label>Default Age check pickup option</label>
|
5546 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5547 |
+
<frontend_type>select</frontend_type>
|
5548 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5549 |
+
<source_model>postnl_core/system_config_source_pakjegemakProductOptions::getAgeCheckOptions</source_model>
|
5550 |
+
<multidimensional>true</multidimensional>
|
5551 |
+
<sort_order>200</sort_order>
|
5552 |
+
<show_in_default>1</show_in_default>
|
5553 |
+
<show_in_website>0</show_in_website>
|
5554 |
+
<show_in_store>0</show_in_store>
|
5555 |
+
<depends>
|
5556 |
+
<delivery_options_active>
|
5557 |
+
<fieldset>delivery_options</fieldset>
|
5558 |
+
<value>1</value>
|
5559 |
+
</delivery_options_active>
|
5560 |
+
<enable_age_check_delivery>
|
5561 |
+
<fieldset>delivery_options</fieldset>
|
5562 |
+
<value>1</value>
|
5563 |
+
</enable_age_check_delivery>
|
5564 |
+
<country>
|
5565 |
+
<fieldset>cif_address</fieldset>
|
5566 |
+
<value>NL</value>
|
5567 |
+
</country>
|
5568 |
+
</depends>
|
5569 |
+
</default_age_check_pickup_product_option>
|
5570 |
+
<default_birthday_check_delivery_product_option translate="label tooltip" module="postnl">
|
5571 |
+
<label>Default Birthday check delivery shipping option</label>
|
5572 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5573 |
+
<frontend_type>select</frontend_type>
|
5574 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5575 |
+
<source_model>postnl_core/system_config_source_birthdayCheckProductOptions::getAvailableOptions</source_model>
|
5576 |
+
<multidimensional>true</multidimensional>
|
5577 |
+
<sort_order>210</sort_order>
|
5578 |
+
<show_in_default>1</show_in_default>
|
5579 |
+
<show_in_website>0</show_in_website>
|
5580 |
+
<show_in_store>0</show_in_store>
|
5581 |
+
<depends>
|
5582 |
+
<delivery_options_active>
|
5583 |
+
<fieldset>delivery_options</fieldset>
|
5584 |
+
<value>1</value>
|
5585 |
+
</delivery_options_active>
|
5586 |
+
<enable_birthday_check_delivery>
|
5587 |
+
<fieldset>delivery_options</fieldset>
|
5588 |
+
<value>1</value>
|
5589 |
+
</enable_birthday_check_delivery>
|
5590 |
+
<country>
|
5591 |
+
<fieldset>cif_address</fieldset>
|
5592 |
+
<value>NL</value>
|
5593 |
+
</country>
|
5594 |
+
</depends>
|
5595 |
+
</default_birthday_check_delivery_product_option>
|
5596 |
+
<default_birthday_check_pickup_product_option translate="label tooltip" module="postnl">
|
5597 |
+
<label>Default Birthday check pickup option</label>
|
5598 |
+
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5599 |
+
<frontend_type>select</frontend_type>
|
5600 |
+
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5601 |
+
<source_model>postnl_core/system_config_source_pakjegemakProductOptions::getBirthdayCheckOptions</source_model>
|
5602 |
+
<multidimensional>true</multidimensional>
|
5603 |
+
<sort_order>220</sort_order>
|
5604 |
+
<show_in_default>1</show_in_default>
|
5605 |
+
<show_in_website>0</show_in_website>
|
5606 |
+
<show_in_store>0</show_in_store>
|
5607 |
+
<depends>
|
5608 |
+
<delivery_options_active>
|
5609 |
+
<fieldset>delivery_options</fieldset>
|
5610 |
+
<value>1</value>
|
5611 |
+
</delivery_options_active>
|
5612 |
+
<enable_birthday_check_delivery>
|
5613 |
+
<fieldset>delivery_options</fieldset>
|
5614 |
+
<value>1</value>
|
5615 |
+
</enable_birthday_check_delivery>
|
5616 |
+
<country>
|
5617 |
+
<fieldset>cif_address</fieldset>
|
5618 |
+
<value>NL</value>
|
5619 |
+
</country>
|
5620 |
+
</depends>
|
5621 |
+
</default_birthday_check_pickup_product_option>
|
5622 |
<default_sameday_product_option translate="label tooltip" module="postnl">
|
5623 |
<label>Default same day delivery shipping option</label>
|
5624 |
<tooltip>This setting may be overwritten by manually creating shipments.</tooltip>
|
5626 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5627 |
<source_model>postnl_core/system_config_source_standardProductOptions::getAvailableSameDayOptions</source_model>
|
5628 |
<multidimensional>true</multidimensional>
|
5629 |
+
<sort_order>230</sort_order>
|
5630 |
<show_in_default>1</show_in_default>
|
5631 |
<show_in_website>0</show_in_website>
|
5632 |
<show_in_store>0</show_in_store>
|
5656 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5657 |
<source_model>postnl_core/system_config_source_pakjeGemakProductOptions::getAvailableOptions</source_model>
|
5658 |
<multidimensional>true</multidimensional>
|
5659 |
+
<sort_order>240</sort_order>
|
5660 |
<show_in_default>1</show_in_default>
|
5661 |
<show_in_website>0</show_in_website>
|
5662 |
<show_in_store>0</show_in_store>
|
5682 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5683 |
<source_model>postnl_core/system_config_source_pakjeGemakProductOptions::getAvailablePgeOptions</source_model>
|
5684 |
<multidimensional>true</multidimensional>
|
5685 |
+
<sort_order>250</sort_order>
|
5686 |
<show_in_default>1</show_in_default>
|
5687 |
<show_in_website>0</show_in_website>
|
5688 |
<show_in_store>0</show_in_store>
|
5712 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5713 |
<source_model>postnl_core/system_config_source_buspakjeProductOptions::getAvailableOptions</source_model>
|
5714 |
<multidimensional>true</multidimensional>
|
5715 |
+
<sort_order>260</sort_order>
|
5716 |
<show_in_default>1</show_in_default>
|
5717 |
<show_in_website>0</show_in_website>
|
5718 |
<show_in_store>0</show_in_store>
|
5734 |
<backend_model>postnl_core/system_config_backend_validateDefaultOption</backend_model>
|
5735 |
<source_model>postnl_core/system_config_source_standardProductOptions::getAvailableStatedAddressOnlyOptions</source_model>
|
5736 |
<multidimensional>true</multidimensional>
|
5737 |
+
<sort_order>270</sort_order>
|
5738 |
<show_in_default>1</show_in_default>
|
5739 |
<show_in_website>0</show_in_website>
|
5740 |
<show_in_store>0</show_in_store>
|
5766 |
<label>Technical Settings</label>
|
5767 |
<comment>These settings are intended for advanced users only! If you're not 100% sure what you're doing, please do not touch these settings.</comment>
|
5768 |
<frontend_model>postnl_adminhtml/system_config_form_fieldset</frontend_model>
|
5769 |
+
<sort_order>1900</sort_order>
|
5770 |
<show_in_default>1</show_in_default>
|
5771 |
<show_in_website>0</show_in_website>
|
5772 |
<show_in_store>0</show_in_store>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @var TIG_PostNL_Model_Resource_Setup $installer
|
42 |
+
* @var TIG_PostNL_Model_Resource_Setup $this
|
43 |
+
*/
|
44 |
+
$installer = $this;
|
45 |
+
|
46 |
+
$installer->startSetup();
|
47 |
+
|
48 |
+
$conn = $installer->getConnection();
|
49 |
+
|
50 |
+
/***********************************************************************************************************************
|
51 |
+
* PRODUCT ATTRIBUTES
|
52 |
+
**********************************************************************************************************************/
|
53 |
+
|
54 |
+
$applyTo = array(
|
55 |
+
Mage_Catalog_Model_Product_Type::TYPE_SIMPLE,
|
56 |
+
Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE,
|
57 |
+
Mage_Catalog_Model_Product_Type::TYPE_GROUPED,
|
58 |
+
Mage_Catalog_Model_Product_Type::TYPE_BUNDLE,
|
59 |
+
);
|
60 |
+
|
61 |
+
$tableName = $installer->getTable('postnl_core/order');
|
62 |
+
|
63 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_type')) {
|
64 |
+
$conn->addColumn(
|
65 |
+
$tableName,
|
66 |
+
'idcheck_type',
|
67 |
+
array(
|
68 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
69 |
+
'length' => '32',
|
70 |
+
'nullable' => true,
|
71 |
+
'comment' => 'ID Check type',
|
72 |
+
'after' => 'pg_retail_network_id'
|
73 |
+
)
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_number')) {
|
78 |
+
$conn->addColumn(
|
79 |
+
$tableName,
|
80 |
+
'idcheck_number',
|
81 |
+
array(
|
82 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
83 |
+
'length' => '1000',
|
84 |
+
'nullable' => true,
|
85 |
+
'comment' => 'ID Check number',
|
86 |
+
'after' => 'idcheck_type'
|
87 |
+
)
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_expiration_date')) {
|
92 |
+
$conn->addColumn(
|
93 |
+
$tableName,
|
94 |
+
'idcheck_expiration_date',
|
95 |
+
array(
|
96 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DATE,
|
97 |
+
'nullable' => true,
|
98 |
+
'comment' => 'ID Check expiration date',
|
99 |
+
'after' => 'idcheck_number'
|
100 |
+
)
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
$tableName = $installer->getTable('postnl_core/shipment');
|
105 |
+
|
106 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_type')) {
|
107 |
+
$conn->addColumn(
|
108 |
+
$tableName,
|
109 |
+
'idcheck_type',
|
110 |
+
array(
|
111 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
112 |
+
'length' => '32',
|
113 |
+
'nullable' => true,
|
114 |
+
'comment' => 'ID Check type',
|
115 |
+
'after' => 'pg_retail_network_id'
|
116 |
+
)
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_number')) {
|
121 |
+
$conn->addColumn(
|
122 |
+
$tableName,
|
123 |
+
'idcheck_number',
|
124 |
+
array(
|
125 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
126 |
+
'length' => '1000',
|
127 |
+
'nullable' => true,
|
128 |
+
'comment' => 'ID Check number',
|
129 |
+
'after' => 'idcheck_type'
|
130 |
+
)
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
if (!$conn->tableColumnExists($tableName, 'idcheck_expiration_date')) {
|
135 |
+
$conn->addColumn(
|
136 |
+
$tableName,
|
137 |
+
'idcheck_expiration_date',
|
138 |
+
array(
|
139 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DATE,
|
140 |
+
'nullable' => true,
|
141 |
+
'comment' => 'ID Check expiration date',
|
142 |
+
'after' => 'idcheck_number'
|
143 |
+
)
|
144 |
+
);
|
145 |
+
}
|
146 |
+
|
147 |
+
/***********************************************************************************************************************
|
148 |
+
* ADD PRODUCT CODES
|
149 |
+
**********************************************************************************************************************/
|
150 |
+
|
151 |
+
$productCodes = array(
|
152 |
+
'3440',
|
153 |
+
'3444',
|
154 |
+
'3447',
|
155 |
+
'3450',
|
156 |
+
'3442',
|
157 |
+
'3445',
|
158 |
+
'3448',
|
159 |
+
'3451',
|
160 |
+
'3437',
|
161 |
+
'3438',
|
162 |
+
'3443',
|
163 |
+
'3446',
|
164 |
+
'3449',
|
165 |
+
'3571',
|
166 |
+
'3572',
|
167 |
+
'3573',
|
168 |
+
'3574',
|
169 |
+
'3575',
|
170 |
+
'3576',
|
171 |
+
'3581',
|
172 |
+
'3582',
|
173 |
+
'3583',
|
174 |
+
'3584',
|
175 |
+
'3585',
|
176 |
+
'3586',
|
177 |
+
);
|
178 |
+
|
179 |
+
$this->addSupportedProductCode($productCodes);
|
180 |
+
|
181 |
+
/***********************************************************************************************************************
|
182 |
+
* DISABLE THE POSTNL CHECKOUT
|
183 |
+
**********************************************************************************************************************/
|
184 |
+
|
185 |
+
$this->resetConfig(array(
|
186 |
+
'postnl/checkout/active',
|
187 |
+
'postnl/checkout_payment_methods/activate_belgium',
|
188 |
+
'postnl/checkout_payment_methods/ideal',
|
189 |
+
'postnl/checkout_payment_methods/creditcard',
|
190 |
+
'postnl/checkout_payment_methods/checkpay',
|
191 |
+
'postnl/checkout_payment_methods/paypal',
|
192 |
+
'postnl/checkout_payment_methods/directdebit',
|
193 |
+
'postnl/checkout_payment_methods/acceptgiro',
|
194 |
+
'postnl/checkout_payment_methods/vooraf_betalen',
|
195 |
+
'postnl/checkout_payment_methods/termijnen',
|
196 |
+
'postnl/checkout_payment_methods/giftcard',
|
197 |
+
'postnl/checkout_payment_methods/rabobank_internetkassa',
|
198 |
+
'postnl/checkout_payment_methods/afterpay',
|
199 |
+
'postnl/checkout_payment_methods/klarna',
|
200 |
+
'postnl/delivery_options/mijnpakket_login_active',
|
201 |
+
'postnl/delivery_options/mijnpakket_notification',
|
202 |
+
'postnl/delivery_options/show_create_mijnpakket_account_link',
|
203 |
+
'postnl/delivery_options/show_mijnpakket_app_link',
|
204 |
+
));
|
205 |
+
|
206 |
+
$installer->endSetup();
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -80,4 +80,4 @@ if (!$conn->tableColumnExists($tableName, 'down_partner_barcode')) {
|
|
80 |
);
|
81 |
}
|
82 |
|
83 |
-
$installer->endSetup();
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
80 |
);
|
81 |
}
|
82 |
|
83 |
+
$installer->endSetup();
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_IntegrityNotification $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_IntegrityNotification $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_LogNotification $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_LogNotification $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_Sales_Items_Column_Qty $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_Sales_Items_Column_Qty $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -92,7 +92,9 @@
|
|
92 |
|
93 |
Event.observe(printWindow, 'unload', function() {
|
94 |
Event.stopObserving(printWindow);
|
95 |
-
|
|
|
|
|
96 |
});
|
97 |
this.form.setAttribute('target', windowName);
|
98 |
} else {
|
@@ -116,7 +118,9 @@
|
|
116 |
$('print_label_spinner').show();
|
117 |
var printWindow = window.open(url);
|
118 |
Event.observe(printWindow, 'unload', function() {
|
119 |
-
|
|
|
|
|
120 |
});
|
121 |
|
122 |
return false;
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
92 |
|
93 |
Event.observe(printWindow, 'unload', function() {
|
94 |
Event.stopObserving(printWindow);
|
95 |
+
setTimeout(function () {
|
96 |
+
window.location.reload();
|
97 |
+
});
|
98 |
});
|
99 |
this.form.setAttribute('target', windowName);
|
100 |
} else {
|
118 |
$('print_label_spinner').show();
|
119 |
var printWindow = window.open(url);
|
120 |
Event.observe(printWindow, 'unload', function() {
|
121 |
+
setTimeout(function () {
|
122 |
+
window.location.reload();
|
123 |
+
});
|
124 |
});
|
125 |
|
126 |
return false;
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -66,7 +66,9 @@
|
|
66 |
$('print_label_spinner').show();
|
67 |
var printWindow = window.open(url);
|
68 |
Event.observe(printWindow, 'unload', function() {
|
69 |
-
|
|
|
|
|
70 |
});
|
71 |
};
|
72 |
//]]>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
66 |
$('print_label_spinner').show();
|
67 |
var printWindow = window.open(url);
|
68 |
Event.observe(printWindow, 'unload', function() {
|
69 |
+
setTimeout(function () {
|
70 |
+
window.location.reload();
|
71 |
+
});
|
72 |
});
|
73 |
};
|
74 |
//]]>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
@@ -76,7 +76,7 @@
|
|
76 |
<?php endif; ?>
|
77 |
</td>
|
78 |
</tr>
|
79 |
-
<?php if ($_isDomesticShipment || $_isBelgium): ?>
|
80 |
<tr>
|
81 |
<td class="label"><label><?php echo $this->__('Expected delivery date'); ?></label></td>
|
82 |
<td class="value"><strong><?php echo $this->formatDate($_postnlShipment->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
76 |
<?php endif; ?>
|
77 |
</td>
|
78 |
</tr>
|
79 |
+
<?php if ((isset($_isDomesticShipment) && $_isDomesticShipment) || $_isBelgium): ?>
|
80 |
<tr>
|
81 |
<td class="label"><label><?php echo $this->__('Expected delivery date'); ?></label></td>
|
82 |
<td class="value"><strong><?php echo $this->formatDate($_postnlShipment->getDeliveryDate(), Mage_Core_Model_Locale::FORMAT_TYPE_FULL) ?></strong></td>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_Sales_Order_Shipment_View_ShippingStatus $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
*/
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_WindowsTheme $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_WindowsTheme $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -94,7 +94,9 @@
|
|
94 |
var printWindow = window.open('', windowName);
|
95 |
|
96 |
Event.observe(printWindow, 'unload', function() {
|
97 |
-
|
|
|
|
|
98 |
});
|
99 |
this.form.setAttribute('target', windowName);
|
100 |
} else {
|
@@ -137,7 +139,9 @@
|
|
137 |
$('print_label_spinner').show();
|
138 |
var printWindow = window.open(url);
|
139 |
Event.observe(printWindow, 'unload', function() {
|
140 |
-
|
|
|
|
|
141 |
});
|
142 |
|
143 |
return false;
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
94 |
var printWindow = window.open('', windowName);
|
95 |
|
96 |
Event.observe(printWindow, 'unload', function() {
|
97 |
+
setTimeout(function () {
|
98 |
+
window.location.reload();
|
99 |
+
});
|
100 |
});
|
101 |
this.form.setAttribute('target', windowName);
|
102 |
} else {
|
139 |
$('print_label_spinner').show();
|
140 |
var printWindow = window.open(url);
|
141 |
Event.observe(printWindow, 'unload', function() {
|
142 |
+
setTimeout(function () {
|
143 |
+
window.location.reload();
|
144 |
+
});
|
145 |
});
|
146 |
|
147 |
return false;
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ConfigCheck $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ConfigCheck $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ConfigCheck $this
|
@@ -133,4 +133,4 @@
|
|
133 |
<div class="module-message warning">
|
134 |
<h4>[POSTNL-0244] <?php echo $this->__('Please enter your Dutch customer code and number.')?> <a href="<?php echo $_helper->getErrorUrl('POSTNL-0244'); ?>" target="blank"><?php echo $this->__('Click here for more information from the TIG knowledgebase.') ?></a></h4>
|
135 |
</div>
|
136 |
-
<?php endif; ?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_ConfigCheck $this
|
133 |
<div class="module-message warning">
|
134 |
<h4>[POSTNL-0244] <?php echo $this->__('Please enter your Dutch customer code and number.')?> <a href="<?php echo $_helper->getErrorUrl('POSTNL-0244'); ?>" target="blank"><?php echo $this->__('Click here for more information from the TIG knowledgebase.') ?></a></h4>
|
135 |
</div>
|
136 |
+
<?php endif; ?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_InfoBox $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_InfoBox $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Js $this
|
@@ -80,7 +80,7 @@
|
|
80 |
window.location.href = url;
|
81 |
return true;
|
82 |
}
|
83 |
-
alert('<?php echo $_helper->__('You did not enter the correct verification text. Try again.'); ?>');
|
84 |
}
|
85 |
console.log('redirect not');
|
86 |
return false;
|
@@ -169,16 +169,16 @@
|
|
169 |
onComplete: function(response) {
|
170 |
response = response.responseText;
|
171 |
if (response == 'ok') {
|
172 |
-
alert('<?php echo $_helper->__('Account settings have been succesfully validated. Please save this page to keep these settings.'); ?>');
|
173 |
return;
|
174 |
}
|
175 |
|
176 |
if (response == 'missing_data') {
|
177 |
-
alert('<?php echo $_helper->__('One or more fields are missing. Please fill these fields and try again.'); ?>');
|
178 |
return;
|
179 |
}
|
180 |
|
181 |
-
alert('<?php echo $_helper->__('Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.'); ?>');
|
182 |
}
|
183 |
});
|
184 |
}
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Js $this
|
80 |
window.location.href = url;
|
81 |
return true;
|
82 |
}
|
83 |
+
alert('<?php echo $this->jsQuoteEscape($_helper->__('You did not enter the correct verification text. Try again.')); ?>');
|
84 |
}
|
85 |
console.log('redirect not');
|
86 |
return false;
|
169 |
onComplete: function(response) {
|
170 |
response = response.responseText;
|
171 |
if (response == 'ok') {
|
172 |
+
alert('<?php echo $this->jsQuoteEscape($_helper->__('Account settings have been succesfully validated. Please save this page to keep these settings.')); ?>');
|
173 |
return;
|
174 |
}
|
175 |
|
176 |
if (response == 'missing_data') {
|
177 |
+
alert('<?php echo $this->jsQuoteEscape($_helper->__('One or more fields are missing. Please fill these fields and try again.')); ?>');
|
178 |
return;
|
179 |
}
|
180 |
|
181 |
+
alert('<?php echo $this->jsQuoteEscape($_helper->__('Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.')); ?>');
|
182 |
}
|
183 |
});
|
184 |
}
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SplitAddressCheck $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SplitAddressCheck $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SupportTab $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_SupportTab $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_System_Config_Form_Field_WarningBox $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_UpgradeNotification $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Adminhtml_UpgradeNotification $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* Observer to edit the sales > shipments grid
|
@@ -1,419 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* ___________ __ __
|
4 |
-
* \__ ___/____ _/ |_ _____ | |
|
5 |
-
* | | / _ \\ __\\__ \ | |
|
6 |
-
* | | | |_| || | / __ \_| |__
|
7 |
-
* |____| \____/ |__| (____ /|____/
|
8 |
-
* \/
|
9 |
-
* ___ __ __
|
10 |
-
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
-
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
-
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
-
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
-
* \/ \/
|
15 |
-
* ________
|
16 |
-
* / _____/_______ ____ __ __ ______
|
17 |
-
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
-
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
-
* \______ /|__| \____/ |____/ | __/
|
20 |
-
* \/ |__|
|
21 |
-
*
|
22 |
-
* NOTICE OF LICENSE
|
23 |
-
*
|
24 |
-
* This source file is subject to the Creative Commons License.
|
25 |
-
* It is available through the world-wide-web at this URL:
|
26 |
-
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
-
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
-
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
-
*
|
30 |
-
* DISCLAIMER
|
31 |
-
*
|
32 |
-
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
-
* versions in the future. If you wish to customize this module for your
|
34 |
-
* needs please contact servicedesk@tig.nl for more information.
|
35 |
-
*
|
36 |
-
* @copyright Copyright (c) 2016 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
-
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
-
*
|
39 |
-
* @var TIG_PostNL_Block_Adminhtml_System_Config_Js $this
|
40 |
-
*/
|
41 |
-
?>
|
42 |
-
<?php $_helper = $this->helper('postnl'); ?>
|
43 |
-
<?php $_activateUrl = $this->getUrl('postnl_admin/adminhtml_extensionControl/activate', array('_secure' => true)); ?>
|
44 |
-
<?php $_validateUrl = $this->getUrl('postnl_admin/adminhtml_config/validateAccount', array('_secure' => true)); ?>
|
45 |
-
<?php $_website = Mage::app()->getRequest()->getParam('website'); ?>
|
46 |
-
<?php $_currentWizardStep = $this->getCurrentWizardStep(); ?>
|
47 |
-
<?php $_saveWizardStepUrl = $this->getSaveWizardStepUrl(); ?>
|
48 |
-
<?php $_hideNotificationUrl = $this->getHideNotificationUrl(); ?>
|
49 |
-
|
50 |
-
<script type="text/javascript">
|
51 |
-
//<![CDATA[
|
52 |
-
/**
|
53 |
-
*
|
54 |
-
*/
|
55 |
-
function openModalConfirm(title, text, callback, url) {
|
56 |
-
var confirm = Dialog.confirm(
|
57 |
-
text,
|
58 |
-
{
|
59 |
-
draggable: true,
|
60 |
-
resizable: true,
|
61 |
-
closable: true,
|
62 |
-
className:"magento",
|
63 |
-
windowClassName:"popup-window",
|
64 |
-
width: 500,
|
65 |
-
height: 463,
|
66 |
-
title: title,
|
67 |
-
okLabel: "<?php echo $_helper->__('Uninstall'); ?>",
|
68 |
-
cancelLabel: "<?php echo $_helper->__('Cancel'); ?>",
|
69 |
-
buttonClass: "myButtonClass",
|
70 |
-
id: "myDialogId",
|
71 |
-
cancel: function(win) { callback('cancel', url); },
|
72 |
-
ok: function(win) { callback('ok', url); return false; }
|
73 |
-
}
|
74 |
-
);
|
75 |
-
}
|
76 |
-
|
77 |
-
function handleConfirmUninstall(value, url) {
|
78 |
-
if (value === 'ok') {
|
79 |
-
var uninstallVerify = $('verify_uninstall').value;
|
80 |
-
if (uninstallVerify === 'uninstall') {
|
81 |
-
window.location.href = url;
|
82 |
-
return true;
|
83 |
-
}
|
84 |
-
alert('<?php echo $_helper->__('You did not enter the correct verification text. Try again.'); ?>');
|
85 |
-
}
|
86 |
-
console.log('redirect not');
|
87 |
-
return false;
|
88 |
-
}
|
89 |
-
|
90 |
-
var postnlConfigWizard = new PostnlConfigWizard({});
|
91 |
-
document.observe('dom:loaded', function() {
|
92 |
-
$('postnl_cif_labels_and_confirming_checkout_extension').observe('change', function() {
|
93 |
-
if ($('postnl_cif_labels_and_confirming_checkout_extension').getValue() == 'other') {
|
94 |
-
$('postnl_cif_labels_and_confirming_use_postcode_check').checked = false;
|
95 |
-
|
96 |
-
var elementsMap = formElementDependenceController.elementsMap;
|
97 |
-
for (var idTo in elementsMap) {
|
98 |
-
if (!elementsMap[idTo]['postnl_cif_labels_and_confirming_use_postcode_check']) {
|
99 |
-
continue;
|
100 |
-
}
|
101 |
-
formElementDependenceController.trackChange(null, idTo, elementsMap[idTo]);
|
102 |
-
}
|
103 |
-
|
104 |
-
}
|
105 |
-
});
|
106 |
-
|
107 |
-
postnlConfigWizard.render();
|
108 |
-
|
109 |
-
var topMessages = $$('.entry-edit > .module-message');
|
110 |
-
topMessages.each(function(element) {
|
111 |
-
$('postnl_wizard').insert({
|
112 |
-
before : element
|
113 |
-
});
|
114 |
-
});
|
115 |
-
|
116 |
-
<?php if (!empty($_currentWizardStep)): ?>
|
117 |
-
if (window.location.hash.length < 1) {
|
118 |
-
var hash = '<?php echo $this->escapeHtml($_currentWizardStep); ?>';
|
119 |
-
postnlConfigWizard.toHash(hash);
|
120 |
-
|
121 |
-
if(window.history.pushState) {
|
122 |
-
window.history.pushState(null, null, hash);
|
123 |
-
postnlConfigWizard.toHash();
|
124 |
-
} else {
|
125 |
-
window.location.hash = hash;
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
var scrollTarget = $('postnl_wizard');
|
130 |
-
if (topMessages[0]) {
|
131 |
-
scrollTarget = topMessages[0];
|
132 |
-
}
|
133 |
-
|
134 |
-
new Effect.Tween(
|
135 |
-
null,
|
136 |
-
document.viewport.getScrollOffsets().top,
|
137 |
-
scrollTarget.cumulativeOffset()[1] - 50,
|
138 |
-
{},
|
139 |
-
function(p){ scrollTo(document.viewport.getScrollOffsets().left, p.round()); }
|
140 |
-
);
|
141 |
-
<?php endif; ?>
|
142 |
-
});
|
143 |
-
|
144 |
-
var postnlActivationUrl = '<?php echo $_activateUrl; ?>';
|
145 |
-
function activatePostNL() {
|
146 |
-
$('config_edit_form').action = postnlActivationUrl;
|
147 |
-
configForm.submit();
|
148 |
-
}
|
149 |
-
|
150 |
-
function validateAccountSettings() {
|
151 |
-
var params = {
|
152 |
-
customerNumber : getConfigValue('postnl_cif_customer_number'),
|
153 |
-
customerCode : getConfigValue('postnl_cif_customer_code'),
|
154 |
-
locationCode : getConfigValue('postnl_cif_collection_location'),
|
155 |
-
website : '<?php echo $_website; ?>',
|
156 |
-
isTestMode : getConfigValue('postnl_cif_mode') == '1' ? 'true' : 'false'
|
157 |
-
};
|
158 |
-
|
159 |
-
if (params.isTestMode == 'true') {
|
160 |
-
params['username'] = getConfigValue('postnl_cif_test_username');
|
161 |
-
params['password'] = getConfigValue('postnl_cif_test_password');
|
162 |
-
} else {
|
163 |
-
params['username'] = getConfigValue('postnl_cif_live_username');
|
164 |
-
params['password'] = getConfigValue('postnl_cif_live_password');
|
165 |
-
}
|
166 |
-
|
167 |
-
new Ajax.Request('<?php echo $_validateUrl; ?>',{
|
168 |
-
method: 'post',
|
169 |
-
parameters: params,
|
170 |
-
onComplete: function(response) {
|
171 |
-
response = response.responseText;
|
172 |
-
if (response == 'ok') {
|
173 |
-
alert('<?php echo $_helper->__('Account settings have been succesfully validated. Please save this page to keep these settings.'); ?>');
|
174 |
-
return;
|
175 |
-
}
|
176 |
-
|
177 |
-
if (response == 'missing_data') {
|
178 |
-
alert('<?php echo $_helper->__('One or more fields are missing. Please fill these fields and try again.'); ?>');
|
179 |
-
return;
|
180 |
-
}
|
181 |
-
|
182 |
-
alert('<?php echo $_helper->__('Your account settings are incorrect. Please check all fields and try again. If this error persists, please contact PostNL.'); ?>');
|
183 |
-
}
|
184 |
-
});
|
185 |
-
}
|
186 |
-
|
187 |
-
function getConfigValue(fieldName) {
|
188 |
-
var inheritName = fieldName + '_inherit';
|
189 |
-
|
190 |
-
if ($(inheritName) && $(inheritName).checked) {
|
191 |
-
return 'inherit';
|
192 |
-
}
|
193 |
-
|
194 |
-
return $(fieldName).getValue();
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Add webservice version number field validation.
|
199 |
-
*/
|
200 |
-
Validation.add('postnl-validate-webservice-version', '<?php echo $_helper->__('Please enter a valid webservice version number. A valid webservice version number consists of a digit, an underscore and then another digit, e.g.: 1_1 or 2_0.'); ?>', {
|
201 |
-
pattern : new RegExp("^([0-9]+_[0-9]+)$", "i")
|
202 |
-
});
|
203 |
-
|
204 |
-
/**
|
205 |
-
* Add packing slip column header validation.
|
206 |
-
*/
|
207 |
-
Validation.add('validate-packing-slip-column-header', '<?php echo $_helper->__('Please use only letters (a-z A-Z), numbers (0-9) or one of the following characters: [( ) , . _ - #] in this field.') ?>', {
|
208 |
-
pattern : new RegExp("^[0-9a-zA-Z,.#\(\)-_]*$")
|
209 |
-
});
|
210 |
-
|
211 |
-
var postnlWizardSaveAndContinue = function(nextStepRel, currentStepRel) {
|
212 |
-
var nextStepHash = '';
|
213 |
-
|
214 |
-
/**
|
215 |
-
* If there is a next step, get it's hash.
|
216 |
-
*/
|
217 |
-
if (nextStepRel) {
|
218 |
-
var nextStepAnchor = $$('a[rel="' + nextStepRel + '"]')[0];
|
219 |
-
if (nextStepAnchor) {
|
220 |
-
nextStepHash = nextStepAnchor.getAttribute('href');
|
221 |
-
}
|
222 |
-
}
|
223 |
-
var params = {
|
224 |
-
next_step_hash : nextStepHash
|
225 |
-
};
|
226 |
-
|
227 |
-
var valid = true;
|
228 |
-
var fields = $$('#' + currentStepRel + ' input,#' + currentStepRel + ' select');
|
229 |
-
fields.each(
|
230 |
-
function(element) {
|
231 |
-
if (element.hasClassName('postnl-validate-empty-failed')) {
|
232 |
-
element.addClassName('required-entry');
|
233 |
-
}
|
234 |
-
|
235 |
-
if (!Validation.validate(element.id)) {
|
236 |
-
valid = false;
|
237 |
-
} else {
|
238 |
-
var advice = $('advice-required-entry-' + element.id);
|
239 |
-
if (advice) {
|
240 |
-
Validation.hideAdvice(element.id, advice);
|
241 |
-
}
|
242 |
-
}
|
243 |
-
|
244 |
-
if (element.hasClassName('required-entry')) {
|
245 |
-
element.removeClassName('required-entry');
|
246 |
-
}
|
247 |
-
}
|
248 |
-
);
|
249 |
-
|
250 |
-
if (!valid) {
|
251 |
-
return;
|
252 |
-
}
|
253 |
-
|
254 |
-
fields.each(
|
255 |
-
function(element) {
|
256 |
-
params[element.name] = element.getValue();
|
257 |
-
}
|
258 |
-
);
|
259 |
-
|
260 |
-
new Ajax.Request('<?php echo $_saveWizardStepUrl; ?>', {
|
261 |
-
method : 'post',
|
262 |
-
parameters : params,
|
263 |
-
onSuccess : function(response) {
|
264 |
-
var responseText = response.responseText;
|
265 |
-
if (responseText == 'success') {
|
266 |
-
/**
|
267 |
-
* If there is no next step, stay on the current step.
|
268 |
-
*/
|
269 |
-
if (!nextStepRel) {
|
270 |
-
nextStepRel = currentStepRel;
|
271 |
-
}
|
272 |
-
|
273 |
-
window.location.hash = nextStepHash;
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Go to the next step.
|
277 |
-
*/
|
278 |
-
postnlConfigWizard.toStep(nextStepRel);
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Add a success message.
|
282 |
-
*/
|
283 |
-
var successMessageText = Translator.translate('The previous step has been saved successfully!');
|
284 |
-
if (nextStepRel == currentStepRel) {
|
285 |
-
successMessageText = Translator.translate('This step has been saved successfully!');
|
286 |
-
}
|
287 |
-
|
288 |
-
var successMessage = new Element('div', {
|
289 |
-
'class' : 'wizard-success'
|
290 |
-
}).update(successMessageText);
|
291 |
-
|
292 |
-
$(nextStepRel).insert({
|
293 |
-
top:successMessage
|
294 |
-
});
|
295 |
-
|
296 |
-
/**
|
297 |
-
* Have the message fade away after 3 seconds.
|
298 |
-
*/
|
299 |
-
setTimeout(function() {
|
300 |
-
successMessage.fade();
|
301 |
-
}, 3000);
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Scroll to the top of the wizard.
|
305 |
-
*/
|
306 |
-
new Effect.Tween(
|
307 |
-
null,
|
308 |
-
document.viewport.getScrollOffsets().top,
|
309 |
-
$('postnl_wizard').cumulativeOffset()[1] - 50,
|
310 |
-
{},
|
311 |
-
function(p){ scrollTo(document.viewport.getScrollOffsets().left, p.round()); }
|
312 |
-
);
|
313 |
-
|
314 |
-
return;
|
315 |
-
}
|
316 |
-
|
317 |
-
if (responseText == 'redirect') {
|
318 |
-
window.location.href = '<?php echo $this->getUrl(''); ?>';
|
319 |
-
|
320 |
-
return;
|
321 |
-
}
|
322 |
-
|
323 |
-
/**
|
324 |
-
* If something went wrong, submit the entire config form as a fallback.
|
325 |
-
*/
|
326 |
-
configForm.submit();
|
327 |
-
}
|
328 |
-
});
|
329 |
-
|
330 |
-
return false;
|
331 |
-
};
|
332 |
-
|
333 |
-
Fieldset.toggleCollapse = function(containerId, saveThroughAjax) {
|
334 |
-
/**
|
335 |
-
* Close all open fieldsets first.
|
336 |
-
*/
|
337 |
-
$$('fieldset .config.collapseable').each(function(element) {
|
338 |
-
/**
|
339 |
-
* If the fieldset's ID is the same as the selected fieldset, or if the fieldset has nested fieldsets,
|
340 |
-
* skip this fieldset.
|
341 |
-
*/
|
342 |
-
if (element.id == containerId || element.select('fieldset .config.collapseable').length) {
|
343 |
-
return;
|
344 |
-
}
|
345 |
-
|
346 |
-
/**
|
347 |
-
* If this fieldset is already hidden, skip it.
|
348 |
-
*/
|
349 |
-
if (element.style.display == 'none') {
|
350 |
-
return;
|
351 |
-
}
|
352 |
-
|
353 |
-
/**
|
354 |
-
* Hide the fieldset.
|
355 |
-
*/
|
356 |
-
if ($(element.id + '-state')) {
|
357 |
-
$(element.id + '-state').value = 0;
|
358 |
-
}
|
359 |
-
$(element.id + '-head').collapsed = 1;
|
360 |
-
|
361 |
-
Fieldset.applyCollapse(element.id);
|
362 |
-
|
363 |
-
/**
|
364 |
-
* Save the fieldset's new, collapsed state.
|
365 |
-
*/
|
366 |
-
if (typeof saveThroughAjax != "undefined") {
|
367 |
-
Fieldset.saveState(saveThroughAjax, {container: element.id, value: $(element.id + '-state').value});
|
368 |
-
}
|
369 |
-
});
|
370 |
-
|
371 |
-
/**
|
372 |
-
* Continue as usual.
|
373 |
-
*/
|
374 |
-
if ($(containerId + '-state')) {
|
375 |
-
collapsed = $(containerId + '-state').value == 1 ? 0 : 1;
|
376 |
-
} else {
|
377 |
-
collapsed = $(containerId + '-head').collapsed;
|
378 |
-
}
|
379 |
-
//Cookie.read(this.cookiePrefix + containerId);
|
380 |
-
if(collapsed==1 || collapsed===undefined) {
|
381 |
-
//Cookie.write(this.cookiePrefix + containerId, 0, 30*24*60*60);
|
382 |
-
if ($(containerId + '-state')) {
|
383 |
-
$(containerId + '-state').value = 1;
|
384 |
-
}
|
385 |
-
$(containerId + '-head').collapsed = 0;
|
386 |
-
} else {
|
387 |
-
//Cookie.clear(this.cookiePrefix + containerId);
|
388 |
-
if ($(containerId + '-state')) {
|
389 |
-
$(containerId + '-state').value = 0;
|
390 |
-
}
|
391 |
-
$(containerId + '-head').collapsed = 1;
|
392 |
-
}
|
393 |
-
|
394 |
-
Fieldset.applyCollapse(containerId);
|
395 |
-
if (typeof saveThroughAjax != "undefined") {
|
396 |
-
Fieldset.saveState(saveThroughAjax, {container: containerId, value: $(containerId + '-state').value});
|
397 |
-
}
|
398 |
-
};
|
399 |
-
|
400 |
-
hideNotification = function(event) {
|
401 |
-
event.stop();
|
402 |
-
|
403 |
-
var element = Event.element(event);
|
404 |
-
var notificationCode = element.getAttribute('data-notification_code');
|
405 |
-
|
406 |
-
new Ajax.Request('<?php echo $_hideNotificationUrl; ?>', {
|
407 |
-
method : 'post',
|
408 |
-
parameters : {
|
409 |
-
notification_code : notificationCode
|
410 |
-
},
|
411 |
-
onSuccess : function() {
|
412 |
-
element.up('.module-message').fade();
|
413 |
-
}
|
414 |
-
});
|
415 |
-
};
|
416 |
-
|
417 |
-
$$('.postnl-hide-notification-link').invoke('observe', 'click', hideNotification.bindAsEventListener());
|
418 |
-
//]]>
|
419 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -34,7 +34,7 @@
|
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
-
* @copyright Copyright (c)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
@@ -364,6 +364,7 @@
|
|
364 |
</reference>
|
365 |
<reference name="checkout.onepage.billing">
|
366 |
<block type="core/template" name="postnl_billing_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
|
|
|
367 |
</reference>
|
368 |
<reference name="checkout.onepage.shipping">
|
369 |
<block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
|
@@ -462,6 +463,7 @@
|
|
462 |
<block type="postnl_deliveryoptions/checkout_deliveryOptions" name="postnl.osc.delivery.options" template="TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml">
|
463 |
<block type="core/template" name="postnl.osc.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
464 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
|
|
465 |
</block>
|
466 |
</reference>
|
467 |
|
@@ -477,6 +479,7 @@
|
|
477 |
<block type="postnl_deliveryoptions/checkout_deliveryOptions" name="postnl.osc.delivery.options" template="TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml">
|
478 |
<block type="core/template" name="postnl.osc.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
479 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
|
|
480 |
</block>
|
481 |
</reference>
|
482 |
</onestepcheckout_ajax_save_billing>
|
@@ -507,6 +510,7 @@
|
|
507 |
<action method="setRegionTemplate"><template>gomage/checkout/html/address/field/region.phtml</template></action>
|
508 |
<action method="setStreetTemplate"><template>gomage/checkout/html/address/field/street.phtml</template></action>
|
509 |
<block type="core/template" name="postnl_billing_postcodecheck" template="TIG/PostNL/address_validation/gomage_checkout/postcode_check.phtml"/>
|
|
|
510 |
</block>
|
511 |
<block type="postnl_addressvalidation/goMage_lightCheckout_shipping" name="checkout.onepage.address.shipping" as="shipping" template="TIG/PostNL/address_validation/gomage_checkout/shipping.phtml">
|
512 |
<action method="setCountryIdTemplate"><template>gomage/checkout/html/address/field/country.phtml</template></action>
|
@@ -520,6 +524,7 @@
|
|
520 |
<block type="postnl_deliveryoptions/checkout_goMage_lightCheckout_deliveryOptions" name="postnl.gomage.delivery.options" template="TIG/PostNL/delivery_options/gomage_checkout/deliveryoptions.phtml">
|
521 |
<block type="core/template" name="postnl.gomage.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
522 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
|
|
523 |
</block>
|
524 |
</reference>
|
525 |
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
-->
|
364 |
</reference>
|
365 |
<reference name="checkout.onepage.billing">
|
366 |
<block type="core/template" name="postnl_billing_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
|
367 |
+
<block type="postnl_deliveryoptions/checkout_idCheck" name="postnl_billing_idcheck" template="TIG/PostNL/delivery_options/idcheck.phtml"/>
|
368 |
</reference>
|
369 |
<reference name="checkout.onepage.shipping">
|
370 |
<block type="core/template" name="postnl_shipping_postcodecheck" template="TIG/PostNL/address_validation/checkout/onepage/postcode_check.phtml"/>
|
463 |
<block type="postnl_deliveryoptions/checkout_deliveryOptions" name="postnl.osc.delivery.options" template="TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml">
|
464 |
<block type="core/template" name="postnl.osc.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
465 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
466 |
+
<block type="postnl_deliveryoptions/checkout_idCheck" name="postnl_billing_idcheck" template="TIG/PostNL/delivery_options/idcheck.phtml"/>
|
467 |
</block>
|
468 |
</reference>
|
469 |
|
479 |
<block type="postnl_deliveryoptions/checkout_deliveryOptions" name="postnl.osc.delivery.options" template="TIG/PostNL/delivery_options/onestepcheckout/deliveryoptions.phtml">
|
480 |
<block type="core/template" name="postnl.osc.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
481 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
482 |
+
<block type="postnl_deliveryoptions/checkout_idCheck" name="postnl_billing_idcheck" template="TIG/PostNL/delivery_options/idcheck.phtml"/>
|
483 |
</block>
|
484 |
</reference>
|
485 |
</onestepcheckout_ajax_save_billing>
|
510 |
<action method="setRegionTemplate"><template>gomage/checkout/html/address/field/region.phtml</template></action>
|
511 |
<action method="setStreetTemplate"><template>gomage/checkout/html/address/field/street.phtml</template></action>
|
512 |
<block type="core/template" name="postnl_billing_postcodecheck" template="TIG/PostNL/address_validation/gomage_checkout/postcode_check.phtml"/>
|
513 |
+
<block type="postnl_deliveryoptions/checkout_idCheck" name="postnl_billing_idcheck" template="TIG/PostNL/delivery_options/idcheck.phtml"/>
|
514 |
</block>
|
515 |
<block type="postnl_addressvalidation/goMage_lightCheckout_shipping" name="checkout.onepage.address.shipping" as="shipping" template="TIG/PostNL/address_validation/gomage_checkout/shipping.phtml">
|
516 |
<action method="setCountryIdTemplate"><template>gomage/checkout/html/address/field/country.phtml</template></action>
|
524 |
<block type="postnl_deliveryoptions/checkout_goMage_lightCheckout_deliveryOptions" name="postnl.gomage.delivery.options" template="TIG/PostNL/delivery_options/gomage_checkout/deliveryoptions.phtml">
|
525 |
<block type="core/template" name="postnl.gomage.add.location" template="TIG/PostNL/delivery_options/addlocation.phtml"/>
|
526 |
<block type="postnl_deliveryoptions/checkout_addPhoneNumber" name="postnl.add.phonenumber" template="TIG/PostNL/delivery_options/addphonenumber.phtml"/>
|
527 |
+
<block type="postnl_deliveryoptions/checkout_idCheck" name="postnl_billing_idcheck" template="TIG/PostNL/delivery_options/idcheck.phtml"/>
|
528 |
</block>
|
529 |
</reference>
|
530 |
|
@@ -33,9 +33,10 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
|
|
39 |
?>
|
40 |
<form id="co-billing-form" action="">
|
41 |
<fieldset>
|
@@ -46,6 +47,12 @@
|
|
46 |
<div class="input-box">
|
47 |
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
48 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
</li>
|
50 |
<?php endif; ?>
|
51 |
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
@@ -60,20 +67,20 @@
|
|
60 |
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('postnl/addressValidation')->getAttributeValidationClass('company') ?>" />
|
61 |
</div>
|
62 |
</div>
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
68 |
</div>
|
69 |
-
|
70 |
-
<?php endif; ?>
|
71 |
</li>
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
<?php if (is_callable(array($this->helper('customer/address'), 'isVatAttributeVisible')) && $this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
78 |
<li class="wide">
|
79 |
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
@@ -112,44 +119,51 @@
|
|
112 |
</div>
|
113 |
</div>
|
114 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
143 |
</div>
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
</div>
|
150 |
-
</
|
151 |
-
|
152 |
-
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
153 |
<?php endif; ?>
|
154 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
155 |
<li class="control">
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
+
/** @var Mage_Checkout_Block_Onepage_Billing $this */
|
40 |
?>
|
41 |
<form id="co-billing-form" action="">
|
42 |
<fieldset>
|
47 |
<div class="input-box">
|
48 |
<?php echo $this->getAddressesHtmlSelect('billing') ?>
|
49 |
</div>
|
50 |
+
|
51 |
+
<?php
|
52 |
+
if ($this->helper('postnl/deliveryOptions')->quoteIsIDCheck()):
|
53 |
+
echo $this->getChildHtml('postnl_billing_idcheck');
|
54 |
+
endif;
|
55 |
+
?>
|
56 |
</li>
|
57 |
<?php endif; ?>
|
58 |
<li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
|
67 |
<input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('postnl/addressValidation')->getAttributeValidationClass('company') ?>" />
|
68 |
</div>
|
69 |
</div>
|
70 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
71 |
+
<div class="field">
|
72 |
+
<label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
73 |
+
<div class="input-box">
|
74 |
+
<input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
75 |
+
</div>
|
76 |
</div>
|
77 |
+
<?php endif; ?>
|
|
|
78 |
</li>
|
79 |
+
<?php echo $this->getChild('postnl_billing_postcodecheck')
|
80 |
+
->setAddressType('billing')
|
81 |
+
->setAddress($this->getAddress())
|
82 |
+
->setCountryHtmlSelect($this->getCountryHtmlSelect('billing'))
|
83 |
+
->toHtml(); ?>
|
84 |
<?php if (is_callable(array($this->helper('customer/address'), 'isVatAttributeVisible')) && $this->helper('customer/address')->isVatAttributeVisible()) : ?>
|
85 |
<li class="wide">
|
86 |
<label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label>
|
119 |
</div>
|
120 |
</div>
|
121 |
</li>
|
122 |
+
|
123 |
+
<?php
|
124 |
+
if (!$this->customerHasAddresses() && $this->helper('postnl/deliveryOptions')->quoteIsIDCheck()):
|
125 |
+
echo $this->getChildHtml('postnl_billing_idcheck');
|
126 |
+
endif;
|
127 |
+
?>
|
128 |
+
|
129 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
130 |
|
131 |
+
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob'); ?>
|
132 |
+
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
133 |
+
<?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
|
134 |
+
<li class="fields">
|
135 |
+
<?php if ($_dob->isEnabled()): ?>
|
136 |
+
<div class="field">
|
137 |
+
<?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
138 |
+
</div>
|
139 |
+
<?php endif; ?>
|
140 |
+
<?php if ($_gender->isEnabled()): ?>
|
141 |
+
<div class="field">
|
142 |
+
<?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
|
143 |
+
</div>
|
144 |
+
<?php endif ?>
|
145 |
+
</li>
|
146 |
+
<?php endif ?>
|
147 |
|
148 |
+
<?php if ($this->isTaxvatEnabled()):?>
|
149 |
+
<li><?php echo $this->getTaxvatHtml() ?></li>
|
150 |
+
<?php endif; ?>
|
151 |
|
152 |
+
<li class="fields" id="register-customer-password">
|
153 |
+
<div class="field">
|
154 |
+
<label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
|
155 |
+
<div class="input-box">
|
156 |
+
<input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
|
157 |
+
</div>
|
158 |
</div>
|
159 |
+
<div class="field">
|
160 |
+
<label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
|
161 |
+
<div class="input-box">
|
162 |
+
<input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
|
163 |
+
</div>
|
164 |
</div>
|
165 |
+
</li>
|
166 |
+
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
|
|
|
167 |
<?php endif; ?>
|
168 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
169 |
<li class="control">
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -158,7 +158,7 @@
|
|
158 |
|
159 |
<?php if ($_addressType == 'shipping'): ?>
|
160 |
$('billing:country_id').observe('change', function() {
|
161 |
-
postcodeCheck<?php echo $_addressType; ?>.changePostcodeCheckDisabledFields($('
|
162 |
});
|
163 |
|
164 |
/**
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
158 |
|
159 |
<?php if ($_addressType == 'shipping'): ?>
|
160 |
$('billing:country_id').observe('change', function() {
|
161 |
+
postcodeCheck<?php echo $_addressType; ?>.changePostcodeCheckDisabledFields($('shipping:country_id').getValue());
|
162 |
});
|
163 |
|
164 |
/**
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -81,7 +81,7 @@
|
|
81 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
82 |
|
83 |
<?php
|
84 |
-
$_show_dob = !$this->isCustomerLoggedIn() || ($this->isCustomerLoggedIn() && !$this->getQuote()->getCustomerDob());
|
85 |
$_show_gender = !$this->isCustomerLoggedIn() || ($this->isCustomerLoggedIn() && !$this->getQuote()->getCustomerGender());
|
86 |
?>
|
87 |
|
@@ -173,6 +173,11 @@
|
|
173 |
<label for="billing_use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
|
174 |
</li>
|
175 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
176 |
</ul>
|
177 |
<?php if (!$this->canShip()): ?>
|
178 |
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
81 |
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
|
82 |
|
83 |
<?php
|
84 |
+
$_show_dob = !$this->isCustomerLoggedIn() || ($this->isCustomerLoggedIn() && !$this->getQuote()->getCustomerDob()) || Mage::helper('postnl')->quoteIsBirthdayCheck();
|
85 |
$_show_gender = !$this->isCustomerLoggedIn() || ($this->isCustomerLoggedIn() && !$this->getQuote()->getCustomerGender());
|
86 |
?>
|
87 |
|
173 |
<label for="billing_use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
|
174 |
</li>
|
175 |
<?php endif; ?>
|
176 |
+
<?php if ($this->helper('postnl/deliveryOptions')->quoteIsIDCheck()): ?>
|
177 |
+
<li>
|
178 |
+
<?php echo $this->getChildHtml('postnl_billing_idcheck'); ?>
|
179 |
+
</li>
|
180 |
+
<?php endif; ?>
|
181 |
</ul>
|
182 |
<?php if (!$this->canShip()): ?>
|
183 |
<input type="hidden" name="billing[use_for_shipping]" value="1" />
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -18,6 +18,7 @@
|
|
18 |
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
* \______ /|__| \____/ |____/ | __/
|
20 |
* \/ |__|
|
|
|
21 |
*
|
22 |
* NOTICE OF LICENSE
|
23 |
*
|
@@ -33,11 +34,13 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
40 |
<?php
|
|
|
|
|
41 |
$formErrors = $this->getParentBlock()->formErrors;
|
42 |
$formErrors = (!empty($formErrors['billing_errors'])) ? $formErrors['billing_errors'] : array();
|
43 |
|
@@ -45,12 +48,12 @@ $helper = Mage::helper('onestepcheckout/checkout');
|
|
45 |
$dataHelper = Mage::helper('onestepcheckout');
|
46 |
|
47 |
$billingFields['firstname'] = '
|
48 |
-
<div class="input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
49 |
<label for="billing:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
50 |
<input class="required-entry input-text" type="text" name="billing[firstname]" id="billing:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFirstname()).'" />
|
51 |
</div>';
|
52 |
$billingFields['lastname'] = '
|
53 |
-
<div class="input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
54 |
<label for="billing:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
55 |
<input class="required-entry input-text" type="text" name="billing[lastname]" id="billing:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getLastname()).'" />
|
56 |
</div>';
|
@@ -66,32 +69,61 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
66 |
<?php endif; ?>
|
67 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
68 |
<?php $billingFields['email'] = $billingFields['email'].'
|
69 |
-
<div class="input-box input-email'.((in_array('email', $formErrors)) ? ' input-error' : '').'">
|
70 |
<label for="billing:email">'.$this->__('Email Address').' <span class="required">*</span></label><br />
|
71 |
-
<input type="
|
72 |
</div>';
|
73 |
?>
|
74 |
<?php endif; ?>
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
<?php if(!$this->settings['exclude_telephone']):?>
|
78 |
<?php $billingFields['telephone'] = '
|
79 |
-
<div class="input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
80 |
<label for="billing:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
81 |
-
<input type="
|
82 |
</div>';
|
83 |
?>
|
84 |
<?php endif; ?>
|
85 |
|
86 |
-
<?php
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
?>
|
|
|
|
|
|
|
|
|
|
|
92 |
<?php if(!$this->settings['exclude_region']): ?>
|
93 |
<?php $billingFields['region_id'] = '
|
94 |
-
<div class="input-box input-region'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
95 |
<label for="billing:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
96 |
<select id="billing:region_id" name="billing[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
97 |
<option value="">'.$this->__('Please select region, state or province').'</option>
|
@@ -103,10 +135,32 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
103 |
</div>';
|
104 |
?>
|
105 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
<?php if(!$this->settings['exclude_company']): ?>
|
108 |
<?php $billingFields['company'] = '
|
109 |
-
<div class="input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
110 |
<label for="billing:company">'.$this->__('Company').'</label><br/>
|
111 |
<input type="text" name="billing[company]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="billing:company" />
|
112 |
</div>';
|
@@ -115,7 +169,7 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
115 |
|
116 |
<?php if(!$this->settings['exclude_fax']): ?>
|
117 |
<?php $billingFields['fax'] = '
|
118 |
-
<div class="input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
119 |
<label for="billing:fax">'.$this->__('Fax').'</label><br/>
|
120 |
<input type="text" name="billing[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="billing:fax" />
|
121 |
</div>';
|
@@ -130,6 +184,7 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
130 |
}
|
131 |
} catch (Exception $e) {
|
132 |
}
|
|
|
133 |
if(!is_object($_taxvat)){
|
134 |
$_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
|
135 |
}
|
@@ -143,7 +198,7 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
143 |
<?php if (method_exists(Mage::helper('customer/address'), 'isVatAttributeVisible') && Mage::helper('customer/address')->isVatAttributeVisible()) : ?>
|
144 |
<?php $billingFields['taxvat'] = '
|
145 |
<label for="billing:vat_id">'.$this->__('VAT Number').'</label>
|
146 |
-
<div class="input-box">
|
147 |
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getVatId()).'" title="'.$this->__('VAT Number').'" class="input-text '.Mage::helper('customer/address')->getAttributeValidationClass('vat_id').'" />
|
148 |
</div>';
|
149 |
?>
|
@@ -151,6 +206,7 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
151 |
<?php
|
152 |
try {
|
153 |
$_dob = $this->getLayout()->createBlock('customer/widget_dob');
|
|
|
154 |
} catch (Exception $e) {
|
155 |
$_dob = false;
|
156 |
}
|
@@ -178,9 +234,12 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
178 |
?>
|
179 |
<?php endif ?>
|
180 |
<?php if(!$this->isCustomerLoggedIn() && $helper->showCreateAccount()): ?>
|
181 |
-
<?php
|
|
|
|
|
|
|
182 |
<div class="input-box">
|
183 |
-
<input id="id_create_account" type="checkbox" name="create_account" value="1" '.((isset($
|
184 |
<label for="id_create_account">'.$this->__('Create an account for later use').'</label>
|
185 |
</div>
|
186 |
|
@@ -196,21 +255,24 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
196 |
}
|
197 |
});
|
198 |
});
|
199 |
-
</script>
|
|
|
|
|
200 |
?>
|
201 |
<?php endif; ?>
|
202 |
<?php if($helper->showPasswords() && !$this->isCustomerLoggedIn()): ?>
|
203 |
<?php
|
|
|
204 |
//id="onestepcheckout-li-password"
|
205 |
$billingFields['password'] = '
|
206 |
<li id="onestepcheckout-li-password" '.(($helper->hidePasswords()) ? 'style="display: none;"':'').'>
|
207 |
-
<div class="input-box input-password'.((in_array('password', $formErrors)) ? ' input-error' : '').'">
|
208 |
<label for="billing:customer_password">'.$this->__('Password').'</label><br/>
|
209 |
-
<input type="password" class="input-text required-entry validate-password" value="'.((isset($
|
210 |
</div>
|
211 |
-
<div class="input-box input-password'.((in_array('confirm_password', $formErrors)) ? ' input-error' : '').'">
|
212 |
<label for="billing:confirm_password">'.$this->__('Confirm password').'</label><br/>
|
213 |
-
<input type="password" class="input-text required-entry validate-cpassword" value="'.((isset($
|
214 |
</div>
|
215 |
</li>';
|
216 |
?>
|
@@ -219,7 +281,9 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
219 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
220 |
<?php $billingFields['save_in_address_book'] = '
|
221 |
<li class="control">
|
222 |
-
<
|
|
|
|
|
223 |
</li>';
|
224 |
?>
|
225 |
<?php else:?>
|
@@ -228,12 +292,58 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
228 |
?>
|
229 |
<?php endif; ?>
|
230 |
|
231 |
-
<?php
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
<li class="
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
* \______ /|__| \____/ |____/ | __/
|
20 |
* \/ |__|
|
21 |
+
* OneStepCheckout
|
22 |
*
|
23 |
* NOTICE OF LICENSE
|
24 |
*
|
34 |
* versions in the future. If you wish to customize this module for your
|
35 |
* needs please contact servicedesk@tig.nl for more information.
|
36 |
*
|
37 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
38 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
39 |
*/
|
40 |
?>
|
41 |
<?php
|
42 |
+
$billingFields = array();
|
43 |
+
$extraBillingFields = array();
|
44 |
$formErrors = $this->getParentBlock()->formErrors;
|
45 |
$formErrors = (!empty($formErrors['billing_errors'])) ? $formErrors['billing_errors'] : array();
|
46 |
|
48 |
$dataHelper = Mage::helper('onestepcheckout');
|
49 |
|
50 |
$billingFields['firstname'] = '
|
51 |
+
<div class="osc-short input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
52 |
<label for="billing:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
53 |
<input class="required-entry input-text" type="text" name="billing[firstname]" id="billing:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFirstname()).'" />
|
54 |
</div>';
|
55 |
$billingFields['lastname'] = '
|
56 |
+
<div class="osc-short input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
57 |
<label for="billing:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
58 |
<input class="required-entry input-text" type="text" name="billing[lastname]" id="billing:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getLastname()).'" />
|
59 |
</div>';
|
69 |
<?php endif; ?>
|
70 |
<?php if(!$this->isCustomerLoggedIn()): ?>
|
71 |
<?php $billingFields['email'] = $billingFields['email'].'
|
72 |
+
<div class="osc-short input-box input-email'.((in_array('email', $formErrors)) ? ' input-error' : '').'">
|
73 |
<label for="billing:email">'.$this->__('Email Address').' <span class="required">*</span></label><br />
|
74 |
+
<input type="email" name="billing[email]" id="billing:email" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getEmail()).'" title="'.$this->__('Email Address') .'" class="validate-email required-entry input-text" />
|
75 |
</div>';
|
76 |
?>
|
77 |
<?php endif; ?>
|
78 |
|
79 |
+
<?php
|
80 |
+
// In some cases email might be 2 div-s inside one <li> and it messes up a good solution for css widths.
|
81 |
+
// Therefore here I make sure email creates just one div inside <li>
|
82 |
+
if (in_array('email', $billingFields) && $billingFields['email']) {
|
83 |
+
$billingFields['email'] = '<div style="overflow: hidden">'.$billingFields['email'].'</div>';
|
84 |
+
}
|
85 |
+
?>
|
86 |
+
|
87 |
|
88 |
<?php if(!$this->settings['exclude_telephone']):?>
|
89 |
<?php $billingFields['telephone'] = '
|
90 |
+
<div class="osc-short input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
91 |
<label for="billing:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
92 |
+
<input type="tel" name="billing[telephone]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getTelephone()).'" title="'.$this->__('Telephone').'" class="required-entry input-text" id="billing:telephone" />
|
93 |
</div>';
|
94 |
?>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
+
<?php if(!$this->settings['exclude_address']):?>
|
98 |
+
<?php $billingFields['street'] = $this->getChild('postnl_billing_postcodecheck')
|
99 |
+
->setAddressType('billing')
|
100 |
+
->setAddress($this->getQuote()->getBillingAddress())
|
101 |
+
->setCountryHtmlSelect($this->getCountryHtmlSelect('billing'))
|
102 |
+
->toHtml();
|
103 |
+
?>
|
104 |
+
<?php endif; ?>
|
105 |
+
|
106 |
+
<?php
|
107 |
+
/**
|
108 |
+
* TIG: Removed the postcode, city and country fields as they are already generated by the PostNL extension.
|
109 |
+
*/
|
110 |
+
?>
|
111 |
+
<?php /* if(!$this->settings['exclude_country_id']):?>
|
112 |
+
<?php
|
113 |
+
$billingFields['country_id'] = '
|
114 |
+
<div class="input-box input-country'.((in_array('country', $formErrors)) ? ' input-error' : '').'">
|
115 |
+
<label for="billing:country_id">'.$this->__('Country').' <span class="required">*</span></label><br />
|
116 |
+
'.$this->getCountryHtmlSelect('billing').'
|
117 |
+
</div>';
|
118 |
?>
|
119 |
+
<?php else: ?>
|
120 |
+
<?php $billingFields['country_id'] = '
|
121 |
+
<input type="hidden" name="billing[country_id]" id="billing:country_id" value="'.$this->settings['default_country'].'" />';
|
122 |
+
?>
|
123 |
+
<?php endif; */ ?>
|
124 |
<?php if(!$this->settings['exclude_region']): ?>
|
125 |
<?php $billingFields['region_id'] = '
|
126 |
+
<div class="osc-short input-box input-region input-region_id'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
127 |
<label for="billing:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
128 |
<select id="billing:region_id" name="billing[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
129 |
<option value="">'.$this->__('Please select region, state or province').'</option>
|
135 |
</div>';
|
136 |
?>
|
137 |
<?php endif; ?>
|
138 |
+
<?php
|
139 |
+
/**
|
140 |
+
* TIG: Removed the postcode, city and country fields as they are already generated by the PostNL extension.
|
141 |
+
*/
|
142 |
+
?>
|
143 |
+
<?php /* if(!$this->settings['exclude_city']):?>
|
144 |
+
<?php $billingFields['city'] = '
|
145 |
+
<div class="osc-short input-box input-city'.((in_array('city', $formErrors)) ? ' input-error' : '').'">
|
146 |
+
<label for="billing:city">'.$this->__('City').' <span class="required">*</span></label><br/>
|
147 |
+
<input type="text" name="billing[city]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getCity()).'" title="'.$this->__('City').'" class="required-entry input-text" id="billing:city" />
|
148 |
+
</div>';
|
149 |
+
?>
|
150 |
+
<?php endif; ?>
|
151 |
+
|
152 |
+
<?php if(!$this->settings['exclude_zip']): ?>
|
153 |
+
<?php $billingFields['postcode'] = '
|
154 |
+
<div class="osc-short input-box input-postcode'.((in_array('postcode', $formErrors)) ? ' input-error' : '').'" >
|
155 |
+
<label for="billing:postcode">'.$this->__('Zip/Postal Code').' <span class="required">*</span></label><br />
|
156 |
+
<input type="text" title="'.$this->__('Zip/Postal Code').'" name="billing[postcode]" id="billing:postcode" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getPostcode()).'" class="validate-zip-international required-entry input-text" />
|
157 |
+
</div>';
|
158 |
+
?>
|
159 |
+
<?php endif; */ ?>
|
160 |
|
161 |
<?php if(!$this->settings['exclude_company']): ?>
|
162 |
<?php $billingFields['company'] = '
|
163 |
+
<div class="osc-short input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
164 |
<label for="billing:company">'.$this->__('Company').'</label><br/>
|
165 |
<input type="text" name="billing[company]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="billing:company" />
|
166 |
</div>';
|
169 |
|
170 |
<?php if(!$this->settings['exclude_fax']): ?>
|
171 |
<?php $billingFields['fax'] = '
|
172 |
+
<div class="osc-short input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
173 |
<label for="billing:fax">'.$this->__('Fax').'</label><br/>
|
174 |
<input type="text" name="billing[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="billing:fax" />
|
175 |
</div>';
|
184 |
}
|
185 |
} catch (Exception $e) {
|
186 |
}
|
187 |
+
|
188 |
if(!is_object($_taxvat)){
|
189 |
$_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
|
190 |
}
|
198 |
<?php if (method_exists(Mage::helper('customer/address'), 'isVatAttributeVisible') && Mage::helper('customer/address')->isVatAttributeVisible()) : ?>
|
199 |
<?php $billingFields['taxvat'] = '
|
200 |
<label for="billing:vat_id">'.$this->__('VAT Number').'</label>
|
201 |
+
<div class="input-box input-vat">
|
202 |
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getVatId()).'" title="'.$this->__('VAT Number').'" class="input-text '.Mage::helper('customer/address')->getAttributeValidationClass('vat_id').'" />
|
203 |
</div>';
|
204 |
?>
|
206 |
<?php
|
207 |
try {
|
208 |
$_dob = $this->getLayout()->createBlock('customer/widget_dob');
|
209 |
+
|
210 |
} catch (Exception $e) {
|
211 |
$_dob = false;
|
212 |
}
|
234 |
?>
|
235 |
<?php endif ?>
|
236 |
<?php if(!$this->isCustomerLoggedIn() && $helper->showCreateAccount()): ?>
|
237 |
+
<?php
|
238 |
+
$getCreateAccount = $this->getRequest()->getPost('create_account', false);
|
239 |
+
$billingFields['create_account'] = '
|
240 |
+
<div>
|
241 |
<div class="input-box">
|
242 |
+
<input id="id_create_account" type="checkbox" name="create_account" value="1" '.((isset($getCreateAccount) && $getCreateAccount == '1') ? ' checked="checked"' : '').' />
|
243 |
<label for="id_create_account">'.$this->__('Create an account for later use').'</label>
|
244 |
</div>
|
245 |
|
255 |
}
|
256 |
});
|
257 |
});
|
258 |
+
</script>
|
259 |
+
</div>
|
260 |
+
';
|
261 |
?>
|
262 |
<?php endif; ?>
|
263 |
<?php if($helper->showPasswords() && !$this->isCustomerLoggedIn()): ?>
|
264 |
<?php
|
265 |
+
$billing_data = $this->getRequest()->getPost('billing', array());
|
266 |
//id="onestepcheckout-li-password"
|
267 |
$billingFields['password'] = '
|
268 |
<li id="onestepcheckout-li-password" '.(($helper->hidePasswords()) ? 'style="display: none;"':'').'>
|
269 |
+
<div class="osc-short input-box input-password'.((in_array('password', $formErrors)) ? ' input-error' : '').'">
|
270 |
<label for="billing:customer_password">'.$this->__('Password').'</label><br/>
|
271 |
+
<input type="password" class="input-text required-entry validate-password" value="'.((isset($billing_data['customer_password'])) ? Mage::helper('core')->escapeHtml($billing_data['customer_password']) : '').'" title="Password" id="billing:customer_password" name="billing[customer_password]"/>
|
272 |
</div>
|
273 |
+
<div class="osc-short input-box input-password'.((in_array('confirm_password', $formErrors)) ? ' input-error' : '').'">
|
274 |
<label for="billing:confirm_password">'.$this->__('Confirm password').'</label><br/>
|
275 |
+
<input type="password" class="input-text required-entry validate-cpassword" value="'.((isset($billing_data['confirm_password'])) ? Mage::helper('core')->escapeHtml($billing_data['confirm_password']) : '').'" id="billing:confirm_password" title="Confirm Password" name="billing[confirm_password]"/>
|
276 |
</div>
|
277 |
</li>';
|
278 |
?>
|
281 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
282 |
<?php $billingFields['save_in_address_book'] = '
|
283 |
<li class="control">
|
284 |
+
<div class="input-box input-save-address">
|
285 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="'.$this->__('Save in address book').'" id="billing:save_in_address_book" onchange="shipping.setSameAsBilling(false);"'.(($dataHelper->clearDash($this->getQuote()->getBillingAddress()->getSaveInAddressBook())) ? 'checked="checked"':'').' class="checkbox" /><label for="billing:save_in_address_book">'.$this->__('Save in address book').'</label>
|
286 |
+
</div>
|
287 |
</li>';
|
288 |
?>
|
289 |
<?php else:?>
|
292 |
?>
|
293 |
<?php endif; ?>
|
294 |
|
295 |
+
<?php
|
296 |
+
|
297 |
+
if ($this->helper('postnl/deliveryOptions')->quoteIsIDCheck()):
|
298 |
+
$extraBillingFields[11] = array(
|
299 |
+
'positionNr' => 11,
|
300 |
+
'fieldKey' => 'postnl_idcheck',
|
301 |
+
'inputElementHtml' => '<li class="control">' . $this->getChildHtml('postnl_billing_idcheck') . '</li>',
|
302 |
+
'isNewlineAfter' => '0',
|
303 |
+
);
|
304 |
+
endif;
|
305 |
+
|
306 |
+
$addressFields = $this->echoAddressFields($billingFields);
|
307 |
+
|
308 |
+
/**
|
309 |
+
* 1. Go from top to bottom and move all items 1 position up (14 -> 15, 10 -> 11, etc)
|
310 |
+
* 2. Place the new items in the array if at the right position.
|
311 |
+
* 3. Sort the array by key.
|
312 |
+
*/
|
313 |
+
foreach ($extraBillingFields as $position => $field):
|
314 |
+
$fieldAdded = false;
|
315 |
+
for ($i = max(array_keys($addressFields)); $i <= 0; $i--):
|
316 |
+
if (isset($addressFields[$i])):
|
317 |
+
$addressFields[$i + 1] = $addressFields[$i];
|
318 |
+
unset($addressFields[$i]);
|
319 |
+
endif;
|
320 |
+
|
321 |
+
if ($position == $i):
|
322 |
+
$fieldAdded = true;
|
323 |
+
$addressFields[$position] = $field;
|
324 |
+
break;
|
325 |
+
endif;
|
326 |
+
endfor;
|
327 |
+
|
328 |
+
if (!$fieldAdded):
|
329 |
+
$addressFields[$position] = $field;
|
330 |
+
endif;
|
331 |
+
endforeach;
|
332 |
+
|
333 |
+
ksort($addressFields);
|
334 |
+
|
335 |
+
// write out the sorted array, inserting <li> where there is Newline After
|
336 |
+
echo '<li class="clearfix">';
|
337 |
+
|
338 |
+
foreach ($addressFields as $inputElemArray ) {
|
339 |
+
echo $inputElemArray ["inputElementHtml"];
|
340 |
+
|
341 |
+
if ($inputElemArray ["isNewlineAfter"]) {
|
342 |
+
echo '</li>';
|
343 |
+
echo '<li class="clearfix">';
|
344 |
+
}
|
345 |
+
} // foreach
|
346 |
+
|
347 |
+
echo '</li>';
|
348 |
+
|
349 |
+
?>
|
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@tig.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
?>
|
40 |
+
<?php
|
41 |
+
$billingFields = array();
|
42 |
+
$extraBillingFields = array();
|
43 |
+
$formErrors = $this->getParentBlock()->formErrors;
|
44 |
+
$formErrors = (!empty($formErrors['billing_errors'])) ? $formErrors['billing_errors'] : array();
|
45 |
+
|
46 |
+
$helper = Mage::helper('onestepcheckout/checkout');
|
47 |
+
$dataHelper = Mage::helper('onestepcheckout');
|
48 |
+
|
49 |
+
$billingFields['firstname'] = '
|
50 |
+
<div class="input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
51 |
+
<label for="billing:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
52 |
+
<input class="required-entry input-text" type="text" name="billing[firstname]" id="billing:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFirstname()).'" />
|
53 |
+
</div>';
|
54 |
+
$billingFields['lastname'] = '
|
55 |
+
<div class="input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
56 |
+
<label for="billing:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
57 |
+
<input class="required-entry input-text" type="text" name="billing[lastname]" id="billing:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getLastname()).'" />
|
58 |
+
</div>';
|
59 |
+
?>
|
60 |
+
<?php if(!$this->isCustomerLoggedIn() || in_array('email_registered', $formErrors)): ?>
|
61 |
+
<?php $billingFields['email'] = '
|
62 |
+
<div class="clearfix" id="onestepcheckout-email-error" '.((!in_array('email_registered', $formErrors)) ? 'style="display: none"' : '').'>
|
63 |
+
<div id="onestepcheckout-email-error-message" class="onestepcheckout-error">'.
|
64 |
+
((in_array('email_registered', $formErrors)) ? $this->__('Email address already registered. Please <a href="#" onclick="login_popup.show(); return false;">login now</a> or use a different email address.') : $this->__('Invalid email address.'))
|
65 |
+
.'</div>
|
66 |
+
</div>';
|
67 |
+
?>
|
68 |
+
<?php endif; ?>
|
69 |
+
<?php if(!$this->isCustomerLoggedIn()): ?>
|
70 |
+
<?php $billingFields['email'] = $billingFields['email'].'
|
71 |
+
<div class="input-box input-email'.((in_array('email', $formErrors)) ? ' input-error' : '').'">
|
72 |
+
<label for="billing:email">'.$this->__('Email Address').' <span class="required">*</span></label><br />
|
73 |
+
<input type="text" name="billing[email]" id="billing:email" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getEmail()).'" title="'.$this->__('Email Address') .'" class="validate-email required-entry input-text" />
|
74 |
+
</div>';
|
75 |
+
?>
|
76 |
+
<?php endif; ?>
|
77 |
+
|
78 |
+
|
79 |
+
<?php if(!$this->settings['exclude_telephone']):?>
|
80 |
+
<?php $billingFields['telephone'] = '
|
81 |
+
<div class="input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
82 |
+
<label for="billing:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
83 |
+
<input type="text" name="billing[telephone]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getTelephone()).'" title="'.$this->__('Telephone').'" class="required-entry input-text" id="billing:telephone" />
|
84 |
+
</div>';
|
85 |
+
?>
|
86 |
+
<?php endif; ?>
|
87 |
+
|
88 |
+
<?php $billingFields['street'] = $this->getChild('postnl_billing_postcodecheck')
|
89 |
+
->setAddressType('billing')
|
90 |
+
->setAddress($this->getQuote()->getBillingAddress())
|
91 |
+
->setCountryHtmlSelect($this->getCountryHtmlSelect('billing'))
|
92 |
+
->toHtml();
|
93 |
+
?>
|
94 |
+
<?php if(!$this->settings['exclude_region']): ?>
|
95 |
+
<?php $billingFields['region_id'] = '
|
96 |
+
<div class="input-box input-region'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
97 |
+
<label for="billing:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
98 |
+
<select id="billing:region_id" name="billing[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
99 |
+
<option value="">'.$this->__('Please select region, state or province').'</option>
|
100 |
+
</select>
|
101 |
+
<script type="text/javascript">
|
102 |
+
$("billing:region_id").setAttribute("defaultValue", "'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getRegionId()).'");
|
103 |
+
</script>
|
104 |
+
<input type="text" id="billing:region" name="billing[region]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getRegion()).'" title="'.$this->__('State/Province').'" class="required-entry input-text" style="display:none" />
|
105 |
+
</div>';
|
106 |
+
?>
|
107 |
+
<?php endif; ?>
|
108 |
+
|
109 |
+
<?php if(!$this->settings['exclude_company']): ?>
|
110 |
+
<?php $billingFields['company'] = '
|
111 |
+
<div class="input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
112 |
+
<label for="billing:company">'.$this->__('Company').'</label><br/>
|
113 |
+
<input type="text" name="billing[company]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="billing:company" />
|
114 |
+
</div>';
|
115 |
+
?>
|
116 |
+
<?php endif; ?>
|
117 |
+
|
118 |
+
<?php if(!$this->settings['exclude_fax']): ?>
|
119 |
+
<?php $billingFields['fax'] = '
|
120 |
+
<div class="input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
121 |
+
<label for="billing:fax">'.$this->__('Fax').'</label><br/>
|
122 |
+
<input type="text" name="billing[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="billing:fax" />
|
123 |
+
</div>';
|
124 |
+
?>
|
125 |
+
<?php endif; ?>
|
126 |
+
|
127 |
+
<?php
|
128 |
+
$_taxvat = false;
|
129 |
+
try {
|
130 |
+
if(Mage::getStoreConfig('onestepcheckout/exclude_fields/enable_pillwaxeuvat_support')){
|
131 |
+
$_taxvat = $this->getLayout()->createBlock('euvat/widget_taxvat');
|
132 |
+
}
|
133 |
+
} catch (Exception $e) {
|
134 |
+
}
|
135 |
+
if(!is_object($_taxvat)){
|
136 |
+
$_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat');
|
137 |
+
}
|
138 |
+
?>
|
139 |
+
<?php if(is_object($_taxvat) && $_taxvat->isEnabled() && !$this->isCustomerLoggedIn()): ?>
|
140 |
+
<?php $billingFields['taxvat'] =
|
141 |
+
$_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
|
142 |
+
->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml();
|
143 |
+
?>
|
144 |
+
<?php endif; ?>
|
145 |
+
<?php if (method_exists(Mage::helper('customer/address'), 'isVatAttributeVisible') && Mage::helper('customer/address')->isVatAttributeVisible()) : ?>
|
146 |
+
<?php $billingFields['taxvat'] = '
|
147 |
+
<label for="billing:vat_id">'.$this->__('VAT Number').'</label>
|
148 |
+
<div class="input-box">
|
149 |
+
<input type="text" id="billing:vat_id" name="billing[vat_id]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getVatId()).'" title="'.$this->__('VAT Number').'" class="input-text '.Mage::helper('customer/address')->getAttributeValidationClass('vat_id').'" />
|
150 |
+
</div>';
|
151 |
+
?>
|
152 |
+
<?php endif; ?>
|
153 |
+
<?php
|
154 |
+
try {
|
155 |
+
$_dob = $this->getLayout()->createBlock('customer/widget_dob');
|
156 |
+
} catch (Exception $e) {
|
157 |
+
$_dob = false;
|
158 |
+
}
|
159 |
+
?>
|
160 |
+
<?php
|
161 |
+
try {
|
162 |
+
$_gender = $this->getLayout()->createBlock('customer/widget_gender');
|
163 |
+
} catch (Exception $e) {
|
164 |
+
$_gender = false;
|
165 |
+
}
|
166 |
+
?>
|
167 |
+
|
168 |
+
<?php if (is_object($_dob) && $_dob->isEnabled() && !$this->isCustomerLoggedIn()): ?>
|
169 |
+
<?php $billingFields['dob'] = '
|
170 |
+
<div class="field">
|
171 |
+
'.$_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml().'
|
172 |
+
</div>';
|
173 |
+
?>
|
174 |
+
<?php endif; ?>
|
175 |
+
<?php if (is_object($_gender) && $_gender->isEnabled() && !$this->isCustomerLoggedIn()): ?>
|
176 |
+
<?php $billingFields['gender'] = '
|
177 |
+
<div class="field">
|
178 |
+
'.$_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml().'
|
179 |
+
</div>';
|
180 |
+
?>
|
181 |
+
<?php endif ?>
|
182 |
+
<?php if(!$this->isCustomerLoggedIn() && $helper->showCreateAccount()): ?>
|
183 |
+
<?php $billingFields['create_account'] = '
|
184 |
+
<div class="input-box">
|
185 |
+
<input id="id_create_account" type="checkbox" name="create_account" value="1" '.((isset($_POST['create_account']) && $_POST['create_account'] == '1') ? ' checked="checked"' : '').' />
|
186 |
+
<label for="id_create_account">'.$this->__('Create an account for later use').'</label>
|
187 |
+
</div>
|
188 |
+
|
189 |
+
<script>
|
190 |
+
document.observe("dom:loaded", function() {
|
191 |
+
$("id_create_account").observe("click", function(e) {
|
192 |
+
var element = e.element();
|
193 |
+
if(element.checked) {
|
194 |
+
$("onestepcheckout-li-password").show();
|
195 |
+
}
|
196 |
+
else {
|
197 |
+
$("onestepcheckout-li-password").hide();
|
198 |
+
}
|
199 |
+
});
|
200 |
+
});
|
201 |
+
</script>';
|
202 |
+
?>
|
203 |
+
<?php endif; ?>
|
204 |
+
<?php if($helper->showPasswords() && !$this->isCustomerLoggedIn()): ?>
|
205 |
+
<?php
|
206 |
+
//id="onestepcheckout-li-password"
|
207 |
+
$billingFields['password'] = '
|
208 |
+
<li id="onestepcheckout-li-password" '.(($helper->hidePasswords()) ? 'style="display: none;"':'').'>
|
209 |
+
<div class="input-box input-password'.((in_array('password', $formErrors)) ? ' input-error' : '').'">
|
210 |
+
<label for="billing:customer_password">'.$this->__('Password').'</label><br/>
|
211 |
+
<input type="password" class="input-text required-entry validate-password" value="'.((isset($_POST['billing']['customer_password'])) ? Mage::helper('core')->escapeHtml($_POST['billing']['customer_password']) : '').'" title="Password" id="billing:customer_password" name="billing[customer_password]"/>
|
212 |
+
</div>
|
213 |
+
<div class="input-box input-password'.((in_array('confirm_password', $formErrors)) ? ' input-error' : '').'">
|
214 |
+
<label for="billing:confirm_password">'.$this->__('Confirm password').'</label><br/>
|
215 |
+
<input type="password" class="input-text required-entry validate-cpassword" value="'.((isset($_POST['billing']['confirm_password'])) ? Mage::helper('core')->escapeHtml($_POST['billing']['confirm_password']) : '').'" id="billing:confirm_password" title="Confirm Password" name="billing[confirm_password]"/>
|
216 |
+
</div>
|
217 |
+
</li>';
|
218 |
+
?>
|
219 |
+
<?php endif; ?>
|
220 |
+
|
221 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
222 |
+
<?php $billingFields['save_in_address_book'] = '
|
223 |
+
<li class="control">
|
224 |
+
<input type="checkbox" name="billing[save_in_address_book]" value="1" title="'.$this->__('Save in address book').'" id="billing:save_in_address_book" onchange="shipping.setSameAsBilling(false);"'.(($dataHelper->clearDash($this->getQuote()->getBillingAddress()->getSaveInAddressBook())) ? 'checked="checked"':'').' class="checkbox" /><label for="billing:save_in_address_book">'.$this->__('Save in address book').'</label>
|
225 |
+
</li>';
|
226 |
+
?>
|
227 |
+
<?php else:?>
|
228 |
+
<?php $billingFields['save_in_address_book'] = '
|
229 |
+
<li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>';
|
230 |
+
?>
|
231 |
+
<?php endif; ?>
|
232 |
+
|
233 |
+
<?php
|
234 |
+
if ($this->helper('postnl/deliveryOptions')->quoteIsIDCheck()):
|
235 |
+
$extraBillingFields[11]['fields'] = array('postnl_idcheck' => '<li class="control">' . $this->getChildHtml('postnl_billing_idcheck') . '</li>');
|
236 |
+
endif;
|
237 |
+
?>
|
238 |
+
|
239 |
+
<?php $billingFields = $this->getBillingFieldsOrder($billingFields);?>
|
240 |
+
|
241 |
+
<?php
|
242 |
+
/**
|
243 |
+
* 1. Go from top to bottom and move all items 1 position up (14 -> 15, 10 -> 11, etc)
|
244 |
+
* 2. Place the new items in the array if at the right position.
|
245 |
+
* 3. Sort the array by key.
|
246 |
+
*/
|
247 |
+
foreach ($extraBillingFields as $position => $field):
|
248 |
+
$fieldAdded = false;
|
249 |
+
for ($i = max(array_keys($billingFields)); $i <= 0; $i--):
|
250 |
+
if (isset($billingFields[$i])):
|
251 |
+
$billingFields[$i + 1] = $billingFields[$i];
|
252 |
+
unset($billingFields[$i]);
|
253 |
+
endif;
|
254 |
+
|
255 |
+
if ($position == $i):
|
256 |
+
$fieldAdded = true;
|
257 |
+
$billingFields[$position] = $field;
|
258 |
+
break;
|
259 |
+
endif;
|
260 |
+
endfor;
|
261 |
+
|
262 |
+
if (!$fieldAdded):
|
263 |
+
$billingFields[$position] = $field;
|
264 |
+
endif;
|
265 |
+
endforeach;
|
266 |
+
ksort($billingFields);
|
267 |
+
?>
|
268 |
+
|
269 |
+
|
270 |
+
<?php $_streetFieldSortOrder = Mage::helper('postnl/addressValidation')->getOscStreetFieldSortOrder(); ?>
|
271 |
+
<?php foreach($billingFields as $key => $value):?>
|
272 |
+
<?php if(!empty($value['has_li']) || $key == $_streetFieldSortOrder):?>
|
273 |
+
<?php echo implode('',$value['fields']);?>
|
274 |
+
<?php else:?>
|
275 |
+
<li class="clearfix"><?php echo implode('',$value['fields']);?></li>
|
276 |
+
<?php endif;?>
|
277 |
+
<?php endforeach;?>
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php /**
|
2 |
+
* ___________ __ __
|
3 |
+
* \__ ___/____ _/ |_ _____ | |
|
4 |
+
* | | / _ \\ __\\__ \ | |
|
5 |
+
* | | | |_| || | / __ \_| |__
|
6 |
+
* |____| \____/ |__| (____ /|____/
|
7 |
+
* \/
|
8 |
+
* ___ __ __
|
9 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
10 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
11 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
12 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
13 |
+
* \/ \/
|
14 |
+
* ________
|
15 |
+
* / _____/_______ ____ __ __ ______
|
16 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
17 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
18 |
+
* \______ /|__| \____/ |____/ | __/
|
19 |
+
* \/ |__|
|
20 |
+
*
|
21 |
+
* NOTICE OF LICENSE
|
22 |
+
*
|
23 |
+
* This source file is subject to the Creative Commons License.
|
24 |
+
* It is available through the world-wide-web at this URL:
|
25 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
26 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
27 |
+
* to servicedesk@tig.nl so we can send you a copy immediately.
|
28 |
+
*
|
29 |
+
* DISCLAIMER
|
30 |
+
*
|
31 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
32 |
+
* versions in the future. If you wish to customize this module for your
|
33 |
+
* needs please contact servicedesk@tig.nl for more information.
|
34 |
+
*
|
35 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
36 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
37 |
+
*/
|
38 |
+
?>
|
39 |
+
<?php
|
40 |
+
$formErrors = $this->getParentBlock()->formErrors;
|
41 |
+
$formErrors = (!empty($formErrors['shipping_errors'])) ? $formErrors['shipping_errors'] : array();
|
42 |
+
|
43 |
+
$helper = Mage::helper('onestepcheckout/checkout');
|
44 |
+
$dataHelper = Mage::helper('onestepcheckout');
|
45 |
+
$shippingFields['firstname'] = '
|
46 |
+
<div class="input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
47 |
+
<label for="shipping:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
48 |
+
<input class="required-entry input-text" type="text" name="shipping[firstname]" id="shipping:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFirstname()).'" />
|
49 |
+
</div>';
|
50 |
+
$shippingFields['lastname'] = '
|
51 |
+
<div class="input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
52 |
+
<label for="shipping:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
53 |
+
<input class="required-entry input-text" type="text" name="shipping[lastname]" id="shipping:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getLastname()).'" />
|
54 |
+
</div>';
|
55 |
+
?>
|
56 |
+
|
57 |
+
|
58 |
+
<?php $shippingFields['street'] = $this->getChild('postnl_shipping_postcodecheck')
|
59 |
+
->setAddressType('shipping')
|
60 |
+
->setAddress($this->getQuote()->getBillingAddress())
|
61 |
+
->setCountryHtmlSelect($this->getCountryHtmlSelect('shipping'))
|
62 |
+
->toHtml();
|
63 |
+
?>
|
64 |
+
<?php if(!$this->settings['exclude_region'] ): ?>
|
65 |
+
<?php $shippingFields['region_id'] = '
|
66 |
+
<div class="input-box input-region'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
67 |
+
<label for="shipping:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
68 |
+
<select id="shipping:region_id" name="shipping[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
69 |
+
<option value="">'.$this->__('Please select region, state or province').'</option>
|
70 |
+
</select>
|
71 |
+
<script type="text/javascript">
|
72 |
+
$("shipping:region_id").setAttribute("defaultValue", "'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getRegionId()).'");
|
73 |
+
</script>
|
74 |
+
<input type="text" id="shipping:region" name="shipping[region]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getRegion()).'" title="'.$this->__('State/Province').'" class="required-entry input-text" style="display:none" />
|
75 |
+
</div>';
|
76 |
+
?>
|
77 |
+
<?php endif; ?>
|
78 |
+
<?php if(!$this->settings['exclude_telephone']):?>
|
79 |
+
<?php $shippingFields['telephone'] = '
|
80 |
+
<div class="input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
81 |
+
<label for="shipping:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
82 |
+
<input type="text" name="shipping[telephone]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getTelephone()).'" title="'.$this->__('Telephone').'" class="required-entry input-text" id="shipping:telephone" />
|
83 |
+
</div>';
|
84 |
+
?>
|
85 |
+
<?php endif; ?>
|
86 |
+
<?php if(!$this->settings['exclude_company']): ?>
|
87 |
+
<?php $shippingFields['company'] = '
|
88 |
+
<div class="input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
89 |
+
<label for="shipping:company">'.$this->__('Company').'</label><br/>
|
90 |
+
<input type="text" name="shipping[company]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="shipping:company" />
|
91 |
+
</div>';
|
92 |
+
?>
|
93 |
+
<?php endif; ?>
|
94 |
+
|
95 |
+
<?php if(!$this->settings['exclude_fax']): ?>
|
96 |
+
<?php $shippingFields['fax'] = '
|
97 |
+
<div class="input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
98 |
+
<label for="shipping:fax">'.$this->__('Fax').'</label><br/>
|
99 |
+
<input type="text" name="shipping[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="shipping:fax" />
|
100 |
+
</div>';
|
101 |
+
?>
|
102 |
+
<?php endif; ?>
|
103 |
+
|
104 |
+
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
105 |
+
<?php $shippingFields['save_in_address_book'] = '
|
106 |
+
<li class="control">
|
107 |
+
<input type="checkbox" name="shipping[save_in_address_book]" value="1" title="'.$this->__('Save in address book').'" id="shipping:save_in_address_book" '.(($this->getQuote()->getShippingAddress()->getSaveInAddressBook()) ? 'checked="checked"':'').' class="checkbox" /><label for="shipping:save_in_address_book">'.$this->__('Save in address book').'</label>
|
108 |
+
</li>';
|
109 |
+
?>
|
110 |
+
<?php else:?>
|
111 |
+
<?php $shippingFields['save_in_address_book'] = '
|
112 |
+
<li class="no-display"><input type="hidden" name="shipping[save_in_address_book]" value="1" /></li>';
|
113 |
+
?>
|
114 |
+
<?php endif; ?>
|
115 |
+
|
116 |
+
<?php $shippingFields = $this->getshippingFieldsOrder($shippingFields);?>
|
117 |
+
<?php $_streetFieldSortOrder = Mage::helper('postnl/addressValidation')->getOscStreetFieldSortOrder(); ?>
|
118 |
+
<?php foreach($shippingFields as $key => $value):?>
|
119 |
+
<?php if(!empty($value['has_li']) || $key == $_streetFieldSortOrder):?>
|
120 |
+
<?php echo implode('',$value['fields']);?>
|
121 |
+
<?php else:?>
|
122 |
+
<li class="clearfix"><?php echo implode('',$value['fields']);?></li>
|
123 |
+
<?php endif;?>
|
124 |
+
<?php endforeach;?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -32,7 +32,7 @@
|
|
32 |
* versions in the future. If you wish to customize this module for your
|
33 |
* needs please contact servicedesk@tig.nl for more information.
|
34 |
*
|
35 |
-
* @copyright Copyright (c)
|
36 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
37 |
*/
|
38 |
?>
|
@@ -43,27 +43,47 @@ $formErrors = (!empty($formErrors['shipping_errors'])) ? $formErrors['shipping_e
|
|
43 |
$helper = Mage::helper('onestepcheckout/checkout');
|
44 |
$dataHelper = Mage::helper('onestepcheckout');
|
45 |
$shippingFields['firstname'] = '
|
46 |
-
<div class="input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
47 |
<label for="shipping:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
48 |
<input class="required-entry input-text" type="text" name="shipping[firstname]" id="shipping:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFirstname()).'" />
|
49 |
</div>';
|
50 |
$shippingFields['lastname'] = '
|
51 |
-
<div class="input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
52 |
<label for="shipping:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
53 |
<input class="required-entry input-text" type="text" name="shipping[lastname]" id="shipping:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getLastname()).'" />
|
54 |
</div>';
|
55 |
?>
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
<?php
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
?>
|
|
|
64 |
<?php if(!$this->settings['exclude_region'] ): ?>
|
65 |
<?php $shippingFields['region_id'] = '
|
66 |
-
<div class="input-box input-region'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
67 |
<label for="shipping:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
68 |
<select id="shipping:region_id" name="shipping[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
69 |
<option value="">'.$this->__('Please select region, state or province').'</option>
|
@@ -75,17 +95,38 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
75 |
</div>';
|
76 |
?>
|
77 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
<?php if(!$this->settings['exclude_telephone']):?>
|
79 |
<?php $shippingFields['telephone'] = '
|
80 |
-
<div class="input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
81 |
<label for="shipping:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
82 |
-
<input type="
|
83 |
</div>';
|
84 |
?>
|
85 |
<?php endif; ?>
|
86 |
<?php if(!$this->settings['exclude_company']): ?>
|
87 |
<?php $shippingFields['company'] = '
|
88 |
-
<div class="input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
89 |
<label for="shipping:company">'.$this->__('Company').'</label><br/>
|
90 |
<input type="text" name="shipping[company]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="shipping:company" />
|
91 |
</div>';
|
@@ -94,12 +135,20 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
94 |
|
95 |
<?php if(!$this->settings['exclude_fax']): ?>
|
96 |
<?php $shippingFields['fax'] = '
|
97 |
-
<div class="input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
98 |
<label for="shipping:fax">'.$this->__('Fax').'</label><br/>
|
99 |
<input type="text" name="shipping[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="shipping:fax" />
|
100 |
</div>';
|
101 |
?>
|
102 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
105 |
<?php $shippingFields['save_in_address_book'] = '
|
@@ -113,12 +162,21 @@ $dataHelper = Mage::helper('onestepcheckout');
|
|
113 |
?>
|
114 |
<?php endif; ?>
|
115 |
|
116 |
-
<?php
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
* versions in the future. If you wish to customize this module for your
|
33 |
* needs please contact servicedesk@tig.nl for more information.
|
34 |
*
|
35 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
36 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
37 |
*/
|
38 |
?>
|
43 |
$helper = Mage::helper('onestepcheckout/checkout');
|
44 |
$dataHelper = Mage::helper('onestepcheckout');
|
45 |
$shippingFields['firstname'] = '
|
46 |
+
<div class="osc-short input-box input-firstname'.((in_array('firstname', $formErrors)) ? ' input-error' : '').'">
|
47 |
<label for="shipping:firstname">'.$this->__('First Name').' <span class="required">*</span></label><br />
|
48 |
<input class="required-entry input-text" type="text" name="shipping[firstname]" id="shipping:firstname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFirstname()).'" />
|
49 |
</div>';
|
50 |
$shippingFields['lastname'] = '
|
51 |
+
<div class="osc-short input-box input-lastname'.((in_array('lastname', $formErrors)) ? ' input-error' : '').'">
|
52 |
<label for="shipping:lastname">'.$this->__('Last Name').' <span class="required">*</span></label><br />
|
53 |
<input class="required-entry input-text" type="text" name="shipping[lastname]" id="shipping:lastname" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getLastname()).'" />
|
54 |
</div>';
|
55 |
?>
|
56 |
|
57 |
+
<?php if(!$this->settings['exclude_address']):?>
|
58 |
+
<?php $shippingFields['street'] = $this->getChild('postnl_shipping_postcodecheck')
|
59 |
+
->setAddressType('shipping')
|
60 |
+
->setAddress($this->getQuote()->getBillingAddress())
|
61 |
+
->setCountryHtmlSelect($this->getCountryHtmlSelect('shipping'))
|
62 |
+
->toHtml();
|
63 |
+
?>
|
64 |
+
<?php endif; ?>
|
65 |
|
66 |
+
<?php
|
67 |
+
/**
|
68 |
+
+ * TIG: Removed the postcode, city and country fields as they are already generated by the PostNL extension.
|
69 |
+
+ */
|
70 |
+
?>
|
71 |
+
<?php /* if(!$this->settings['exclude_country_id']):?>
|
72 |
+
<?php
|
73 |
+
$shippingFields['country_id'] = '
|
74 |
+
<div class="input-box input-country'.((in_array('country', $formErrors)) ? ' input-error' : '').'">
|
75 |
+
<label for="shipping:country_id">'.$this->__('Country').' <span class="required">*</span></label><br />
|
76 |
+
'.$this->getCountryHtmlSelect('shipping').'
|
77 |
+
</div>';
|
78 |
+
?>
|
79 |
+
<?php else: ?>
|
80 |
+
<?php $shippingFields['country_id'] = '
|
81 |
+
<input type="hidden" name="shipping[country_id]" id="shipping:country_id" value="'.$this->settings['default_country'].'" />';
|
82 |
?>
|
83 |
+
<?php endif; */ ?>
|
84 |
<?php if(!$this->settings['exclude_region'] ): ?>
|
85 |
<?php $shippingFields['region_id'] = '
|
86 |
+
<div class="osc-short input-box input-region input-region_id'.((in_array('region', $formErrors)) ? ' input-error' : '').'">
|
87 |
<label for="shipping:region">'.$this->__('State/Province').' <span class="required">*</span></label><br/>
|
88 |
<select id="shipping:region_id" name="shipping[region_id]" title="'.$this->__('State/Province').'" class="validate-select" style="display:none">
|
89 |
<option value="">'.$this->__('Please select region, state or province').'</option>
|
95 |
</div>';
|
96 |
?>
|
97 |
<?php endif; ?>
|
98 |
+
<?php
|
99 |
+
/**
|
100 |
+
* TIG: Removed the postcode, city and country fields as they are already generated by the PostNL extension.
|
101 |
+
*/
|
102 |
+
?>
|
103 |
+
<?php /* if(!$this->settings['exclude_city']):?>
|
104 |
+
<?php $shippingFields['city'] = '
|
105 |
+
<div class="osc-short input-box input-city'.((in_array('city', $formErrors)) ? ' input-error' : '').'">
|
106 |
+
<label for="shipping:city">'.$this->__('City').' <span class="required">*</span></label><br/>
|
107 |
+
<input type="text" name="shipping[city]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getCity()).'" title="'.$this->__('City').'" class="required-entry input-text" id="shipping:city" />
|
108 |
+
</div>';
|
109 |
+
?>
|
110 |
+
<?php endif; ?>
|
111 |
+
<?php if(!$this->settings['exclude_zip']): ?>
|
112 |
+
<?php $shippingFields['postcode'] = '
|
113 |
+
<div class="osc-short input-box input-postcode'.((in_array('postcode', $formErrors)) ? ' input-error' : '').'" >
|
114 |
+
<label for="shipping:postcode">'.$this->__('Zip/Postal Code').' <span class="required">*</span></label><br />
|
115 |
+
<input type="text" title="'.$this->__('Zip/Postal Code').'" name="shipping[postcode]" id="shipping:postcode" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getPostcode()).'" class="validate-zip-international required-entry input-text" />
|
116 |
+
</div>';
|
117 |
+
?>
|
118 |
+
<?php endif; */ ?>
|
119 |
<?php if(!$this->settings['exclude_telephone']):?>
|
120 |
<?php $shippingFields['telephone'] = '
|
121 |
+
<div class="osc-short input-box input-telephone'.((in_array('telephone', $formErrors)) ? ' input-error' : '').'">
|
122 |
<label for="shipping:telephone">'.$this->__('Telephone').' <span class="required">*</span></label><br/>
|
123 |
+
<input type="tel" name="shipping[telephone]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getTelephone()).'" title="'.$this->__('Telephone').'" class="required-entry input-text" id="shipping:telephone" />
|
124 |
</div>';
|
125 |
?>
|
126 |
<?php endif; ?>
|
127 |
<?php if(!$this->settings['exclude_company']): ?>
|
128 |
<?php $shippingFields['company'] = '
|
129 |
+
<div class="osc-short input-box input-company'.((in_array('company', $formErrors)) ? ' input-error' : '').'">
|
130 |
<label for="shipping:company">'.$this->__('Company').'</label><br/>
|
131 |
<input type="text" name="shipping[company]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getCompany()).'" title="'.$this->__('Company').'" class="input-text" id="shipping:company" />
|
132 |
</div>';
|
135 |
|
136 |
<?php if(!$this->settings['exclude_fax']): ?>
|
137 |
<?php $shippingFields['fax'] = '
|
138 |
+
<div class="osc-short input-box input-fax'.((in_array('fax', $formErrors)) ? ' input-error' : '').'">
|
139 |
<label for="shipping:fax">'.$this->__('Fax').'</label><br/>
|
140 |
<input type="text" name="shipping[fax]" value="'.$dataHelper->clearDash($this->getQuote()->getShippingAddress()->getFax()).'" title="'.$this->__('Fax').'" class="input-text" id="shipping:fax" />
|
141 |
</div>';
|
142 |
?>
|
143 |
<?php endif; ?>
|
144 |
+
<?php if (method_exists(Mage::helper('customer/address'), 'isVatAttributeVisible') && Mage::helper('customer/address')->isVatAttributeVisible()) : ?>
|
145 |
+
<?php $shippingFields['taxvat'] = '
|
146 |
+
<label for="billing:vat_id">'.$this->__('VAT Number').'</label>
|
147 |
+
<div class="input-box input-vat">
|
148 |
+
<input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="'.$dataHelper->clearDash($this->getQuote()->getBillingAddress()->getVatId()).'" title="'.$this->__('VAT Number').'" class="input-text '.Mage::helper('customer/address')->getAttributeValidationClass('vat_id').'" />
|
149 |
+
</div>';
|
150 |
+
?>
|
151 |
+
<?php endif; ?>
|
152 |
|
153 |
<?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
|
154 |
<?php $shippingFields['save_in_address_book'] = '
|
162 |
?>
|
163 |
<?php endif; ?>
|
164 |
|
165 |
+
<?php
|
166 |
+
|
167 |
+
$addressFields = $this->echoAddressFields($shippingFields);
|
168 |
+
|
169 |
+
// write out the sorted array, inserting <li> where there is Newline After
|
170 |
+
echo '<li class="clearfix">';
|
171 |
+
|
172 |
+
foreach ($addressFields as $inputElemArray ) {
|
173 |
+
echo $inputElemArray ["inputElementHtml"];
|
174 |
+
|
175 |
+
if ($inputElemArray ["isNewlineAfter"]) {
|
176 |
+
echo '</li>';
|
177 |
+
echo '<li class="clearfix">';
|
178 |
+
}
|
179 |
+
} // foreach
|
180 |
+
|
181 |
+
echo '</li>';
|
182 |
+
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
/**
|
40 |
+
* @var TIG_PostNL_Block_Checkout_Widget_Date $this
|
41 |
+
*/
|
42 |
+
|
43 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
44 |
+
$helper = Mage::helper('postnl');
|
45 |
+
|
46 |
+
if ($this->hasLabel()) {
|
47 |
+
?>
|
48 |
+
<label for="<?php echo $this->getFieldId('month') ?>">
|
49 |
+
<?php echo $this->getLabel() ?>
|
50 |
+
<?php if ($this->getIsRequired()): ?>
|
51 |
+
<span class="required"><?php if ($helper->isIdevOsc()): echo '*'; endif; ?></span>
|
52 |
+
<?php endif; ?>
|
53 |
+
</label>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
?>
|
57 |
+
<div class="input-box postnl-date">
|
58 |
+
<?php
|
59 |
+
$this->setDateInput('d',
|
60 |
+
'<div class="postnl-day">
|
61 |
+
<input type="text" id="' . $this->getFieldId('day') . '" name="' . $this->getFieldName('day') . '" value="' . $this->getDay() . '" title="' . $this->__('Day') . '" class="input-text" ' . $this->getFieldParams() . ' />
|
62 |
+
<label for="' . $this->getFieldId('day') . '">' . $this->__('DD') . '</label>
|
63 |
+
</div>'
|
64 |
+
);
|
65 |
+
|
66 |
+
$this->setDateInput('m',
|
67 |
+
'<div class="postnl-month">
|
68 |
+
<input type="text" id="' . $this->getFieldId('month') . '" name="' . $this->getFieldName('month') . '" value="' . $this->getMonth() . '" title="' . $this->__('Month') . '" class="input-text" ' . $this->getFieldParams() . ' />
|
69 |
+
<label for="' . $this->getFieldId('month') . '">' . $this->__('MM') . '</label>
|
70 |
+
</div>'
|
71 |
+
);
|
72 |
+
|
73 |
+
$this->setDateInput('y',
|
74 |
+
'<div class="postnl-year">
|
75 |
+
<input type="text" id="' . $this->getFieldId('year') . '" name="' . $this->getFieldName('year') . '" value="' . $this->getYear() . '" title="' . $this->__('Year') . '" class="input-text" ' . $this->getFieldParams() . ' />
|
76 |
+
<label for="' . $this->getFieldId('year') . '">' . $this->__('YYYY') . '</label>
|
77 |
+
</div>'
|
78 |
+
);
|
79 |
+
|
80 |
+
echo $this->getSortedDateInputs();
|
81 |
+
?>
|
82 |
+
<div class="postnl-full">
|
83 |
+
<input type="hidden" id="<?php echo $this->getFieldId('full')?>" name="<?php echo $this->getFieldName('full')?>" />
|
84 |
+
</div>
|
85 |
+
|
86 |
+
<div class="postnl-idcheck-validation-advice validation-advice-container" style="display:none;"></div>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<script type="text/javascript">
|
90 |
+
//<![CDATA[
|
91 |
+
var el = $$('.postnl-date')[0];
|
92 |
+
var container = {};
|
93 |
+
container.day = Element.select(el, '.postnl-day input')[0];
|
94 |
+
container.month = Element.select(el, '.postnl-month input')[0];
|
95 |
+
container.year = Element.select(el, '.postnl-year input')[0];
|
96 |
+
container.full = Element.select(el, '.postnl-full input')[0];
|
97 |
+
container.advice = Element.select(el, '.postnl-idcheck-validation-advice')[0];
|
98 |
+
|
99 |
+
var result = new Varien.DateElement('container', container, <?php echo $this->getIsRequired() ? 'true' : 'false' ?>, '<?php echo $this->getDateFormat() ?>');
|
100 |
+
|
101 |
+
result.validateDataErrorText = 'Please enter a date that is in the future.';
|
102 |
+
|
103 |
+
/**
|
104 |
+
* The default is to check that the date is in the past, but we need to check that the date is in the future.
|
105 |
+
*
|
106 |
+
* @returns {boolean}
|
107 |
+
*/
|
108 |
+
result.validateData = function () {
|
109 |
+
var date = new Date;
|
110 |
+
return date < this.fullDate;
|
111 |
+
};
|
112 |
+
//]]>
|
113 |
+
</script>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Core_Order_Returns_Shipment_Items $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Core_Order_Returns_Shipment_Items $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -42,14 +42,17 @@
|
|
42 |
<?php
|
43 |
/** @var TIG_PostNL_Helper_DeliveryOptions $_helper */
|
44 |
$_helper = Mage::helper('postnl/deliveryOptions'); ?>
|
45 |
-
|
46 |
-
<?php
|
47 |
-
<?php
|
48 |
-
|
49 |
-
<?php
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
54 |
<?php endif; ?>
|
55 |
<?php endif; ?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
42 |
<?php
|
43 |
/** @var TIG_PostNL_Helper_DeliveryOptions $_helper */
|
44 |
$_helper = Mage::helper('postnl/deliveryOptions'); ?>
|
45 |
+
|
46 |
+
<?php if ($_order): ?>
|
47 |
+
<?php $_deliveryOptions = $_helper->getDeliveryOptionsInfo($_order, false); ?>
|
48 |
+
<?php $_filteredDeliveryOptions = array_filter($_deliveryOptions); ?>
|
49 |
+
<?php if (!empty($_filteredDeliveryOptions) && $_helper->canUseDeliveryDays(false)): ?>
|
50 |
+
<br />
|
51 |
+
<?php echo $this->formatDate($_deliveryOptions['store_delivery_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM); ?>
|
52 |
+
<?php if ($_deliveryOptions['store_delivery_time_start'] && $_deliveryOptions['store_delivery_time_end'] && $_helper->canUseTimeframes(false)): ?>
|
53 |
+
(<?php echo $_deliveryOptions['store_delivery_time_start']; ?> - <?php echo $_deliveryOptions['store_delivery_time_end']; ?>)
|
54 |
+
<?php elseif ($_deliveryOptions['store_delivery_time_start'] && $_helper->canUseTimeframes(false)): ?>
|
55 |
+
(<?php echo $_helper->__('from')?> <?php echo $_deliveryOptions['store_delivery_time_start']; ?>)
|
56 |
+
<?php endif; ?>
|
57 |
<?php endif; ?>
|
58 |
<?php endif; ?>
|
@@ -33,29 +33,32 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
40 |
<?php /** @var Mage_Sales_Model_Order $_order */ ?>
|
41 |
<?php $_order = $this->getOrder(); ?>
|
42 |
<?php $_helper = Mage::helper('postnl'); ?>
|
43 |
-
|
44 |
-
<?php if ($
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
61 |
<?php endif; ?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
40 |
<?php /** @var Mage_Sales_Model_Order $_order */ ?>
|
41 |
<?php $_order = $this->getOrder(); ?>
|
42 |
<?php $_helper = Mage::helper('postnl'); ?>
|
43 |
+
|
44 |
+
<?php if ($_order): ?>
|
45 |
+
<?php $_pakjeGemakAddress = $_helper->getPakjeGemakAddressForOrder($_order); ?>
|
46 |
+
<?php if ($_pakjeGemakAddress): ?>
|
47 |
+
<table cellspacing="0" cellpadding="0" border="0" width="650">
|
48 |
+
<thead>
|
49 |
+
<tr>
|
50 |
+
<th align="left" width="325" bgcolor="#EAEAEA" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><?php echo $_helper->__('Post office address:'); ?></th>
|
51 |
+
</tr>
|
52 |
+
</thead>
|
53 |
+
<tbody>
|
54 |
+
<tr>
|
55 |
+
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA;">
|
56 |
+
<?php echo $_helper->__('You have chosen to pick up your address at the following post office location:') ?><br/><br/>
|
57 |
+
<?php echo $_pakjeGemakAddress->format('html'); ?>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
</tbody>
|
61 |
+
</table>
|
62 |
+
<br/>
|
63 |
+
<?php endif; ?>
|
64 |
<?php endif; ?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Core_ShippingStatus $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_Core_ShippingStatus $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_DeliveryOptions_Checkout_AddPhoneNumber $this
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*
|
39 |
* @var TIG_PostNL_Block_DeliveryOptions_Checkout_AddPhoneNumber $this
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -33,7 +33,7 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
@@ -43,13 +43,19 @@
|
|
43 |
* @var Mage_Sales_Model_Quote_Address $_address
|
44 |
*/
|
45 |
?>
|
46 |
-
<?php $_store
|
47 |
-
<?php $_address
|
48 |
-
<?php $_postcode
|
49 |
-
<?php $_country
|
50 |
-
<?php $_deliveryDate
|
51 |
-
<?php $
|
52 |
-
<?php $
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
<?php $_canUseResponsive = Mage::helper('postnl/deliveryOptions')->canUseResponsive(); ?>
|
55 |
|
@@ -249,6 +255,7 @@
|
|
249 |
|
250 |
var postcode;
|
251 |
var housenumber;
|
|
|
252 |
var fullAddress = "<?php echo implode(' ', $_address->getStreet()) . ', ' . $_address->getCity() . ', ' . $_address->getPostcode() . ', ' . $_address->getCountry(); ?>";
|
253 |
|
254 |
/**
|
@@ -276,11 +283,12 @@
|
|
276 |
|
277 |
postcode = getPostnlPostcode(billingOrShipping);
|
278 |
housenumber = getPostnlHousenumber(billingOrShipping);
|
|
|
279 |
|
280 |
/**
|
281 |
* If we don't have a postcode or house number, we cant retrieve the available time frames and locations.
|
282 |
*/
|
283 |
-
if (!postcode || !housenumber) {
|
284 |
return;
|
285 |
}
|
286 |
|
@@ -295,7 +303,7 @@
|
|
295 |
/**
|
296 |
* Start the delivery options script.
|
297 |
*/
|
298 |
-
startDeliveryOptions(postcode, housenumber, fullAddress);
|
299 |
}
|
300 |
|
301 |
/**
|
@@ -303,9 +311,10 @@
|
|
303 |
*
|
304 |
* @param {string} postcode
|
305 |
* @param {int} housenumber
|
|
|
306 |
* @param {string} fullAddress
|
307 |
*/
|
308 |
-
function startDeliveryOptions(postcode, housenumber, fullAddress) {
|
309 |
var options;
|
310 |
var params;
|
311 |
var postnlDebugMode = <?php echo $this->isDebugEnabled() ? 'true' : 'false'; ?>;
|
@@ -317,10 +326,18 @@
|
|
317 |
locationsInAreaUrl : '<?php echo $this->getUrl('postnl/deliveryOptions/getLocationsInArea', array('_secure' => true)) ?>',
|
318 |
postcode : postcode,
|
319 |
housenumber : housenumber,
|
|
|
|
|
320 |
country : '<?php echo $this->escapeHtml($_country); ?>',
|
321 |
-
deliveryDate : '<?php echo $_deliveryDate; ?>',
|
|
|
322 |
imageBaseUrl : baseUrl,
|
323 |
-
fullAddress : fullAddress
|
|
|
|
|
|
|
|
|
|
|
324 |
};
|
325 |
|
326 |
options = {
|
@@ -514,6 +531,55 @@
|
|
514 |
return housenumber;
|
515 |
}
|
516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
/**
|
518 |
* Register a bunch of OSC specific observers
|
519 |
*/
|
@@ -556,12 +622,17 @@
|
|
556 |
/**
|
557 |
* These fields' values are used to determine available delivery options.
|
558 |
*/
|
559 |
-
if (!$('virtual_billing_street' + streetnameField)
|
560 |
var fieldsToObserve = [
|
561 |
'billing_street' + streetnameField,
|
562 |
'shipping_street' + streetnameField,
|
563 |
'billing_postcode',
|
564 |
-
'
|
|
|
|
|
|
|
|
|
|
|
565 |
];
|
566 |
|
567 |
if (streetnameField != housenumberField) {
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
*/
|
39 |
?>
|
43 |
* @var Mage_Sales_Model_Quote_Address $_address
|
44 |
*/
|
45 |
?>
|
46 |
+
<?php $_store = Mage::app()->getStore(); ?>
|
47 |
+
<?php $_address = $this->getShippingAddress(); ?>
|
48 |
+
<?php $_postcode = $this->getPostcode(); ?>
|
49 |
+
<?php $_country = $this->getCountry(); ?>
|
50 |
+
<?php $_deliveryDate = $this->getDeliveryDate('delivery'); ?>
|
51 |
+
<?php $_pickupDate = $this->getDeliveryDate('pickup'); ?>
|
52 |
+
<?php $_streetData = $this->getStreetData(); ?>
|
53 |
+
<?php $_housenumber = $_streetData['housenumber']; ?>
|
54 |
+
<?php $_street = $_streetData['streetname']; ?>
|
55 |
+
<?php $_city = $this->getCity(); ?>
|
56 |
+
<?php $_weekdayCutOffTime = $this->getCutOff('weekday'); ?>
|
57 |
+
<?php $_sundayCutOffTime = $this->getCutOff('sunday'); ?>
|
58 |
+
<?php $_sameDayCutOffTime = $this->getCutOff('sameday'); ?>
|
59 |
|
60 |
<?php $_canUseResponsive = Mage::helper('postnl/deliveryOptions')->canUseResponsive(); ?>
|
61 |
|
255 |
|
256 |
var postcode;
|
257 |
var housenumber;
|
258 |
+
var street;
|
259 |
var fullAddress = "<?php echo implode(' ', $_address->getStreet()) . ', ' . $_address->getCity() . ', ' . $_address->getPostcode() . ', ' . $_address->getCountry(); ?>";
|
260 |
|
261 |
/**
|
283 |
|
284 |
postcode = getPostnlPostcode(billingOrShipping);
|
285 |
housenumber = getPostnlHousenumber(billingOrShipping);
|
286 |
+
street = getPostnlStreet(billingOrShipping);
|
287 |
|
288 |
/**
|
289 |
* If we don't have a postcode or house number, we cant retrieve the available time frames and locations.
|
290 |
*/
|
291 |
+
if (!postcode || !housenumber || !street) {
|
292 |
return;
|
293 |
}
|
294 |
|
303 |
/**
|
304 |
* Start the delivery options script.
|
305 |
*/
|
306 |
+
startDeliveryOptions(postcode, housenumber, street, fullAddress);
|
307 |
}
|
308 |
|
309 |
/**
|
311 |
*
|
312 |
* @param {string} postcode
|
313 |
* @param {int} housenumber
|
314 |
+
* @param {string} street
|
315 |
* @param {string} fullAddress
|
316 |
*/
|
317 |
+
function startDeliveryOptions(postcode, housenumber, street, fullAddress) {
|
318 |
var options;
|
319 |
var params;
|
320 |
var postnlDebugMode = <?php echo $this->isDebugEnabled() ? 'true' : 'false'; ?>;
|
326 |
locationsInAreaUrl : '<?php echo $this->getUrl('postnl/deliveryOptions/getLocationsInArea', array('_secure' => true)) ?>',
|
327 |
postcode : postcode,
|
328 |
housenumber : housenumber,
|
329 |
+
street : street,
|
330 |
+
city : '<?php echo $this->escapeHtml($_city); ?>',
|
331 |
country : '<?php echo $this->escapeHtml($_country); ?>',
|
332 |
+
deliveryDate : '<?php echo $this->escapeJavascriptHtml($_deliveryDate); ?>',
|
333 |
+
pickupDate : '<?php echo $this->escapeJavascriptHtml($_pickupDate); ?>',
|
334 |
imageBaseUrl : baseUrl,
|
335 |
+
fullAddress : fullAddress,
|
336 |
+
cutOffTimes : {
|
337 |
+
weekday: '<?php echo $_weekdayCutOffTime; ?>',
|
338 |
+
sunday: '<?php echo $_sundayCutOffTime; ?>',
|
339 |
+
sameday: '<?php echo $_sameDayCutOffTime; ?>'
|
340 |
+
}
|
341 |
};
|
342 |
|
343 |
options = {
|
531 |
return housenumber;
|
532 |
}
|
533 |
|
534 |
+
/**
|
535 |
+
* @param {string} billingOrShipping
|
536 |
+
*
|
537 |
+
* @returns {string|int}
|
538 |
+
*/
|
539 |
+
function getPostnlStreet(billingOrShipping) {
|
540 |
+
var street = '<?php echo $_street; ?>';
|
541 |
+
var addressSelectField;
|
542 |
+
|
543 |
+
if (billingOrShipping == 'billing') {
|
544 |
+
addressSelectField = $('billing-address-select');
|
545 |
+
} else {
|
546 |
+
addressSelectField = $('shipping-address-select');
|
547 |
+
}
|
548 |
+
|
549 |
+
/**
|
550 |
+
* If we don't have a street and no preset address is chosen, get the street from the street address field.
|
551 |
+
*/
|
552 |
+
if (!street
|
553 |
+
|| (
|
554 |
+
(!addressSelectField || addressSelectField.getValue() == '')
|
555 |
+
&& street != $(billingOrShipping + '_street' + streetnameField).getValue()
|
556 |
+
)
|
557 |
+
) {
|
558 |
+
var streetFieldValue = $(billingOrShipping + '_street' + streetnameField).getValue();
|
559 |
+
|
560 |
+
if (streetFieldValue) {
|
561 |
+
street = streetFieldValue;
|
562 |
+
}
|
563 |
+
}
|
564 |
+
|
565 |
+
/**
|
566 |
+
* If we still don't have a street, get it from the streetname field.
|
567 |
+
*/
|
568 |
+
if (!street) {
|
569 |
+
var streetname = $(billingOrShipping + '_street' + streetnameField).getValue();
|
570 |
+
var streetnameRegex = /([a-zA-Z]+)/;
|
571 |
+
|
572 |
+
var streetnameArray = streetname.match(streetnameRegex);
|
573 |
+
if (!streetnameArray || streetnameArray.length < 1) {
|
574 |
+
throw "Unable to parse streetname";
|
575 |
+
}
|
576 |
+
|
577 |
+
street = streetnameArray[0];
|
578 |
+
}
|
579 |
+
|
580 |
+
return street;
|
581 |
+
}
|
582 |
+
|
583 |
/**
|
584 |
* Register a bunch of OSC specific observers
|
585 |
*/
|
622 |
/**
|
623 |
* These fields' values are used to determine available delivery options.
|
624 |
*/
|
625 |
+
if (!$('virtual_billing_street' + streetnameField) || !$('virtual_shipping_street' + streetnameField)) {
|
626 |
var fieldsToObserve = [
|
627 |
'billing_street' + streetnameField,
|
628 |
'shipping_street' + streetnameField,
|
629 |
'billing_postcode',
|
630 |
+
'billing_city',
|
631 |
+
'shipping_postcode',
|
632 |
+
'billing_city',
|
633 |
+
'postnl_idcheck:type',
|
634 |
+
'postnl_idcheck:number',
|
635 |
+
'postnl_idcheck:expiration_date_full'
|
636 |
];
|
637 |
|
638 |
if (streetnameField != housenumberField) {
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* ___________ __ __
|
4 |
+
* \__ ___/____ _/ |_ _____ | |
|
5 |
+
* | | / _ \\ __\\__ \ | |
|
6 |
+
* | | | |_| || | / __ \_| |__
|
7 |
+
* |____| \____/ |__| (____ /|____/
|
8 |
+
* \/
|
9 |
+
* ___ __ __
|
10 |
+
* | | ____ _/ |_ ____ _______ ____ ____ _/ |_
|
11 |
+
* | | / \\ __\_/ __ \\_ __ \ / \ _/ __ \\ __\
|
12 |
+
* | || | \| | \ ___/ | | \/| | \\ ___/ | |
|
13 |
+
* |___||___| /|__| \_____>|__| |___| / \_____>|__|
|
14 |
+
* \/ \/
|
15 |
+
* ________
|
16 |
+
* / _____/_______ ____ __ __ ______
|
17 |
+
* / \ ___\_ __ \ / _ \ | | \\____ \
|
18 |
+
* \ \_\ \| | \/| |_| || | /| |_| |
|
19 |
+
* \______ /|__| \____/ |____/ | __/
|
20 |
+
* \/ |__|
|
21 |
+
*
|
22 |
+
* NOTICE OF LICENSE
|
23 |
+
*
|
24 |
+
* This source file is subject to the Creative Commons License.
|
25 |
+
* It is available through the world-wide-web at this URL:
|
26 |
+
* http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
27 |
+
* If you are unable to obtain it through the world-wide-web, please send an email
|
28 |
+
* to servicedesk@totalinternetgroup.nl so we can send you a copy immediately.
|
29 |
+
*
|
30 |
+
* DISCLAIMER
|
31 |
+
*
|
32 |
+
* Do not edit or add to this file if you wish to upgrade this module to newer
|
33 |
+
* versions in the future. If you wish to customize this module for your
|
34 |
+
* needs please contact servicedesk@totalinternetgroup.nl for more information.
|
35 |
+
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.totalinternetgroup.nl)
|
37 |
+
* @license http://creativecommons.org/licenses/by-nc-nd/3.0/nl/deed.en_US
|
38 |
+
*/
|
39 |
+
/** @var TIG_PostNL_Block_DeliveryOptions_Checkout_IdCheck $this */
|
40 |
+
|
41 |
+
/** @var TIG_PostNL_Helper_Data $helper */
|
42 |
+
$helper = $this->helper('postnl');
|
43 |
+
?>
|
44 |
+
<div id="postnl_idcheck">
|
45 |
+
<em><?php echo $helper->__('The following data will be used for a personidentification when delivering the parcel.'); ?></em>
|
46 |
+
|
47 |
+
<div class="fields">
|
48 |
+
<div class="field">
|
49 |
+
<label for="billing_postnl_idcheck:type">
|
50 |
+
<?php echo $helper->__('Document type'); ?>
|
51 |
+
<span class="required"><?php if ($helper->isIdevOsc()): echo '*'; endif; ?></span>
|
52 |
+
</label>
|
53 |
+
<div class="input-box">
|
54 |
+
<?php
|
55 |
+
echo $this->getLayout()->createBlock('core/html_select')
|
56 |
+
->setName('billing_postnl_idcheck[type]')
|
57 |
+
->setId('billing_postnl_idcheck:type')
|
58 |
+
->setClass('required-entry')
|
59 |
+
->setValue($this->getPostnlOrder()->getIdcheckType())
|
60 |
+
->setOptions($this->helper('postnl/deliveryOptions_iDCheck')->getValidationOptions())
|
61 |
+
->toHtml();
|
62 |
+
?>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
|
66 |
+
<div class="field">
|
67 |
+
<label for="billing_postnl_idcheck:number">
|
68 |
+
<?php echo $helper->__('Documentnumber:'); ?>
|
69 |
+
<span class="required"><?php if ($helper->isIdevOsc()): echo '*'; endif; ?></span>
|
70 |
+
</label>
|
71 |
+
<div class="input-box">
|
72 |
+
<input type="text" name="billing_postnl_idcheck[number]" value="<?php echo $this->escapeHtml($this->getPostnlOrder()->getIdcheckNumber()); ?>" id="billing_postnl_idcheck:number" class="input-text required-entry">
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
<?php
|
78 |
+
/** @var TIG_PostNL_Block_Checkout_Widget_Date $_date */
|
79 |
+
$_date = $this->getLayout()->createBlock('postnl/checkout_widget_date');
|
80 |
+
echo $_date
|
81 |
+
->setFieldIdFormat('billing_postnl_idcheck:expiration_date_%s')
|
82 |
+
->setFieldNameFormat('billing_postnl_idcheck[expiration_date_%s]')
|
83 |
+
->setLabel($helper->__('Expiration date:'))
|
84 |
+
->setDate($this->getPostnlOrder()->getIdcheckExpirationDate())
|
85 |
+
->setIsRequired(true)
|
86 |
+
->toHtml();
|
87 |
+
?>
|
88 |
+
</div>
|
@@ -33,16 +33,16 @@
|
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
-
* @copyright Copyright (c)
|
37 |
* @license htt
|
33 |
* versions in the future. If you wish to customize this module for your
|
34 |
* needs please contact servicedesk@tig.nl for more information.
|
35 |
*
|
36 |
+
* @copyright Copyright (c) 2017 Total Internet Group B.V. (http://www.tig.nl)
|
37 |
* @license htt
|