Version Notes
Shoe store has the following Features.
1. Ajax add to cart, wishlist and Compare Products.
2. Responsive Mega menu.
3. Ajax One step Checkout
Download this release
Release Info
Developer | AbserveTech |
Extension | AbservetechShoestore |
Version | 0.0.1 |
Comparing to | |
See all releases |
Version 0.0.1
- app/code/community/Abserve/AjaxWishlist/Block/AjaxWishlist.php +26 -0
- app/code/community/Abserve/AjaxWishlist/Helper/Data.php +15 -0
- app/code/community/Abserve/AjaxWishlist/controllers/IndexController.php +148 -0
- app/code/community/Abserve/AjaxWishlist/etc/config.xml +81 -0
- app/code/community/Abserve/Ajaxcart/Block/Adminhtml/Info.php +38 -0
- app/code/community/Abserve/Ajaxcart/Block/Adminhtml/Url.php +94 -0
- app/code/community/Abserve/Ajaxcart/Helper/Data.php +11 -0
- app/code/community/Abserve/Ajaxcart/Model/Observer.php +104 -0
- app/code/community/Abserve/Ajaxcart/Model/Response.php +109 -0
- app/code/community/Abserve/Ajaxcart/controllers/Checkout/CartController.php +203 -0
- app/code/community/Abserve/Ajaxcart/etc/config.xml +140 -0
- app/code/community/Abserve/Ajaxcart/etc/system.xml +69 -0
- app/code/community/Abserve/AutoCurrency/Helper/Data.php +171 -0
- app/code/community/Abserve/AutoCurrency/Model/Store.php +115 -0
- app/code/community/Abserve/AutoCurrency/Model/System/Config/Source/Database.php +40 -0
- app/code/community/Abserve/AutoCurrency/etc/config.xml +41 -0
- app/code/community/Abserve/AutoCurrency/etc/system.xml +48 -0
- app/code/community/Abserve/Catalog/Model/Convert/Adapter/Category.php +138 -0
- app/code/community/Abserve/Catalog/etc/config.xml +21 -0
- app/code/community/Abserve/CustomMenu/Block/About.php +212 -0
- app/code/community/Abserve/CustomMenu/Block/Navigation - Copy.php +542 -0
- app/code/community/Abserve/CustomMenu/Block/Navigation.php +407 -0
- app/code/community/Abserve/CustomMenu/Block/Navigation_old.php +536 -0
- app/code/community/Abserve/CustomMenu/Block/Toggle.php +43 -0
- app/code/community/Abserve/CustomMenu/Block/Topmenu.php +17 -0
- app/code/community/Abserve/CustomMenu/Helper/Data.php +151 -0
- app/code/community/Abserve/CustomMenu/controllers/AjaxmenucontentController.php +24 -0
- app/code/community/Abserve/CustomMenu/controllers/AjaxmobilemenucontentController.php +22 -0
- app/code/community/Abserve/CustomMenu/etc/config.xml +144 -0
- app/code/community/Abserve/CustomMenu/etc/system.xml +231 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback.php +21 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit.php +60 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Form.php +28 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/Form.php +119 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/History.php +40 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/Message.php +37 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tabs.php +46 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Grid.php +135 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/File.php +43 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Product.php +19 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Sentstatus.php +23 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Status.php +31 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/License/Purchaseform.php +24 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/License/Updateform.php +48 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/License/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox.php +27 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid.php +106 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid/Renderer/Actions.php +44 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid/Renderer/Extensions.php +28 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Window.php +127 -0
- app/code/community/Abserve/Magenotification/Block/Adminhtml/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Config/Extensioncerts.php +191 -0
- app/code/community/Abserve/Magenotification/Block/Config/Extensionkeys.php +242 -0
- app/code/community/Abserve/Magenotification/Block/Config/Field.php +23 -0
- app/code/community/Abserve/Magenotification/Block/Config/Label.php +22 -0
- app/code/community/Abserve/Magenotification/Block/Config/Licenseinfo.php +59 -0
- app/code/community/Abserve/Magenotification/Block/Config/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Block/Rewrite/AdminhtmlNotificationGridRendererActions.php +46 -0
- app/code/community/Abserve/Magenotification/Block/Rewrite/AdminhtmlNotificationWindow.php +27 -0
- app/code/community/Abserve/Magenotification/Block/Rewrite/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Helper/Data.php +564 -0
- app/code/community/Abserve/Magenotification/Helper/Feedback.php +129 -0
- app/code/community/Abserve/Magenotification/Helper/License.php +40 -0
- app/code/community/Abserve/Magenotification/Helper/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Config.php +37 -0
- app/code/community/Abserve/Magenotification/Model/Feedback.php +71 -0
- app/code/community/Abserve/Magenotification/Model/Feedbackmessage.php +58 -0
- app/code/community/Abserve/Magenotification/Model/Keygen.php +224 -0
- app/code/community/Abserve/Magenotification/Model/License.php +31 -0
- app/code/community/Abserve/Magenotification/Model/Logger.php +20 -0
- app/code/community/Abserve/Magenotification/Model/Magenotification.php +196 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback.php +18 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback/Collection.php +10 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage.php +18 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage/Collection.php +19 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/License.php +17 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/License/Collection.php +18 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/License/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Logger.php +18 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Logger/Collection.php +19 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Logger/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification.php +18 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification/Collection.php +19 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Mysql4/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Observer.php +23 -0
- app/code/community/Abserve/Magenotification/Model/Rewrite/AdminnotificationMysql4Inbox.php +53 -0
- app/code/community/Abserve/Magenotification/Model/Rewrite/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Source/Time.php +47 -0
- app/code/community/Abserve/Magenotification/Model/Source/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/Model/Status.php +24 -0
- app/code/community/Abserve/Magenotification/Model/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/controllers/Adminhtml/FeedbackController.php +310 -0
- app/code/community/Abserve/Magenotification/controllers/Adminhtml/LicenseController.php +41 -0
- app/code/community/Abserve/Magenotification/controllers/Adminhtml/MagenotificationController.php +156 -0
- app/code/community/Abserve/Magenotification/controllers/Adminhtml/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/etc/adminhtml.xml +101 -0
- app/code/community/Abserve/Magenotification/etc/config.xml +120 -0
- app/code/community/Abserve/Magenotification/etc/system.xml +68 -0
- app/code/community/Abserve/Magenotification/etc/vssver2.scc +0 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.0.php +22 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.1.php +59 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.2.php +73 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.0-0.1.1.php +59 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.0-0.1.2.php +64 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.1-0.1.2.php +26 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.2-0.1.3.php +25 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.3-0.1.4.php +25 -0
- app/code/community/Abserve/Magenotification/sql/magenotification_setup/vssver2.scc +0 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Config/Edit.php +39 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country.php +74 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit.php +56 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Form.php +33 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Tab/Form.php +31 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Tabs.php +37 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Grid.php +181 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Countrygrid.php +37 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip.php +73 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit.php +55 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Form.php +32 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Tab/Form.php +30 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Tabs.php +36 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Grid.php +48 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoipgrid.php +40 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Sales/Order/View/Tab/Delivery.php +77 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Sales/Order/View/Tab/Survey.php +77 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Field/Position.php +234 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Field/Style.php +316 -0
- app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Form/Field/Separator.php +64 -0
- app/code/community/Abserve/Onestepcheckout/Block/Checkout/Links.php +43 -0
- app/code/community/Abserve/Onestepcheckout/Block/Onepage/Link.php +23 -0
- app/code/community/Abserve/Onestepcheckout/Block/Onestepcheckout.php +444 -0
- app/code/community/Abserve/Onestepcheckout/Block/Postcode.php +24 -0
- app/code/community/Abserve/Onestepcheckout/Block/Reload.php +19 -0
- app/code/community/Abserve/Onestepcheckout/Block/Review.php +24 -0
- app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Delivery.php +32 -0
- app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Discount.php +34 -0
- app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Giftwrap.php +31 -0
- app/code/community/Abserve/Onestepcheckout/Block/System/Config/Form/Field/Survey.php +23 -0
- app/code/community/Abserve/Onestepcheckout/Block/Widget/Dob.php +100 -0
- app/code/community/Abserve/Onestepcheckout/Helper/Data.php +791 -0
- app/code/community/Abserve/Onestepcheckout/Helper/Message.php +29 -0
- app/code/community/Abserve/Onestepcheckout/Helper/Rewrite/Checkout/Url.php +22 -0
- app/code/community/Abserve/Onestepcheckout/Model/Address.php +33 -0
- app/code/community/Abserve/Onestepcheckout/Model/Config.php +20 -0
- app/code/community/Abserve/Onestepcheckout/Model/Country.php +86 -0
- app/code/community/Abserve/Onestepcheckout/Model/Countrylist.php +34 -0
- app/code/community/Abserve/Onestepcheckout/Model/Countryversion.php +28 -0
- app/code/community/Abserve/Onestepcheckout/Model/Customer/Customer.php +28 -0
- app/code/community/Abserve/Onestepcheckout/Model/Customer/Form.php +42 -0
- app/code/community/Abserve/Onestepcheckout/Model/Delivery.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Geoip.php +74 -0
- app/code/community/Abserve/Onestepcheckout/Model/Giftwrap.php +34 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Config.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Config/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Country.php +17 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Country/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countrylist.php +17 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countrylist/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countryversion.php +17 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countryversion/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Delivery.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Geoip.php +17 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Geoip/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Survey.php +17 -0
- app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Survey/Collection.php +18 -0
- app/code/community/Abserve/Onestepcheckout/Model/Observer.php +404 -0
- app/code/community/Abserve/Onestepcheckout/Model/Order/Pdf/Amount.php +41 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Creditmemo/Total/Discount.php +23 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Creditmemo/Total/Giftwrap.php +25 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Invoice/Total/Discount.php +23 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Invoice/Total/Giftwrap.php +25 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Pdf/Invoice.php +282 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Pdf/Shipment.php +433 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Quote/Address/Total/Discount.php +44 -0
- app/code/community/Abserve/Onestepcheckout/Model/Sales/Quote/Address/Total/Giftwrap.php +102 -0
- app/code/community/Abserve/Onestepcheckout/Model/Source/Ajaxbilling.php +20 -0
- app/code/community/Abserve/Onestepcheckout/Model/Source/Layout.php +27 -0
- app/code/community/Abserve/Onestepcheckout/Model/Source/Payment.php +29 -0
- app/code/community/Abserve/Onestepcheckout/Model/Source/Reloadpayment.php +20 -0
- app/code/community/Abserve/Onestepcheckout/Model/Source/Shipping.php +28 -0
- app/code/community/Abserve/Onestepcheckout/Model/Survey.php +18 -0
- app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/CountryController.php +238 -0
- app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/GeoipController.php +220 -0
- app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/SimiController.php +20 -0
- app/code/community/Abserve/Onestepcheckout/controllers/AjaxController.php +74 -0
- app/code/community/Abserve/Onestepcheckout/controllers/GeoipController.php +101 -0
- app/code/community/Abserve/Onestepcheckout/controllers/IndexController.php +1106 -0
- app/code/community/Abserve/Onestepcheckout/controllers/PaymentController.php +284 -0
- app/code/community/Abserve/Onestepcheckout/etc/adminhtml.xml +75 -0
- app/code/community/Abserve/Onestepcheckout/etc/config.xml +452 -0
- app/code/community/Abserve/Onestepcheckout/etc/system.xml +957 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.0.1-1.1.0.php +30 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.0-1.1.1.php +9 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.1-1.1.5.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.5-1.1.6.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.6-1.1.7.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.7-1.1.8.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.8-1.1.9.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.9-1.2.2.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.2.2-1.2.3.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.2.3-2.0.0.php +17 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.0-2.0.1.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.1-2.0.2.php +5 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.2-3.0.0.php +42 -0
- app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-3.0.0-3.1.0.php +40 -0
- app/code/community/Abserve/PaypalBNCode/Helper/Data.php +14 -0
- app/code/community/Abserve/PaypalBNCode/Model/Config.php +43 -0
- app/code/community/Abserve/PaypalBNCode/etc/config.xml +34 -0
- app/code/community/Abserve/Settings/Block/Settings.php +4 -0
- app/code/community/Abserve/Settings/Helper/Data.php +14 -0
- app/code/community/Abserve/Settings/controllers/IndexController.php +54 -0
- app/code/community/Abserve/Settings/etc/adminhtml.xml +22 -0
- app/code/community/Abserve/Settings/etc/config.xml +70 -0
- app/code/community/Abserve/Settings/etc/system.xml +191 -0
- app/code/community/Abserve/license_certificates/Abserve_Onestepcheckout.xml +19 -0
- app/design/adminhtml/default/default/layout/magenotification.xml +16 -0
- app/design/adminhtml/default/default/layout/onestepcheckout.xml +98 -0
- app/design/adminhtml/default/default/template/magenotification/feedback/files.phtml +17 -0
- app/design/adminhtml/default/default/template/magenotification/feedback/history.phtml +31 -0
- app/design/adminhtml/default/default/template/magenotification/license/licenseinfo.phtml +68 -0
- app/design/adminhtml/default/default/template/magenotification/license/purchaseform.phtml +7 -0
- app/design/adminhtml/default/default/template/magenotification/license/updateform.phtml +41 -0
- app/design/adminhtml/default/default/template/onestepcheckout/country.phtml +183 -0
- app/design/adminhtml/default/default/template/onestepcheckout/geoip.phtml +171 -0
- app/design/adminhtml/default/default/template/onestepcheckout/geoipgrid.phtml +74 -0
- app/design/adminhtml/default/default/template/onestepcheckout/info.phtml +162 -0
- app/design/adminhtml/default/default/template/onestepcheckout/sales/order/view/tab/delivery.phtml +36 -0
- app/design/adminhtml/default/default/template/onestepcheckout/sales/order/view/tab/survey.phtml +69 -0
- app/design/frontend/abserve/shoestore/etc/theme.xml +30 -0
- app/design/frontend/abserve/shoestore/etc/widget.xml +166 -0
- app/design/frontend/abserve/shoestore/layout/abservemegamenu/custommenu.xml +15 -0
- app/design/frontend/abserve/shoestore/layout/ajaxcart.xml +188 -0
- app/design/frontend/abserve/shoestore/layout/ajaxwishlist.xml +42 -0
- app/design/frontend/abserve/shoestore/layout/bundle.xml +383 -0
- app/design/frontend/abserve/shoestore/layout/catalog.xml +450 -0
- app/design/frontend/abserve/shoestore/layout/catalog_msrp.xml +75 -0
- app/design/frontend/abserve/shoestore/layout/catalogsearch.xml +148 -0
- app/design/frontend/abserve/shoestore/layout/checkout.xml +542 -0
- app/design/frontend/abserve/shoestore/layout/cms.xml +108 -0
- app/design/frontend/abserve/shoestore/layout/configurableswatches.xml +79 -0
- app/design/frontend/abserve/shoestore/layout/contacts.xml +43 -0
- app/design/frontend/abserve/shoestore/layout/customer.xml +301 -0
- app/design/frontend/abserve/shoestore/layout/directory.xml +43 -0
- app/design/frontend/abserve/shoestore/layout/downloadable.xml +232 -0
- app/design/frontend/abserve/shoestore/layout/newsletter.xml +67 -0
- app/design/frontend/abserve/shoestore/layout/oauth.xml +137 -0
- app/design/frontend/abserve/shoestore/layout/onestepcheckout.xml +328 -0
- app/design/frontend/abserve/shoestore/layout/page.xml +245 -0
- app/design/frontend/abserve/shoestore/layout/paypal.xml +205 -0
- app/design/frontend/abserve/shoestore/layout/persistent.xml +63 -0
- app/design/frontend/abserve/shoestore/layout/review.xml +66 -0
app/code/community/Abserve/AjaxWishlist/Block/AjaxWishlist.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_AjaxWishlist_Block_AjaxWishlist extends Mage_Core_Block_Template
|
12 |
+
{
|
13 |
+
public function _prepareLayout()
|
14 |
+
{
|
15 |
+
return parent::_prepareLayout();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getAjaxWishlist()
|
19 |
+
{
|
20 |
+
if (!$this->hasData('ajaxwishlist')) {
|
21 |
+
$this->setData('ajaxwishlist', Mage::registry('ajaxwishlist'));
|
22 |
+
}
|
23 |
+
return $this->getData('ajaxwishlist');
|
24 |
+
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Abserve/AjaxWishlist/Helper/Data.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_AjaxWishlist_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
}
|
app/code/community/Abserve/AjaxWishlist/controllers/IndexController.php
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_AjaxWishlist_IndexController extends Mage_Core_Controller_Front_Action
|
12 |
+
{
|
13 |
+
|
14 |
+
public function compareAction(){
|
15 |
+
$response = array();
|
16 |
+
|
17 |
+
if ($productId = (int) $this->getRequest()->getParam('product')) {
|
18 |
+
$product = Mage::getModel('catalog/product')
|
19 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
20 |
+
->load($productId);
|
21 |
+
|
22 |
+
if ($product->getId()/* && !$product->isSuper()*/) {
|
23 |
+
Mage::getSingleton('catalog/product_compare_list')->addProduct($product);
|
24 |
+
$response['status'] = 'SUCCESS';
|
25 |
+
$response['message'] = $this->__('The product %s has been added to comparison list.', Mage::helper('core')->escapeHtml($product->getName()));
|
26 |
+
Mage::register('referrer_url', $this->_getRefererUrl());
|
27 |
+
Mage::helper('catalog/product_compare')->calculate();
|
28 |
+
Mage::dispatchEvent('catalog_product_compare_add_product', array('product'=>$product));
|
29 |
+
$this->loadLayout();
|
30 |
+
$sidebar_block = $this->getLayout()->getBlock('catalog.compare.sidebar');
|
31 |
+
$sidebar_block->setTemplate('ajaxwishlist/catalog/product/compare/sidebar.phtml');
|
32 |
+
$sidebar = $sidebar_block->toHtml();
|
33 |
+
$response['sidebar'] = $sidebar;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
protected function _getWishlist()
|
43 |
+
{
|
44 |
+
$wishlist = Mage::registry('wishlist');
|
45 |
+
if ($wishlist) {
|
46 |
+
return $wishlist;
|
47 |
+
}
|
48 |
+
|
49 |
+
try {
|
50 |
+
$wishlist = Mage::getModel('wishlist/wishlist')
|
51 |
+
->loadByCustomer(Mage::getSingleton('customer/session')->getCustomer(), true);
|
52 |
+
Mage::register('wishlist', $wishlist);
|
53 |
+
} catch (Mage_Core_Exception $e) {
|
54 |
+
Mage::getSingleton('wishlist/session')->addError($e->getMessage());
|
55 |
+
} catch (Exception $e) {
|
56 |
+
Mage::getSingleton('wishlist/session')->addException($e,
|
57 |
+
Mage::helper('wishlist')->__('Cannot create wishlist.')
|
58 |
+
);
|
59 |
+
return false;
|
60 |
+
}
|
61 |
+
|
62 |
+
return $wishlist;
|
63 |
+
}
|
64 |
+
public function addAction()
|
65 |
+
{
|
66 |
+
|
67 |
+
$response = array();
|
68 |
+
if (!Mage::getStoreConfigFlag('wishlist/general/active')) {
|
69 |
+
$response['status'] = 'ERROR';
|
70 |
+
$response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
|
71 |
+
}
|
72 |
+
if(!Mage::getSingleton('customer/session')->isLoggedIn()){
|
73 |
+
$response['status'] = 'ERROR';
|
74 |
+
$response['message'] = $this->__('Please Login First');
|
75 |
+
}
|
76 |
+
|
77 |
+
if(empty($response)){
|
78 |
+
$session = Mage::getSingleton('customer/session');
|
79 |
+
$wishlist = $this->_getWishlist();
|
80 |
+
if (!$wishlist) {
|
81 |
+
$response['status'] = 'ERROR';
|
82 |
+
$response['message'] = $this->__('Unable to Create Wishlist');
|
83 |
+
}else{
|
84 |
+
|
85 |
+
$productId = (int) $this->getRequest()->getParam('product');
|
86 |
+
if (!$productId) {
|
87 |
+
$response['status'] = 'ERROR';
|
88 |
+
$response['message'] = $this->__('Product Not Found');
|
89 |
+
}else{
|
90 |
+
|
91 |
+
$product = Mage::getModel('catalog/product')->load($productId);
|
92 |
+
if (!$product->getId() || !$product->isVisibleInCatalog()) {
|
93 |
+
$response['status'] = 'ERROR';
|
94 |
+
$response['message'] = $this->__('Cannot specify product.');
|
95 |
+
}else{
|
96 |
+
|
97 |
+
try {
|
98 |
+
$requestParams = $this->getRequest()->getParams();
|
99 |
+
$buyRequest = new Varien_Object($requestParams);
|
100 |
+
|
101 |
+
$result = $wishlist->addNewItem($product, $buyRequest);
|
102 |
+
if (is_string($result)) {
|
103 |
+
Mage::throwException($result);
|
104 |
+
}
|
105 |
+
$wishlist->save();
|
106 |
+
|
107 |
+
Mage::dispatchEvent(
|
108 |
+
'wishlist_add_product',
|
109 |
+
array(
|
110 |
+
'wishlist' => $wishlist,
|
111 |
+
'product' => $product,
|
112 |
+
'item' => $result
|
113 |
+
)
|
114 |
+
);
|
115 |
+
|
116 |
+
Mage::helper('wishlist')->calculate();
|
117 |
+
|
118 |
+
$message = $this->__('%1$s has been added to your wishlist.', $product->getName(), $referer);
|
119 |
+
$response['status'] = 'SUCCESS';
|
120 |
+
$response['message'] = $message;
|
121 |
+
|
122 |
+
Mage::unregister('wishlist');
|
123 |
+
|
124 |
+
$this->loadLayout();
|
125 |
+
$toplink = $this->getLayout()->getBlock('top.links')->toHtml();
|
126 |
+
$sidebar_block = $this->getLayout()->getBlock('wishlist_sidebar');
|
127 |
+
$sidebar = $sidebar_block->toHtml();
|
128 |
+
$response['toplink'] = $toplink;
|
129 |
+
$response['sidebar'] = $sidebar;
|
130 |
+
}
|
131 |
+
catch (Mage_Core_Exception $e) {
|
132 |
+
$response['status'] = 'ERROR';
|
133 |
+
$response['message'] = $this->__('An error occurred while adding item to wishlist: %s', $e->getMessage());
|
134 |
+
}
|
135 |
+
catch (Exception $e) {
|
136 |
+
mage::log($e->getMessage());
|
137 |
+
$response['status'] = 'ERROR';
|
138 |
+
$response['message'] = $this->__('An error occurred while adding item to wishlist.');
|
139 |
+
}
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
}
|
145 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
}
|
app/code/community/Abserve/AjaxWishlist/etc/config.xml
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_AjaxWishlist>
|
14 |
+
<version>0.1.0</version>
|
15 |
+
</Abserve_AjaxWishlist>
|
16 |
+
</modules>
|
17 |
+
<frontend>
|
18 |
+
<routers>
|
19 |
+
<ajaxwishlist>
|
20 |
+
<use>standard</use>
|
21 |
+
<args>
|
22 |
+
<module>Abserve_AjaxWishlist</module>
|
23 |
+
<frontName>ajaxwishlist</frontName>
|
24 |
+
</args>
|
25 |
+
</ajaxwishlist>
|
26 |
+
</routers>
|
27 |
+
<layout>
|
28 |
+
<updates>
|
29 |
+
<ajaxwishlist>
|
30 |
+
<file>ajaxwishlist.xml</file>
|
31 |
+
</ajaxwishlist>
|
32 |
+
</updates>
|
33 |
+
</layout>
|
34 |
+
</frontend>
|
35 |
+
<global>
|
36 |
+
<models>
|
37 |
+
<ajaxwishlist>
|
38 |
+
<class>Abserve_AjaxWishlist_Model</class>
|
39 |
+
<resourceModel>ajaxwishlist_mysql4</resourceModel>
|
40 |
+
</ajaxwishlist>
|
41 |
+
<ajaxwishlist_mysql4>
|
42 |
+
<class>Abserve_AjaxWishlist_Model_Mysql4</class>
|
43 |
+
<entities>
|
44 |
+
<ajaxwishlist>
|
45 |
+
<table>ajaxwishlist</table>
|
46 |
+
</ajaxwishlist>
|
47 |
+
</entities>
|
48 |
+
</ajaxwishlist_mysql4>
|
49 |
+
</models>
|
50 |
+
<resources>
|
51 |
+
<ajaxwishlist_setup>
|
52 |
+
<setup>
|
53 |
+
<module>Abserve_AjaxWishlist</module>
|
54 |
+
</setup>
|
55 |
+
<connection>
|
56 |
+
<use>core_setup</use>
|
57 |
+
</connection>
|
58 |
+
</ajaxwishlist_setup>
|
59 |
+
<ajaxwishlist_write>
|
60 |
+
<connection>
|
61 |
+
<use>core_write</use>
|
62 |
+
</connection>
|
63 |
+
</ajaxwishlist_write>
|
64 |
+
<ajaxwishlist_read>
|
65 |
+
<connection>
|
66 |
+
<use>core_read</use>
|
67 |
+
</connection>
|
68 |
+
</ajaxwishlist_read>
|
69 |
+
</resources>
|
70 |
+
<blocks>
|
71 |
+
<ajaxwishlist>
|
72 |
+
<class>Abserve_AjaxWishlist_Block</class>
|
73 |
+
</ajaxwishlist>
|
74 |
+
</blocks>
|
75 |
+
<helpers>
|
76 |
+
<ajaxwishlist>
|
77 |
+
<class>Abserve_AjaxWishlist_Helper</class>
|
78 |
+
</ajaxwishlist>
|
79 |
+
</helpers>
|
80 |
+
</global>
|
81 |
+
</config>
|
app/code/community/Abserve/Ajaxcart/Block/Adminhtml/Info.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Ajaxcart_Block_Adminhtml_Info extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
13 |
+
|
14 |
+
protected function _getInfo($content) {
|
15 |
+
$output = $this->_getStyle();
|
16 |
+
$output .= '<div class="creativestyle-info">';
|
17 |
+
$output .= $content;
|
18 |
+
$output .= '</div>';
|
19 |
+
return $output;
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _getStyle() {
|
23 |
+
$content = '<style>';
|
24 |
+
$content .= '.creativestyle-info { border: 1px solid #cccccc; background: #e7efef; margin-bottom: 10px; padding: 10px; height: auto; }';
|
25 |
+
$content .= '.creativestyle-info .creativestyle-logo { float: right; padding: 5px; }';
|
26 |
+
$content .= '.creativestyle-info .creativestyle-command { border: 1px solid #cccccc; background: #ffffff; padding: 15px; text-align: left; margin: 10px 0; font-weight: bold; }';
|
27 |
+
$content .= '.creativestyle-info h3 { color: #ea7601; }';
|
28 |
+
$content .= '.creativestyle-info h3 small { font-weight: normal; font-size: 80%; font-style: italic; }';
|
29 |
+
$content .= '</style>';
|
30 |
+
return $content;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
34 |
+
$content = '<h3>' . $this->__('Ajaxcart documentation').'</h3>';
|
35 |
+
return $this->_getInfo($content);
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
app/code/community/Abserve/Ajaxcart/Block/Adminhtml/Url.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
|
11 |
+
<?php
|
12 |
+
class Abserve_Ajaxcart_Block_Adminhtml_Url extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
13 |
+
|
14 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
|
15 |
+
$this->setElement($element);
|
16 |
+
$output = '<script type="text/javascript">//<![CDATA[' . "\n";
|
17 |
+
$output .= ' var xml_form_template = \'' . str_replace("'", "\'", $this->_getRowEditHtml()) .'\';' . "\n";
|
18 |
+
$output .= '//]]></script>' . "\n";
|
19 |
+
$output .= '<input type="hidden" name="' . $this->getElement()->getName() . '" value="">';
|
20 |
+
$output .= '<table id="xml_container" style="border-collapse:collapse;"><tbody>';
|
21 |
+
$output .= $this->_getHeaderHtml();
|
22 |
+
if ($this->getElement()->getData('value')) {
|
23 |
+
foreach ($this->getElement()->getData('value/id') as $elementIndex => $elementName) {
|
24 |
+
$output .= $this->_getRowHtml($elementIndex);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
$output .= '<tr><td colspan="2" style="padding: 4px 0;">';
|
28 |
+
$output .= $this->_getAddButtonHtml();
|
29 |
+
$output .= '</td></tr>';
|
30 |
+
$output .= '</tbody></table>';
|
31 |
+
return $output;
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _getHeaderHtml() {
|
35 |
+
$output = '<tr>';
|
36 |
+
$output .= '<th style="padding: 2px; text-align: center;">';
|
37 |
+
$output .= Mage::helper('ajaxcart')->__('ID/Class selector of block to be updated');
|
38 |
+
$output .= '</th>';
|
39 |
+
$output .= '<th style="padding: 2px; text-align: center;">';
|
40 |
+
$output .= Mage::helper('ajaxcart')->__('Layout Update Block name(should be same as in XML)');
|
41 |
+
$output .= '</th>';
|
42 |
+
$output .= '<th> </th>';
|
43 |
+
$output .= '</tr>';
|
44 |
+
return $output;
|
45 |
+
}
|
46 |
+
|
47 |
+
protected function _getRowHtml($index = 0) {
|
48 |
+
$output = '<tr>';
|
49 |
+
$output .= '<td style="padding: 2px 0;">';
|
50 |
+
$output .= '<input type="text" class="required-entry input-text" style="margin-right:10px" name="' . $this->getElement()->getName() . '[id][]" value="' . $this->getElement()->getData('value/id/' . $index) . '" />';
|
51 |
+
$output .= '</td>';
|
52 |
+
$output .= '<td style="padding: 2px 0;">';
|
53 |
+
$output .= '<input class="required-entry input-text" name="' . $this->getElement()->getName() . '[xml][]" value="'.$this->getElement()->getData('value/xml/' . $index) . '">';
|
54 |
+
$output .= '</td>';
|
55 |
+
$output .= '<td style="padding: 2px 4px;">';
|
56 |
+
$output .= $this->_getRemoveButtonHtml();
|
57 |
+
$output .= '</td>';
|
58 |
+
$output .= '</tr>';
|
59 |
+
return $output;
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function _getRowEditHtml() {
|
63 |
+
$output = '<tr>';
|
64 |
+
$output .= '<td style="padding: 2px 0;">';
|
65 |
+
$output .= '<input class="required-entry input-text" style="margin-right:10px" name="' . $this->getElement()->getName() . '[id][]" />';
|
66 |
+
$output .= '</td>';
|
67 |
+
$output .= '<td style="padding: 2px 0;">';
|
68 |
+
$output .= '<input class="required-entry input-text" name="' . $this->getElement()->getName() . '[xml][]">';
|
69 |
+
$output .= '</td>';
|
70 |
+
$output .= '<td style="padding: 2px 4px;">';
|
71 |
+
$output .= $this->_getRemoveButtonHtml();
|
72 |
+
$output .= '</td>';
|
73 |
+
$output .= '</tr>';
|
74 |
+
return $output;
|
75 |
+
}
|
76 |
+
|
77 |
+
protected function _getAddButtonHtml() {
|
78 |
+
return $this->getLayout()->createBlock('adminhtml/widget_button')
|
79 |
+
->setType('button')
|
80 |
+
->setClass('add')
|
81 |
+
->setLabel($this->__('Add Layout Update Block'))
|
82 |
+
->setOnClick("Element.insert($(this).up('tr'), {before: xml_form_template})")
|
83 |
+
->toHtml();
|
84 |
+
}
|
85 |
+
|
86 |
+
protected function _getRemoveButtonHtml() {
|
87 |
+
return $this->getLayout()->createBlock('adminhtml/widget_button')
|
88 |
+
->setType('button')
|
89 |
+
->setClass('delete v-middle')
|
90 |
+
->setLabel($this->__('Delete'))
|
91 |
+
->setOnClick("Element.remove($(this).up('tr'))")
|
92 |
+
->toHtml();
|
93 |
+
}
|
94 |
+
}
|
app/code/community/Abserve/Ajaxcart/Helper/Data.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Ajaxcart_Helper_data extends Mage_Core_Helper_Abstract {}
|
app/code/community/Abserve/Ajaxcart/Model/Observer.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Ajaxcart_Model_Observer {
|
13 |
+
|
14 |
+
public function addToCartEvent($observer) {
|
15 |
+
|
16 |
+
$request = Mage::app()->getFrontController()->getRequest();
|
17 |
+
|
18 |
+
if (!$request->getParam('in_cart') && !$request->getParam('is_checkout')) {
|
19 |
+
|
20 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
21 |
+
|
22 |
+
$_response = Mage::getModel('ajaxcart/response')
|
23 |
+
->setProductName($observer->getProduct()->getName())
|
24 |
+
->setMessage(Mage::helper('checkout')->__('%s was added into cart.', $observer->getProduct()->getName()));
|
25 |
+
|
26 |
+
//append updated blocks
|
27 |
+
$_response->addUpdatedBlocks($_response);
|
28 |
+
|
29 |
+
$_response->send();
|
30 |
+
}
|
31 |
+
if ($request->getParam('is_checkout')) {
|
32 |
+
|
33 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
34 |
+
|
35 |
+
$_response = Mage::getModel('ajaxcart/response')
|
36 |
+
->setProductName($observer->getProduct()->getName())
|
37 |
+
->setMessage(Mage::helper('checkout')->__('%s was added into cart.', $observer->getProduct()->getName()));
|
38 |
+
$_response->send();
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
public function updateItemEvent($observer) {
|
43 |
+
|
44 |
+
$request = Mage::app()->getFrontController()->getRequest();
|
45 |
+
|
46 |
+
if (!$request->getParam('in_cart') && !$request->getParam('is_checkout')) {
|
47 |
+
|
48 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
49 |
+
|
50 |
+
$_response = Mage::getModel('ajaxcart/response')
|
51 |
+
->setMessage(Mage::helper('checkout')->__('Item was updated.'));
|
52 |
+
|
53 |
+
//append updated blocks
|
54 |
+
$_response->addUpdatedBlocks($_response);
|
55 |
+
|
56 |
+
$_response->send();
|
57 |
+
}
|
58 |
+
if ($request->getParam('is_checkout')) {
|
59 |
+
|
60 |
+
Mage::getSingleton('checkout/session')->setNoCartRedirect(true);
|
61 |
+
|
62 |
+
$_response = Mage::getModel('ajaxcart/response')
|
63 |
+
->setMessage(Mage::helper('checkout')->__('Item was updated.'));
|
64 |
+
$_response->send();
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function getConfigurableOptions($observer) {
|
69 |
+
$is_ajax = Mage::app()->getFrontController()->getRequest()->getParam('ajax');
|
70 |
+
|
71 |
+
if($is_ajax) {
|
72 |
+
$_response = Mage::getModel('ajaxcart/response');
|
73 |
+
|
74 |
+
$product = Mage::registry('current_product');
|
75 |
+
if (!$product->isConfigurable() && !$product->getTypeId() == 'bundle'){return false;exit;}
|
76 |
+
|
77 |
+
//append configurable options block
|
78 |
+
$_response->addConfigurableOptionsBlock($_response);
|
79 |
+
$_response->send();
|
80 |
+
}
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getGroupProductOptions() {
|
85 |
+
$id = Mage::app()->getFrontController()->getRequest()->getParam('product');
|
86 |
+
$options = Mage::app()->getFrontController()->getRequest()->getParam('super_group');
|
87 |
+
|
88 |
+
if($id) {
|
89 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
90 |
+
if($product->getData()) {
|
91 |
+
if($product->getTypeId() == 'grouped' && !$options) {
|
92 |
+
$_response = Mage::getModel('ajaxcart/response');
|
93 |
+
Mage::register('product', $product);
|
94 |
+
Mage::register('current_product', $product);
|
95 |
+
|
96 |
+
//add group product's items block
|
97 |
+
$_response->addGroupProductItemsBlock($_response);
|
98 |
+
$_response->send();
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
}
|
app/code/community/Abserve/Ajaxcart/Model/Response.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Ajaxcart_Model_Response extends Mage_Catalog_Block_Product_Abstract {
|
13 |
+
|
14 |
+
public function send() {
|
15 |
+
Zend_Json::$useBuiltinEncoderDecoder = true;
|
16 |
+
if ($this->getError())
|
17 |
+
$this->setR('error');
|
18 |
+
else
|
19 |
+
$this->setR('success');
|
20 |
+
Mage::app()->getFrontController()->getResponse()->setHeader('Content-Type', 'text/plain')->setBody(Zend_Json::encode($this->getData()));
|
21 |
+
Mage::app()->getFrontController()->getResponse()->sendResponse();
|
22 |
+
die;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function addUpdatedBlocks(&$_response) {
|
26 |
+
$updated_blocks = unserialize(Mage::getStoreConfig('ajaxcart/general/update_blocks'));
|
27 |
+
|
28 |
+
if ($updated_blocks) {
|
29 |
+
$layout = Mage::getSingleton('core/layout');
|
30 |
+
$res = array();
|
31 |
+
|
32 |
+
foreach ($updated_blocks['id'] as $index => $block) {
|
33 |
+
$value = $layout->getBlock($updated_blocks['xml'][$index]);
|
34 |
+
|
35 |
+
if ($value) {
|
36 |
+
$tmp['key'] = $block;
|
37 |
+
$tmp['value'] = $value->toHtml();
|
38 |
+
$res[] = $tmp;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
if (!empty($res)) {
|
42 |
+
$_response->setUpdateBlocks($res);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
public function addConfigurableOptionsBlock(&$_response) {
|
48 |
+
$layout = Mage::getSingleton('core/layout');
|
49 |
+
$res = '';
|
50 |
+
$_product = Mage::registry('current_product');
|
51 |
+
|
52 |
+
$layout->getUpdate()->addHandle('ajaxcart_configurable_options');
|
53 |
+
|
54 |
+
if ($_product->getTypeId() == 'bundle')
|
55 |
+
$layout->getUpdate()->addHandle('ajaxcart_bundle_options');
|
56 |
+
|
57 |
+
// set unique cache ID to bypass caching
|
58 |
+
$cacheId = 'LAYOUT_'.Mage::app()->getStore()->getId().md5(join('__', $layout->getUpdate()->getHandles()));
|
59 |
+
$layout->getUpdate()->setCacheId($cacheId);
|
60 |
+
|
61 |
+
$layout->getUpdate()->load();
|
62 |
+
$layout->generateXml();
|
63 |
+
$layout->generateBlocks();
|
64 |
+
|
65 |
+
$value = $layout->getBlock('ajaxcart.configurable.options');
|
66 |
+
|
67 |
+
if ($value) {
|
68 |
+
$res .= $value->toHtml();
|
69 |
+
}
|
70 |
+
|
71 |
+
if ($_product->getTypeId() == 'bundle') {
|
72 |
+
$value = $layout->getBlock('product.info.bundle');
|
73 |
+
|
74 |
+
if ($value) {
|
75 |
+
$res .= $value->toHtml();
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
if (!empty($res)) {
|
80 |
+
$_response->setConfigurableOptionsBlock($res);
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
public function addGroupProductItemsBlock(&$_response) {
|
85 |
+
$layout = Mage::getSingleton('core/layout');
|
86 |
+
$res = '';
|
87 |
+
|
88 |
+
$layout->getUpdate()->addHandle('ajaxcart_grouped_options');
|
89 |
+
|
90 |
+
// set unique cache ID to bypass caching
|
91 |
+
$cacheId = 'LAYOUT_'.Mage::app()->getStore()->getId().md5(join('__', $layout->getUpdate()->getHandles()));
|
92 |
+
$layout->getUpdate()->setCacheId($cacheId);
|
93 |
+
|
94 |
+
$layout->getUpdate()->load();
|
95 |
+
$layout->generateXml();
|
96 |
+
$layout->generateBlocks();
|
97 |
+
|
98 |
+
$value = $layout->getBlock('ajaxcart.grouped.options');
|
99 |
+
|
100 |
+
if ($value) {
|
101 |
+
$res .= $value->toHtml();
|
102 |
+
}
|
103 |
+
|
104 |
+
if (!empty($res)) {
|
105 |
+
$_response->setConfigurableOptionsBlock($res);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
app/code/community/Abserve/Ajaxcart/controllers/Checkout/CartController.php
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
require_once 'Mage/Checkout/controllers/CartController.php';
|
13 |
+
|
14 |
+
class Abserve_Ajaxcart_Checkout_CartController extends Mage_Checkout_CartController {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Add product to shopping cart action
|
18 |
+
*/
|
19 |
+
public function addAction() {
|
20 |
+
$cart = $this->_getCart();
|
21 |
+
$params = $this->getRequest()->getParams();
|
22 |
+
try {
|
23 |
+
if (isset($params['qty'])) {
|
24 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
25 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
26 |
+
);
|
27 |
+
$params['qty'] = $filter->filter($params['qty']);
|
28 |
+
}
|
29 |
+
|
30 |
+
$product = $this->_initProduct();
|
31 |
+
$related = $this->getRequest()->getParam('related_product');
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Check product availability
|
35 |
+
*/
|
36 |
+
if (!$product) {
|
37 |
+
$this->_goBack();
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
$cart->addProduct($product, $params);
|
42 |
+
if (!empty($related)) {
|
43 |
+
$cart->addProductsByIds(explode(',', $related));
|
44 |
+
}
|
45 |
+
|
46 |
+
$cart->save();
|
47 |
+
|
48 |
+
$this->_getSession()->setCartWasUpdated(true);
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @todo remove wishlist observer processAddToCart
|
52 |
+
*/
|
53 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxcart');
|
54 |
+
$this->loadLayout();
|
55 |
+
|
56 |
+
Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
|
57 |
+
);
|
58 |
+
|
59 |
+
if (!$this->_getSession()->getNoCartRedirect(true)) {
|
60 |
+
if (!$cart->getQuote()->getHasError()) {
|
61 |
+
$message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
|
62 |
+
$this->_getSession()->addSuccess($message);
|
63 |
+
}
|
64 |
+
$this->_goBack();
|
65 |
+
}
|
66 |
+
} catch (Mage_Core_Exception $e) {
|
67 |
+
$_response = Mage::getModel('ajaxcart/response');
|
68 |
+
$_response->setError(true);
|
69 |
+
|
70 |
+
$messages = array_unique(explode("\n", $e->getMessage()));
|
71 |
+
$json_messages = array();
|
72 |
+
foreach ($messages as $message) {
|
73 |
+
$json_messages[] = Mage::helper('core')->escapeHtml($message);
|
74 |
+
}
|
75 |
+
|
76 |
+
$_response->setMessages($json_messages);
|
77 |
+
|
78 |
+
$url = $this->_getSession()->getRedirectUrl(true);
|
79 |
+
|
80 |
+
$_response->send();
|
81 |
+
} catch (Exception $e) {
|
82 |
+
$this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
|
83 |
+
Mage::logException($e);
|
84 |
+
|
85 |
+
$_response = Mage::getModel('ajaxcart/response');
|
86 |
+
$_response->setError(true);
|
87 |
+
$_response->setMessage($this->__('Cannot add the item to shopping cart.'));
|
88 |
+
$_response->send();
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Update product configuration for a cart item
|
94 |
+
*/
|
95 |
+
public function updateItemOptionsAction() {
|
96 |
+
$cart = $this->_getCart();
|
97 |
+
$id = (int) $this->getRequest()->getParam('id');
|
98 |
+
$params = $this->getRequest()->getParams();
|
99 |
+
|
100 |
+
if (!isset($params['options'])) {
|
101 |
+
$params['options'] = array();
|
102 |
+
}
|
103 |
+
try {
|
104 |
+
if (isset($params['qty'])) {
|
105 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
106 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
107 |
+
);
|
108 |
+
$params['qty'] = $filter->filter($params['qty']);
|
109 |
+
}
|
110 |
+
|
111 |
+
$quoteItem = $cart->getQuote()->getItemById($id);
|
112 |
+
if (!$quoteItem) {
|
113 |
+
Mage::throwException($this->__('Quote item is not found.'));
|
114 |
+
}
|
115 |
+
|
116 |
+
$item = $cart->updateItem($id, new Varien_Object($params));
|
117 |
+
if (is_string($item)) {
|
118 |
+
Mage::throwException($item);
|
119 |
+
}
|
120 |
+
if ($item->getHasError()) {
|
121 |
+
Mage::throwException($item->getMessage());
|
122 |
+
}
|
123 |
+
|
124 |
+
$related = $this->getRequest()->getParam('related_product');
|
125 |
+
if (!empty($related)) {
|
126 |
+
$cart->addProductsByIds(explode(',', $related));
|
127 |
+
}
|
128 |
+
|
129 |
+
$cart->save();
|
130 |
+
|
131 |
+
$this->_getSession()->setCartWasUpdated(true);
|
132 |
+
|
133 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxcart');
|
134 |
+
$this->loadLayout();
|
135 |
+
|
136 |
+
Mage::dispatchEvent('checkout_cart_update_item_complete', array('item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse())
|
137 |
+
);
|
138 |
+
if (!$this->_getSession()->getNoCartRedirect(true)) {
|
139 |
+
if (!$cart->getQuote()->getHasError()) {
|
140 |
+
$message = $this->__('%s was updated in your shopping cart.', Mage::helper('core')->htmlEscape($item->getProduct()->getName()));
|
141 |
+
$this->_getSession()->addSuccess($message);
|
142 |
+
}
|
143 |
+
$this->_goBack();
|
144 |
+
}
|
145 |
+
} catch (Mage_Core_Exception $e) {
|
146 |
+
$_response = Mage::getModel('ajaxcart/response');
|
147 |
+
$_response->setError(true);
|
148 |
+
|
149 |
+
$messages = array_unique(explode("\n", $e->getMessage()));
|
150 |
+
$json_messages = array();
|
151 |
+
foreach ($messages as $message) {
|
152 |
+
$json_messages[] = Mage::helper('core')->escapeHtml($message);
|
153 |
+
}
|
154 |
+
|
155 |
+
$_response->setMessages($json_messages);
|
156 |
+
|
157 |
+
$url = $this->_getSession()->getRedirectUrl(true);
|
158 |
+
|
159 |
+
$_response->send();
|
160 |
+
} catch (Exception $e) {
|
161 |
+
$this->_getSession()->addException($e, $this->__('Cannot update the item.'));
|
162 |
+
Mage::logException($e);
|
163 |
+
|
164 |
+
$_response = Mage::getModel('ajaxcart/response');
|
165 |
+
$_response->setError(true);
|
166 |
+
$_response->setMessage($this->__('Cannot update the item.'));
|
167 |
+
$_response->send();
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Delete shoping cart item action
|
173 |
+
*/
|
174 |
+
public function deleteAction() {
|
175 |
+
$id = (int) $this->getRequest()->getParam('id');
|
176 |
+
if ($id) {
|
177 |
+
try {
|
178 |
+
$this->_getCart()->removeItem($id)
|
179 |
+
->save();
|
180 |
+
} catch (Exception $e) {
|
181 |
+
$_response = Mage::getModel('ajaxcart/response');
|
182 |
+
$_response->setError(true);
|
183 |
+
$_response->setMessage($this->__('Cannot remove the item.'));
|
184 |
+
$_response->send();
|
185 |
+
|
186 |
+
Mage::logException($e);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
$_response = Mage::getModel('ajaxcart/response');
|
191 |
+
|
192 |
+
$_response->setMessage($this->__('Item was removed.'));
|
193 |
+
|
194 |
+
//append updated blocks
|
195 |
+
$this->getLayout()->getUpdate()->addHandle('ajaxcart');
|
196 |
+
$this->loadLayout();
|
197 |
+
|
198 |
+
$_response->addUpdatedBlocks($_response);
|
199 |
+
|
200 |
+
$_response->send();
|
201 |
+
}
|
202 |
+
|
203 |
+
}
|
app/code/community/Abserve/Ajaxcart/etc/config.xml
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_Ajaxcart>
|
14 |
+
<version>2.0.1</version>
|
15 |
+
</Abserve_Ajaxcart>
|
16 |
+
</modules>
|
17 |
+
<global>
|
18 |
+
<models>
|
19 |
+
<ajaxcart>
|
20 |
+
<class>Abserve_Ajaxcart_Model</class>
|
21 |
+
</ajaxcart>
|
22 |
+
</models>
|
23 |
+
<blocks>
|
24 |
+
<ajaxcart>
|
25 |
+
<class>Abserve_Ajaxcart_Block</class>
|
26 |
+
</ajaxcart>
|
27 |
+
</blocks>
|
28 |
+
<helpers>
|
29 |
+
<ajaxcart>
|
30 |
+
<class>Abserve_Ajaxcart_Helper</class>
|
31 |
+
</ajaxcart>
|
32 |
+
</helpers>
|
33 |
+
<rewrite>
|
34 |
+
<Abserve_ajaxcart_checkout_cart>
|
35 |
+
<from><![CDATA[#^/checkout/cart/#]]></from>
|
36 |
+
<to>/ajaxcart/checkout_cart/</to>
|
37 |
+
</Abserve_ajaxcart_checkout_cart>
|
38 |
+
</rewrite>
|
39 |
+
</global>
|
40 |
+
<frontend>
|
41 |
+
<routers>
|
42 |
+
<ajaxcart>
|
43 |
+
<use>standard</use>
|
44 |
+
<args>
|
45 |
+
<module>Abserve_Ajaxcart</module>
|
46 |
+
<frontName>ajaxcart</frontName>
|
47 |
+
</args>
|
48 |
+
</ajaxcart>
|
49 |
+
</routers>
|
50 |
+
<events>
|
51 |
+
<checkout_cart_add_product_complete>
|
52 |
+
<observers>
|
53 |
+
<ajaxcart>
|
54 |
+
<type>singleton</type>
|
55 |
+
<class>ajaxcart/observer</class>
|
56 |
+
<method>addToCartEvent</method>
|
57 |
+
</ajaxcart>
|
58 |
+
</observers>
|
59 |
+
</checkout_cart_add_product_complete>
|
60 |
+
<checkout_cart_update_item_complete>
|
61 |
+
<observers>
|
62 |
+
<ajaxcart>
|
63 |
+
<type>singleton</type>
|
64 |
+
<class>ajaxcart/observer</class>
|
65 |
+
<method>updateItemEvent</method>
|
66 |
+
</ajaxcart>
|
67 |
+
</observers>
|
68 |
+
</checkout_cart_update_item_complete>
|
69 |
+
<!--for configurable products-->
|
70 |
+
<controller_action_postdispatch_catalog_product_view>
|
71 |
+
<observers>
|
72 |
+
<ajaxcart>
|
73 |
+
<class>ajaxcart/observer</class>
|
74 |
+
<method>getConfigurableOptions</method>
|
75 |
+
</ajaxcart>
|
76 |
+
</observers>
|
77 |
+
</controller_action_postdispatch_catalog_product_view>
|
78 |
+
<!--for group products-->
|
79 |
+
<controller_action_predispatch_checkout_cart_add>
|
80 |
+
<observers>
|
81 |
+
<ajaxcart>
|
82 |
+
<type>singleton</type>
|
83 |
+
<class>ajaxcart/observer</class>
|
84 |
+
<method>getGroupProductOptions</method>
|
85 |
+
</ajaxcart>
|
86 |
+
</observers>
|
87 |
+
</controller_action_predispatch_checkout_cart_add>
|
88 |
+
</events>
|
89 |
+
<layout>
|
90 |
+
<updates>
|
91 |
+
<ajaxcart>
|
92 |
+
<file>ajaxcart.xml</file>
|
93 |
+
</ajaxcart>
|
94 |
+
</updates>
|
95 |
+
</layout>
|
96 |
+
</frontend>
|
97 |
+
<adminhtml>
|
98 |
+
<acl>
|
99 |
+
<resources>
|
100 |
+
<all>
|
101 |
+
<title>Allow Everything</title>
|
102 |
+
</all>
|
103 |
+
<admin>
|
104 |
+
<children>
|
105 |
+
<system>
|
106 |
+
<children>
|
107 |
+
<config>
|
108 |
+
<children>
|
109 |
+
<ajaxcart>
|
110 |
+
<title>Ajaxcart Settings</title>
|
111 |
+
</ajaxcart>
|
112 |
+
</children>
|
113 |
+
</config>
|
114 |
+
</children>
|
115 |
+
</system>
|
116 |
+
</children>
|
117 |
+
</admin>
|
118 |
+
</resources>
|
119 |
+
</acl>
|
120 |
+
<menu>
|
121 |
+
<settings module="settings">
|
122 |
+
<children>
|
123 |
+
<ajaxcart module="ajaxcart">
|
124 |
+
<title>Ajax Cart Configuration</title>
|
125 |
+
<sort_order>6</sort_order>
|
126 |
+
<action>adminhtml/system_config/edit/section/ajaxcart</action>
|
127 |
+
</ajaxcart>
|
128 |
+
</children>
|
129 |
+
</settings>
|
130 |
+
</menu>
|
131 |
+
</adminhtml>
|
132 |
+
<default>
|
133 |
+
<ajaxcart>
|
134 |
+
<general>
|
135 |
+
<enable>1</enable>
|
136 |
+
<update_blocks>a:2:{s:2:"id";a:4:{i:0;s:17:".block.block-cart";i:1;s:14:".header .links";i:2;s:26:".checkout-cart-index .cart";i:3;s:16:".header-minicart";}s:3:"xml";a:4:{i:0;s:12:"cart_sidebar";i:1;s:9:"top.links";i:2;s:13:"checkout.cart";i:3;s:13:"minicart_head";}}</update_blocks>
|
137 |
+
</general>
|
138 |
+
</ajaxcart>
|
139 |
+
</default>
|
140 |
+
</config>
|
app/code/community/Abserve/Ajaxcart/etc/system.xml
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<abserve translate="label">
|
14 |
+
<label>Ajaxcart Extension</label>
|
15 |
+
<sort_order>400</sort_order>
|
16 |
+
</abserve>
|
17 |
+
</tabs>
|
18 |
+
|
19 |
+
<sections>
|
20 |
+
<ajaxcart translate="label" module="ajaxcart">
|
21 |
+
<label>Ajax Cart Configuration</label>
|
22 |
+
<comment>This extension was developed by Abserve Gajjar</comment>
|
23 |
+
<tab>settings</tab>
|
24 |
+
<frontend_type>text</frontend_type>
|
25 |
+
<sort_order>10</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
<groups>
|
30 |
+
<plugin_info>
|
31 |
+
<frontend_model>ajaxcart/adminhtml_info</frontend_model>
|
32 |
+
<sort_order>0</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</plugin_info>
|
37 |
+
<general translate="label">
|
38 |
+
<label>Ajaxcart Configuration</label>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
<sort_order>2</sort_order>
|
43 |
+
<fields>
|
44 |
+
<enable translate="label">
|
45 |
+
<label>Enable Ajax Cart</label>
|
46 |
+
<frontend_type>select</frontend_type>
|
47 |
+
<sort_order>1</sort_order>
|
48 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
<comment>Enable using Ajaxcart</comment>
|
53 |
+
</enable>
|
54 |
+
<update_blocks translate="label">
|
55 |
+
<label>XML of update blocks</label>
|
56 |
+
<comment>insert HTML parent tag ID of block to be updated</comment>
|
57 |
+
<frontend_model>ajaxcart/adminhtml_url</frontend_model>
|
58 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
59 |
+
<sort_order>50</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>0</show_in_website>
|
62 |
+
<show_in_store>0</show_in_store>
|
63 |
+
</update_blocks>
|
64 |
+
</fields>
|
65 |
+
</general>
|
66 |
+
</groups>
|
67 |
+
</ajaxcart>
|
68 |
+
</sections>
|
69 |
+
</config>
|
app/code/community/Abserve/AutoCurrency/Helper/Data.php
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
|
13 |
+
class Abserve_AutoCurrency_Helper_Data extends Mage_Core_Helper_Abstract
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Check if the module is enabled
|
17 |
+
*
|
18 |
+
* @return boolean 0 or 1
|
19 |
+
*/
|
20 |
+
public function isEnabled()
|
21 |
+
{
|
22 |
+
return Mage::getStoreConfig('catalog/autocurrency/enable_disable');
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Check IP database source
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public function getDatabaseSource()
|
31 |
+
{
|
32 |
+
$db = Mage::getStoreConfig('catalog/autocurrency/database_source');
|
33 |
+
if ($db == null) {
|
34 |
+
$db = 'ip2country';
|
35 |
+
}
|
36 |
+
return $db;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get IP Address
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function getIpAddress()
|
45 |
+
{
|
46 |
+
return $_SERVER['REMOTE_ADDR'];
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Include GeoIP Inc file
|
51 |
+
*/
|
52 |
+
public function loadGeoIpInc()
|
53 |
+
{
|
54 |
+
// Load geoip.inc
|
55 |
+
include_once(Mage::getBaseDir().'/var/geoip/geoip.inc');
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Load GeoIPv4 binary data file
|
60 |
+
*/
|
61 |
+
public function loadGeoIpv4()
|
62 |
+
{
|
63 |
+
$geoIPv4 = geoip_open(Mage::getBaseDir().'/var/geoip/GeoIP.dat',GEOIP_STANDARD);
|
64 |
+
return $geoIPv4;
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Load GeoIPv6 binary data file
|
69 |
+
*/
|
70 |
+
public function loadGeoIpv6()
|
71 |
+
{
|
72 |
+
$geoIPv6 = geoip_open(Mage::getBaseDir().'/var/geoip/GeoIPv6.dat',GEOIP_STANDARD);
|
73 |
+
return $geoIPv6;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Check whether the given IP Address is valid
|
78 |
+
*
|
79 |
+
* @param string IP Address
|
80 |
+
* @return boolean True/False
|
81 |
+
*/
|
82 |
+
public function checkValidIp($ip)
|
83 |
+
{
|
84 |
+
if(!filter_var($ip, FILTER_VALIDATE_IP)) {
|
85 |
+
return false;
|
86 |
+
}
|
87 |
+
return true;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Check whether the given IP Address is IPv6
|
92 |
+
*
|
93 |
+
* @param string IP Address
|
94 |
+
* @return boolean True/False
|
95 |
+
*/
|
96 |
+
public function checkIpv6($ip)
|
97 |
+
{
|
98 |
+
if(!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
99 |
+
return false;
|
100 |
+
}
|
101 |
+
return true;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Include IP2Country.php file
|
106 |
+
* and load ip2country.dat file
|
107 |
+
*
|
108 |
+
*/
|
109 |
+
public function loadIp2Country()
|
110 |
+
{
|
111 |
+
include_once(Mage::getBaseDir().'/var/geoip/ip2country/Ip2Country.php');
|
112 |
+
$ipc = new Ip2Country(Mage::getBaseDir().'/var/geoip/ip2country/ip2country.dat');
|
113 |
+
$ipc->preload();
|
114 |
+
return $ipc;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Get Currency code by Country code
|
119 |
+
*
|
120 |
+
* @return string
|
121 |
+
*/
|
122 |
+
public function getCurrencyByCountry($countryCode)
|
123 |
+
{
|
124 |
+
$map = array( '' => '',
|
125 |
+
"EU" => "EUR", "AD" => "EUR", "AE" => "AED", "AF" => "AFN", "AG" => "XCD", "AI" => "XCD",
|
126 |
+
"AL" => "ALL", "AM" => "AMD", "CW" => "ANG", "AO" => "AOA", "AQ" => "AQD", "AR" => "ARS", "AS" => "EUR",
|
127 |
+
"AT" => "EUR", "AU" => "AUD", "AW" => "AWG", "AZ" => "AZN", "BA" => "BAM", "BB" => "BBD",
|
128 |
+
"BD" => "BDT", "BE" => "EUR", "BF" => "XOF", "BG" => "BGL", "BH" => "BHD", "BI" => "BIF",
|
129 |
+
"BJ" => "XOF", "BM" => "BMD", "BN" => "BND", "BO" => "BOB", "BR" => "BRL", "BS" => "BSD",
|
130 |
+
"BT" => "BTN", "BV" => "NOK", "BW" => "BWP", "BY" => "BYR", "BZ" => "BZD", "CA" => "CAD",
|
131 |
+
"CC" => "AUD", "CD" => "CDF", "CF" => "XAF", "CG" => "XAF", "CH" => "CHF", "CI" => "XOF",
|
132 |
+
"CK" => "NZD", "CL" => "CLP", "CM" => "XAF", "CN" => "CNY", "CO" => "COP", "CR" => "CRC",
|
133 |
+
"CU" => "CUP", "CV" => "CVE", "CX" => "AUD", "CY" => "EUR", "CZ" => "CZK", "DE" => "EUR",
|
134 |
+
"DJ" => "DJF", "DK" => "DKK", "DM" => "XCD", "DO" => "DOP", "DZ" => "DZD", "EC" => "ECS",
|
135 |
+
"EE" => "EEK", "EG" => "EGP", "EH" => "MAD", "ER" => "ETB", "ES" => "EUR", "ET" => "ETB",
|
136 |
+
"FI" => "EUR", "FJ" => "FJD", "FK" => "FKP", "FM" => "USD", "FO" => "DKK", "FR" => "EUR", "SX" => "ANG",
|
137 |
+
"GA" => "XAF", "GB" => "GBP", "GD" => "XCD", "GE" => "GEL", "GF" => "EUR", "GH" => "GHS",
|
138 |
+
"GI" => "GIP", "GL" => "DKK", "GM" => "GMD", "GN" => "GNF", "GP" => "EUR", "GQ" => "XAF",
|
139 |
+
"GR" => "EUR", "GS" => "GBP", "GT" => "GTQ", "GU" => "USD", "GW" => "XOF", "GY" => "GYD",
|
140 |
+
"HK" => "HKD", "HM" => "AUD", "HN" => "HNL", "HR" => "HRK", "HT" => "HTG", "HU" => "HUF",
|
141 |
+
"ID" => "IDR", "IE" => "EUR", "IL" => "ILS", "IN" => "INR", "IO" => "USD", "IQ" => "IQD",
|
142 |
+
"IR" => "IRR", "IS" => "ISK", "IT" => "EUR", "JM" => "JMD", "JO" => "JOD", "JP" => "JPY",
|
143 |
+
"KE" => "KES", "KG" => "KGS", "KH" => "KHR", "KI" => "AUD", "KM" => "KMF", "KN" => "XCD",
|
144 |
+
"KP" => "KPW", "KR" => "KRW", "KW" => "KWD", "KY" => "KYD", "KZ" => "KZT", "LA" => "LAK",
|
145 |
+
"LB" => "LBP", "LC" => "XCD", "LI" => "CHF", "LK" => "LKR", "LR" => "LRD", "LS" => "LSL",
|
146 |
+
"LT" => "LTL", "LU" => "EUR", "LV" => "LVL", "LY" => "LYD", "MA" => "MAD", "MC" => "EUR",
|
147 |
+
"MD" => "MDL", "MG" => "MGF", "MH" => "USD", "MK" => "MKD", "ML" => "XOF", "MM" => "MMK",
|
148 |
+
"MN" => "MNT", "MO" => "MOP", "MP" => "USD", "MQ" => "EUR", "MR" => "MRO", "MS" => "XCD",
|
149 |
+
"MT" => "EUR", "MU" => "MUR", "MV" => "MVR", "MW" => "MWK", "MX" => "MXN", "MY" => "MYR",
|
150 |
+
"MZ" => "MZN", "NA" => "NAD", "NC" => "XPF", "NE" => "XOF", "NF" => "AUD", "NG" => "NGN",
|
151 |
+
"NI" => "NIO", "NL" => "EUR", "NO" => "NOK", "NP" => "NPR", "NR" => "AUD", "NU" => "NZD",
|
152 |
+
"NZ" => "NZD", "OM" => "OMR", "PA" => "PAB", "PE" => "PEN", "PF" => "XPF", "PG" => "PGK",
|
153 |
+
"PH" => "PHP", "PK" => "PKR", "PL" => "PLN", "PM" => "EUR", "PN" => "NZD", "PR" => "USD", "PS" => "ILS", "PT" => "EUR",
|
154 |
+
"PW" => "USD", "PY" => "PYG", "QA" => "QAR", "RE" => "EUR", "RO" => "RON", "RU" => "RUB",
|
155 |
+
"RW" => "RWF", "SA" => "SAR", "SB" => "SBD", "SC" => "SCR", "SD" => "SDD", "SE" => "SEK",
|
156 |
+
"SG" => "SGD", "SH" => "SHP", "SI" => "EUR", "SJ" => "NOK", "SK" => "SKK", "SL" => "SLL",
|
157 |
+
"SM" => "EUR", "SN" => "XOF", "SO" => "SOS", "SR" => "SRG", "ST" => "STD", "SV" => "SVC",
|
158 |
+
"SY" => "SYP", "SZ" => "SZL", "TC" => "USD", "TD" => "XAF", "TF" => "EUR", "TG" => "XOF",
|
159 |
+
"TH" => "THB", "TJ" => "TJS", "TK" => "NZD", "TM" => "TMM", "TN" => "TND", "TO" => "TOP", "TL" => "USD",
|
160 |
+
"TR" => "TRY", "TT" => "TTD", "TV" => "AUD", "TW" => "TWD", "TZ" => "TZS", "UA" => "UAH",
|
161 |
+
"UG" => "UGX", "UM" => "USD", "US" => "USD", "UY" => "UYU", "UZ" => "UZS", "VA" => "EUR",
|
162 |
+
"VC" => "XCD", "VE" => "VEF", "VG" => "USD", "VI" => "USD", "VN" => "VND", "VU" => "VUV",
|
163 |
+
"WF" => "XPF", "WS" => "EUR", "YE" => "YER", "YT" => "EUR", "RS" => "RSD",
|
164 |
+
"ZA" => "ZAR", "ZM" => "ZMK", "ME" => "EUR", "ZW" => "ZWD",
|
165 |
+
"AX" => "EUR", "GG" => "GBP", "IM" => "GBP",
|
166 |
+
"JE" => "GBP", "BL" => "EUR", "MF" => "EUR", "BQ" => "USD", "SS" => "SSP"
|
167 |
+
);
|
168 |
+
|
169 |
+
return $map[$countryCode];
|
170 |
+
}
|
171 |
+
}
|
app/code/community/Abserve/AutoCurrency/Model/Store.php
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
|
13 |
+
class Abserve_AutoCurrency_Model_Store extends Mage_Core_Model_Store
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* Update default store currency code
|
17 |
+
*
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function getDefaultCurrencyCode()
|
21 |
+
{
|
22 |
+
if (Mage::helper('autocurrency')->isEnabled()) {
|
23 |
+
$result = $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_DEFAULT);
|
24 |
+
return $this->getCurrencyCodeByIp($result);
|
25 |
+
} else {
|
26 |
+
return parent::getDefaultCurrencyCode();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Get Currency code by IP Address
|
32 |
+
*
|
33 |
+
* @return string
|
34 |
+
*/
|
35 |
+
public function getCurrencyCodeByIp($result = '')
|
36 |
+
{
|
37 |
+
$databaseSource = Mage::helper('autocurrency')->getDatabaseSource();
|
38 |
+
|
39 |
+
if ($databaseSource == 'maxmind') {
|
40 |
+
$currencyCode = $this->getCurrencyCodeMaxMind();
|
41 |
+
} else {
|
42 |
+
$currencyCode = $this->getCurrencyCodeIp2Country();
|
43 |
+
}
|
44 |
+
|
45 |
+
// if currencyCode is not present in allowedCurrencies
|
46 |
+
// then return the default currency code
|
47 |
+
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
48 |
+
if(!in_array($currencyCode, $allowedCurrencies)) {
|
49 |
+
return $result;
|
50 |
+
}
|
51 |
+
|
52 |
+
return $currencyCode;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Get Currency code by IP Address
|
57 |
+
* Using Ip2Country Database
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function getCurrencyCodeIp2Country()
|
62 |
+
{
|
63 |
+
// load Ip2Country database
|
64 |
+
$ipc = Mage::helper('autocurrency')->loadIp2Country();
|
65 |
+
|
66 |
+
// get IP Address
|
67 |
+
$ipAddress = Mage::helper('autocurrency')->getIpAddress();
|
68 |
+
|
69 |
+
// additional valid ip check
|
70 |
+
// because Ip2Country generates error for invalid IP address
|
71 |
+
if (!Mage::helper('autocurrency')->checkValidIp($ipAddress)) {
|
72 |
+
return null;
|
73 |
+
}
|
74 |
+
|
75 |
+
$countryCode = $ipc->lookup($ipAddress);
|
76 |
+
|
77 |
+
$currencyCode = Mage::helper('autocurrency')->getCurrencyByCountry($countryCode);
|
78 |
+
|
79 |
+
return $currencyCode;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get Currency code by IP Address
|
84 |
+
* Using MaxMind Database
|
85 |
+
*
|
86 |
+
* @return string
|
87 |
+
*/
|
88 |
+
public function getCurrencyCodeMaxMind()
|
89 |
+
{
|
90 |
+
// include geoip.inc file
|
91 |
+
Mage::helper('autocurrency')->loadGeoIpInc();
|
92 |
+
|
93 |
+
// get IP Address
|
94 |
+
$ipAddress = Mage::helper('autocurrency')->getIpAddress();
|
95 |
+
|
96 |
+
// load GeoIP .dat binary file
|
97 |
+
if (Mage::helper('autocurrency')->checkIpv6($ipAddress)) {
|
98 |
+
$geoIp = Mage::helper('autocurrency')->loadGeoIpv6();
|
99 |
+
} else {
|
100 |
+
$geoIp = Mage::helper('autocurrency')->loadGeoIpv4();
|
101 |
+
}
|
102 |
+
|
103 |
+
// get country code from ip address
|
104 |
+
$countryCode = geoip_country_code_by_addr($geoIp, $ipAddress);
|
105 |
+
|
106 |
+
// get currency code from country code
|
107 |
+
//$currencyCode = geoip_currency_code_by_country_code($geoIp, $countryCode);
|
108 |
+
$currencyCode = Mage::helper('autocurrency')->getCurrencyByCountry($countryCode);
|
109 |
+
|
110 |
+
// close the geo database
|
111 |
+
geoip_close($geoIp);
|
112 |
+
|
113 |
+
return $currencyCode;
|
114 |
+
}
|
115 |
+
}
|
app/code/community/Abserve/AutoCurrency/Model/System/Config/Source/Database.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_AutoCurrency_Model_System_Config_Source_Database
|
13 |
+
{
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Options getter
|
17 |
+
*
|
18 |
+
* @return array
|
19 |
+
*/
|
20 |
+
public function toOptionArray()
|
21 |
+
{
|
22 |
+
return array(
|
23 |
+
array('value' => 'ip2country', 'label'=>Mage::helper('autocurrency')->__('IP to Country')),
|
24 |
+
array('value' => 'maxmind', 'label'=>Mage::helper('autocurrency')->__('Max Mind')),
|
25 |
+
);
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Get options in "key-value" format
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
+
public function toArray()
|
34 |
+
{
|
35 |
+
return array(
|
36 |
+
'ip2country' => Mage::helper('autocurrency')->__('IP to Country'),
|
37 |
+
'maxmind' => Mage::helper('autocurrency')->__('Max Mind'),
|
38 |
+
);
|
39 |
+
}
|
40 |
+
}
|
app/code/community/Abserve/AutoCurrency/etc/config.xml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?xml version="1.0"?>
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_AutoCurrency>
|
14 |
+
<version>0.2.0</version>
|
15 |
+
</Abserve_AutoCurrency>
|
16 |
+
</modules>
|
17 |
+
<global>
|
18 |
+
<models>
|
19 |
+
<autocurrency>
|
20 |
+
<class>Abserve_AutoCurrency_Model</class>
|
21 |
+
</autocurrency>
|
22 |
+
<core>
|
23 |
+
<rewrite>
|
24 |
+
<store>Abserve_AutoCurrency_Model_Store</store>
|
25 |
+
</rewrite>
|
26 |
+
</core>
|
27 |
+
</models>
|
28 |
+
<helpers>
|
29 |
+
<autocurrency>
|
30 |
+
<class>Abserve_AutoCurrency_Helper</class>
|
31 |
+
</autocurrency>
|
32 |
+
</helpers>
|
33 |
+
</global>
|
34 |
+
<default>
|
35 |
+
<catalog>
|
36 |
+
<autocurrency>
|
37 |
+
<enable_disable>1</enable_disable>
|
38 |
+
</autocurrency>
|
39 |
+
</catalog>
|
40 |
+
</default>
|
41 |
+
</config>
|
app/code/community/Abserve/AutoCurrency/etc/system.xml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
11 |
+
<config>
|
12 |
+
<sections>
|
13 |
+
<catalog translate="label">
|
14 |
+
<groups>
|
15 |
+
<autocurrency translate="label" module="autocurrency">
|
16 |
+
<label>Auto Currency</label>
|
17 |
+
<frontend_type>text</frontend_type>
|
18 |
+
<sort_order>10</sort_order>
|
19 |
+
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
+
<show_in_store>1</show_in_store>
|
22 |
+
<fields>
|
23 |
+
<enable_disable translate="label comment">
|
24 |
+
<label>Enable</label>
|
25 |
+
<comment>Enable/Disable extension</comment>
|
26 |
+
<frontend_type>select</frontend_type>
|
27 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
28 |
+
<sort_order>10</sort_order>
|
29 |
+
<show_in_default>1</show_in_default>
|
30 |
+
<show_in_website>1</show_in_website>
|
31 |
+
<show_in_store>1</show_in_store>
|
32 |
+
</enable_disable>
|
33 |
+
<database_source translate="label comment">
|
34 |
+
<label>Database Source</label>
|
35 |
+
<comment></comment>
|
36 |
+
<frontend_type>select</frontend_type>
|
37 |
+
<source_model>autocurrency/system_config_source_database</source_model>
|
38 |
+
<sort_order>20</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</database_source>
|
43 |
+
</fields>
|
44 |
+
</autocurrency>
|
45 |
+
</groups>
|
46 |
+
</catalog>
|
47 |
+
</sections>
|
48 |
+
</config>
|
app/code/community/Abserve/Catalog/Model/Convert/Adapter/Category.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Catalog_Model_Convert_Adapter_Category
|
12 |
+
extends Mage_Eav_Model_Convert_Adapter_Entity
|
13 |
+
{
|
14 |
+
protected $_categoryCache = array();
|
15 |
+
|
16 |
+
protected $_stores;
|
17 |
+
|
18 |
+
protected $_displayModes = array( 'PRODUCTS', 'PAGE', 'PRODUCTS_AND_PAGE');
|
19 |
+
|
20 |
+
public function parse()
|
21 |
+
{
|
22 |
+
$batchModel = Mage::getSingleton('dataflow/batch');
|
23 |
+
|
24 |
+
$batchImportModel = $batchModel->getBatchImportModel();
|
25 |
+
$importIds = $batchImportModel->getIdCollection();
|
26 |
+
|
27 |
+
foreach ($importIds as $importId) {
|
28 |
+
|
29 |
+
$batchImportModel->load($importId);
|
30 |
+
$importData = $batchImportModel->getBatchData();
|
31 |
+
|
32 |
+
$this->saveRow($importData);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
public function saveRow(array $importData)
|
37 |
+
{
|
38 |
+
if (empty($importData['store'])) {
|
39 |
+
if (!is_null($this->getBatchParams('store'))) {
|
40 |
+
$store = $this->getStoreById($this->getBatchParams('store'));
|
41 |
+
} else {
|
42 |
+
$message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'store');
|
43 |
+
Mage::throwException($message);
|
44 |
+
}
|
45 |
+
} else {
|
46 |
+
$store = $this->getStoreByCode($importData['store']);
|
47 |
+
}
|
48 |
+
|
49 |
+
if ($store === false) {
|
50 |
+
$message = Mage::helper('catalog')->__('Skip import row, store "%s" field not exists', $importData['store']);
|
51 |
+
Mage::throwException($message);
|
52 |
+
}
|
53 |
+
|
54 |
+
$rootId = $store->getRootCategoryId();
|
55 |
+
if (!$rootId) {
|
56 |
+
return array();
|
57 |
+
}
|
58 |
+
$rootPath = '1/'.$rootId;
|
59 |
+
if (empty($this->_categoryCache[$store->getId()])) {
|
60 |
+
$collection = Mage::getModel('catalog/category')->getCollection()
|
61 |
+
->setStore($store)
|
62 |
+
->addAttributeToSelect('name');
|
63 |
+
$collection->getSelect()->where("path like '".$rootPath."/%'");
|
64 |
+
|
65 |
+
foreach ($collection as $cat) {
|
66 |
+
$pathArr = explode('/', $cat->getPath());
|
67 |
+
$namePath = '';
|
68 |
+
for ($i=2, $l=sizeof($pathArr); $i<$l; $i++) {
|
69 |
+
$name = $collection->getItemById($pathArr[$i])->getName();
|
70 |
+
$namePath .= (empty($namePath) ? '' : '/').trim($name);
|
71 |
+
}
|
72 |
+
$cat->setNamePath($namePath);
|
73 |
+
}
|
74 |
+
|
75 |
+
$cache = array();
|
76 |
+
foreach ($collection as $cat) {
|
77 |
+
$cache[strtolower($cat->getNamePath())] = $cat;
|
78 |
+
$cat->unsNamePath();
|
79 |
+
}
|
80 |
+
$this->_categoryCache[$store->getId()] = $cache;
|
81 |
+
}
|
82 |
+
$cache =& $this->_categoryCache[$store->getId()];
|
83 |
+
|
84 |
+
$importData['categories'] = preg_replace('#\s*/\s*#', '/', trim($importData['categories']));
|
85 |
+
if (!empty($cache[$importData['categories']])) {
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
|
89 |
+
$path = $rootPath;
|
90 |
+
$namePath = '';
|
91 |
+
|
92 |
+
$i = 1;
|
93 |
+
$categories = explode('/', $importData['categories']);
|
94 |
+
foreach ($categories as $catName) {
|
95 |
+
$namePath .= (empty($namePath) ? '' : '/').strtolower($catName);
|
96 |
+
if (empty($cache[$namePath])) {
|
97 |
+
|
98 |
+
$dispMode = $this->_displayModes[2];
|
99 |
+
|
100 |
+
$cat = Mage::getModel('catalog/category')
|
101 |
+
->setStoreId($store->getId())
|
102 |
+
->setPath($path)
|
103 |
+
->setName($catName)
|
104 |
+
->setIsActive(1)
|
105 |
+
->setIsAnchor(1)
|
106 |
+
->setDisplayMode($dispMode)
|
107 |
+
->save();
|
108 |
+
$cache[$namePath] = $cat;
|
109 |
+
}
|
110 |
+
$catId = $cache[$namePath]->getId();
|
111 |
+
$path .= '/'.$catId;
|
112 |
+
$i++;
|
113 |
+
}
|
114 |
+
|
115 |
+
return true;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getStoreByCode($store)
|
119 |
+
{
|
120 |
+
$this->_initStores();
|
121 |
+
if (isset($this->_stores[$store])) {
|
122 |
+
return $this->_stores[$store];
|
123 |
+
}
|
124 |
+
return false;
|
125 |
+
}
|
126 |
+
|
127 |
+
protected function _initStores ()
|
128 |
+
{
|
129 |
+
if (is_null($this->_stores)) {
|
130 |
+
$this->_stores = Mage::app()->getStores(true, true);
|
131 |
+
foreach ($this->_stores as $code => $store) {
|
132 |
+
$this->_storesIdCode[$store->getId()] = $code;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
?>
|
app/code/community/Abserve/Catalog/etc/config.xml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<?xml version="1.0"?>
|
11 |
+
<config>
|
12 |
+
<global>
|
13 |
+
<models>
|
14 |
+
<catalog>
|
15 |
+
<rewrite>
|
16 |
+
<convert_adapter_category>Abserve_Catalog_Model_Convert_Adapter_Category</convert_adapter_category>
|
17 |
+
</rewrite>
|
18 |
+
</catalog>
|
19 |
+
</models>
|
20 |
+
</global>
|
21 |
+
</config>
|
app/code/community/Abserve/CustomMenu/Block/About.php
ADDED
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_Block_About
|
13 |
+
extends Mage_Adminhtml_Block_Abstract
|
14 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
15 |
+
{
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Render fieldset html
|
19 |
+
*
|
20 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
21 |
+
* @return string
|
22 |
+
*/
|
23 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
24 |
+
{
|
25 |
+
$default = <<<HTML
|
26 |
+
<div style="background-color:#EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:20px;">
|
27 |
+
<p>
|
28 |
+
<b style="font-size:12px;">WebAndPeople</b>, a family of niche sites, provides small businesses with everything they need to start selling online.
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
<strong>PREMIUM and FREE MAGENTO TEMPALTES and EXTENSIONS</strong><br />
|
32 |
+
<a href="http://web-experiment.info" target="_blank">Web-Experiment.info</a> offers a wide choice of nice-looking and easily editable free and premium Magento Themes. At Web-Experiment, you can find free downloads or buy premium tempaltes for the extremely popular Magento eCommerce platform.<br />
|
33 |
+
<strong>MAGENTO HOSTING</strong></strong><br />
|
34 |
+
<a href="http://magenting.com" target="_blank">Magenting.com</a>, a new and improved hosting solution, is allowing you to easily create, promote, and manage your online store with Magento. Magenting users will receive a valuable set of tools and features, including automatic Magento eCommerce installation, automatic Magento template installation and a free or paid professional Magento hosting account.<br />
|
35 |
+
<strong>WEB DEVELOPMENT</strong><br />
|
36 |
+
<a href="http://abservemegamenu.com" target="_blank">WebAndPeople.com</a> is a team of professional Web developers and designers who are some of the best in the industry. WebAndPeople provides Web application development, custom Magento theme designs, and Website design services.<br />
|
37 |
+
<br />
|
38 |
+
</p>
|
39 |
+
<p>
|
40 |
+
Our themes and extensions on <a href="http://www.magentocommerce.com/magento-connect/developer/WebAndPeople" target="_blank">MagentoConnect</a><br />
|
41 |
+
Should you have any questions <a href="http://web-experiment.info/support" target="_blank">Contact Us</a> or email at <a href="mailto:support@web-experiment.info">support@web-experiment.info</a>
|
42 |
+
<br />
|
43 |
+
</p>
|
44 |
+
</div>
|
45 |
+
HTML;
|
46 |
+
$default = json_encode($default);
|
47 |
+
$html = '<div id="abserve_aboutus_content"></div>
|
48 |
+
|
49 |
+
<script type="text/javascript"> //<![CDATA[
|
50 |
+
|
51 |
+
/* JSON-P implementation for Prototype.js somewhat by Dan Dean (http://www.dandean.com)
|
52 |
+
*
|
53 |
+
* *HEAVILY* based on Tobie Langel\'s version: http://gist.github.com/145466.
|
54 |
+
* Might as well just call this an iteration.
|
55 |
+
*
|
56 |
+
* This version introduces:
|
57 |
+
* - Support for predefined callbacks (Necessary for OAuth signed requests, by @rboyce)
|
58 |
+
* - Partial integration with Ajax.Responders (Thanks to @sr3d for the kick in this direction)
|
59 |
+
* - Compatibility with Prototype 1.7 (Thanks to @soung3 for the bug report)
|
60 |
+
* - Will not break if page lacks a <head> element
|
61 |
+
*
|
62 |
+
* See examples in README for usage
|
63 |
+
*
|
64 |
+
* VERSION 1.1.2
|
65 |
+
*
|
66 |
+
* new Ajax.JSONRequest(url, options);
|
67 |
+
* - url (String): JSON-P endpoint url.
|
68 |
+
* - options (Object): Configuration options for the request.
|
69 |
+
*/
|
70 |
+
Ajax.JSONRequest = Class.create(Ajax.Base, (function() {
|
71 |
+
var id = 0, head = document.getElementsByTagName(\'head\')[0] || document.body;
|
72 |
+
return {
|
73 |
+
initialize: function($super, url, options) {
|
74 |
+
$super(options);
|
75 |
+
this.options.url = url;
|
76 |
+
this.options.callbackParamName = this.options.callbackParamName || \'callback\';
|
77 |
+
this.options.timeout = this.options.timeout || 10; // Default timeout: 10 seconds
|
78 |
+
this.options.invokeImmediately = (!Object.isUndefined(this.options.invokeImmediately)) ? this.options.invokeImmediately : true ;
|
79 |
+
|
80 |
+
if (!Object.isUndefined(this.options.parameters) && Object.isString(this.options.parameters)) {
|
81 |
+
this.options.parameters = this.options.parameters.toQueryParams();
|
82 |
+
}
|
83 |
+
|
84 |
+
if (this.options.invokeImmediately) {
|
85 |
+
this.request();
|
86 |
+
}
|
87 |
+
},
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Ajax.JSONRequest#_cleanup() -> undefined
|
91 |
+
* Cleans up after the request
|
92 |
+
**/
|
93 |
+
_cleanup: function() {
|
94 |
+
if (this.timeout) {
|
95 |
+
clearTimeout(this.timeout);
|
96 |
+
this.timeout = null;
|
97 |
+
}
|
98 |
+
if (this.transport && Object.isElement(this.transport)) {
|
99 |
+
this.transport.remove();
|
100 |
+
this.transport = null;
|
101 |
+
}
|
102 |
+
},
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Ajax.JSONRequest#request() -> undefined
|
106 |
+
* Invokes the JSON-P request lifecycle
|
107 |
+
**/
|
108 |
+
request: function() {
|
109 |
+
|
110 |
+
// Define local vars
|
111 |
+
var response = new Ajax.JSONResponse(this);
|
112 |
+
var key = this.options.callbackParamName,
|
113 |
+
name = \'_prototypeJSONPCallback_\' + (id++),
|
114 |
+
complete = function() {
|
115 |
+
if (Object.isFunction(this.options.onComplete)) {
|
116 |
+
this.options.onComplete.call(this, response);
|
117 |
+
}
|
118 |
+
Ajax.Responders.dispatch(\'onComplete\', this, response);
|
119 |
+
}.bind(this);
|
120 |
+
|
121 |
+
// If the callback parameter is already defined, use that
|
122 |
+
if (this.options.parameters[key] !== undefined) {
|
123 |
+
name = this.options.parameters[key];
|
124 |
+
}
|
125 |
+
// Otherwise, add callback as a parameter
|
126 |
+
else {
|
127 |
+
this.options.parameters[key] = name;
|
128 |
+
}
|
129 |
+
|
130 |
+
// Build request URL
|
131 |
+
this.options.parameters[key] = name;
|
132 |
+
var url = this.options.url + ((this.options.url.include(\'?\') ? \'&\' : \'?\') + Object.toQueryString(this.options.parameters));
|
133 |
+
|
134 |
+
// Define callback function
|
135 |
+
window[name] = function(json) {
|
136 |
+
this._cleanup(); // Garbage collection
|
137 |
+
window[name] = undefined;
|
138 |
+
|
139 |
+
response.status = 200;
|
140 |
+
response.statusText = "OK";
|
141 |
+
response.setResponseContent(json);
|
142 |
+
|
143 |
+
if (Object.isFunction(this.options.onSuccess)) {
|
144 |
+
this.options.onSuccess.call(this, response);
|
145 |
+
}
|
146 |
+
Ajax.Responders.dispatch(\'onSuccess\', this, response);
|
147 |
+
|
148 |
+
complete();
|
149 |
+
|
150 |
+
}.bind(this);
|
151 |
+
|
152 |
+
this.transport = new Element(\'script\', { type: \'text/javascript\', src: url });
|
153 |
+
|
154 |
+
if (Object.isFunction(this.options.onCreate)) {
|
155 |
+
this.options.onCreate.call(this, response);
|
156 |
+
}
|
157 |
+
Ajax.Responders.dispatch(\'onCreate\', this);
|
158 |
+
|
159 |
+
head.appendChild(this.transport);
|
160 |
+
|
161 |
+
this.timeout = setTimeout(function() {
|
162 |
+
this._cleanup();
|
163 |
+
window[name] = Prototype.emptyFunction;
|
164 |
+
if (Object.isFunction(this.options.onFailure)) {
|
165 |
+
response.status = 504;
|
166 |
+
response.statusText = "Gateway Timeout";
|
167 |
+
this.options.onFailure.call(this, response);
|
168 |
+
}
|
169 |
+
complete();
|
170 |
+
}.bind(this), this.options.timeout * 1000);
|
171 |
+
},
|
172 |
+
toString: function() { return "[object Ajax.JSONRequest]"; }
|
173 |
+
};
|
174 |
+
})());
|
175 |
+
|
176 |
+
Ajax.JSONResponse = Class.create({
|
177 |
+
initialize: function(request) {
|
178 |
+
this.request = request;
|
179 |
+
},
|
180 |
+
request: undefined,
|
181 |
+
status: 0,
|
182 |
+
statusText: \'\',
|
183 |
+
responseJSON: undefined,
|
184 |
+
responseText: undefined,
|
185 |
+
setResponseContent: function(json) {
|
186 |
+
this.responseJSON = json;
|
187 |
+
this.responseText = Object.toJSON(json);
|
188 |
+
},
|
189 |
+
getTransport: function() {
|
190 |
+
if (this.request) return this.request.transport;
|
191 |
+
},
|
192 |
+
toString: function() { return "[object Ajax.JSONResponse]"; }
|
193 |
+
});
|
194 |
+
|
195 |
+
window.onload = function(){
|
196 |
+
var html = ' . $default . ';
|
197 |
+
|
198 |
+
new Ajax.JSONRequest(\'http://web-experiment.info/about-us.php\', {
|
199 |
+
callbackParamName: "jsoncallback",
|
200 |
+
timeout: 1,
|
201 |
+
onComplete: function(response) {
|
202 |
+
if (response.responseJSON && response.responseJSON.html) {
|
203 |
+
html = response.responseJSON.html;
|
204 |
+
}
|
205 |
+
Element.replace(\'abserve_aboutus_content\', html);
|
206 |
+
}
|
207 |
+
});
|
208 |
+
};
|
209 |
+
//]]></script>';
|
210 |
+
return $html;
|
211 |
+
}
|
212 |
+
}
|
app/code/community/Abserve/CustomMenu/Block/Navigation - Copy.php
ADDED
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
13 |
+
{
|
14 |
+
const CUSTOM_BLOCK_TEMPLATE = "abserve_custom_menu_%d";
|
15 |
+
|
16 |
+
private $_productsCount = null;
|
17 |
+
private $_topMenu = array();
|
18 |
+
private $_popupMenu = array();
|
19 |
+
|
20 |
+
public function drawCustomMenuMobileItem($category, $level = 0, $last = false)
|
21 |
+
{
|
22 |
+
if (!$category->getIsActive()) return '';
|
23 |
+
$html = array();
|
24 |
+
$id = $category->getId();
|
25 |
+
// --- Sub Categories ---
|
26 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
27 |
+
// --- class for active category ---
|
28 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
29 |
+
$hasSubMenu = count($activeChildren);
|
30 |
+
$catUrl = $this->getCategoryUrl($category);
|
31 |
+
$html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
|
32 |
+
$html[] = '<div class="parentMenu">';
|
33 |
+
// --- Top Menu Item ---
|
34 |
+
$html[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="' . $catUrl .'">';
|
35 |
+
$name = $this->escapeHtml($category->getName());
|
36 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
37 |
+
$name = str_replace(' ', ' ', $name);
|
38 |
+
}
|
39 |
+
$html[] = '<span>' . $name . '</span>';
|
40 |
+
$html[] = '</a>';
|
41 |
+
if ($hasSubMenu) {
|
42 |
+
$html[] = '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
43 |
+
}
|
44 |
+
$html[] = '</div>';
|
45 |
+
// --- Add Popup block (hidden) ---
|
46 |
+
if ($hasSubMenu) {
|
47 |
+
// --- draw Sub Categories ---
|
48 |
+
$html[] = '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu" style="display: none;">';
|
49 |
+
$html[] = $this->drawMobileMenuItem($activeChildren);
|
50 |
+
$html[] = '<div class="clearBoth"></div>';
|
51 |
+
$html[] = '</div>';
|
52 |
+
}
|
53 |
+
$html[] = '</div>';
|
54 |
+
$html = implode("\n", $html);
|
55 |
+
return $html;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getTopMenuArray()
|
59 |
+
{
|
60 |
+
return $this->_topMenu;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getPopupMenuArray()
|
64 |
+
{
|
65 |
+
return $this->_popupMenu;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function drawCustomMenuItem($category, $level = 0, $last = false)
|
69 |
+
{
|
70 |
+
if (!$category->getIsActive()) return;
|
71 |
+
$htmlTop = array();
|
72 |
+
$id = $category->getId();
|
73 |
+
// --- Static Block ---
|
74 |
+
$blockId = sprintf(self::CUSTOM_BLOCK_TEMPLATE, $id); // --- static block key
|
75 |
+
#Mage::log($blockId);
|
76 |
+
$collection = Mage::getModel('cms/block')->getCollection()
|
77 |
+
->addFieldToFilter('identifier', array(array('like' => $blockId . '_w%'), array('eq' => $blockId)))
|
78 |
+
->addFieldToFilter('is_active', 1);
|
79 |
+
$blockId = $collection->getFirstItem()->getIdentifier();
|
80 |
+
#Mage::log($blockId);
|
81 |
+
$blockHtml = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($blockId)->toHtml();
|
82 |
+
// --- Sub Categories ---
|
83 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
84 |
+
// --- class for active category ---
|
85 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
86 |
+
// --- Popup functions for show ---
|
87 |
+
$drawPopup = ($blockHtml || count($activeChildren));
|
88 |
+
if ($drawPopup) {
|
89 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '" onmouseover="abserveShowMenuPopup(this, event, \'popup' . $id . '\',\''.$id.'\');" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\', \''.$id.'\')">';
|
90 |
+
} else {
|
91 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '">';
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
// --- Top Menu Item ---
|
96 |
+
$htmlTop[] = '<div class="parentMenu">';
|
97 |
+
if ($level == 0 && $drawPopup) {
|
98 |
+
$htmlTop[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="'.$this->getCategoryUrl($category).'" rel="'.$this->getCategoryUrl($category).'">';
|
99 |
+
} else {
|
100 |
+
$htmlTop[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="'.$this->getCategoryUrl($category).'">';
|
101 |
+
}
|
102 |
+
|
103 |
+
$name = $this->escapeHtml($category->getName());
|
104 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
105 |
+
$name = str_replace(' ', ' ', $name);
|
106 |
+
}
|
107 |
+
$htmlTop[] = '<span>' . $name . '</span>';
|
108 |
+
$htmlTop[] = '</a>';
|
109 |
+
$htmlTop[] = '</div>';
|
110 |
+
$htmlTop[] = '</div>';
|
111 |
+
$this->_topMenu[] = implode("\n", $htmlTop);
|
112 |
+
// --- Add Popup block (hidden) ---
|
113 |
+
if ($drawPopup) {
|
114 |
+
$htmlPopup = array();
|
115 |
+
// --- Popup function for hide ---
|
116 |
+
$htmlPopup[] = '<div id="popup' . $id . '" class="abserve-custom-menu-popup" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')" onmouseover="abservePopupOver(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
|
117 |
+
// --- draw Sub Categories ---
|
118 |
+
if (count($activeChildren)) {
|
119 |
+
$columns = (int)Mage::getStoreConfig('custom_menu/columns/count');
|
120 |
+
$htmlPopup[] = '<div class="block1">';
|
121 |
+
$htmlPopup[] = $this->drawColumns($activeChildren, $columns,$id);
|
122 |
+
$htmlPopup[] = $this->drawColumnsImage($activeChildren, $columns,$id);
|
123 |
+
$htmlPopup[] = '<div class="clearBoth"></div>';
|
124 |
+
$htmlPopup[] = '</div>';
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
// -- Shown Product List --
|
129 |
+
$htmlPopup[] = '<div id="' . $blockId . '" class="block2 product_img_block">';
|
130 |
+
|
131 |
+
// Get Product List :
|
132 |
+
$category = new Mage_Catalog_Model_Category();
|
133 |
+
$category->load($id);
|
134 |
+
$collection = $category->getProductCollection();
|
135 |
+
$collection->addAttributeToSelect('*');
|
136 |
+
foreach ($collection as $_product) {
|
137 |
+
$image_url= Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getImage() );
|
138 |
+
$product_url= Mage::getUrl($_product->getUrlPath());
|
139 |
+
}
|
140 |
+
|
141 |
+
/*$htmlPopup[] = '<div class="row">';
|
142 |
+
$htmlPopup[] = '<div id="owl-demo" class="owl-carousel">';
|
143 |
+
foreach ($collection as $_product) {
|
144 |
+
$image_url= Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getImage() );
|
145 |
+
$product_url= Mage::getUrl($_product->getUrlPath());
|
146 |
+
|
147 |
+
$htmlPopup[] = '<div class="slide-block item" style="background:url('.$image_url.');background-size:contain;background-repeat:no-repeat;">';
|
148 |
+
$htmlPopup[] = '<div class="text-block">';
|
149 |
+
$htmlPopup[] = '<a class="product_title_text" href="'.$product_url.'"> '.$_product->getName().'</a>';
|
150 |
+
$htmlPopup[] = '<h5>Flat 40% Offer</h5>';
|
151 |
+
$htmlPopup[] = '<a class="product_buy" href="'.$product_url.'">Buy Now</a>';
|
152 |
+
$htmlPopup[] = '</div>';
|
153 |
+
$htmlPopup[] = '</div>';
|
154 |
+
}
|
155 |
+
$htmlPopup[] = '</div>';
|
156 |
+
$htmlPopup[] = '</div>';*/
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
$htmlPopup[] = '</div>';
|
161 |
+
|
162 |
+
// --- draw Custom User Block ---
|
163 |
+
if ($blockHtml) {
|
164 |
+
$htmlPopup[] = '<div id="' . $blockId . '" class="block2">';
|
165 |
+
$htmlPopup[] = $blockHtml;
|
166 |
+
$htmlPopup[] = '</div>';
|
167 |
+
}
|
168 |
+
$htmlPopup[] = '</div>';
|
169 |
+
$this->_popupMenu[] = implode("\n", $htmlPopup);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
public function drawMobileMenuItem($children, $level = 1)
|
174 |
+
{
|
175 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
176 |
+
$html = '';
|
177 |
+
foreach ($children as $child) {
|
178 |
+
if (is_object($child) && $child->getIsActive()) {
|
179 |
+
// --- class for active category ---
|
180 |
+
$active = '';
|
181 |
+
$id = $child->getId();
|
182 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
183 |
+
if ($this->isCategoryActive($child)) {
|
184 |
+
$active = ' actParent';
|
185 |
+
if ($id == $keyCurrent) $active = ' act';
|
186 |
+
}
|
187 |
+
$html.= '<div id="menu-mobile-' . $id . '" class="itemMenu level' . $level . $active . '">';
|
188 |
+
// --- format category name ---
|
189 |
+
$name = $this->escapeHtml($child->getName());
|
190 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
191 |
+
$html.= '<div class="parentMenu">';
|
192 |
+
$html.= '<a class="category_name cat_id_'.$id.' itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
193 |
+
if (count($activeChildren) > 0) {
|
194 |
+
$html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
195 |
+
}
|
196 |
+
$html.= '</div>';
|
197 |
+
if (count($activeChildren) > 0) {
|
198 |
+
$html.= '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu level' . $level . '" style="display: none;">';
|
199 |
+
$html.= $this->drawMobileMenuItem($activeChildren, $level + 1);
|
200 |
+
$html.= '<div class="clearBoth"></div>';
|
201 |
+
$html.= '</div>';
|
202 |
+
}
|
203 |
+
$html.= '</div>';
|
204 |
+
}
|
205 |
+
}
|
206 |
+
return $html;
|
207 |
+
}
|
208 |
+
|
209 |
+
public function drawMenuImageItem($children, $level = 1,$main_cat_id)
|
210 |
+
{
|
211 |
+
//$html = '<div class=" cat_id_img_'.$level.'">';
|
212 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
213 |
+
foreach ($children as $child) {
|
214 |
+
if (is_object($child) && $child->getIsActive()) {
|
215 |
+
// --- class for active category ---
|
216 |
+
$active = '';
|
217 |
+
if ($this->isCategoryActive($child)) {
|
218 |
+
$active = ' actParent';
|
219 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
220 |
+
}
|
221 |
+
// --- format category name ---
|
222 |
+
$name = $this->escapeHtml($child->getName());
|
223 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
224 |
+
|
225 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
226 |
+
if (count($activeChildren) > 0) {
|
227 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
228 |
+
$html.= $this->drawMenuImageItem($activeChildren, $level + 1);
|
229 |
+
$html.= '</div>';
|
230 |
+
}
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
$catimagename = Mage::getModel('catalog/category')->load($child->getId())->getThumbnail();
|
236 |
+
$catimgsrc = Mage::getBaseUrl('media').'catalog/category/'.$catimagename;
|
237 |
+
if($catimagename)
|
238 |
+
// $catimage = '<span style="background:url('.$catimgsrc.');" class="category_image img_cat_id_'.$child->getId().'" > <img style="height:300px;float:right;" src="'.$catimgsrc.'" /> </span>';
|
239 |
+
$catimage = '<div> <span style="background:url('.$catimgsrc.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$child->getId().'" > </span></div>';
|
240 |
+
else{
|
241 |
+
$catimgurl = $this->getSkinUrl('css/abservemegamenu/images/cat_img.png');
|
242 |
+
$catimage = '<div> <span style="background:url('.$catimgurl.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$child->getId().'" > </span></div>';
|
243 |
+
}
|
244 |
+
//$catimage = '';
|
245 |
+
$html.=$catimage;
|
246 |
+
|
247 |
+
|
248 |
+
}
|
249 |
+
|
250 |
+
//$html.= '</div>';
|
251 |
+
|
252 |
+
return $html;
|
253 |
+
}
|
254 |
+
|
255 |
+
public function drawMenuItem($children, $level = 1,$main_cat_id)
|
256 |
+
{
|
257 |
+
$html = '<div class="itemMenu level' . $level . ' main_cat_id'.$main_cat_id.'">';
|
258 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
259 |
+
foreach ($children as $child) {
|
260 |
+
if (is_object($child) && $child->getIsActive()) {
|
261 |
+
// --- class for active category ---
|
262 |
+
$active = '';
|
263 |
+
if ($this->isCategoryActive($child)) {
|
264 |
+
$active = ' actParent';
|
265 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
266 |
+
}
|
267 |
+
// --- format category name ---
|
268 |
+
$name = $this->escapeHtml($child->getName());
|
269 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
270 |
+
$html.= '<div class="submenu" onmouseover="abserveHoverSubcategory(\''.$child->getId().'\',\''.$main_cat_id.'\');">';
|
271 |
+
$html.= '<a class="cat_id_'.$child->getId().' itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '" ><span>' . $name . '</span></a>';
|
272 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
273 |
+
if (count($activeChildren) > 0) {
|
274 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
275 |
+
$html.= $this->drawSubMenuItem($activeChildren, $level + 1);
|
276 |
+
$html.= '</div>';
|
277 |
+
}
|
278 |
+
$html .= '</div>';
|
279 |
+
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
$html.= '</div>';
|
284 |
+
|
285 |
+
return $html;
|
286 |
+
}
|
287 |
+
|
288 |
+
|
289 |
+
public function drawSubMenuItem($children, $level = 1,$main_cat_id)
|
290 |
+
{
|
291 |
+
$html = '<div class="itemMenu level' . $level . ' main_cat_id'.$main_cat_id.'">';
|
292 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
293 |
+
foreach ($children as $child) {
|
294 |
+
if (is_object($child) && $child->getIsActive()) {
|
295 |
+
// --- class for active category ---
|
296 |
+
$active = '';
|
297 |
+
if ($this->isCategoryActive($child)) {
|
298 |
+
$active = ' actParent';
|
299 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
300 |
+
}
|
301 |
+
// --- format category name ---
|
302 |
+
$name = $this->escapeHtml($child->getName());
|
303 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
304 |
+
$html.= '<a class="cat_id_'.$child->getId().' itemMenuName level' . $level . $active . '" href="'.$this->getCategoryUrl($child).'"><span>' . $name . '</span></a>';
|
305 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
306 |
+
if (count($activeChildren) > 0) {
|
307 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
308 |
+
$html.= $this->drawSubMenuItem($activeChildren, $level + 1);
|
309 |
+
$html.= '</div>';
|
310 |
+
}
|
311 |
+
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
$html.= '</div>';
|
316 |
+
|
317 |
+
return $html;
|
318 |
+
}
|
319 |
+
|
320 |
+
|
321 |
+
public function drawColumnsImage($children, $columns = 1,$main_cat_id)
|
322 |
+
{
|
323 |
+
$html = '';
|
324 |
+
$html .= '<div class="category_image_wrapper" >';
|
325 |
+
// --- explode by columns ---
|
326 |
+
if ($columns < 1) $columns = 1;
|
327 |
+
$chunks = $this->_explodeByColumns($children, $columns);
|
328 |
+
// --- draw columns ---
|
329 |
+
$lastColumnNumber = count($chunks);
|
330 |
+
$i = 1;
|
331 |
+
foreach ($chunks as $key => $value) {
|
332 |
+
if (!count($value)) continue;
|
333 |
+
//$html.= '<div class="column">';
|
334 |
+
$html.= $this->drawMenuImageItem($value, 1,$main_cat_id);
|
335 |
+
//$html.= '</div>';
|
336 |
+
$i++;
|
337 |
+
}
|
338 |
+
|
339 |
+
//-- Main Category Image --
|
340 |
+
$catimagename = Mage::getModel('catalog/category')->load($main_cat_id)->getThumbnail();
|
341 |
+
$catimgsrc = Mage::getBaseUrl('media').'catalog/category/'.$catimagename;
|
342 |
+
if($catimagename){
|
343 |
+
//$catimage = '<span style="background:url('.$catimgsrc.');" class="category_image img_cat_id_'.$main_cat_id.'" ><img src="'.$catimgsrc.'" style="height:300px;float:right;"/> </span>';
|
344 |
+
$catimage = '<div><span style="background:url('.$catimgsrc.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$main_cat_id.'" ></span></div>';
|
345 |
+
}
|
346 |
+
else{
|
347 |
+
$catimgurl = $this->getSkinUrl('css/abservemegamenu/images/cat_img.png');
|
348 |
+
$catimage = '<div><span style="background:url('.$catimgurl.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$main_cat_id.'" ></span></div>';
|
349 |
+
//$catimage = '<div><span style="background:url('.$catimgsrc.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$main_cat_id.'" ></span></div>';
|
350 |
+
}
|
351 |
+
$html .= $catimage;
|
352 |
+
$html .= '</div>';
|
353 |
+
return $html;
|
354 |
+
}
|
355 |
+
|
356 |
+
public function drawColumns($children, $columns = 1,$main_cat_id)
|
357 |
+
{
|
358 |
+
$html = '';
|
359 |
+
// --- explode by columns ---
|
360 |
+
if ($columns < 1) $columns = 1;
|
361 |
+
$chunks = $this->_explodeByColumns($children, $columns);
|
362 |
+
// --- draw columns ---
|
363 |
+
$lastColumnNumber = count($chunks);
|
364 |
+
$i = 1;
|
365 |
+
foreach ($chunks as $key => $value) {
|
366 |
+
if (!count($value)) continue;
|
367 |
+
$class = '';
|
368 |
+
if ($i == 1) $class.= ' first';
|
369 |
+
if ($i == $lastColumnNumber) $class.= ' last';
|
370 |
+
if ($i % 2) $class.= ' odd'; else $class.= ' even';
|
371 |
+
$html.= '<div class="column' . $class . '">';
|
372 |
+
$html.= $this->drawMenuItem($value, 1,$main_cat_id);
|
373 |
+
$html.= '</div>';
|
374 |
+
$i++;
|
375 |
+
}
|
376 |
+
|
377 |
+
return $html;
|
378 |
+
}
|
379 |
+
|
380 |
+
protected function _getActiveChildren($parent, $level)
|
381 |
+
{
|
382 |
+
$activeChildren = array();
|
383 |
+
// --- check level ---
|
384 |
+
$maxLevel = (int)Mage::getStoreConfig('custom_menu/general/max_level');
|
385 |
+
if ($maxLevel > 0) {
|
386 |
+
if ($level >= ($maxLevel - 1)) return $activeChildren;
|
387 |
+
}
|
388 |
+
// --- / check level ---
|
389 |
+
if (Mage::helper('catalog/category_flat')->isEnabled()) {
|
390 |
+
$children = $parent->getChildrenNodes();
|
391 |
+
$childrenCount = count($children);
|
392 |
+
} else {
|
393 |
+
$children = $parent->getChildren();
|
394 |
+
$childrenCount = $children->count();
|
395 |
+
}
|
396 |
+
$hasChildren = $children && $childrenCount;
|
397 |
+
if ($hasChildren) {
|
398 |
+
foreach ($children as $child) {
|
399 |
+
if ($this->_isCategoryDisplayed($child)) {
|
400 |
+
array_push($activeChildren, $child);
|
401 |
+
}
|
402 |
+
}
|
403 |
+
}
|
404 |
+
return $activeChildren;
|
405 |
+
}
|
406 |
+
|
407 |
+
private function _isCategoryDisplayed(&$child)
|
408 |
+
{
|
409 |
+
if (!$child->getIsActive()) return false;
|
410 |
+
// === check products count ===
|
411 |
+
// --- get collection info ---
|
412 |
+
if (!Mage::getStoreConfig('custom_menu/general/display_empty_categories')) {
|
413 |
+
$data = $this->_getProductsCountData();
|
414 |
+
// --- check by id ---
|
415 |
+
$id = $child->getId();
|
416 |
+
#Mage::log($id); Mage::log($data);
|
417 |
+
if (!isset($data[$id]) || !$data[$id]['product_count']) return false;
|
418 |
+
}
|
419 |
+
// === / check products count ===
|
420 |
+
return true;
|
421 |
+
}
|
422 |
+
|
423 |
+
private function _getProductsCountData()
|
424 |
+
{
|
425 |
+
if (is_null($this->_productsCount)) {
|
426 |
+
$collection = Mage::getModel('catalog/category')->getCollection();
|
427 |
+
$storeId = Mage::app()->getStore()->getId();
|
428 |
+
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
|
429 |
+
$collection->addAttributeToSelect('name')
|
430 |
+
->addAttributeToSelect('is_active')
|
431 |
+
->setProductStoreId($storeId)
|
432 |
+
->setLoadProductCount(true)
|
433 |
+
->setStoreId($storeId);
|
434 |
+
$productsCount = array();
|
435 |
+
foreach($collection as $cat) {
|
436 |
+
$productsCount[$cat->getId()] = array(
|
437 |
+
'name' => $cat->getName(),
|
438 |
+
'product_count' => $cat->getProductCount(),
|
439 |
+
);
|
440 |
+
}
|
441 |
+
#Mage::log($productsCount);
|
442 |
+
$this->_productsCount = $productsCount;
|
443 |
+
}
|
444 |
+
return $this->_productsCount;
|
445 |
+
}
|
446 |
+
|
447 |
+
private function _explodeByColumns($target, $num)
|
448 |
+
{
|
449 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/divided_horizontally')) {
|
450 |
+
$target = self::_explodeArrayByColumnsHorisontal($target, $num);
|
451 |
+
} else {
|
452 |
+
$target = self::_explodeArrayByColumnsVertical($target, $num);
|
453 |
+
}
|
454 |
+
#return $target;
|
455 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/integrate') && count($target)) {
|
456 |
+
// --- combine consistently numerically small column ---
|
457 |
+
// --- 1. calc length of each column ---
|
458 |
+
$max = 0; $columnsLength = array();
|
459 |
+
foreach ($target as $key => $child) {
|
460 |
+
$count = 0;
|
461 |
+
$this->_countChild($child, 1, $count);
|
462 |
+
if ($max < $count) $max = $count;
|
463 |
+
$columnsLength[$key] = $count;
|
464 |
+
}
|
465 |
+
// --- 2. merge small columns with next ---
|
466 |
+
$xColumns = array(); $column = array(); $cnt = 0;
|
467 |
+
$xColumnsLength = array(); $k = 0;
|
468 |
+
foreach ($columnsLength as $key => $count) {
|
469 |
+
$cnt+= $count;
|
470 |
+
if ($cnt > $max && count($column)) {
|
471 |
+
$xColumns[$k] = $column;
|
472 |
+
$xColumnsLength[$k] = $cnt - $count;
|
473 |
+
$k++; $column = array(); $cnt = $count;
|
474 |
+
}
|
475 |
+
$column = array_merge($column, $target[$key]);
|
476 |
+
}
|
477 |
+
$xColumns[$k] = $column;
|
478 |
+
$xColumnsLength[$k] = $cnt - $count;
|
479 |
+
// --- 3. integrate columns of one element ---
|
480 |
+
$target = $xColumns; $xColumns = array(); $nextKey = -1;
|
481 |
+
if ($max > 1 && count($target) > 1) {
|
482 |
+
foreach($target as $key => $column) {
|
483 |
+
if ($key == $nextKey) continue;
|
484 |
+
if ($xColumnsLength[$key] == 1) {
|
485 |
+
// --- merge with next column ---
|
486 |
+
$nextKey = $key + 1;
|
487 |
+
if (isset($target[$nextKey]) && count($target[$nextKey])) {
|
488 |
+
$xColumns[] = array_merge($column, $target[$nextKey]);
|
489 |
+
continue;
|
490 |
+
}
|
491 |
+
}
|
492 |
+
$xColumns[] = $column;
|
493 |
+
}
|
494 |
+
$target = $xColumns;
|
495 |
+
}
|
496 |
+
}
|
497 |
+
$_rtl = Mage::getStoreConfigFlag('custom_menu/general/rtl');
|
498 |
+
if ($_rtl) {
|
499 |
+
$target = array_reverse($target);
|
500 |
+
}
|
501 |
+
return $target;
|
502 |
+
}
|
503 |
+
|
504 |
+
private function _countChild($children, $level, &$count)
|
505 |
+
{
|
506 |
+
foreach ($children as $child) {
|
507 |
+
if ($child->getIsActive()) {
|
508 |
+
$count++; $activeChildren = $this->_getActiveChildren($child, $level);
|
509 |
+
if (count($activeChildren) > 0) $this->_countChild($activeChildren, $level + 1, $count);
|
510 |
+
}
|
511 |
+
}
|
512 |
+
}
|
513 |
+
|
514 |
+
private static function _explodeArrayByColumnsHorisontal($list, $num)
|
515 |
+
{
|
516 |
+
if ($num <= 0) return array($list);
|
517 |
+
$partition = array();
|
518 |
+
$partition = array_pad($partition, $num, array());
|
519 |
+
$i = 0;
|
520 |
+
foreach ($list as $key => $value) {
|
521 |
+
$partition[$i][$key] = $value;
|
522 |
+
if (++$i == $num) $i = 0;
|
523 |
+
}
|
524 |
+
return $partition;
|
525 |
+
}
|
526 |
+
|
527 |
+
private static function _explodeArrayByColumnsVertical($list, $num)
|
528 |
+
{
|
529 |
+
if ($num <= 0) return array($list);
|
530 |
+
$listlen = count($list);
|
531 |
+
$partlen = floor($listlen / $num);
|
532 |
+
$partrem = $listlen % $num;
|
533 |
+
$partition = array();
|
534 |
+
$mark = 0;
|
535 |
+
for ($column = 0; $column < $num; $column++) {
|
536 |
+
$incr = ($column < $partrem) ? $partlen + 1 : $partlen;
|
537 |
+
$partition[$column] = array_slice($list, $mark, $incr);
|
538 |
+
$mark += $incr;
|
539 |
+
}
|
540 |
+
return $partition;
|
541 |
+
}
|
542 |
+
}
|
app/code/community/Abserve/CustomMenu/Block/Navigation.php
ADDED
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Abserve_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
4 |
+
{
|
5 |
+
const CUSTOM_BLOCK_TEMPLATE = "abserve_custom_menu_%d";
|
6 |
+
|
7 |
+
private $_productsCount = null;
|
8 |
+
private $_topMenu = array();
|
9 |
+
private $_popupMenu = array();
|
10 |
+
|
11 |
+
public function drawCustomMenuMobileItem($category, $level = 0, $last = false)
|
12 |
+
{
|
13 |
+
if (!$category->getIsActive()) return '';
|
14 |
+
$html = array();
|
15 |
+
$id = $category->getId();
|
16 |
+
// --- Sub Categories ---
|
17 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
18 |
+
// --- class for active category ---
|
19 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
20 |
+
$hasSubMenu = count($activeChildren);
|
21 |
+
$catUrl = $this->getCategoryUrl($category);
|
22 |
+
$html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
|
23 |
+
$html[] = '<div class="parentMenu">';
|
24 |
+
// --- Top Menu Item ---
|
25 |
+
$html[] = '<a class="level' . $level . $active . '" href="' . $catUrl .'">';
|
26 |
+
$name = $this->escapeHtml($category->getName());
|
27 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
28 |
+
$name = str_replace(' ', ' ', $name);
|
29 |
+
}
|
30 |
+
$html[] = '<span>' . $name . '</span>';
|
31 |
+
$html[] = '</a>';
|
32 |
+
if ($hasSubMenu) {
|
33 |
+
$html[] = '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
34 |
+
}
|
35 |
+
$html[] = '</div>';
|
36 |
+
// --- Add Popup block (hidden) ---
|
37 |
+
if ($hasSubMenu) {
|
38 |
+
// --- draw Sub Categories ---
|
39 |
+
$html[] = '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu" style="display: none;">';
|
40 |
+
$html[] = $this->drawMobileMenuItem($activeChildren);
|
41 |
+
$html[] = '<div class="clearBoth"></div>';
|
42 |
+
$html[] = '</div>';
|
43 |
+
}
|
44 |
+
$html[] = '</div>';
|
45 |
+
$html = implode("\n", $html);
|
46 |
+
return $html;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getTopMenuArray()
|
50 |
+
{
|
51 |
+
return $this->_topMenu;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getPopupMenuArray()
|
55 |
+
{
|
56 |
+
return $this->_popupMenu;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function drawCustomMenuItem($category, $level = 0, $last = false)
|
60 |
+
{
|
61 |
+
if (!$category->getIsActive()) return;
|
62 |
+
$htmlTop = array();
|
63 |
+
$id = $category->getId();
|
64 |
+
// --- Static Block ---
|
65 |
+
$blockId = sprintf(self::CUSTOM_BLOCK_TEMPLATE, $id); // --- static block key
|
66 |
+
#Mage::log($blockId);
|
67 |
+
$collection = Mage::getModel('cms/block')->getCollection()
|
68 |
+
->addFieldToFilter('identifier', array(array('like' => $blockId . '_w%'), array('eq' => $blockId)))
|
69 |
+
->addFieldToFilter('is_active', 1);
|
70 |
+
$blockId = $collection->getFirstItem()->getIdentifier();
|
71 |
+
#Mage::log($blockId);
|
72 |
+
$blockHtml = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($blockId)->toHtml();
|
73 |
+
// --- Sub Categories ---
|
74 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
75 |
+
// --- class for active category ---
|
76 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
77 |
+
// --- Popup functions for show ---
|
78 |
+
$drawPopup = ($blockHtml || count($activeChildren));
|
79 |
+
if ($drawPopup) {
|
80 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '" onmouseover="abserveShowMenuPopup(this, event, \'popup' . $id . '\');" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
|
81 |
+
} else {
|
82 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '">';
|
83 |
+
}
|
84 |
+
// --- Top Menu Item ---
|
85 |
+
$htmlTop[] = '<div class="parentMenu">';
|
86 |
+
if ($level == 0 && $drawPopup) {
|
87 |
+
$htmlTop[] = '<a class="level' . $level . $active . '" href="javascript:void(0);" rel="'.$this->getCategoryUrl($category).'">';
|
88 |
+
} else {
|
89 |
+
$htmlTop[] = '<a class="level' . $level . $active . '" href="'.$this->getCategoryUrl($category).'">';
|
90 |
+
}
|
91 |
+
$name = $this->escapeHtml($category->getName());
|
92 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
93 |
+
$name = str_replace(' ', ' ', $name);
|
94 |
+
}
|
95 |
+
$htmlTop[] = '<span>' . $name . '</span>';
|
96 |
+
$htmlTop[] = '</a>';
|
97 |
+
$htmlTop[] = '</div>';
|
98 |
+
$htmlTop[] = '</div>';
|
99 |
+
$this->_topMenu[] = implode("\n", $htmlTop);
|
100 |
+
// --- Add Popup block (hidden) ---
|
101 |
+
if ($drawPopup) {
|
102 |
+
$htmlPopup = array();
|
103 |
+
// --- Popup function for hide ---
|
104 |
+
$htmlPopup[] = '<div id="popup' . $id . '" class="abserve-custom-menu-popup" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')" onmouseover="abservePopupOver(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
|
105 |
+
// --- draw Sub Categories ---
|
106 |
+
if (count($activeChildren)) {
|
107 |
+
$columns = (int)Mage::getStoreConfig('custom_menu/columns/count');
|
108 |
+
$htmlPopup[] = '<div class="block1">';
|
109 |
+
$htmlPopup[] = $this->drawColumns($activeChildren, $columns);
|
110 |
+
$htmlPopup[] = '<div class="clearBoth"></div>';
|
111 |
+
$htmlPopup[] = '</div>';
|
112 |
+
}
|
113 |
+
// --- draw Custom User Block ---
|
114 |
+
if ($blockHtml) {
|
115 |
+
$htmlPopup[] = '<div id="' . $blockId . '" class="block2">';
|
116 |
+
$htmlPopup[] = $blockHtml;
|
117 |
+
$htmlPopup[] = '</div>';
|
118 |
+
}
|
119 |
+
$htmlPopup[] = '</div>';
|
120 |
+
$this->_popupMenu[] = implode("\n", $htmlPopup);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
public function drawMobileMenuItem($children, $level = 1)
|
125 |
+
{
|
126 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
127 |
+
$html = '';
|
128 |
+
foreach ($children as $child) {
|
129 |
+
if (is_object($child) && $child->getIsActive()) {
|
130 |
+
// --- class for active category ---
|
131 |
+
$active = '';
|
132 |
+
$id = $child->getId();
|
133 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
134 |
+
if ($this->isCategoryActive($child)) {
|
135 |
+
$active = ' actParent';
|
136 |
+
if ($id == $keyCurrent) $active = ' act';
|
137 |
+
}
|
138 |
+
$html.= '<div id="menu-mobile-' . $id . '" class="itemMenu level' . $level . $active . '">';
|
139 |
+
// --- format category name ---
|
140 |
+
$name = $this->escapeHtml($child->getName());
|
141 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
142 |
+
$html.= '<div class="parentMenu">';
|
143 |
+
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
144 |
+
if (count($activeChildren) > 0) {
|
145 |
+
$html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
146 |
+
}
|
147 |
+
$html.= '</div>';
|
148 |
+
if (count($activeChildren) > 0) {
|
149 |
+
$html.= '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu level' . $level . '" style="display: none;">';
|
150 |
+
$html.= $this->drawMobileMenuItem($activeChildren, $level + 1);
|
151 |
+
$html.= '<div class="clearBoth"></div>';
|
152 |
+
$html.= '</div>';
|
153 |
+
}
|
154 |
+
$html.= '</div>';
|
155 |
+
}
|
156 |
+
}
|
157 |
+
return $html;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function drawMenuItem($children, $level = 1)
|
161 |
+
{
|
162 |
+
$html = '<div class="itemMenu level' . $level . '">';
|
163 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
164 |
+
foreach ($children as $child) {
|
165 |
+
if (is_object($child) && $child->getIsActive()) {
|
166 |
+
// --- class for active category ---
|
167 |
+
$active = '';
|
168 |
+
if ($this->isCategoryActive($child)) {
|
169 |
+
$active = ' actParent';
|
170 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
171 |
+
}
|
172 |
+
// --- format category name ---
|
173 |
+
$name = $this->escapeHtml($child->getName());
|
174 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
175 |
+
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
176 |
+
$catimagename = Mage::getModel('catalog/category')->load($child->getId())->getThumbnail();
|
177 |
+
$catimgsrc = Mage::getBaseUrl('media').'catalog/category/'.$catimagename;
|
178 |
+
$html .= '<div class="parent_img" style="background-image:url('.$catimgsrc.');"> </div>';
|
179 |
+
|
180 |
+
|
181 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
182 |
+
if (count($activeChildren) > 0) {
|
183 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
184 |
+
$html.= $this->drawSubMenuItem($activeChildren, $level + 1);
|
185 |
+
$html.= '</div>';
|
186 |
+
}
|
187 |
+
}
|
188 |
+
}
|
189 |
+
$html.= '</div>';
|
190 |
+
return $html;
|
191 |
+
}
|
192 |
+
|
193 |
+
public function drawSubMenuItem($children, $level = 1)
|
194 |
+
{
|
195 |
+
$html = '<div class="itemMenu level' . $level . '">';
|
196 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
197 |
+
foreach ($children as $child) {
|
198 |
+
if (is_object($child) && $child->getIsActive()) {
|
199 |
+
// --- class for active category ---
|
200 |
+
$active = '';
|
201 |
+
if ($this->isCategoryActive($child)) {
|
202 |
+
$active = ' actParent';
|
203 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
204 |
+
}
|
205 |
+
// --- format category name ---
|
206 |
+
$name = $this->escapeHtml($child->getName());
|
207 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
208 |
+
$html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
209 |
+
|
210 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
211 |
+
if (count($activeChildren) > 0) {
|
212 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
213 |
+
$html.= $this->drawMenuItem($activeChildren, $level + 1);
|
214 |
+
$html.= '</div>';
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
$html.= '</div>';
|
219 |
+
return $html;
|
220 |
+
}
|
221 |
+
|
222 |
+
public function drawColumns($children, $columns = 1)
|
223 |
+
{
|
224 |
+
$html = '';
|
225 |
+
// --- explode by columns ---
|
226 |
+
if ($columns < 1) $columns = 1;
|
227 |
+
$chunks = $this->_explodeByColumns($children, $columns);
|
228 |
+
// --- draw columns ---
|
229 |
+
$lastColumnNumber = count($chunks);
|
230 |
+
$i = 1;
|
231 |
+
foreach ($chunks as $key => $value) {
|
232 |
+
if (!count($value)) continue;
|
233 |
+
$class = '';
|
234 |
+
if ($i == 1) $class.= ' first';
|
235 |
+
if ($i == $lastColumnNumber) $class.= ' last';
|
236 |
+
if ($i % 2) $class.= ' odd'; else $class.= ' even';
|
237 |
+
$html.= '<div class="column' . $class . '">';
|
238 |
+
$html.= $this->drawMenuItem($value, 1);
|
239 |
+
$html.= '</div>';
|
240 |
+
$i++;
|
241 |
+
}
|
242 |
+
return $html;
|
243 |
+
}
|
244 |
+
|
245 |
+
protected function _getActiveChildren($parent, $level)
|
246 |
+
{
|
247 |
+
$activeChildren = array();
|
248 |
+
// --- check level ---
|
249 |
+
$maxLevel = (int)Mage::getStoreConfig('custom_menu/general/max_level');
|
250 |
+
if ($maxLevel > 0) {
|
251 |
+
if ($level >= ($maxLevel - 1)) return $activeChildren;
|
252 |
+
}
|
253 |
+
// --- / check level ---
|
254 |
+
if (Mage::helper('catalog/category_flat')->isEnabled()) {
|
255 |
+
$children = $parent->getChildrenNodes();
|
256 |
+
$childrenCount = count($children);
|
257 |
+
} else {
|
258 |
+
$children = $parent->getChildren();
|
259 |
+
$childrenCount = $children->count();
|
260 |
+
}
|
261 |
+
$hasChildren = $children && $childrenCount;
|
262 |
+
if ($hasChildren) {
|
263 |
+
foreach ($children as $child) {
|
264 |
+
if ($this->_isCategoryDisplayed($child)) {
|
265 |
+
array_push($activeChildren, $child);
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
return $activeChildren;
|
270 |
+
}
|
271 |
+
|
272 |
+
private function _isCategoryDisplayed(&$child)
|
273 |
+
{
|
274 |
+
if (!$child->getIsActive()) return false;
|
275 |
+
// === check products count ===
|
276 |
+
// --- get collection info ---
|
277 |
+
if (!Mage::getStoreConfig('custom_menu/general/display_empty_categories')) {
|
278 |
+
$data = $this->_getProductsCountData();
|
279 |
+
// --- check by id ---
|
280 |
+
$id = $child->getId();
|
281 |
+
#Mage::log($id); Mage::log($data);
|
282 |
+
if (!isset($data[$id]) || !$data[$id]['product_count']) return false;
|
283 |
+
}
|
284 |
+
// === / check products count ===
|
285 |
+
return true;
|
286 |
+
}
|
287 |
+
|
288 |
+
private function _getProductsCountData()
|
289 |
+
{
|
290 |
+
if (is_null($this->_productsCount)) {
|
291 |
+
$collection = Mage::getModel('catalog/category')->getCollection();
|
292 |
+
$storeId = Mage::app()->getStore()->getId();
|
293 |
+
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
|
294 |
+
$collection->addAttributeToSelect('name')
|
295 |
+
->addAttributeToSelect('is_active')
|
296 |
+
->setProductStoreId($storeId)
|
297 |
+
->setLoadProductCount(true)
|
298 |
+
->setStoreId($storeId);
|
299 |
+
$productsCount = array();
|
300 |
+
foreach($collection as $cat) {
|
301 |
+
$productsCount[$cat->getId()] = array(
|
302 |
+
'name' => $cat->getName(),
|
303 |
+
'product_count' => $cat->getProductCount(),
|
304 |
+
);
|
305 |
+
}
|
306 |
+
#Mage::log($productsCount);
|
307 |
+
$this->_productsCount = $productsCount;
|
308 |
+
}
|
309 |
+
return $this->_productsCount;
|
310 |
+
}
|
311 |
+
|
312 |
+
private function _explodeByColumns($target, $num)
|
313 |
+
{
|
314 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/divided_horizontally')) {
|
315 |
+
$target = self::_explodeArrayByColumnsHorisontal($target, $num);
|
316 |
+
} else {
|
317 |
+
$target = self::_explodeArrayByColumnsVertical($target, $num);
|
318 |
+
}
|
319 |
+
#return $target;
|
320 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/integrate') && count($target)) {
|
321 |
+
// --- combine consistently numerically small column ---
|
322 |
+
// --- 1. calc length of each column ---
|
323 |
+
$max = 0; $columnsLength = array();
|
324 |
+
foreach ($target as $key => $child) {
|
325 |
+
$count = 0;
|
326 |
+
$this->_countChild($child, 1, $count);
|
327 |
+
if ($max < $count) $max = $count;
|
328 |
+
$columnsLength[$key] = $count;
|
329 |
+
}
|
330 |
+
// --- 2. merge small columns with next ---
|
331 |
+
$xColumns = array(); $column = array(); $cnt = 0;
|
332 |
+
$xColumnsLength = array(); $k = 0;
|
333 |
+
foreach ($columnsLength as $key => $count) {
|
334 |
+
$cnt+= $count;
|
335 |
+
if ($cnt > $max && count($column)) {
|
336 |
+
$xColumns[$k] = $column;
|
337 |
+
$xColumnsLength[$k] = $cnt - $count;
|
338 |
+
$k++; $column = array(); $cnt = $count;
|
339 |
+
}
|
340 |
+
$column = array_merge($column, $target[$key]);
|
341 |
+
}
|
342 |
+
$xColumns[$k] = $column;
|
343 |
+
$xColumnsLength[$k] = $cnt - $count;
|
344 |
+
// --- 3. integrate columns of one element ---
|
345 |
+
$target = $xColumns; $xColumns = array(); $nextKey = -1;
|
346 |
+
if ($max > 1 && count($target) > 1) {
|
347 |
+
foreach($target as $key => $column) {
|
348 |
+
if ($key == $nextKey) continue;
|
349 |
+
if ($xColumnsLength[$key] == 1) {
|
350 |
+
// --- merge with next column ---
|
351 |
+
$nextKey = $key + 1;
|
352 |
+
if (isset($target[$nextKey]) && count($target[$nextKey])) {
|
353 |
+
$xColumns[] = array_merge($column, $target[$nextKey]);
|
354 |
+
continue;
|
355 |
+
}
|
356 |
+
}
|
357 |
+
$xColumns[] = $column;
|
358 |
+
}
|
359 |
+
$target = $xColumns;
|
360 |
+
}
|
361 |
+
}
|
362 |
+
$_rtl = Mage::getStoreConfigFlag('custom_menu/general/rtl');
|
363 |
+
if ($_rtl) {
|
364 |
+
$target = array_reverse($target);
|
365 |
+
}
|
366 |
+
return $target;
|
367 |
+
}
|
368 |
+
|
369 |
+
private function _countChild($children, $level, &$count)
|
370 |
+
{
|
371 |
+
foreach ($children as $child) {
|
372 |
+
if ($child->getIsActive()) {
|
373 |
+
$count++; $activeChildren = $this->_getActiveChildren($child, $level);
|
374 |
+
if (count($activeChildren) > 0) $this->_countChild($activeChildren, $level + 1, $count);
|
375 |
+
}
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
private static function _explodeArrayByColumnsHorisontal($list, $num)
|
380 |
+
{
|
381 |
+
if ($num <= 0) return array($list);
|
382 |
+
$partition = array();
|
383 |
+
$partition = array_pad($partition, $num, array());
|
384 |
+
$i = 0;
|
385 |
+
foreach ($list as $key => $value) {
|
386 |
+
$partition[$i][$key] = $value;
|
387 |
+
if (++$i == $num) $i = 0;
|
388 |
+
}
|
389 |
+
return $partition;
|
390 |
+
}
|
391 |
+
|
392 |
+
private static function _explodeArrayByColumnsVertical($list, $num)
|
393 |
+
{
|
394 |
+
if ($num <= 0) return array($list);
|
395 |
+
$listlen = count($list);
|
396 |
+
$partlen = floor($listlen / $num);
|
397 |
+
$partrem = $listlen % $num;
|
398 |
+
$partition = array();
|
399 |
+
$mark = 0;
|
400 |
+
for ($column = 0; $column < $num; $column++) {
|
401 |
+
$incr = ($column < $partrem) ? $partlen + 1 : $partlen;
|
402 |
+
$partition[$column] = array_slice($list, $mark, $incr);
|
403 |
+
$mark += $incr;
|
404 |
+
}
|
405 |
+
return $partition;
|
406 |
+
}
|
407 |
+
}
|
app/code/community/Abserve/CustomMenu/Block/Navigation_old.php
ADDED
@@ -0,0 +1,536 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_Block_Navigation extends Mage_Catalog_Block_Navigation
|
13 |
+
{
|
14 |
+
const CUSTOM_BLOCK_TEMPLATE = "abserve_custom_menu_%d";
|
15 |
+
|
16 |
+
private $_productsCount = null;
|
17 |
+
private $_topMenu = array();
|
18 |
+
private $_popupMenu = array();
|
19 |
+
|
20 |
+
public function drawCustomMenuMobileItem($category, $level = 0, $last = false)
|
21 |
+
{
|
22 |
+
if (!$category->getIsActive()) return '';
|
23 |
+
$html = array();
|
24 |
+
$id = $category->getId();
|
25 |
+
// --- Sub Categories ---
|
26 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
27 |
+
// --- class for active category ---
|
28 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
29 |
+
$hasSubMenu = count($activeChildren);
|
30 |
+
$catUrl = $this->getCategoryUrl($category);
|
31 |
+
$html[] = '<div id="menu-mobile-' . $id . '" class="menu-mobile level0' . $active . '">';
|
32 |
+
$html[] = '<div class="parentMenu">';
|
33 |
+
// --- Top Menu Item ---
|
34 |
+
$html[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="' . $catUrl .'">';
|
35 |
+
$name = $this->escapeHtml($category->getName());
|
36 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
37 |
+
$name = str_replace(' ', ' ', $name);
|
38 |
+
}
|
39 |
+
$html[] = '<span>' . $name . '</span>';
|
40 |
+
$html[] = '</a>';
|
41 |
+
if ($hasSubMenu) {
|
42 |
+
$html[] = '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
43 |
+
}
|
44 |
+
$html[] = '</div>';
|
45 |
+
// --- Add Popup block (hidden) ---
|
46 |
+
if ($hasSubMenu) {
|
47 |
+
// --- draw Sub Categories ---
|
48 |
+
$html[] = '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu" style="display: none;">';
|
49 |
+
$html[] = $this->drawMobileMenuItem($activeChildren);
|
50 |
+
$html[] = '<div class="clearBoth"></div>';
|
51 |
+
$html[] = '</div>';
|
52 |
+
}
|
53 |
+
$html[] = '</div>';
|
54 |
+
$html = implode("\n", $html);
|
55 |
+
return $html;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function getTopMenuArray()
|
59 |
+
{
|
60 |
+
return $this->_topMenu;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getPopupMenuArray()
|
64 |
+
{
|
65 |
+
return $this->_popupMenu;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function drawCustomMenuItem($category, $level = 0, $last = false)
|
69 |
+
{
|
70 |
+
if (!$category->getIsActive()) return;
|
71 |
+
$htmlTop = array();
|
72 |
+
$id = $category->getId();
|
73 |
+
// --- Static Block ---
|
74 |
+
$blockId = sprintf(self::CUSTOM_BLOCK_TEMPLATE, $id); // --- static block key
|
75 |
+
#Mage::log($blockId);
|
76 |
+
$collection = Mage::getModel('cms/block')->getCollection()
|
77 |
+
->addFieldToFilter('identifier', array(array('like' => $blockId . '_w%'), array('eq' => $blockId)))
|
78 |
+
->addFieldToFilter('is_active', 1);
|
79 |
+
$blockId = $collection->getFirstItem()->getIdentifier();
|
80 |
+
#Mage::log($blockId);
|
81 |
+
$blockHtml = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId($blockId)->toHtml();
|
82 |
+
// --- Sub Categories ---
|
83 |
+
$activeChildren = $this->_getActiveChildren($category, $level);
|
84 |
+
// --- class for active category ---
|
85 |
+
$active = ''; if ($this->isCategoryActive($category)) $active = ' act';
|
86 |
+
// --- Popup functions for show ---
|
87 |
+
$drawPopup = ($blockHtml || count($activeChildren));
|
88 |
+
if ($drawPopup) {
|
89 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '" onmouseover="abserveShowMenuPopup(this, event, \'popup' . $id . '\',\''.$id.'\');" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\', \''.$id.'\')">';
|
90 |
+
} else {
|
91 |
+
$htmlTop[] = '<div id="menu' . $id . '" class="menu' . $active . '">';
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
// --- Top Menu Item ---
|
96 |
+
$htmlTop[] = '<div class="parentMenu">';
|
97 |
+
if ($level == 0 && $drawPopup) {
|
98 |
+
$htmlTop[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="javascript:void(0);" rel="'.$this->getCategoryUrl($category).'">';
|
99 |
+
} else {
|
100 |
+
$htmlTop[] = '<a class="category_name cat_id_'.$id.' level' . $level . $active . '" href="'.$this->getCategoryUrl($category).'">';
|
101 |
+
}
|
102 |
+
|
103 |
+
$name = $this->escapeHtml($category->getName());
|
104 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) {
|
105 |
+
$name = str_replace(' ', ' ', $name);
|
106 |
+
}
|
107 |
+
$htmlTop[] = '<span>' . $name . '</span>';
|
108 |
+
$htmlTop[] = '</a>';
|
109 |
+
$htmlTop[] = '</div>';
|
110 |
+
$htmlTop[] = '</div>';
|
111 |
+
$this->_topMenu[] = implode("\n", $htmlTop);
|
112 |
+
// --- Add Popup block (hidden) ---
|
113 |
+
if ($drawPopup) {
|
114 |
+
$htmlPopup = array();
|
115 |
+
// --- Popup function for hide ---
|
116 |
+
$htmlPopup[] = '<div id="popup' . $id . '" class="abserve-custom-menu-popup" onmouseout="abserveHideMenuPopup(this, event, \'popup' . $id . '\', \'menu' . $id . '\')" onmouseover="abservePopupOver(this, event, \'popup' . $id . '\', \'menu' . $id . '\')">';
|
117 |
+
// --- draw Sub Categories ---
|
118 |
+
if (count($activeChildren)) {
|
119 |
+
$columns = (int)Mage::getStoreConfig('custom_menu/columns/count');
|
120 |
+
$htmlPopup[] = '<div class="block1">';
|
121 |
+
$htmlPopup[] = $this->drawColumns($activeChildren, $columns,$id);
|
122 |
+
$htmlPopup[] = $this->drawColumnsImage($activeChildren, $columns,$id);
|
123 |
+
$htmlPopup[] = '<div class="clearBoth"></div>';
|
124 |
+
$htmlPopup[] = '</div>';
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
// -- Shown Product List --
|
129 |
+
$htmlPopup[] = '<div id="' . $blockId . '" class="block2 product_img_block">';
|
130 |
+
|
131 |
+
// Get Product List :
|
132 |
+
$category = new Mage_Catalog_Model_Category();
|
133 |
+
$category->load($id);
|
134 |
+
$collection = $category->getProductCollection();
|
135 |
+
$collection->addAttributeToSelect('*');
|
136 |
+
foreach ($collection as $_product) {
|
137 |
+
$image_url= Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getImage() );
|
138 |
+
$product_url= Mage::getUrl($_product->getUrlPath());
|
139 |
+
}
|
140 |
+
|
141 |
+
/*$htmlPopup[] = '<div class="row">';
|
142 |
+
$htmlPopup[] = '<div id="owl-demo" class="owl-carousel">';
|
143 |
+
foreach ($collection as $_product) {
|
144 |
+
$image_url= Mage::getModel('catalog/product_media_config')->getMediaUrl( $_product->getImage() );
|
145 |
+
$product_url= Mage::getUrl($_product->getUrlPath());
|
146 |
+
|
147 |
+
$htmlPopup[] = '<div class="slide-block item" style="background:url('.$image_url.');background-size:contain;background-repeat:no-repeat;">';
|
148 |
+
$htmlPopup[] = '<div class="text-block">';
|
149 |
+
$htmlPopup[] = '<a class="product_title_text" href="'.$product_url.'"> '.$_product->getName().'</a>';
|
150 |
+
$htmlPopup[] = '<h5>Flat 40% Offer</h5>';
|
151 |
+
$htmlPopup[] = '<a class="product_buy" href="'.$product_url.'">Buy Now</a>';
|
152 |
+
$htmlPopup[] = '</div>';
|
153 |
+
$htmlPopup[] = '</div>';
|
154 |
+
}
|
155 |
+
$htmlPopup[] = '</div>';
|
156 |
+
$htmlPopup[] = '</div>';*/
|
157 |
+
|
158 |
+
|
159 |
+
|
160 |
+
$htmlPopup[] = '</div>';
|
161 |
+
|
162 |
+
// --- draw Custom User Block ---
|
163 |
+
if ($blockHtml) {
|
164 |
+
$htmlPopup[] = '<div id="' . $blockId . '" class="block2">';
|
165 |
+
$htmlPopup[] = $blockHtml;
|
166 |
+
$htmlPopup[] = '</div>';
|
167 |
+
}
|
168 |
+
$htmlPopup[] = '</div>';
|
169 |
+
$this->_popupMenu[] = implode("\n", $htmlPopup);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
public function drawMobileMenuItem($children, $level = 1)
|
174 |
+
{
|
175 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
176 |
+
$html = '';
|
177 |
+
foreach ($children as $child) {
|
178 |
+
if (is_object($child) && $child->getIsActive()) {
|
179 |
+
// --- class for active category ---
|
180 |
+
$active = '';
|
181 |
+
$id = $child->getId();
|
182 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
183 |
+
if ($this->isCategoryActive($child)) {
|
184 |
+
$active = ' actParent';
|
185 |
+
if ($id == $keyCurrent) $active = ' act';
|
186 |
+
}
|
187 |
+
$html.= '<div id="menu-mobile-' . $id . '" class="itemMenu level' . $level . $active . '">';
|
188 |
+
// --- format category name ---
|
189 |
+
$name = $this->escapeHtml($child->getName());
|
190 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
191 |
+
$html.= '<div class="parentMenu">';
|
192 |
+
$html.= '<a class="category_name cat_id_'.$id.' itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
|
193 |
+
if (count($activeChildren) > 0) {
|
194 |
+
$html.= '<span class="button" rel="submenu-mobile-' . $id . '" onclick="abserveSubMenuToggle(this, \'menu-mobile-' . $id . '\', \'submenu-mobile-' . $id . '\');"> </span>';
|
195 |
+
}
|
196 |
+
$html.= '</div>';
|
197 |
+
if (count($activeChildren) > 0) {
|
198 |
+
$html.= '<div id="submenu-mobile-' . $id . '" rel="level' . $level . '" class="abserve-custom-menu-submenu level' . $level . '" style="display: none;">';
|
199 |
+
$html.= $this->drawMobileMenuItem($activeChildren, $level + 1);
|
200 |
+
$html.= '<div class="clearBoth"></div>';
|
201 |
+
$html.= '</div>';
|
202 |
+
}
|
203 |
+
$html.= '</div>';
|
204 |
+
}
|
205 |
+
}
|
206 |
+
return $html;
|
207 |
+
}
|
208 |
+
|
209 |
+
public function drawMenuImageItem($children, $level = 1,$main_cat_id)
|
210 |
+
{
|
211 |
+
//$html = '<div class=" cat_id_img_'.$level.'">';
|
212 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
213 |
+
foreach ($children as $child) {
|
214 |
+
if (is_object($child) && $child->getIsActive()) {
|
215 |
+
// --- class for active category ---
|
216 |
+
$active = '';
|
217 |
+
if ($this->isCategoryActive($child)) {
|
218 |
+
$active = ' actParent';
|
219 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
220 |
+
}
|
221 |
+
// --- format category name ---
|
222 |
+
$name = $this->escapeHtml($child->getName());
|
223 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
224 |
+
|
225 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
226 |
+
if (count($activeChildren) > 0) {
|
227 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
228 |
+
$html.= $this->drawMenuImageItem($activeChildren, $level + 1);
|
229 |
+
$html.= '</div>';
|
230 |
+
}
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
|
235 |
+
$catimagename = Mage::getModel('catalog/category')->load($child->getId())->getThumbnail();
|
236 |
+
$catimgsrc = Mage::getBaseUrl('media').'catalog/category/'.$catimagename;
|
237 |
+
if($catimagename)
|
238 |
+
// $catimage = '<span style="background:url('.$catimgsrc.');" class="category_image img_cat_id_'.$child->getId().'" > <img style="height:300px;float:right;" src="'.$catimgsrc.'" /> </span>';
|
239 |
+
$catimage = '<div> <span style="background:url('.$catimgsrc.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$child->getId().'" > </span></div>';
|
240 |
+
else
|
241 |
+
$catimage = '';
|
242 |
+
$html.=$catimage;
|
243 |
+
|
244 |
+
|
245 |
+
}
|
246 |
+
|
247 |
+
//$html.= '</div>';
|
248 |
+
|
249 |
+
return $html;
|
250 |
+
}
|
251 |
+
|
252 |
+
public function drawMenuItem($children, $level = 1,$main_cat_id)
|
253 |
+
{
|
254 |
+
$html = '<div class="itemMenu level' . $level . ' main_cat_id'.$main_cat_id.'">';
|
255 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
256 |
+
foreach ($children as $child) {
|
257 |
+
if (is_object($child) && $child->getIsActive()) {
|
258 |
+
// --- class for active category ---
|
259 |
+
$active = '';
|
260 |
+
if ($this->isCategoryActive($child)) {
|
261 |
+
$active = ' actParent';
|
262 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
263 |
+
}
|
264 |
+
// --- format category name ---
|
265 |
+
$name = $this->escapeHtml($child->getName());
|
266 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
267 |
+
$html.= '<div class="submenu" onmouseover="abserveHoverSubcategory(\''.$child->getId().'\',\''.$main_cat_id.'\');">';
|
268 |
+
$html.= '<a class="cat_id_'.$child->getId().' itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '" ><span>' . $name . '</span></a>';
|
269 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
270 |
+
if (count($activeChildren) > 0) {
|
271 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
272 |
+
$html.= $this->drawSubMenuItem($activeChildren, $level + 1);
|
273 |
+
$html.= '</div>';
|
274 |
+
}
|
275 |
+
$html .= '</div>';
|
276 |
+
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
$html.= '</div>';
|
281 |
+
|
282 |
+
return $html;
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
public function drawSubMenuItem($children, $level = 1,$main_cat_id)
|
287 |
+
{
|
288 |
+
$html = '<div class="itemMenu level' . $level . ' main_cat_id'.$main_cat_id.'">';
|
289 |
+
$keyCurrent = $this->getCurrentCategory()->getId();
|
290 |
+
foreach ($children as $child) {
|
291 |
+
if (is_object($child) && $child->getIsActive()) {
|
292 |
+
// --- class for active category ---
|
293 |
+
$active = '';
|
294 |
+
if ($this->isCategoryActive($child)) {
|
295 |
+
$active = ' actParent';
|
296 |
+
if ($child->getId() == $keyCurrent) $active = ' act';
|
297 |
+
}
|
298 |
+
// --- format category name ---
|
299 |
+
$name = $this->escapeHtml($child->getName());
|
300 |
+
if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', ' ', $name);
|
301 |
+
$html.= '<a class="cat_id_'.$child->getId().' itemMenuName level' . $level . $active . '" href="'.$this->getCategoryUrl($child).'"><span>' . $name . '</span></a>';
|
302 |
+
$activeChildren = $this->_getActiveChildren($child, $level);
|
303 |
+
if (count($activeChildren) > 0) {
|
304 |
+
$html.= '<div class="itemSubMenu level' . $level . '">';
|
305 |
+
$html.= $this->drawSubMenuItem($activeChildren, $level + 1);
|
306 |
+
$html.= '</div>';
|
307 |
+
}
|
308 |
+
|
309 |
+
}
|
310 |
+
}
|
311 |
+
|
312 |
+
$html.= '</div>';
|
313 |
+
|
314 |
+
return $html;
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
public function drawColumnsImage($children, $columns = 1,$main_cat_id)
|
319 |
+
{
|
320 |
+
$html = '';
|
321 |
+
$html .= '<div class="category_image_wrapper" >';
|
322 |
+
// --- explode by columns ---
|
323 |
+
if ($columns < 1) $columns = 1;
|
324 |
+
$chunks = $this->_explodeByColumns($children, $columns);
|
325 |
+
// --- draw columns ---
|
326 |
+
$lastColumnNumber = count($chunks);
|
327 |
+
$i = 1;
|
328 |
+
foreach ($chunks as $key => $value) {
|
329 |
+
if (!count($value)) continue;
|
330 |
+
//$html.= '<div class="column">';
|
331 |
+
$html.= $this->drawMenuImageItem($value, 1,$main_cat_id);
|
332 |
+
//$html.= '</div>';
|
333 |
+
$i++;
|
334 |
+
}
|
335 |
+
|
336 |
+
//-- Main Category Image --
|
337 |
+
$catimagename = Mage::getModel('catalog/category')->load($main_cat_id)->getThumbnail();
|
338 |
+
$catimgsrc = Mage::getBaseUrl('media').'catalog/category/'.$catimagename;
|
339 |
+
if($catimagename){
|
340 |
+
//$catimage = '<span style="background:url('.$catimgsrc.');" class="category_image img_cat_id_'.$main_cat_id.'" ><img src="'.$catimgsrc.'" style="height:300px;float:right;"/> </span>';
|
341 |
+
$catimage = '<div><span style="background:url('.$catimgsrc.'); height: 232px;background-size: contain !important; background-repeat: no-repeat; background-position: center center; margin: 0 auto;" class="category_image img_cat_id_'.$main_cat_id.'" ></span></div>';
|
342 |
+
}
|
343 |
+
else
|
344 |
+
$catimage = '';
|
345 |
+
$html .= $catimage;
|
346 |
+
$html .= '</div>';
|
347 |
+
return $html;
|
348 |
+
}
|
349 |
+
|
350 |
+
public function drawColumns($children, $columns = 1,$main_cat_id)
|
351 |
+
{
|
352 |
+
$html = '';
|
353 |
+
// --- explode by columns ---
|
354 |
+
if ($columns < 1) $columns = 1;
|
355 |
+
$chunks = $this->_explodeByColumns($children, $columns);
|
356 |
+
// --- draw columns ---
|
357 |
+
$lastColumnNumber = count($chunks);
|
358 |
+
$i = 1;
|
359 |
+
foreach ($chunks as $key => $value) {
|
360 |
+
if (!count($value)) continue;
|
361 |
+
$class = '';
|
362 |
+
if ($i == 1) $class.= ' first';
|
363 |
+
if ($i == $lastColumnNumber) $class.= ' last';
|
364 |
+
if ($i % 2) $class.= ' odd'; else $class.= ' even';
|
365 |
+
$html.= '<div class="column' . $class . '">';
|
366 |
+
$html.= $this->drawMenuItem($value, 1,$main_cat_id);
|
367 |
+
$html.= '</div>';
|
368 |
+
$i++;
|
369 |
+
}
|
370 |
+
|
371 |
+
return $html;
|
372 |
+
}
|
373 |
+
|
374 |
+
protected function _getActiveChildren($parent, $level)
|
375 |
+
{
|
376 |
+
$activeChildren = array();
|
377 |
+
// --- check level ---
|
378 |
+
$maxLevel = (int)Mage::getStoreConfig('custom_menu/general/max_level');
|
379 |
+
if ($maxLevel > 0) {
|
380 |
+
if ($level >= ($maxLevel - 1)) return $activeChildren;
|
381 |
+
}
|
382 |
+
// --- / check level ---
|
383 |
+
if (Mage::helper('catalog/category_flat')->isEnabled()) {
|
384 |
+
$children = $parent->getChildrenNodes();
|
385 |
+
$childrenCount = count($children);
|
386 |
+
} else {
|
387 |
+
$children = $parent->getChildren();
|
388 |
+
$childrenCount = $children->count();
|
389 |
+
}
|
390 |
+
$hasChildren = $children && $childrenCount;
|
391 |
+
if ($hasChildren) {
|
392 |
+
foreach ($children as $child) {
|
393 |
+
if ($this->_isCategoryDisplayed($child)) {
|
394 |
+
array_push($activeChildren, $child);
|
395 |
+
}
|
396 |
+
}
|
397 |
+
}
|
398 |
+
return $activeChildren;
|
399 |
+
}
|
400 |
+
|
401 |
+
private function _isCategoryDisplayed(&$child)
|
402 |
+
{
|
403 |
+
if (!$child->getIsActive()) return false;
|
404 |
+
// === check products count ===
|
405 |
+
// --- get collection info ---
|
406 |
+
if (!Mage::getStoreConfig('custom_menu/general/display_empty_categories')) {
|
407 |
+
$data = $this->_getProductsCountData();
|
408 |
+
// --- check by id ---
|
409 |
+
$id = $child->getId();
|
410 |
+
#Mage::log($id); Mage::log($data);
|
411 |
+
if (!isset($data[$id]) || !$data[$id]['product_count']) return false;
|
412 |
+
}
|
413 |
+
// === / check products count ===
|
414 |
+
return true;
|
415 |
+
}
|
416 |
+
|
417 |
+
private function _getProductsCountData()
|
418 |
+
{
|
419 |
+
if (is_null($this->_productsCount)) {
|
420 |
+
$collection = Mage::getModel('catalog/category')->getCollection();
|
421 |
+
$storeId = Mage::app()->getStore()->getId();
|
422 |
+
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
|
423 |
+
$collection->addAttributeToSelect('name')
|
424 |
+
->addAttributeToSelect('is_active')
|
425 |
+
->setProductStoreId($storeId)
|
426 |
+
->setLoadProductCount(true)
|
427 |
+
->setStoreId($storeId);
|
428 |
+
$productsCount = array();
|
429 |
+
foreach($collection as $cat) {
|
430 |
+
$productsCount[$cat->getId()] = array(
|
431 |
+
'name' => $cat->getName(),
|
432 |
+
'product_count' => $cat->getProductCount(),
|
433 |
+
);
|
434 |
+
}
|
435 |
+
#Mage::log($productsCount);
|
436 |
+
$this->_productsCount = $productsCount;
|
437 |
+
}
|
438 |
+
return $this->_productsCount;
|
439 |
+
}
|
440 |
+
|
441 |
+
private function _explodeByColumns($target, $num)
|
442 |
+
{
|
443 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/divided_horizontally')) {
|
444 |
+
$target = self::_explodeArrayByColumnsHorisontal($target, $num);
|
445 |
+
} else {
|
446 |
+
$target = self::_explodeArrayByColumnsVertical($target, $num);
|
447 |
+
}
|
448 |
+
#return $target;
|
449 |
+
if ((int)Mage::getStoreConfig('custom_menu/columns/integrate') && count($target)) {
|
450 |
+
// --- combine consistently numerically small column ---
|
451 |
+
// --- 1. calc length of each column ---
|
452 |
+
$max = 0; $columnsLength = array();
|
453 |
+
foreach ($target as $key => $child) {
|
454 |
+
$count = 0;
|
455 |
+
$this->_countChild($child, 1, $count);
|
456 |
+
if ($max < $count) $max = $count;
|
457 |
+
$columnsLength[$key] = $count;
|
458 |
+
}
|
459 |
+
// --- 2. merge small columns with next ---
|
460 |
+
$xColumns = array(); $column = array(); $cnt = 0;
|
461 |
+
$xColumnsLength = array(); $k = 0;
|
462 |
+
foreach ($columnsLength as $key => $count) {
|
463 |
+
$cnt+= $count;
|
464 |
+
if ($cnt > $max && count($column)) {
|
465 |
+
$xColumns[$k] = $column;
|
466 |
+
$xColumnsLength[$k] = $cnt - $count;
|
467 |
+
$k++; $column = array(); $cnt = $count;
|
468 |
+
}
|
469 |
+
$column = array_merge($column, $target[$key]);
|
470 |
+
}
|
471 |
+
$xColumns[$k] = $column;
|
472 |
+
$xColumnsLength[$k] = $cnt - $count;
|
473 |
+
// --- 3. integrate columns of one element ---
|
474 |
+
$target = $xColumns; $xColumns = array(); $nextKey = -1;
|
475 |
+
if ($max > 1 && count($target) > 1) {
|
476 |
+
foreach($target as $key => $column) {
|
477 |
+
if ($key == $nextKey) continue;
|
478 |
+
if ($xColumnsLength[$key] == 1) {
|
479 |
+
// --- merge with next column ---
|
480 |
+
$nextKey = $key + 1;
|
481 |
+
if (isset($target[$nextKey]) && count($target[$nextKey])) {
|
482 |
+
$xColumns[] = array_merge($column, $target[$nextKey]);
|
483 |
+
continue;
|
484 |
+
}
|
485 |
+
}
|
486 |
+
$xColumns[] = $column;
|
487 |
+
}
|
488 |
+
$target = $xColumns;
|
489 |
+
}
|
490 |
+
}
|
491 |
+
$_rtl = Mage::getStoreConfigFlag('custom_menu/general/rtl');
|
492 |
+
if ($_rtl) {
|
493 |
+
$target = array_reverse($target);
|
494 |
+
}
|
495 |
+
return $target;
|
496 |
+
}
|
497 |
+
|
498 |
+
private function _countChild($children, $level, &$count)
|
499 |
+
{
|
500 |
+
foreach ($children as $child) {
|
501 |
+
if ($child->getIsActive()) {
|
502 |
+
$count++; $activeChildren = $this->_getActiveChildren($child, $level);
|
503 |
+
if (count($activeChildren) > 0) $this->_countChild($activeChildren, $level + 1, $count);
|
504 |
+
}
|
505 |
+
}
|
506 |
+
}
|
507 |
+
|
508 |
+
private static function _explodeArrayByColumnsHorisontal($list, $num)
|
509 |
+
{
|
510 |
+
if ($num <= 0) return array($list);
|
511 |
+
$partition = array();
|
512 |
+
$partition = array_pad($partition, $num, array());
|
513 |
+
$i = 0;
|
514 |
+
foreach ($list as $key => $value) {
|
515 |
+
$partition[$i][$key] = $value;
|
516 |
+
if (++$i == $num) $i = 0;
|
517 |
+
}
|
518 |
+
return $partition;
|
519 |
+
}
|
520 |
+
|
521 |
+
private static function _explodeArrayByColumnsVertical($list, $num)
|
522 |
+
{
|
523 |
+
if ($num <= 0) return array($list);
|
524 |
+
$listlen = count($list);
|
525 |
+
$partlen = floor($listlen / $num);
|
526 |
+
$partrem = $listlen % $num;
|
527 |
+
$partition = array();
|
528 |
+
$mark = 0;
|
529 |
+
for ($column = 0; $column < $num; $column++) {
|
530 |
+
$incr = ($column < $partrem) ? $partlen + 1 : $partlen;
|
531 |
+
$partition[$column] = array_slice($list, $mark, $incr);
|
532 |
+
$mark += $incr;
|
533 |
+
}
|
534 |
+
return $partition;
|
535 |
+
}
|
536 |
+
}
|
app/code/community/Abserve/CustomMenu/Block/Toggle.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_Block_Toggle extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
public function _prepareLayout()
|
15 |
+
{
|
16 |
+
if (!Mage::getStoreConfig('custom_menu/general/enabled')) return;
|
17 |
+
$layout = $this->getLayout();
|
18 |
+
$topnav = $layout->getBlock('catalog.topnav');
|
19 |
+
$head = $layout->getBlock('head');
|
20 |
+
if (is_object($topnav) && is_object($head)) {
|
21 |
+
$topnav->setTemplate('abservemegamenu/custommenu/top.phtml');
|
22 |
+
$head->addItem('skin_js', 'js/abservemegamenu/custommenu/custommenu.js');
|
23 |
+
$head->addItem('skin_css', 'css/abservemegamenu/custommenu/custommenu.css');
|
24 |
+
|
25 |
+
// --- Carousel slider ---
|
26 |
+
/*$head->addItem('skin_css', 'owl-carousel/owl.carousel.css');
|
27 |
+
$head->addItem('skin_css', 'owl-carousel/owl.theme.css');
|
28 |
+
$head->addItem('skin_js', 'owl-carousel/owl.carousel.min.js');*/
|
29 |
+
|
30 |
+
|
31 |
+
// --- Insert menu content ---
|
32 |
+
if (!Mage::getStoreConfig('custom_menu/general/ajax_load_content')) {
|
33 |
+
$menuContent = $layout->getBlock('custommenu-content');
|
34 |
+
if (!is_object($menuContent)) {
|
35 |
+
$menuContent = $layout->createBlock('core/template', 'custommenu-content')
|
36 |
+
->setTemplate('abservemegamenu/custommenu/menucontent.phtml');
|
37 |
+
}
|
38 |
+
$positionTarget = $layout->getBlock('before_body_end');
|
39 |
+
if (is_object($positionTarget)) $positionTarget->append($menuContent);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Abserve/CustomMenu/Block/Topmenu.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
if (!Mage::getStoreConfig('custom_menu/general/enabled')) {
|
13 |
+
class Abserve_CustomMenu_Block_Topmenu extends Mage_Page_Block_Html_Topmenu {}
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
class Abserve_CustomMenu_Block_Topmenu extends Abserve_CustomMenu_Block_Navigation {}
|
app/code/community/Abserve/CustomMenu/Helper/Data.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
private $_menuData = null;
|
15 |
+
|
16 |
+
public function saveCurrentCategoryIdToSession()
|
17 |
+
{
|
18 |
+
$currentCategory = Mage::registry('current_category');
|
19 |
+
$currentCategoryId = 0;
|
20 |
+
if (is_object($currentCategory)) {
|
21 |
+
$currentCategoryId = $currentCategory->getId();
|
22 |
+
}
|
23 |
+
Mage::getSingleton('catalog/session')
|
24 |
+
->setCustomMenuCurrentCategoryId($currentCategoryId);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function initCurrentCategory()
|
28 |
+
{
|
29 |
+
$currentCategoryId = Mage::getSingleton('catalog/session')->getCustomMenuCurrentCategoryId();
|
30 |
+
$currentCategory = null;
|
31 |
+
if ($currentCategoryId) {
|
32 |
+
$currentCategory = Mage::getModel('catalog/category')
|
33 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
34 |
+
->load($currentCategoryId);
|
35 |
+
}
|
36 |
+
Mage::unregister('current_category');
|
37 |
+
Mage::register('current_category', $currentCategory);
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getMenuData()
|
41 |
+
{
|
42 |
+
if (!is_null($this->_menuData)) return $this->_menuData;
|
43 |
+
$blockClassName = Mage::getConfig()->getBlockClassName('custommenu/navigation');
|
44 |
+
$block = new $blockClassName();
|
45 |
+
$categories = $block->getStoreCategories();
|
46 |
+
if (is_object($categories)) $categories = $block->getStoreCategories()->getNodes();
|
47 |
+
if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) {
|
48 |
+
$_moblieMenuAjaxUrl = str_replace('http:', '', Mage::getUrl('custommenu/ajaxmobilemenucontent'));
|
49 |
+
$_menuAjaxUrl = str_replace('http:', '', Mage::getUrl('custommenu/ajaxmenucontent'));
|
50 |
+
} else {
|
51 |
+
$_moblieMenuAjaxUrl = '';
|
52 |
+
$_menuAjaxUrl = '';
|
53 |
+
}
|
54 |
+
$this->_menuData = array(
|
55 |
+
'_block' => $block,
|
56 |
+
'_categories' => $categories,
|
57 |
+
'_moblieMenuAjaxUrl' => $_moblieMenuAjaxUrl,
|
58 |
+
'_menuAjaxUrl' => $_menuAjaxUrl,
|
59 |
+
'_showHomeLink' => Mage::getStoreConfig('custom_menu/general/show_home_link'),
|
60 |
+
'_popupWidth' => Mage::getStoreConfig('custom_menu/popup/width') + 0,
|
61 |
+
'_popupTopOffset' => Mage::getStoreConfig('custom_menu/popup/top_offset') + 0,
|
62 |
+
'_popupDelayBeforeDisplaying' => Mage::getStoreConfig('custom_menu/popup/delay_displaying') + 0,
|
63 |
+
'_popupDelayBeforeHiding' => Mage::getStoreConfig('custom_menu/popup/delay_hiding') + 0,
|
64 |
+
'_rtl' => Mage::getStoreConfig('custom_menu/general/rtl') + 0,
|
65 |
+
'_mobileMenuEnabled' => Mage::getStoreConfig('custom_menu/general/mobile_menu') + 0,
|
66 |
+
'_mobileMenuWidthInit' => Mage::getStoreConfig('custom_menu/general/mobile_menu_width_init') + 0,
|
67 |
+
);
|
68 |
+
return $this->_menuData;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function getMobileMenuContent()
|
72 |
+
{
|
73 |
+
$menuData = Mage::helper('custommenu')->getMenuData();
|
74 |
+
extract($menuData);
|
75 |
+
if (!$_mobileMenuEnabled) return '';
|
76 |
+
// --- Home Link ---
|
77 |
+
$homeLinkUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
78 |
+
$homeLinkText = $this->__('Home');
|
79 |
+
$homeLink = '';
|
80 |
+
if ($_showHomeLink) {
|
81 |
+
$homeLink = <<<HTML
|
82 |
+
<div id="menu-mobile-0" class="menu-mobile level0">
|
83 |
+
<div class="parentMenu">
|
84 |
+
<a href="$homeLinkUrl">
|
85 |
+
<span>$homeLinkText</span>
|
86 |
+
</a>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
HTML;
|
90 |
+
}
|
91 |
+
// --- Menu Content ---
|
92 |
+
$mobileMenuContent = '';
|
93 |
+
$mobileMenuContentArray = array();
|
94 |
+
foreach ($_categories as $_category) {
|
95 |
+
$mobileMenuContentArray[] = $_block->drawCustomMenuMobileItem($_category);
|
96 |
+
}
|
97 |
+
if (count($mobileMenuContentArray)) {
|
98 |
+
$mobileMenuContent = implode("\n", $mobileMenuContentArray);
|
99 |
+
}
|
100 |
+
// --- Result ---
|
101 |
+
$menu = <<<HTML
|
102 |
+
$homeLink
|
103 |
+
$mobileMenuContent
|
104 |
+
<div class="clearBoth"></div>
|
105 |
+
HTML;
|
106 |
+
return $menu;
|
107 |
+
}
|
108 |
+
|
109 |
+
public function getMenuContent()
|
110 |
+
{
|
111 |
+
$menuData = Mage::helper('custommenu')->getMenuData();
|
112 |
+
extract($menuData);
|
113 |
+
// --- Home Link ---
|
114 |
+
$homeLinkUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
115 |
+
$homeLinkText = $this->__('Home');
|
116 |
+
$homeLink = '';
|
117 |
+
if ($_showHomeLink) {
|
118 |
+
$homeLink = <<<HTML
|
119 |
+
<div class="menu">
|
120 |
+
<div class="parentMenu menu0">
|
121 |
+
<a href="$homeLinkUrl">
|
122 |
+
<span>$homeLinkText</span>
|
123 |
+
</a>
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
+
HTML;
|
127 |
+
}
|
128 |
+
// --- Menu Content ---
|
129 |
+
$menuContent = '';
|
130 |
+
$menuContentArray = array();
|
131 |
+
foreach ($_categories as $_category) {
|
132 |
+
$_block->drawCustomMenuItem($_category);
|
133 |
+
}
|
134 |
+
$topMenuArray = $_block->getTopMenuArray();
|
135 |
+
if (count($topMenuArray)) {
|
136 |
+
$topMenuContent = implode("\n", $topMenuArray);
|
137 |
+
}
|
138 |
+
$popupMenuArray = $_block->getPopupMenuArray();
|
139 |
+
$popupMenuContent = '';
|
140 |
+
if (count($popupMenuArray)) {
|
141 |
+
$popupMenuContent = implode("\n", $popupMenuArray);
|
142 |
+
}
|
143 |
+
// --- Result ---
|
144 |
+
$topMenu = <<<HTML
|
145 |
+
$homeLink
|
146 |
+
$topMenuContent
|
147 |
+
<div class="clearBoth"></div>
|
148 |
+
HTML;
|
149 |
+
return array('topMenu' => $topMenu, 'popupMenu' => $popupMenuContent);
|
150 |
+
}
|
151 |
+
}
|
app/code/community/Abserve/CustomMenu/controllers/AjaxmenucontentController.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_AjaxmenucontentController extends Mage_Core_Controller_Front_Action
|
13 |
+
{
|
14 |
+
public function indexAction()
|
15 |
+
{
|
16 |
+
if ($this->getRequest()->isXmlHttpRequest()) {
|
17 |
+
Mage::helper('custommenu')->initCurrentCategory();
|
18 |
+
$menu = Mage::helper('custommenu')->getMenuContent();
|
19 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
}
|
app/code/community/Abserve/CustomMenu/controllers/AjaxmobilemenucontentController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_CustomMenu_AjaxmobilemenucontentController extends Mage_Core_Controller_Front_Action
|
13 |
+
{
|
14 |
+
public function indexAction()
|
15 |
+
{
|
16 |
+
if ($this->getRequest()->isXmlHttpRequest()) {
|
17 |
+
Mage::helper('custommenu')->initCurrentCategory();
|
18 |
+
$menu = Mage::helper('custommenu')->getMobileMenuContent();
|
19 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
20 |
+
}
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Abserve/CustomMenu/etc/config.xml
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_CustomMenu>
|
14 |
+
<version>2.10.0</version>
|
15 |
+
</Abserve_CustomMenu>
|
16 |
+
</modules>
|
17 |
+
<frontend>
|
18 |
+
<routers>
|
19 |
+
<custommenu>
|
20 |
+
<use>standard</use>
|
21 |
+
<args>
|
22 |
+
<frontName>custommenu</frontName>
|
23 |
+
<module>Abserve_CustomMenu</module>
|
24 |
+
</args>
|
25 |
+
</custommenu>
|
26 |
+
</routers>
|
27 |
+
<layout>
|
28 |
+
<updates>
|
29 |
+
<custommenu>
|
30 |
+
<file>abservemegamenu/custommenu.xml</file>
|
31 |
+
</custommenu>
|
32 |
+
</updates>
|
33 |
+
</layout>
|
34 |
+
</frontend>
|
35 |
+
<adminhtml>
|
36 |
+
<acl>
|
37 |
+
<resources>
|
38 |
+
<all>
|
39 |
+
<title>Allow Everything</title>
|
40 |
+
</all>
|
41 |
+
<admin>
|
42 |
+
<children>
|
43 |
+
<system>
|
44 |
+
<children>
|
45 |
+
<config>
|
46 |
+
<children>
|
47 |
+
<custom_menu translate="title" module="custommenu">
|
48 |
+
<title><![CDATA[Web & People: Custom Menu]]></title>
|
49 |
+
<sort_order>2000</sort_order>
|
50 |
+
</custom_menu>
|
51 |
+
</children>
|
52 |
+
</config>
|
53 |
+
</children>
|
54 |
+
</system>
|
55 |
+
</children>
|
56 |
+
</admin>
|
57 |
+
</resources>
|
58 |
+
</acl>
|
59 |
+
<menu>
|
60 |
+
<settings module="settings">
|
61 |
+
<children>
|
62 |
+
<custommenu module="custommenu">
|
63 |
+
<title>Custom Megamenu</title>
|
64 |
+
<sort_order>3</sort_order>
|
65 |
+
<action>adminhtml/system_config/edit/section/custommenu</action>
|
66 |
+
</custommenu>
|
67 |
+
</children>
|
68 |
+
</settings>
|
69 |
+
</menu>
|
70 |
+
</adminhtml>
|
71 |
+
<global>
|
72 |
+
<blocks>
|
73 |
+
<catalog>
|
74 |
+
<rewrite>
|
75 |
+
<navigation>Abserve_CustomMenu_Block_Navigation</navigation>
|
76 |
+
<!-- v1.4-1.6 -->
|
77 |
+
</rewrite>
|
78 |
+
</catalog>
|
79 |
+
<page>
|
80 |
+
<rewrite>
|
81 |
+
<html_topmenu>Abserve_CustomMenu_Block_Topmenu</html_topmenu>
|
82 |
+
<!-- v1.7+ -->
|
83 |
+
</rewrite>
|
84 |
+
</page>
|
85 |
+
<custommenu>
|
86 |
+
<class>Abserve_CustomMenu_Block</class>
|
87 |
+
</custommenu>
|
88 |
+
</blocks>
|
89 |
+
<helpers>
|
90 |
+
<custommenu>
|
91 |
+
<class>Abserve_CustomMenu_Helper</class>
|
92 |
+
</custommenu>
|
93 |
+
</helpers>
|
94 |
+
</global>
|
95 |
+
<default>
|
96 |
+
<custom_menu>
|
97 |
+
<general>
|
98 |
+
<version>2.10.0</version>
|
99 |
+
<enabled>1</enabled>
|
100 |
+
<ajax_load_content>0</ajax_load_content>
|
101 |
+
<mobile_menu>1</mobile_menu>
|
102 |
+
<mobile_menu_width_init>771</mobile_menu_width_init>
|
103 |
+
<display_empty_categories>1</display_empty_categories>
|
104 |
+
<max_level>3</max_level>
|
105 |
+
<show_home_link>1</show_home_link>
|
106 |
+
<non_breaking_space>0</non_breaking_space>
|
107 |
+
<rtl>0</rtl>
|
108 |
+
</general>
|
109 |
+
<columns>
|
110 |
+
<count>3</count>
|
111 |
+
<divided_horizontally>0</divided_horizontally>
|
112 |
+
<integrate>1</integrate>
|
113 |
+
</columns>
|
114 |
+
<popup>
|
115 |
+
<width>0</width>
|
116 |
+
<top_offset>0</top_offset>
|
117 |
+
<delay_displaying>150</delay_displaying>
|
118 |
+
<delay_hiding>100</delay_hiding>
|
119 |
+
</popup>
|
120 |
+
</custom_menu>
|
121 |
+
</default>
|
122 |
+
<adminhtml>
|
123 |
+
<acl>
|
124 |
+
<resources>
|
125 |
+
<admin>
|
126 |
+
<children>
|
127 |
+
<system>
|
128 |
+
<children>
|
129 |
+
<config>
|
130 |
+
<children>
|
131 |
+
<about_abservemegamenu translate="title" module="custommenu">
|
132 |
+
<title><![CDATA[Web & People: About Us]]></title>
|
133 |
+
<sort_order>1000</sort_order>
|
134 |
+
</about_abservemegamenu>
|
135 |
+
</children>
|
136 |
+
</config>
|
137 |
+
</children>
|
138 |
+
</system>
|
139 |
+
</children>
|
140 |
+
</admin>
|
141 |
+
</resources>
|
142 |
+
</acl>
|
143 |
+
</adminhtml>
|
144 |
+
</config>
|
app/code/community/Abserve/CustomMenu/etc/system.xml
ADDED
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<abserve_megamenu translate="label" module="custommenu">
|
14 |
+
<label> Abserve Megamenu </label>
|
15 |
+
<sort_order>150</sort_order>
|
16 |
+
</abserve_megamenu>
|
17 |
+
</tabs>
|
18 |
+
<sections>
|
19 |
+
<custom_menu translate="label" module="custommenu">
|
20 |
+
<label>Custom MegaMenu</label>
|
21 |
+
<tab>settings</tab>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>200</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<groups>
|
28 |
+
<general translate="label">
|
29 |
+
<label>General</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<comment><![CDATA[In order to display a custom block with images or other html content in the popup, use the <b>Static Block</b> (<strong>CMS->Static Blocks</strong> section) with the ID like "<b>abserve_custom_menu_83</b>", where "<b>83</b>" is the ID of the category]]></comment>
|
32 |
+
<sort_order>10</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<expanded>1</expanded>
|
37 |
+
<fields>
|
38 |
+
<version translate="label">
|
39 |
+
<label>Extension Release</label>
|
40 |
+
<frontend_type>label</frontend_type>
|
41 |
+
<sort_order>1</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</version>
|
46 |
+
<enabled translate="label comment">
|
47 |
+
<label>Enable</label>
|
48 |
+
<frontend_type>select</frontend_type>
|
49 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
50 |
+
<sort_order>5</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>1</show_in_website>
|
53 |
+
<show_in_store>1</show_in_store>
|
54 |
+
</enabled>
|
55 |
+
<max_level translate="label comment">
|
56 |
+
<label>Visible menu depth</label>
|
57 |
+
<comment><![CDATA[e.g. 1, 2, 3, 4. Set "0" to disable limits. For example, if you set this value to 2, only second level categories will be displayed]]></comment>
|
58 |
+
<frontend_type>text</frontend_type>
|
59 |
+
<sort_order>10</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</max_level>
|
64 |
+
<show_home_link translate="label">
|
65 |
+
<label>Show the link "Home"</label>
|
66 |
+
<frontend_type>select</frontend_type>
|
67 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
68 |
+
<sort_order>15</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
</show_home_link>
|
73 |
+
<display_empty_categories translate="label comment">
|
74 |
+
<label>Display empty categories</label>
|
75 |
+
<comment><![CDATA[An empty category is a category that has no products]]></comment>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
78 |
+
<sort_order>20</sort_order>
|
79 |
+
<show_in_default>1</show_in_default>
|
80 |
+
<show_in_website>1</show_in_website>
|
81 |
+
<show_in_store>1</show_in_store>
|
82 |
+
</display_empty_categories>
|
83 |
+
<mobile_menu translate="label comment">
|
84 |
+
<label>Enable mobile view</label>
|
85 |
+
<comment>Switch to a special view on mobile devices</comment>
|
86 |
+
<frontend_type>select</frontend_type>
|
87 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
88 |
+
<sort_order>25</sort_order>
|
89 |
+
<show_in_default>1</show_in_default>
|
90 |
+
<show_in_website>1</show_in_website>
|
91 |
+
<show_in_store>1</show_in_store>
|
92 |
+
</mobile_menu>
|
93 |
+
<mobile_menu_width_init translate="label comment">
|
94 |
+
<label>Width to trigger to mobile view</label>
|
95 |
+
<comment>Specify a required screen width in pixel from which the mobile menu would be displayed</comment>
|
96 |
+
<frontend_type>text</frontend_type>
|
97 |
+
<sort_order>30</sort_order>
|
98 |
+
<show_in_default>1</show_in_default>
|
99 |
+
<show_in_website>1</show_in_website>
|
100 |
+
<show_in_store>1</show_in_store>
|
101 |
+
<depends>
|
102 |
+
<mobile_menu>1</mobile_menu>
|
103 |
+
</depends>
|
104 |
+
</mobile_menu_width_init>
|
105 |
+
<rtl translate="label">
|
106 |
+
<label>Enable RTL Text mode</label>
|
107 |
+
<frontend_type>select</frontend_type>
|
108 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
109 |
+
<sort_order>35</sort_order>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>1</show_in_store>
|
113 |
+
</rtl>
|
114 |
+
<ajax_load_content translate="label comment">
|
115 |
+
<label>Load content through ajax</label>
|
116 |
+
<frontend_type>select</frontend_type>
|
117 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
118 |
+
<sort_order>40</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>1</show_in_store>
|
122 |
+
</ajax_load_content>
|
123 |
+
</fields>
|
124 |
+
</general>
|
125 |
+
<columns translate="label">
|
126 |
+
<label>Columns</label>
|
127 |
+
<frontend_type>text</frontend_type>
|
128 |
+
<sort_order>15</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
<fields>
|
133 |
+
<count translate="label comment">
|
134 |
+
<label>Number of columns</label>
|
135 |
+
<comment><![CDATA[The maximum number of columns in the popup, <br />e.g. 1, 2, 3]]></comment>
|
136 |
+
<frontend_type>text</frontend_type>
|
137 |
+
<sort_order>1</sort_order>
|
138 |
+
<show_in_default>1</show_in_default>
|
139 |
+
<show_in_website>1</show_in_website>
|
140 |
+
<show_in_store>1</show_in_store>
|
141 |
+
</count>
|
142 |
+
<divided_horizontally translate="label comment">
|
143 |
+
<label>Split subcategories left to right</label>
|
144 |
+
<comment>Next subcategory is placed to the next column. By default it is placed bottom in the same column</comment>
|
145 |
+
<frontend_type>select</frontend_type>
|
146 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
147 |
+
<sort_order>3</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
<show_in_website>1</show_in_website>
|
150 |
+
<show_in_store>1</show_in_store>
|
151 |
+
</divided_horizontally>
|
152 |
+
<integrate translate="label comment">
|
153 |
+
<label>Merge small subcategories</label>
|
154 |
+
<comment>Merge small subcategory lists into one column, except the extreme left categories</comment>
|
155 |
+
<frontend_type>select</frontend_type>
|
156 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
157 |
+
<sort_order>5</sort_order>
|
158 |
+
<show_in_default>1</show_in_default>
|
159 |
+
<show_in_website>1</show_in_website>
|
160 |
+
<show_in_store>1</show_in_store>
|
161 |
+
</integrate>
|
162 |
+
</fields>
|
163 |
+
</columns>
|
164 |
+
<popup translate="label">
|
165 |
+
<label>Popup settings</label>
|
166 |
+
<frontend_type>text</frontend_type>
|
167 |
+
<sort_order>20</sort_order>
|
168 |
+
<show_in_default>1</show_in_default>
|
169 |
+
<show_in_website>1</show_in_website>
|
170 |
+
<show_in_store>1</show_in_store>
|
171 |
+
<fields>
|
172 |
+
<width translate="label comment">
|
173 |
+
<label>Width</label>
|
174 |
+
<comment>Pixels. Set "0" to disable fixed width</comment>
|
175 |
+
<frontend_type>text</frontend_type>
|
176 |
+
<sort_order>1</sort_order>
|
177 |
+
<show_in_default>1</show_in_default>
|
178 |
+
<show_in_website>1</show_in_website>
|
179 |
+
<show_in_store>1</show_in_store>
|
180 |
+
</width>
|
181 |
+
<top_offset translate="label comment">
|
182 |
+
<label>Top offset</label>
|
183 |
+
<comment>Pixels. Set "0" to calculate the offset automatically</comment>
|
184 |
+
<frontend_type>text</frontend_type>
|
185 |
+
<sort_order>3</sort_order>
|
186 |
+
<show_in_default>1</show_in_default>
|
187 |
+
<show_in_website>1</show_in_website>
|
188 |
+
<show_in_store>1</show_in_store>
|
189 |
+
</top_offset>
|
190 |
+
<delay_displaying translate="label comment">
|
191 |
+
<label>Delay before displaying</label>
|
192 |
+
<comment>Milliseconds</comment>
|
193 |
+
<frontend_type>text</frontend_type>
|
194 |
+
<sort_order>15</sort_order>
|
195 |
+
<show_in_default>1</show_in_default>
|
196 |
+
<show_in_website>1</show_in_website>
|
197 |
+
<show_in_store>1</show_in_store>
|
198 |
+
</delay_displaying>
|
199 |
+
<delay_hiding translate="label comment">
|
200 |
+
<label>Delay before hiding</label>
|
201 |
+
<comment>Milliseconds</comment>
|
202 |
+
<frontend_type>text</frontend_type>
|
203 |
+
<sort_order>20</sort_order>
|
204 |
+
<show_in_default>1</show_in_default>
|
205 |
+
<show_in_website>1</show_in_website>
|
206 |
+
<show_in_store>1</show_in_store>
|
207 |
+
</delay_hiding>
|
208 |
+
</fields>
|
209 |
+
</popup>
|
210 |
+
</groups>
|
211 |
+
</custom_menu>
|
212 |
+
<!-- <about_abservemegamenu translate="label" module="custommenu">
|
213 |
+
<label>About Us</label>
|
214 |
+
<tab>abserve_megamenu</tab>
|
215 |
+
<frontend_type>text</frontend_type>
|
216 |
+
<sort_order>99</sort_order>
|
217 |
+
<show_in_default>1</show_in_default>
|
218 |
+
<show_in_website>1</show_in_website>
|
219 |
+
<show_in_store>1</show_in_store>
|
220 |
+
<groups>
|
221 |
+
<info>
|
222 |
+
<frontend_model>custommenu/about</frontend_model>
|
223 |
+
<sort_order>10</sort_order>
|
224 |
+
<show_in_default>1</show_in_default>
|
225 |
+
<show_in_website>1</show_in_website>
|
226 |
+
<show_in_store>1</show_in_store>
|
227 |
+
</info>
|
228 |
+
</groups>
|
229 |
+
</about_abservemegamenu> -->
|
230 |
+
</sections>
|
231 |
+
</config>
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback extends Mage_Adminhtml_Block_Widget_Grid_Container
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->_controller = 'adminhtml_feedback';
|
16 |
+
$this->_blockGroup = 'magenotification';
|
17 |
+
$this->_headerText = Mage::helper('magenotification')->__('Feedbacks Manager');
|
18 |
+
parent::__construct();
|
19 |
+
$this->_updateButton('add', 'label', Mage::helper('magenotification')->__('Post Feedback'));
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
parent::__construct();
|
17 |
+
|
18 |
+
$this->_objectId = 'id';
|
19 |
+
$this->_blockGroup = 'magenotification';
|
20 |
+
$this->_controller = 'adminhtml_feedback';
|
21 |
+
|
22 |
+
$this->_updateButton('save', 'label', Mage::helper('magenotification')->__('Save'));
|
23 |
+
$this->_updateButton('delete', 'label', Mage::helper('magenotification')->__('Delete'));
|
24 |
+
|
25 |
+
$this->_addButton('saveandcontinue', array(
|
26 |
+
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
27 |
+
'onclick' => 'saveAndContinueEdit()',
|
28 |
+
'class' => 'save',
|
29 |
+
), -100);
|
30 |
+
|
31 |
+
if($this->getRequest()->getParam('id')){
|
32 |
+
$this->_addButton('sendfeedback', array(
|
33 |
+
'label' => Mage::helper('adminhtml')->__('Resend'),
|
34 |
+
'onclick' => 'location.href=\''.$this->getUrl('*/*/resend',array('id'=>$this->getRequest()->getParam('id'))).'\'',
|
35 |
+
'class' => 'add',
|
36 |
+
), -1);
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->_formScripts[] = "
|
40 |
+
function toggleEditor() {
|
41 |
+
if (tinyMCE.getInstanceById('magenotification_content') == null) {
|
42 |
+
tinyMCE.execCommand('mceAddControl', false, 'magenotification_content');
|
43 |
+
} else {
|
44 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'magenotification_content');
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
function saveAndContinueEdit(){
|
49 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
50 |
+
}
|
51 |
+
";
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getHeaderText()
|
55 |
+
{
|
56 |
+
if( Mage::registry('feedback_data') && Mage::registry('feedback_data')->getId() ) {
|
57 |
+
return Mage::helper('magenotification')->__("Edit Feedback for '%s'", $this->htmlEscape(Mage::registry('feedback_data')->getExtension()));
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Form.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
13 |
+
{
|
14 |
+
protected function _prepareForm()
|
15 |
+
{
|
16 |
+
$form = new Varien_Data_Form(array(
|
17 |
+
'id' => 'edit_form',
|
18 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
19 |
+
'method' => 'post',
|
20 |
+
'enctype' => 'multipart/form-data'
|
21 |
+
)
|
22 |
+
);
|
23 |
+
|
24 |
+
$form->setUseContainer(true);
|
25 |
+
$this->setForm($form);
|
26 |
+
return parent::_prepareForm();
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
13 |
+
{
|
14 |
+
protected function _prepareForm()
|
15 |
+
{
|
16 |
+
$form = new Varien_Data_Form();
|
17 |
+
$this->setForm($form);
|
18 |
+
$fieldset = $form->addFieldset('feedback_form', array('legend'=>Mage::helper('magenotification')->__('Feedback detail')));
|
19 |
+
|
20 |
+
$data = array();
|
21 |
+
if ( Mage::getSingleton('adminhtml/session')->getFeedbackData() )
|
22 |
+
{
|
23 |
+
$data = Mage::getSingleton('adminhtml/session')->getFeedbackData();
|
24 |
+
Mage::getSingleton('adminhtml/session')->setFeedbackData(null);
|
25 |
+
} elseif ( Mage::registry('feedback_data') ) {
|
26 |
+
$data = Mage::registry('feedback_data')->getData();
|
27 |
+
}
|
28 |
+
$dataObject = new Varien_Object($data);
|
29 |
+
|
30 |
+
if($dataObject->getFeedbackId()){
|
31 |
+
$fieldset->addField('is_sent', 'note', array(
|
32 |
+
'label' => '',
|
33 |
+
'name' => 'is_sent',
|
34 |
+
'text' => $dataObject->getIsSent() == '1' ? '<span style="width:250px;" class="grid-severity-notice"><span>'.$this->__('Sent to Abserve.com').'</span></span>' : '<span style="width:250px;" class="grid-severity-critical"><span>'.$this->__('Not sent to Abserve.com').'</span></span>',
|
35 |
+
));
|
36 |
+
}
|
37 |
+
|
38 |
+
if($dataObject->getFeedbackId()){
|
39 |
+
$fieldset->addField('code', 'note', array(
|
40 |
+
'label' => Mage::helper('magenotification')->__('Feedback Code'),
|
41 |
+
'name' => 'code',
|
42 |
+
'text' => $dataObject->getCode(),
|
43 |
+
));
|
44 |
+
|
45 |
+
$fieldset->addField('extension', 'note', array(
|
46 |
+
'label' => Mage::helper('magenotification')->__('Extension'),
|
47 |
+
'name' => 'extension',
|
48 |
+
'text' => $dataObject->getExtension().' - version '. $dataObject->getExtensionVersion(),
|
49 |
+
));
|
50 |
+
} else {
|
51 |
+
$fieldset->addField('extension', 'select', array(
|
52 |
+
'label' => Mage::helper('magenotification')->__('Extension'),
|
53 |
+
'name' => 'extension',
|
54 |
+
'values' => Mage::helper('magenotification')->getExtensionOption(),
|
55 |
+
'class' => 'required-entry',
|
56 |
+
'required' => true,
|
57 |
+
));
|
58 |
+
}
|
59 |
+
|
60 |
+
if($dataObject->getFeedbackId()){
|
61 |
+
$fieldset->addField('created_time', 'note', array(
|
62 |
+
'label' => Mage::helper('magenotification')->__('Posted'),
|
63 |
+
'name' => 'created_time',
|
64 |
+
'text' => $this->formatDate($dataObject->getCreatedTime(),'medium',true),
|
65 |
+
));
|
66 |
+
|
67 |
+
if($dataObject->getCouponCode()){
|
68 |
+
$fieldset->addField('coupon_code', 'note', array(
|
69 |
+
'label' => Mage::helper('magenotification')->__('Coupon'),
|
70 |
+
'name' => 'coupon_code',
|
71 |
+
'text' => '<b>'.$dataObject->getCouponCode().'</b> ('.
|
72 |
+
Mage::helper('magenotification')->__('for discount').' '.$dataObject->getCouponValue().' '.
|
73 |
+
Mage::helper('magenotification')->__('to').' '.
|
74 |
+
Mage::helper('core')->formatDate($dataObject->getExpiredCoupon(),'medium',false).')',
|
75 |
+
));
|
76 |
+
}
|
77 |
+
|
78 |
+
$fieldset->addField('status', 'select', array(
|
79 |
+
'label' => Mage::helper('magenotification')->__('Status'),
|
80 |
+
'name' => 'status',
|
81 |
+
'values' => Mage::helper('magenotification')->getFeedbackStatusOption(),
|
82 |
+
'disabled' => 'disabled',
|
83 |
+
'style' => 'width:600px;',
|
84 |
+
));
|
85 |
+
|
86 |
+
$fieldset->addField('content', 'note', array(
|
87 |
+
'name' => 'content',
|
88 |
+
'label' => Mage::helper('magenotification')->__('Feedback'),
|
89 |
+
'text' => $dataObject->getData('content'),
|
90 |
+
));
|
91 |
+
|
92 |
+
$fieldset->addField('attached_file', 'note', array(
|
93 |
+
'name' => 'attached_file',
|
94 |
+
'label' => Mage::helper('magenotification')->__('Attached Files'),
|
95 |
+
'text' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_renderer_file')
|
96 |
+
->setFeedback($dataObject)->getAttachedFilesHtml(),
|
97 |
+
));
|
98 |
+
|
99 |
+
} else {
|
100 |
+
|
101 |
+
$fieldset->addField('content', 'editor', array(
|
102 |
+
'name' => 'content',
|
103 |
+
'label' => Mage::helper('magenotification')->__('Feedback'),
|
104 |
+
'style' => 'width:600px;height:300px',
|
105 |
+
'class' => 'required-entry',
|
106 |
+
'required' => true,
|
107 |
+
));
|
108 |
+
|
109 |
+
$fieldset->addField('attached_file', 'note', array(
|
110 |
+
'name' => 'attached_file',
|
111 |
+
'label' => Mage::helper('magenotification')->__('Attached Files'),
|
112 |
+
'text' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_renderer_file')->toHtml(),
|
113 |
+
));
|
114 |
+
}
|
115 |
+
|
116 |
+
$form->setValues($data);
|
117 |
+
return parent::_prepareForm();
|
118 |
+
}
|
119 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/History.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit_Tab_History
|
13 |
+
extends Mage_Adminhtml_Block_Template
|
14 |
+
{
|
15 |
+
public function __construct()
|
16 |
+
{
|
17 |
+
parent::__construct();
|
18 |
+
$this->setTemplate('magenotification/feedback/history.phtml');
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getFeedback()
|
22 |
+
{
|
23 |
+
return Mage::registry('feedback_data');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getMessages()
|
27 |
+
{
|
28 |
+
return $this->getFeedback()->getMessages();
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getMessageTitle($message)
|
32 |
+
{
|
33 |
+
$title = '<b>';
|
34 |
+
$title .= ($message->getIsCustomer() == '1') ? $this->__('From Admin') : $this->__('From').' '.Abserve_Magenotification_Model_Keygen::SERVER_NAME;
|
35 |
+
$title .= ' - '.$message->getUser().'</b> ';
|
36 |
+
$title .= $this->__('on').' ';
|
37 |
+
$title .= Mage::helper('core')->formatDate($message->getPostedTime(),'medium',true);
|
38 |
+
return $title;
|
39 |
+
}
|
40 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/Message.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit_Tab_Message extends Mage_Adminhtml_Block_Widget_Form
|
13 |
+
{
|
14 |
+
protected function _prepareForm()
|
15 |
+
{
|
16 |
+
$form = new Varien_Data_Form();
|
17 |
+
$this->setForm($form);
|
18 |
+
$fieldset = $form->addFieldset('feedback_message', array('legend'=>Mage::helper('magenotification')->__('Post Message')));
|
19 |
+
|
20 |
+
$fieldset->addField('message', 'editor', array(
|
21 |
+
'name' => 'message',
|
22 |
+
'label' => Mage::helper('magenotification')->__('Message'),
|
23 |
+
'style' => 'width:600px;height:150px',
|
24 |
+
'class' => 'required-entry',
|
25 |
+
'required' => true,
|
26 |
+
));
|
27 |
+
|
28 |
+
$fieldset->addField('attached_file', 'note', array(
|
29 |
+
'name' => 'attached_file',
|
30 |
+
'label' => Mage::helper('magenotification')->__('Attached Files'),
|
31 |
+
'text' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_renderer_file')->toHtml(),
|
32 |
+
));
|
33 |
+
|
34 |
+
|
35 |
+
return parent::_prepareForm();
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tab/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/Tabs.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
13 |
+
{
|
14 |
+
|
15 |
+
public function __construct()
|
16 |
+
{
|
17 |
+
parent::__construct();
|
18 |
+
$this->setId('feedback_tabs');
|
19 |
+
$this->setDestElementId('edit_form');
|
20 |
+
$this->setTitle(Mage::helper('magenotification')->__('Feedback Detail'));
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _beforeToHtml()
|
24 |
+
{
|
25 |
+
$this->addTab('form_section', array(
|
26 |
+
'label' => Mage::helper('magenotification')->__('Feedback Detail'),
|
27 |
+
'title' => Mage::helper('magenotification')->__('Feedback Detail'),
|
28 |
+
'content' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_edit_tab_form')->toHtml(),
|
29 |
+
));
|
30 |
+
|
31 |
+
if($this->getRequest()->getParam('id')){
|
32 |
+
$this->addTab('message_section', array(
|
33 |
+
'label' => Mage::helper('magenotification')->__('Post Message'),
|
34 |
+
'title' => Mage::helper('magenotification')->__('Post Message'),
|
35 |
+
'content' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_edit_tab_message')->toHtml(),
|
36 |
+
));
|
37 |
+
|
38 |
+
$this->addTab('history_section', array(
|
39 |
+
'label' => Mage::helper('magenotification')->__('View Posted Message'),
|
40 |
+
'title' => Mage::helper('magenotification')->__('View Posted Message'),
|
41 |
+
'content' => $this->getLayout()->createBlock('magenotification/adminhtml_feedback_edit_tab_history')->toHtml(),
|
42 |
+
));
|
43 |
+
}
|
44 |
+
return parent::_beforeToHtml();
|
45 |
+
}
|
46 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Edit/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Grid.php
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
parent::__construct();
|
17 |
+
$this->setId('feedbackGrid');
|
18 |
+
$this->setDefaultSort('feedback_id');
|
19 |
+
$this->setDefaultDir('DESC');
|
20 |
+
$this->setSaveParametersInSession(true);
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _prepareCollection()
|
24 |
+
{
|
25 |
+
$collection = Mage::getModel('magenotification/feedback')->getCollection();
|
26 |
+
$this->setCollection($collection);
|
27 |
+
return parent::_prepareCollection();
|
28 |
+
}
|
29 |
+
|
30 |
+
protected function _prepareColumns()
|
31 |
+
{
|
32 |
+
$this->addColumn('feedback_id', array(
|
33 |
+
'header' => Mage::helper('magenotification')->__('ID'),
|
34 |
+
'align' =>'right',
|
35 |
+
'width' => '50px',
|
36 |
+
'index' => 'feedback_id',
|
37 |
+
));
|
38 |
+
|
39 |
+
$this->addColumn('code', array(
|
40 |
+
'header' => Mage::helper('magenotification')->__('Feedback Code'),
|
41 |
+
'align' =>'right',
|
42 |
+
'width' => '50px',
|
43 |
+
'index' => 'code',
|
44 |
+
));
|
45 |
+
|
46 |
+
$this->addColumn('extension', array(
|
47 |
+
'header' => Mage::helper('magenotification')->__('Extension'),
|
48 |
+
'align' =>'left',
|
49 |
+
'index' => 'extension',
|
50 |
+
'renderer' => 'magenotification/adminhtml_feedback_renderer_product',
|
51 |
+
));
|
52 |
+
|
53 |
+
$this->addColumn('coupon_code', array(
|
54 |
+
'header' => Mage::helper('magenotification')->__('Coupon'),
|
55 |
+
'align' =>'left',
|
56 |
+
'index' => 'coupon_code',
|
57 |
+
));
|
58 |
+
|
59 |
+
$this->addColumn('created', array(
|
60 |
+
'header' => Mage::helper('magenotification')->__('Posted'),
|
61 |
+
'align' =>'left',
|
62 |
+
'width' => '80px',
|
63 |
+
'type' => 'date',
|
64 |
+
'index' => 'created',
|
65 |
+
));
|
66 |
+
|
67 |
+
$this->addColumn('status', array(
|
68 |
+
'header' => Mage::helper('magenotification')->__('Status'),
|
69 |
+
'align' => 'left',
|
70 |
+
'width' => '80px',
|
71 |
+
'index' => 'status',
|
72 |
+
'type' => 'options',
|
73 |
+
'options' => Mage::helper('magenotification')->getFeedbackStatusList(),
|
74 |
+
'renderer' => 'magenotification/adminhtml_feedback_renderer_status',
|
75 |
+
));
|
76 |
+
|
77 |
+
|
78 |
+
$this->addColumn('is_sent', array(
|
79 |
+
'header' => Mage::helper('magenotification')->__('Is Sent'),
|
80 |
+
'align' => 'left',
|
81 |
+
'width' => '80px',
|
82 |
+
'index' => 'is_sent',
|
83 |
+
'type' => 'options',
|
84 |
+
'options' => Mage::helper('magenotification/feedback')->getSentStatusList(),
|
85 |
+
'renderer' => 'magenotification/adminhtml_feedback_renderer_sentstatus',
|
86 |
+
));
|
87 |
+
|
88 |
+
|
89 |
+
$this->addColumn('action',
|
90 |
+
array(
|
91 |
+
'header' => Mage::helper('magenotification')->__('Action'),
|
92 |
+
'width' => '100',
|
93 |
+
'type' => 'action',
|
94 |
+
'getter' => 'getId',
|
95 |
+
'actions' => array(
|
96 |
+
array(
|
97 |
+
'caption' => Mage::helper('magenotification')->__('Edit'),
|
98 |
+
'url' => array('base'=> '*/*/edit'),
|
99 |
+
'field' => 'id'
|
100 |
+
)
|
101 |
+
),
|
102 |
+
'filter' => false,
|
103 |
+
'sortable' => false,
|
104 |
+
'index' => 'stores',
|
105 |
+
'is_system' => true,
|
106 |
+
));
|
107 |
+
|
108 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('magenotification')->__('CSV'));
|
109 |
+
$this->addExportType('*/*/exportXml', Mage::helper('magenotification')->__('XML'));
|
110 |
+
|
111 |
+
return parent::_prepareColumns();
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function _prepareMassaction()
|
115 |
+
{
|
116 |
+
$this->setMassactionIdField('feedback_id');
|
117 |
+
$this->getMassactionBlock()->setFormFieldName('feedback');
|
118 |
+
|
119 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
120 |
+
'label' => Mage::helper('magenotification')->__('Delete'),
|
121 |
+
'url' => $this->getUrl('*/*/massDelete'),
|
122 |
+
'confirm' => Mage::helper('magenotification')->__('Are you sure?')
|
123 |
+
));
|
124 |
+
|
125 |
+
$statuses = Mage::getSingleton('magenotification/status')->getOptionArray();
|
126 |
+
|
127 |
+
return $this;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function getRowUrl($row)
|
131 |
+
{
|
132 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/File.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Renderer_File
|
12 |
+
extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
protected function _prepareLayout()
|
15 |
+
{
|
16 |
+
parent::_prepareLayout();
|
17 |
+
$this->setTemplate('magenotification/feedback/files.phtml');
|
18 |
+
return $this;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getAttachedFilesHtml()
|
22 |
+
{
|
23 |
+
$feedback = $this->getFeedback();
|
24 |
+
$html = '';
|
25 |
+
$attachedfiles = $feedback->getFile();
|
26 |
+
if($attachedfiles){
|
27 |
+
$attachedfiles = explode(',',$attachedfiles);
|
28 |
+
if(count($attachedfiles)){
|
29 |
+
$count = 1;
|
30 |
+
foreach($attachedfiles as $attachedfile){
|
31 |
+
$html .= '<br/>'.($count++).'. <a href="'.Mage::getBaseUrl('media').'feedback'.$attachedfile.'">'.$this->getFileName($attachedfile).'</a>';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
$html .= '<br/><br/>';
|
35 |
+
}
|
36 |
+
return $html;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getFileName($path)
|
40 |
+
{
|
41 |
+
return substr($path,strrpos($path,'/')+1);
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Product.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Renderer_Product
|
12 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
13 |
+
{
|
14 |
+
/* Render Grid Column*/
|
15 |
+
public function render(Varien_Object $row)
|
16 |
+
{
|
17 |
+
return $row->getExtension().' - '.$this->__('version').' '.$row->getExtensionVersion();
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Sentstatus.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Renderer_Sentstatus
|
12 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
13 |
+
{
|
14 |
+
/* Render Grid Column*/
|
15 |
+
public function render(Varien_Object $row)
|
16 |
+
{
|
17 |
+
if($row->getIsSent() == '1'){
|
18 |
+
return '<span class="grid-severity-notice"><span>'.$this->__('Sent').'</span></span>';
|
19 |
+
} else {
|
20 |
+
return '<span class="grid-severity-critical"><span>'.$this->__('Not Sent').'</span></span>';
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/Status.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Feedback_Renderer_Status
|
12 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
13 |
+
{
|
14 |
+
/* Render Grid Column*/
|
15 |
+
public function render(Varien_Object $row)
|
16 |
+
{
|
17 |
+
$statuses = Mage::helper('magenotification')->getFeedbackStatusList();
|
18 |
+
switch((int)$row->getStatus()){
|
19 |
+
case 1:
|
20 |
+
$prefix = 'notice';
|
21 |
+
break;
|
22 |
+
case 2:
|
23 |
+
$prefix = 'critical';
|
24 |
+
break;
|
25 |
+
case 3:
|
26 |
+
default:
|
27 |
+
$prefix = 'major';
|
28 |
+
}
|
29 |
+
return '<span class="grid-severity-'.$prefix.'"><span>'.$statuses[(int)$row->getStatus()].'</span></span>';
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/Renderer/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Feedback/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/License/Purchaseform.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_License_Purchaseform
|
12 |
+
extends Mage_Adminhtml_Block_Template
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
parent::__construct();
|
17 |
+
$this->setTemplate('magenotification/license/purchaseform.phtml');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getPurchaseUrl()
|
21 |
+
{
|
22 |
+
return $this->getUrl('magenotification/adminhtml_license/purchase',array('extension'=>$this->getExtensionName(),'_secure'=>true));
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/License/Updateform.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_License_Updateform
|
12 |
+
extends Mage_Adminhtml_Block_Template
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
parent::__construct();
|
17 |
+
$this->setTemplate('magenotification/license/updateform.phtml');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getUpdateUrl()
|
21 |
+
{
|
22 |
+
//return $this->getUrl('magenotification/adminhtml_license/upgrade',array('licensekey'=>$this->getLicensekey(),'_secure'=>true));
|
23 |
+
return $this->getUrl('magenotification/adminhtml_license/upgrade',array('_secure'=>true));
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getViewPriceUrl()
|
27 |
+
{
|
28 |
+
//return $this->getUrl('magenotification/adminhtml_license/viewprice',array('licensekey'=>$this->getLicensekey(),'_secure'=>true));
|
29 |
+
return $this->getUrl('magenotification/adminhtml_license/viewprice',array('_secure'=>true));
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getLicenseTypeOption()
|
33 |
+
{
|
34 |
+
$list = array();
|
35 |
+
$list[Abserve_Magenotification_Model_Keygen::DOMAIN1] = $this->__('1 Domains');
|
36 |
+
$list[Abserve_Magenotification_Model_Keygen::DOMAIN2] = $this->__('2 Domains');
|
37 |
+
$list[Abserve_Magenotification_Model_Keygen::DOMAIN5] = $this->__('5 Domains');
|
38 |
+
$list[Abserve_Magenotification_Model_Keygen::DOMAIN10] = $this->__('10 Domains');
|
39 |
+
$list[Abserve_Magenotification_Model_Keygen::UNLIMITED] = $this->__('Unlimited Domain');
|
40 |
+
$list[Abserve_Magenotification_Model_Keygen::DEVELOPER] = $this->__('Developer');
|
41 |
+
foreach($list as $key=>$item){
|
42 |
+
if($key <= $this->getCurrentLicenseType()){
|
43 |
+
unset($list[$key]);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
return $list;
|
47 |
+
}
|
48 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/License/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Notification_Inbox extends Mage_Adminhtml_Block_Widget_Grid_Container
|
13 |
+
{
|
14 |
+
public function __construct()
|
15 |
+
{
|
16 |
+
$this->_controller = 'adminhtml_notification_inbox';
|
17 |
+
$this->_blockGroup = 'magenotification';
|
18 |
+
$this->_headerText = Mage::helper('magenotification')->__('Messages Inbox');
|
19 |
+
parent::__construct();
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareLayout()
|
23 |
+
{
|
24 |
+
$this->_removeButton('add');
|
25 |
+
return parent::_prepareLayout();
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Block_Adminhtml_Notification_Inbox_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
13 |
+
{
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
$this->setSaveParametersInSession(true);
|
17 |
+
$this->setId('magenotificationGrid');
|
18 |
+
$this->setIdFieldName('notification_id');
|
19 |
+
$this->setDefaultSort('added_date', 'desc');
|
20 |
+
$this->setFilterVisibility(false);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Init backups collection
|
25 |
+
*/
|
26 |
+
protected function _prepareCollection()
|
27 |
+
{
|
28 |
+
$collection = Mage::getModel('magenotification/magenotification')
|
29 |
+
->getCollection()
|
30 |
+
->addFieldToFilter('is_remove',0);
|
31 |
+
$this->setCollection($collection);
|
32 |
+
return parent::_prepareCollection();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Configuration of grid
|
37 |
+
*/
|
38 |
+
protected function _prepareColumns()
|
39 |
+
{
|
40 |
+
$this->addColumn('severity', array(
|
41 |
+
'header' => Mage::helper('adminnotification')->__('Severity'),
|
42 |
+
'width' => '60px',
|
43 |
+
'index' => 'severity',
|
44 |
+
'renderer' => 'adminhtml/notification_grid_renderer_severity',
|
45 |
+
));
|
46 |
+
|
47 |
+
$this->addColumn('added_date', array(
|
48 |
+
'header' => Mage::helper('adminnotification')->__('Date Added'),
|
49 |
+
'index' => 'added_date',
|
50 |
+
'width' => '150px',
|
51 |
+
'type' => 'datetime'
|
52 |
+
));
|
53 |
+
|
54 |
+
$this->addColumn('title', array(
|
55 |
+
'header' => Mage::helper('adminnotification')->__('Message'),
|
56 |
+
'index' => 'title',
|
57 |
+
'renderer' => 'adminhtml/notification_grid_renderer_notice',
|
58 |
+
));
|
59 |
+
$this->addColumn('related_extensions', array(
|
60 |
+
'header' => Mage::helper('adminnotification')->__('Related Extensions'),
|
61 |
+
'index' => 'related_extensions',
|
62 |
+
'renderer' => 'magenotification/adminhtml_notification_inbox_grid_renderer_extensions',
|
63 |
+
));
|
64 |
+
$this->addColumn('actions', array(
|
65 |
+
'header' => Mage::helper('adminnotification')->__('Actions'),
|
66 |
+
'width' => '250px',
|
67 |
+
'sortable' => false,
|
68 |
+
'renderer' => 'magenotification/adminhtml_notification_inbox_grid_renderer_actions',
|
69 |
+
));
|
70 |
+
|
71 |
+
return parent::_prepareColumns();
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Prepare mass action
|
76 |
+
*/
|
77 |
+
protected function _prepareMassaction()
|
78 |
+
{
|
79 |
+
$this->setMassactionIdField('notification_id');
|
80 |
+
$this->getMassactionBlock()->setFormFieldName('notification');
|
81 |
+
|
82 |
+
$this->getMassactionBlock()->addItem('mark_as_read', array(
|
83 |
+
'label' => Mage::helper('adminnotification')->__('Mark as Read'),
|
84 |
+
'url' => $this->getUrl('*/*/massMarkAsRead', array('_current'=>true)),
|
85 |
+
));
|
86 |
+
|
87 |
+
$this->getMassactionBlock()->addItem('remove', array(
|
88 |
+
'label' => Mage::helper('adminnotification')->__('Remove'),
|
89 |
+
'url' => $this->getUrl('*/*/massRemove'),
|
90 |
+
'confirm' => Mage::helper('adminnotification')->__('Are you sure?')
|
91 |
+
));
|
92 |
+
|
93 |
+
// $this->getColumn('massaction')->setWidth('30px');
|
94 |
+
|
95 |
+
return $this;
|
96 |
+
}
|
97 |
+
|
98 |
+
public function getRowClass(Varien_Object $row) {
|
99 |
+
return $row->getIsRead() ? 'read' : 'unread';
|
100 |
+
}
|
101 |
+
|
102 |
+
public function getRowClickCallback()
|
103 |
+
{
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid/Renderer/Actions.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Notification_Inbox_Grid_Renderer_Actions
|
12 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Renders grid column
|
16 |
+
*
|
17 |
+
* @param Varien_Object $row
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function render(Varien_Object $row)
|
21 |
+
{
|
22 |
+
$readDetailsHtml = ($row->getUrl())
|
23 |
+
? '<a target="_blank" href="'. $row->getUrl() .'">' .
|
24 |
+
Mage::helper('adminnotification')->__('Read Details') .'</a> | '
|
25 |
+
: '';
|
26 |
+
|
27 |
+
$markAsReadHtml = (!$row->getIsRead())
|
28 |
+
? '<a href="'. $this->getUrl('*/*/markAsRead/', array('_current' => true, 'id' => $row->getId())) .'">' .
|
29 |
+
Mage::helper('adminnotification')->__('Mark as Read') .'</a> | '
|
30 |
+
: '';
|
31 |
+
|
32 |
+
return sprintf('%s%s<a href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>',
|
33 |
+
$readDetailsHtml,
|
34 |
+
$markAsReadHtml,
|
35 |
+
$this->getUrl('*/*/remove/', array(
|
36 |
+
'_current'=>true,
|
37 |
+
'id' => $row->getId(),
|
38 |
+
Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $this->helper('core/url')->getEncodedUrl())
|
39 |
+
),
|
40 |
+
Mage::helper('adminnotification')->__('Are you sure?'),
|
41 |
+
Mage::helper('adminnotification')->__('Remove')
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Inbox/Grid/Renderer/Extensions.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Notification_Inbox_Grid_Renderer_Extensions
|
12 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Renders grid column
|
16 |
+
*
|
17 |
+
* @param Varien_Object $row
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public function render(Varien_Object $row)
|
21 |
+
{
|
22 |
+
$related_extensions = $row->getRelatedExtensions();
|
23 |
+
if(strlen($related_extensions)>100){
|
24 |
+
return substr($related_extensions,0,100).'...';
|
25 |
+
}else
|
26 |
+
return $related_extensions;
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/Notification/Window.php
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Adminhtml_Notification_Window extends Mage_Adminhtml_Block_Notification_Window{
|
12 |
+
const XML_FREQUENCY_PATH = 'magenotification/general/frequency';
|
13 |
+
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->setHeaderText($this->escapeHtml($this->__('Incoming Message')));
|
18 |
+
$this->setCloseText($this->escapeHtml($this->__('close')));
|
19 |
+
$this->setReadDetailsText($this->escapeHtml($this->__('Read details')));
|
20 |
+
$this->setNoticeText($this->escapeHtml($this->__('NOTICE')));
|
21 |
+
$this->setMinorText($this->escapeHtml($this->__('MINOR')));
|
22 |
+
$this->setMajorText($this->escapeHtml($this->__('MAJOR')));
|
23 |
+
$this->setCriticalText($this->escapeHtml($this->__('CRITICAL')));
|
24 |
+
$collectionNotifiByModule = $this->getNotificationByModule();
|
25 |
+
if($collectionNotifiByModule && $collectionNotifiByModule->getFirstItem()->getData()){
|
26 |
+
$inboxFirstData = $collectionNotifiByModule->getFirstItem()->getData();
|
27 |
+
$this->setNoticeMessageText($this->escapeHtml($collectionNotifiByModule->getFirstItem()->getTitle()));
|
28 |
+
$this->setNoticeMessageUrl($this->escapeUrl($collectionNotifiByModule->getFirstItem()->getUrl()));
|
29 |
+
}else{
|
30 |
+
$this->setNoticeMessageText($this->escapeHtml($this->getLastNotice()->getTitle()));
|
31 |
+
$this->setNoticeMessageUrl($this->escapeUrl($this->getLastNotice()->getUrl()));
|
32 |
+
}
|
33 |
+
switch ($this->getLastNotice()->getSeverity()) {
|
34 |
+
default:
|
35 |
+
case Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE:
|
36 |
+
$severity = 'SEVERITY_NOTICE';
|
37 |
+
break;
|
38 |
+
case Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR:
|
39 |
+
$severity = 'SEVERITY_MINOR';
|
40 |
+
break;
|
41 |
+
case Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR:
|
42 |
+
$severity = 'SEVERITY_MAJOR';
|
43 |
+
break;
|
44 |
+
case Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL:
|
45 |
+
$severity = 'SEVERITY_CRITICAL';
|
46 |
+
break;
|
47 |
+
}
|
48 |
+
$this->setNoticeSeverity($severity);
|
49 |
+
}
|
50 |
+
|
51 |
+
public function canShow()
|
52 |
+
{
|
53 |
+
/* --- Start By Zuongthao ----*/
|
54 |
+
$pathXmlModule = $this->getRequest()->getRouteName();
|
55 |
+
$module = (string)Mage::getConfig()->getNode('admin/routers/'.$pathXmlModule.'/args/module');
|
56 |
+
if(strpos($module ,'Abserve_') !== false){
|
57 |
+
$moduleName = strtolower(str_replace('Abserve_','',$module));
|
58 |
+
$collection = $this->getNotificationByModule();
|
59 |
+
if($collection){
|
60 |
+
$inboxFirstData = $collection->getFirstItem()->getData();
|
61 |
+
if($inboxFirstData && Mage::getModel('core/cookie')->get('notification_'.$moduleName) != 1){
|
62 |
+
$getFrequency = Mage::getStoreConfig(self::XML_FREQUENCY_PATH) * 3600;
|
63 |
+
$cookie = Mage::getSingleton('core/cookie');
|
64 |
+
$cookie->set('notification_'.$moduleName, '1' ,$getFrequency,'/');
|
65 |
+
$listPopCookie = $cookie->get('listPopCookie');
|
66 |
+
if($listPopCookie ){
|
67 |
+
$listPopCookie = $listPopCookie.','.$inboxFirstData['magenotification_id'];
|
68 |
+
}else{
|
69 |
+
$listPopCookie = $inboxFirstData['magenotification_id'];
|
70 |
+
}
|
71 |
+
$cookie->set('listPopCookie',$listPopCookie,$getFrequency);
|
72 |
+
return true;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
/* ---- End Zuongthao ---- */
|
77 |
+
|
78 |
+
if (!is_null($this->_available)) {
|
79 |
+
return $this->_available;
|
80 |
+
}
|
81 |
+
if (!Mage::getSingleton('admin/session')->isFirstPageAfterLogin()) {
|
82 |
+
$this->_available = false;
|
83 |
+
return false;
|
84 |
+
}
|
85 |
+
if (!$this->isOutputEnabled('Mage_AdminNotification')) {
|
86 |
+
$this->_available = false;
|
87 |
+
return false;
|
88 |
+
}
|
89 |
+
if (!$this->_isAllowed()) {
|
90 |
+
$this->_available = false;
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
if (is_null($this->_available)) {
|
94 |
+
$this->_available = $this->isShow();
|
95 |
+
}
|
96 |
+
return $this->_available;
|
97 |
+
}
|
98 |
+
public function getNotificationByModule(){
|
99 |
+
/* --- Start By Zuongthao ----*/
|
100 |
+
$pathXmlModule = $this->getRequest()->getRouteName();
|
101 |
+
$module = (string)Mage::getConfig()->getNode('admin/routers/'.$pathXmlModule.'/args/module');
|
102 |
+
if(strpos($module ,'Abserve_') !== false){
|
103 |
+
$moduleName = strtolower(str_replace('Abserve_','',$module));
|
104 |
+
$inboxModel = Mage::getModel('magenotification/magenotification');
|
105 |
+
$collection = $inboxModel->getCollection()
|
106 |
+
->addFieldToFilter('is_read',0)
|
107 |
+
->addFieldToFilter('is_remove',0)
|
108 |
+
->addFieldToFilter('related_extensions', array(array('like' => '%,'.$moduleName),
|
109 |
+
array('like' => '%,'.$moduleName.',%'),
|
110 |
+
array('like' => $moduleName),
|
111 |
+
array('like' => $moduleName.',%'),
|
112 |
+
array('like' => '%0%')));
|
113 |
+
$cookie = Mage::getSingleton('core/cookie');
|
114 |
+
$listPopCookie = trim($cookie->get('listPopCookie'));
|
115 |
+
$explodeListPopCookie = explode(',',$listPopCookie);
|
116 |
+
if(count($explodeListPopCookie) > 0 && $listPopCookie != ''){
|
117 |
+
$collection->addFieldToFilter('magenotification_id',array('nin' => $explodeListPopCookie));
|
118 |
+
}
|
119 |
+
$collection->setOrder('added_date', 'desc');
|
120 |
+
return $collection;
|
121 |
+
}
|
122 |
+
return null;
|
123 |
+
/* ---- End Zuongthao ---- */
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Adminhtml/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Config/Extensioncerts.php
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Config_Extensioncerts
|
12 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
13 |
+
{
|
14 |
+
protected $_dummyElement;
|
15 |
+
protected $_fieldRenderer;
|
16 |
+
protected $_values;
|
17 |
+
|
18 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
19 |
+
{
|
20 |
+
$html = $this->_getHeaderHtml($element);
|
21 |
+
|
22 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
23 |
+
|
24 |
+
// sort($modules);
|
25 |
+
|
26 |
+
foreach ($modules as $moduleName => $moduleInfo) {
|
27 |
+
|
28 |
+
if ($moduleName==='Mage_Adminhtml') {
|
29 |
+
continue;
|
30 |
+
}
|
31 |
+
if ($moduleName==='Abserve_Magenotification') {
|
32 |
+
continue;
|
33 |
+
}
|
34 |
+
if(strpos('a'.$moduleName,'Abserve') == 0){
|
35 |
+
continue;
|
36 |
+
}
|
37 |
+
if((string)$moduleInfo->codePool != 'community'){
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
|
41 |
+
if(isset($moduleInfo->nonecheckkey) && (string)$moduleInfo->nonecheckkey == 'true'){
|
42 |
+
continue;
|
43 |
+
}
|
44 |
+
|
45 |
+
$module_alias = (string)$moduleInfo->aliasName ? (string)$moduleInfo->aliasName : $moduleName;
|
46 |
+
|
47 |
+
$this->_renderLicenseInfo($element, $moduleName, $module_alias, $html);
|
48 |
+
}
|
49 |
+
$html .= $this->_getFooterHtml($element);
|
50 |
+
return $html;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Render The License Information
|
55 |
+
*
|
56 |
+
* @param type $fieldset
|
57 |
+
* @param type $moduleName
|
58 |
+
* @param type $moduleAlias
|
59 |
+
* @param type $html
|
60 |
+
* @return boolean
|
61 |
+
*/
|
62 |
+
protected function _renderLicenseInfo($fieldset, $moduleName, $moduleAlias, &$html)
|
63 |
+
{
|
64 |
+
$config = Mage::getSingleton('magenotification/config');
|
65 |
+
$moduleConfig = $config->getNode($moduleName);
|
66 |
+
if ($moduleConfig === false) {
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
$licenseType = (string)$moduleConfig->type;
|
70 |
+
if ($licenseType == Abserve_Magenotification_Model_Config::COMMERCIAL_LICENSE) {
|
71 |
+
$licenseinfo = Mage::getBlockSingleton('magenotification/config_licenseinfo')
|
72 |
+
->setConfigData($this->getConfigData())
|
73 |
+
->setModuleConfig($moduleConfig)
|
74 |
+
->setExtensionName($moduleName)
|
75 |
+
->toHtml();
|
76 |
+
|
77 |
+
// Commercial license info
|
78 |
+
$field = $fieldset->addField($moduleName.'_license_info', 'label', array(
|
79 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_license_info][value]',
|
80 |
+
'label' => (string)$moduleConfig->name ? (string)$moduleConfig->name : $moduleAlias,
|
81 |
+
'value' => $licenseinfo,
|
82 |
+
'can_use_default_value' => false,
|
83 |
+
'can_use_website_value' => false,
|
84 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
85 |
+
$html .= $field->toHtml();
|
86 |
+
|
87 |
+
$html .= $this->_getDividerHtml($fieldset, $moduleName);
|
88 |
+
}
|
89 |
+
return true;
|
90 |
+
}
|
91 |
+
|
92 |
+
protected function _getDummyElement()
|
93 |
+
{
|
94 |
+
if (empty($this->_dummyElement)) {
|
95 |
+
$this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
|
96 |
+
}
|
97 |
+
return $this->_dummyElement;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _getFieldRenderer()
|
101 |
+
{
|
102 |
+
if (empty($this->_fieldRenderer)) {
|
103 |
+
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
104 |
+
}
|
105 |
+
return $this->_fieldRenderer;
|
106 |
+
}
|
107 |
+
|
108 |
+
protected function _getValues()
|
109 |
+
{
|
110 |
+
if (empty($this->_values)) {
|
111 |
+
$this->_values = array(
|
112 |
+
array('label'=>Mage::helper('adminhtml')->__('Enable'), 'value'=>0),
|
113 |
+
array('label'=>Mage::helper('adminhtml')->__('Disable'), 'value'=>1),
|
114 |
+
);
|
115 |
+
}
|
116 |
+
return $this->_values;
|
117 |
+
}
|
118 |
+
|
119 |
+
protected function _getDividerHtml($fieldset,$moduleName)
|
120 |
+
{
|
121 |
+
$field = $fieldset->addField($moduleName.'_divider', 'label',
|
122 |
+
array(
|
123 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_divider][value]',
|
124 |
+
'label' => '',
|
125 |
+
'value' => '<div style="margin:5px 0 20px 0;border-top: 1px dashed rgb(221, 108, 15);min-width: 312px;"></div>',
|
126 |
+
'inherit' => false,
|
127 |
+
'can_use_default_value' => 0,
|
128 |
+
'can_use_website_value' => 0,
|
129 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
130 |
+
|
131 |
+
return $field->toHtml();
|
132 |
+
}
|
133 |
+
|
134 |
+
protected function _getFieldHtml($fieldset, $moduleName, $module_alias)
|
135 |
+
{
|
136 |
+
$configData = $this->getConfigData();
|
137 |
+
$path = 'magenotificationsecure/extension_keys/'.$moduleName; //TODO: move as property of form
|
138 |
+
$data = isset($configData[$path]) ? $configData[$path] : '';
|
139 |
+
|
140 |
+
$e = $this->_getDummyElement();
|
141 |
+
|
142 |
+
$field = $fieldset->addField($moduleName, 'text',
|
143 |
+
array(
|
144 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'][value]',
|
145 |
+
'label' => $module_alias,
|
146 |
+
'value' => $data,
|
147 |
+
'style' => 'width:688px;',
|
148 |
+
'inherit' => isset($configData[$path]) ? false : true,
|
149 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
|
150 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
|
151 |
+
))->setRenderer($this->_getFieldRenderer());
|
152 |
+
|
153 |
+
return $field->toHtml();
|
154 |
+
}
|
155 |
+
|
156 |
+
protected function _getInfoHtml($fieldset, $moduleName)
|
157 |
+
{
|
158 |
+
$configData = $this->getConfigData();
|
159 |
+
$path = 'magenotificationsecure/extension_keys/'.$moduleName; //TODO: move as property of form
|
160 |
+
$data = isset($configData[$path]) ? $configData[$path] : array();
|
161 |
+
if($data){
|
162 |
+
$helper = Mage::helper('magenotification');
|
163 |
+
//prepare license info
|
164 |
+
$licenseinfo = $helper->getLicenseInfo($data,$moduleName);
|
165 |
+
//prepare additional license form
|
166 |
+
$licenseType = $helper->getLicenseType($moduleName);
|
167 |
+
$additionalLicenseForm = '';
|
168 |
+
if( in_array($licenseType,array(-1,
|
169 |
+
0,
|
170 |
+
Abserve_Magenotification_Model_Keygen::TRIAL_VERSION,
|
171 |
+
//Abserve_Magenotification_Model_Keygen::DEVELOPMENT,
|
172 |
+
)) || $helper->getDBResponseCode() < Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS ){
|
173 |
+
$additionalLicenseForm = Mage::getBlockSingleton('magenotification/adminhtml_license_purchaseform')
|
174 |
+
->setExtensionName($helper->getExtensionName($moduleName))
|
175 |
+
->toHtml();
|
176 |
+
}
|
177 |
+
//license info field
|
178 |
+
$e = $this->_getDummyElement();
|
179 |
+
$field = $fieldset->addField($moduleName.'_license_info', 'label',
|
180 |
+
array(
|
181 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_license_info][value]',
|
182 |
+
'label' => $helper->__('License Info'),
|
183 |
+
'value' => $licenseinfo . $additionalLicenseForm,
|
184 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
|
185 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
|
186 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
187 |
+
|
188 |
+
return $field->toHtml();
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Config/Extensionkeys.php
ADDED
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Config_Extensionkeys
|
12 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
13 |
+
{
|
14 |
+
protected $_dummyElement;
|
15 |
+
protected $_fieldRenderer;
|
16 |
+
protected $_values;
|
17 |
+
|
18 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
19 |
+
{
|
20 |
+
$html = $this->_getHeaderHtml($element);
|
21 |
+
|
22 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
23 |
+
|
24 |
+
// sort($modules);
|
25 |
+
|
26 |
+
foreach ($modules as $moduleName => $moduleInfo) {
|
27 |
+
|
28 |
+
if ($moduleName==='Mage_Adminhtml') {
|
29 |
+
continue;
|
30 |
+
}
|
31 |
+
if ($moduleName==='Abserve_Magenotification') {
|
32 |
+
continue;
|
33 |
+
}
|
34 |
+
if(strpos('a'.$moduleName,'Abserve') == 0){
|
35 |
+
continue;
|
36 |
+
}
|
37 |
+
if((string)$moduleInfo->codePool != 'community'){
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
|
41 |
+
if(isset($moduleInfo->nonecheckkey) && (string)$moduleInfo->nonecheckkey == 'true'){
|
42 |
+
continue;
|
43 |
+
}
|
44 |
+
|
45 |
+
$module_alias = (string)$moduleInfo->aliasName ? (string)$moduleInfo->aliasName : $moduleName;
|
46 |
+
|
47 |
+
if ($this->_renderLicenseInfo($element, $moduleName, $module_alias, $html)) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
|
51 |
+
$html .= $this->_getFieldHtml($element, $moduleName, $module_alias);
|
52 |
+
$html .= $this->_getInfoHtml($element, $moduleName);
|
53 |
+
$html .= $this->_getDividerHtml($element, $moduleName);
|
54 |
+
}
|
55 |
+
$html .= $this->_getFooterHtml($element);
|
56 |
+
return $html;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Render The License Information
|
61 |
+
*
|
62 |
+
* @param type $fieldset
|
63 |
+
* @param type $moduleName
|
64 |
+
* @param type $moduleAlias
|
65 |
+
* @param type $html
|
66 |
+
* @return boolean
|
67 |
+
*/
|
68 |
+
protected function _renderLicenseInfo($fieldset, $moduleName, $moduleAlias, &$html)
|
69 |
+
{
|
70 |
+
$config = Mage::getSingleton('magenotification/config');
|
71 |
+
$moduleConfig = $config->getNode($moduleName);
|
72 |
+
if ($moduleConfig === false) {
|
73 |
+
return false;
|
74 |
+
}
|
75 |
+
$licenseType = (string)$moduleConfig->type;
|
76 |
+
if ($licenseType == Abserve_Magenotification_Model_Config::TRIAL_LICENSE) {
|
77 |
+
// You are using a trial version of %s extension.
|
78 |
+
$configData = $this->getConfigData();
|
79 |
+
$path = 'magenotificationsecure/extension_keys/'.$moduleName;
|
80 |
+
$licenseKey = isset($configData[$path]) ? $configData[$path] : '';
|
81 |
+
|
82 |
+
$helper = Mage::helper('magenotification');
|
83 |
+
if ($licenseKey) {
|
84 |
+
$licenseinfo = $helper->getLicenseInfo($licenseKey, $moduleName);
|
85 |
+
if ($helper->getDBResponseCode() < Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS
|
86 |
+
&& (string)$moduleConfig->trial_key
|
87 |
+
) {
|
88 |
+
$licenseKey = (string)$moduleConfig->trial_key;
|
89 |
+
$licenseinfo = $helper->getLicenseInfo($licenseKey, $moduleName);
|
90 |
+
}
|
91 |
+
} elseif ((string)$moduleConfig->trial_key) {
|
92 |
+
$licenseKey = (string)$moduleConfig->trial_key;
|
93 |
+
$licenseinfo = $helper->getLicenseInfo($licenseKey, $moduleName);
|
94 |
+
}
|
95 |
+
|
96 |
+
// Render Input License Key
|
97 |
+
$extensionName = (string)$moduleConfig->name ? (string)$moduleConfig->name : $moduleAlias;
|
98 |
+
$field = $fieldset->addField($moduleName, 'text', array(
|
99 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'][value]',
|
100 |
+
'label' => $extensionName,
|
101 |
+
'value' => $licenseKey,
|
102 |
+
'style' => 'width:688px;',
|
103 |
+
'inherit' => isset($configData[$path]) ? false : true,
|
104 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($this->_dummyElement),
|
105 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($this->_dummyElement),
|
106 |
+
'comment' => $licenseKey ? '' : $helper->__('You are using a trial version of %s extension.', $extensionName),
|
107 |
+
))->setRenderer($this->_getFieldRenderer());
|
108 |
+
$html .= $field->toHtml();
|
109 |
+
|
110 |
+
// Get License Info by packaged license key
|
111 |
+
if ($licenseKey) {
|
112 |
+
$additionalLicenseForm = '';
|
113 |
+
if (in_array($helper->getLicenseType($moduleName), array(
|
114 |
+
-1, 0, Abserve_Magenotification_Model_Keygen::TRIAL_VERSION
|
115 |
+
)) || $helper->getDBResponseCode() < Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS) {
|
116 |
+
$additionalLicenseForm = Mage::getBlockSingleton('magenotification/adminhtml_license_purchaseform')->setExtensionName($helper->getExtensionName($moduleName))->toHtml();
|
117 |
+
}
|
118 |
+
$field = $fieldset->addField($moduleName.'_license_info', 'label', array(
|
119 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_license_info][value]',
|
120 |
+
'label' => $helper->__('License Info'),
|
121 |
+
'value' => $licenseinfo . $additionalLicenseForm,
|
122 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($this->_dummyElement),
|
123 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($this->_dummyElement),
|
124 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
125 |
+
$html .= $field->toHtml();
|
126 |
+
} else {
|
127 |
+
$additionalLicenseForm = Mage::getBlockSingleton('magenotification/adminhtml_license_purchaseform')->setExtensionName($helper->getExtensionName($moduleName))->toHtml();
|
128 |
+
$field = $fieldset->addField($moduleName.'_license_info', 'label', array(
|
129 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_license_info][value]',
|
130 |
+
'label' => '',
|
131 |
+
'value' => '<hr width="345">' . $additionalLicenseForm,
|
132 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($this->_dummyElement),
|
133 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($this->_dummyElement),
|
134 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
135 |
+
$html .= $field->toHtml();
|
136 |
+
}
|
137 |
+
|
138 |
+
$html .= $this->_getDividerHtml($fieldset, $moduleName);
|
139 |
+
}
|
140 |
+
return true;
|
141 |
+
}
|
142 |
+
|
143 |
+
protected function _getDummyElement()
|
144 |
+
{
|
145 |
+
if (empty($this->_dummyElement)) {
|
146 |
+
$this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
|
147 |
+
}
|
148 |
+
return $this->_dummyElement;
|
149 |
+
}
|
150 |
+
|
151 |
+
protected function _getFieldRenderer()
|
152 |
+
{
|
153 |
+
if (empty($this->_fieldRenderer)) {
|
154 |
+
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
155 |
+
}
|
156 |
+
return $this->_fieldRenderer;
|
157 |
+
}
|
158 |
+
|
159 |
+
protected function _getValues()
|
160 |
+
{
|
161 |
+
if (empty($this->_values)) {
|
162 |
+
$this->_values = array(
|
163 |
+
array('label'=>Mage::helper('adminhtml')->__('Enable'), 'value'=>0),
|
164 |
+
array('label'=>Mage::helper('adminhtml')->__('Disable'), 'value'=>1),
|
165 |
+
);
|
166 |
+
}
|
167 |
+
return $this->_values;
|
168 |
+
}
|
169 |
+
|
170 |
+
protected function _getDividerHtml($fieldset,$moduleName)
|
171 |
+
{
|
172 |
+
$field = $fieldset->addField($moduleName.'_divider', 'label',
|
173 |
+
array(
|
174 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_divider][value]',
|
175 |
+
'label' => '',
|
176 |
+
'value' => '<div style="margin:5px 0 20px 0;border-top: 1px dashed rgb(221, 108, 15);"></div>',
|
177 |
+
'inherit' => false,
|
178 |
+
'can_use_default_value' => 0,
|
179 |
+
'can_use_website_value' => 0,
|
180 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
181 |
+
|
182 |
+
return $field->toHtml();
|
183 |
+
}
|
184 |
+
|
185 |
+
protected function _getFieldHtml($fieldset, $moduleName, $module_alias)
|
186 |
+
{
|
187 |
+
$configData = $this->getConfigData();
|
188 |
+
$path = 'magenotificationsecure/extension_keys/'.$moduleName; //TODO: move as property of form
|
189 |
+
$data = isset($configData[$path]) ? $configData[$path] : '';
|
190 |
+
|
191 |
+
$e = $this->_getDummyElement();
|
192 |
+
|
193 |
+
$field = $fieldset->addField($moduleName, 'text',
|
194 |
+
array(
|
195 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'][value]',
|
196 |
+
'label' => $module_alias,
|
197 |
+
'value' => $data,
|
198 |
+
'style' => 'width:688px;',
|
199 |
+
'inherit' => isset($configData[$path]) ? false : true,
|
200 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
|
201 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
|
202 |
+
))->setRenderer($this->_getFieldRenderer());
|
203 |
+
|
204 |
+
return $field->toHtml();
|
205 |
+
}
|
206 |
+
|
207 |
+
protected function _getInfoHtml($fieldset, $moduleName)
|
208 |
+
{
|
209 |
+
$configData = $this->getConfigData();
|
210 |
+
$path = 'magenotificationsecure/extension_keys/'.$moduleName; //TODO: move as property of form
|
211 |
+
$data = isset($configData[$path]) ? $configData[$path] : array();
|
212 |
+
if($data){
|
213 |
+
$helper = Mage::helper('magenotification');
|
214 |
+
//prepare license info
|
215 |
+
$licenseinfo = $helper->getLicenseInfo($data,$moduleName);
|
216 |
+
//prepare additional license form
|
217 |
+
$licenseType = $helper->getLicenseType($moduleName);
|
218 |
+
$additionalLicenseForm = '';
|
219 |
+
if( in_array($licenseType,array(-1,
|
220 |
+
0,
|
221 |
+
Abserve_Magenotification_Model_Keygen::TRIAL_VERSION,
|
222 |
+
//Abserve_Magenotification_Model_Keygen::DEVELOPMENT,
|
223 |
+
)) || $helper->getDBResponseCode() < Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS ){
|
224 |
+
$additionalLicenseForm = Mage::getBlockSingleton('magenotification/adminhtml_license_purchaseform')
|
225 |
+
->setExtensionName($helper->getExtensionName($moduleName))
|
226 |
+
->toHtml();
|
227 |
+
}
|
228 |
+
//license info field
|
229 |
+
$e = $this->_getDummyElement();
|
230 |
+
$field = $fieldset->addField($moduleName.'_license_info', 'label',
|
231 |
+
array(
|
232 |
+
'name' => 'groups[extension_keys][fields]['.$moduleName.'_license_info][value]',
|
233 |
+
'label' => $helper->__('License Info'),
|
234 |
+
'value' => $licenseinfo . $additionalLicenseForm,
|
235 |
+
'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
|
236 |
+
'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
|
237 |
+
))->setRenderer(Mage::getBlockSingleton('magenotification/config_field'));
|
238 |
+
|
239 |
+
return $field->toHtml();
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Config/Field.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Config_Field
|
12 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
13 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
14 |
+
{
|
15 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
16 |
+
{
|
17 |
+
$html = $element->getBold() ? '<strong>' : '';
|
18 |
+
$html.= $element->getValue();
|
19 |
+
$html.= $element->getBold() ? '</strong>' : '';
|
20 |
+
$html.= $element->getAfterElementHtml();
|
21 |
+
return $html;
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Config/Label.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Config_Label
|
12 |
+
extends Varien_Data_Form_Element_Label
|
13 |
+
{
|
14 |
+
public function getElementHtml()
|
15 |
+
{
|
16 |
+
$html = $this->getBold() ? '<strong>' : '';
|
17 |
+
$html.= $this->getValue();
|
18 |
+
$html.= $this->getBold() ? '</strong>' : '';
|
19 |
+
$html.= $this->getAfterElementHtml();
|
20 |
+
return $html;
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Config/Licenseinfo.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
/**
|
12 |
+
* License Info Block
|
13 |
+
*/
|
14 |
+
class Abserve_Magenotification_Block_Config_Licenseinfo extends Mage_Adminhtml_Block_Template
|
15 |
+
{
|
16 |
+
protected function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->setTemplate('magenotification/license/licenseinfo.phtml');
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getConfigLicenseSerial()
|
23 |
+
{
|
24 |
+
$configData = $this->getConfigData();
|
25 |
+
$moduleName = $this->getExtensionName();
|
26 |
+
|
27 |
+
$path = 'magenotificationcerts/extension_serials/'.$moduleName;
|
28 |
+
return isset($configData[$path]) ? $configData[$path] : '';
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* get license serial (provided by Abserve.com)
|
33 |
+
*
|
34 |
+
* @return string
|
35 |
+
*/
|
36 |
+
public function getLicenseSerial()
|
37 |
+
{
|
38 |
+
$moduleConfig = $this->getModuleConfig();
|
39 |
+
return (string)$moduleConfig->serial;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getLicenseType()
|
43 |
+
{
|
44 |
+
$moduleConfig = $this->getModuleConfig();
|
45 |
+
return (string)$moduleConfig->type;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getActivationDate()
|
49 |
+
{
|
50 |
+
$moduleConfig = $this->getModuleConfig();
|
51 |
+
return (string)$moduleConfig->activation_date;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getExpirationDate()
|
55 |
+
{
|
56 |
+
$moduleConfig = $this->getModuleConfig();
|
57 |
+
return (string)$moduleConfig->expiration_date;
|
58 |
+
}
|
59 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Config/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Block/Rewrite/AdminhtmlNotificationGridRendererActions.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Rewrite_AdminhtmlNotificationGridRendererActions
|
12 |
+
extends Mage_Adminhtml_Block_Notification_Grid_Renderer_Actions
|
13 |
+
{
|
14 |
+
public function render(Varien_Object $row)
|
15 |
+
{
|
16 |
+
|
17 |
+
if(! Mage::getModel('magenotification/magenotification')->is_existedUrl($row->getUrl()))
|
18 |
+
{
|
19 |
+
return parent::render($row);
|
20 |
+
}
|
21 |
+
|
22 |
+
$read_url = $this->getUrl('magenotification/adminhtml_magenotification/readdetail',array('id'=>$row->getId()));
|
23 |
+
|
24 |
+
if (!$row->getIsRead()) {
|
25 |
+
return sprintf('<a target="_blank" href="%s">%s</a> | <a href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>',
|
26 |
+
$read_url,
|
27 |
+
Mage::helper('adminnotification')->__('Read Details'),
|
28 |
+
$this->getUrl('*/*/markAsRead/', array('_current'=>true, 'id' => $row->getId())),
|
29 |
+
Mage::helper('adminnotification')->__('Mark as Read'),
|
30 |
+
$this->getUrl('*/*/remove/', array('_current'=>true, 'id' => $row->getId())),
|
31 |
+
Mage::helper('adminnotification')->__('Are you sure?'),
|
32 |
+
Mage::helper('adminnotification')->__('Remove')
|
33 |
+
);
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
return sprintf('<a target="_blank" href="%s">%s</a> | <a href="%s" onClick="deleteConfirm(\'%s\',this.href); return false;">%s</a>',
|
37 |
+
$read_url,
|
38 |
+
Mage::helper('adminnotification')->__('Read Details'),
|
39 |
+
$this->getUrl('*/*/remove/', array('_current'=>true, 'id' => $row->getId())),
|
40 |
+
Mage::helper('adminnotification')->__('Are you sure?'),
|
41 |
+
Mage::helper('adminnotification')->__('Remove')
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Rewrite/AdminhtmlNotificationWindow.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Magenotification_Block_Rewrite_AdminhtmlNotificationWindow extends Mage_Adminhtml_Block_Notification_Window
|
12 |
+
{
|
13 |
+
protected function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
|
17 |
+
if(Mage::getModel('magenotification/magenotification')->is_existedUrl($this->getLastNotice()->getUrl()))
|
18 |
+
{
|
19 |
+
$url = $this->getUrl('magenotification/adminhtml_magenotification/readdetail',array('id'=>$this->getLastNotice()->getId()));
|
20 |
+
|
21 |
+
$this->setHeaderText(addslashes($this->__('Abserve Message')));
|
22 |
+
|
23 |
+
$this->setNoticeMessageUrl(addslashes($url));
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
app/code/community/Abserve/Magenotification/Block/Rewrite/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Helper/Data.php
ADDED
@@ -0,0 +1,564 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
const LICENSE_INFO_PATH = 'magenotificationsecure/extension_keys/Abserve_{{extension_name}}_license_info';
|
16 |
+
//const LICENSE_INFO_FORMAT1 = '<hr width="280" /><b>{{license_type}}</b><br/>{{activated_time}}<br/>{{domains}} {{expired_info}}<hr width="280" />';
|
17 |
+
const LICENSE_INFO_FORMAT1 = '<hr width="345" /><b>{{license_type}}</b><br/>{{activated_time}}<br/>{{domains}} {{expired_info}}<hr width="345" />';
|
18 |
+
const LICENSE_INFO_FORMAT2 = "<hr/><pre> {{license_type}} \n {{activated_time}} \n {{domains}} {{expired_info}}</pre><hr/>";
|
19 |
+
|
20 |
+
public $PASSED_KEYWORDS = array('abserve','localhost','test.','test/','dev/','dev.','development','demo-');
|
21 |
+
|
22 |
+
protected $_extension;
|
23 |
+
protected $_licenseType = array();
|
24 |
+
protected $_errorMessage = null;
|
25 |
+
protected $_logger = array();
|
26 |
+
|
27 |
+
public function checkLicenseKeyFrontController($controller) {return true;}
|
28 |
+
public function checkLicenseKeyAdminController($controller) {return true;}
|
29 |
+
public function checkLicenseKey($extensionName) {return true;}
|
30 |
+
|
31 |
+
// used for checking license in front-end controller
|
32 |
+
public function checkTrialKeyFrontController($controller)
|
33 |
+
{
|
34 |
+
$extensionName = get_class($controller);
|
35 |
+
if(!$this->checkTrialKey($extensionName)){
|
36 |
+
$request = $controller->getRequest();
|
37 |
+
$request->initForward();
|
38 |
+
$request->setActionName('noRoute')->setDispatched(false);
|
39 |
+
return false;
|
40 |
+
} else {
|
41 |
+
return true;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
// used for checking license in back-end controller
|
46 |
+
public function checkTrialKeyAdminController($controller)
|
47 |
+
{
|
48 |
+
$extensionName = get_class($controller);
|
49 |
+
if(!$this->checkTrialKey($extensionName)){
|
50 |
+
$message = $this->getInvalidKeyNotice();
|
51 |
+
$controller->loadLayout();
|
52 |
+
$contentBlock = $controller->getLayout()->createBlock('core/text');
|
53 |
+
$contentBlock->setText($message);
|
54 |
+
$controller->getLayout()->getBlock('root')->setChild('content',$contentBlock);
|
55 |
+
$controller->renderLayout();
|
56 |
+
return false;
|
57 |
+
}elseif((int)$this->getDBLicenseType() == Abserve_Magenotification_Model_Keygen::TRIAL_VERSION
|
58 |
+
|| (int)$this->getDBLicenseType() == Abserve_Magenotification_Model_Keygen::DEVELOPMENT){
|
59 |
+
$versionLabel = (int)$this->getDBLicenseType() == Abserve_Magenotification_Model_Keygen::TRIAL_VERSION ? $this->__('trial') : $this->__('development');
|
60 |
+
Mage::getSingleton('core/session')->addNotice($this->__('You are using a %s version of %s extension. It will be expired on %s.',
|
61 |
+
$versionLabel,
|
62 |
+
$this->_extension,
|
63 |
+
$this->getDBExpiredTime()
|
64 |
+
));
|
65 |
+
}
|
66 |
+
return true;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function checkTrialKey($extensionName)
|
70 |
+
{
|
71 |
+
if(strpos('a'.$extensionName,'Abserve')){
|
72 |
+
$arrName = explode('_',$extensionName);
|
73 |
+
$extensionName = isset($arrName[1]) ? $arrName[1] : str_replace('Abserve','',$extensionName);
|
74 |
+
}
|
75 |
+
$this->_extension = $extensionName;
|
76 |
+
//$baseUrl = Mage::getBaseUrl();
|
77 |
+
$baseUrl = Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)->getBaseUrl();
|
78 |
+
//check passed key words
|
79 |
+
foreach($this->PASSED_KEYWORDS as $passed_keyword){
|
80 |
+
if(strpos($baseUrl,$passed_keyword))
|
81 |
+
return true;
|
82 |
+
}
|
83 |
+
|
84 |
+
$domain = $this->getDomain($baseUrl);
|
85 |
+
|
86 |
+
// Check Depend Extension, Use Key of Major Extension
|
87 |
+
$config = Mage::getSingleton('magenotification/config');
|
88 |
+
$moduleConfig = $config->getNode('Abserve_'.$extensionName);
|
89 |
+
if ($moduleConfig !== false
|
90 |
+
&& (string)$moduleConfig->type == Abserve_Magenotification_Model_Config::DEPEND_LICENSE
|
91 |
+
&& (string)$moduleConfig->depend
|
92 |
+
) {
|
93 |
+
$extensionName = (string)$moduleConfig->depend;
|
94 |
+
$arrName = explode('_',$extensionName);
|
95 |
+
$extensionName = isset($arrName[1]) ? $arrName[1] : str_replace('Abserve','',$extensionName);
|
96 |
+
$this->_extension = $extensionName;
|
97 |
+
}
|
98 |
+
|
99 |
+
$licensekey = Mage::getStoreConfig('magenotificationsecure/extension_keys/Abserve_'.$extensionName);
|
100 |
+
$licensekey = trim($licensekey);
|
101 |
+
|
102 |
+
//get cached data
|
103 |
+
if($this->getDBLicenseKey() == $licensekey
|
104 |
+
&& $this->getDBCheckdate() == date('Y-m-d')
|
105 |
+
&& $this->getDBSumcode() == $this->getSumcode()){
|
106 |
+
$responsecode = $this->getDBResponseCode();
|
107 |
+
} else {
|
108 |
+
//check license key online
|
109 |
+
$responsecode = Mage::getSingleton('magenotification/keygen')->checkLicenseKey($licensekey,$extensionName,$domain);
|
110 |
+
//save data into database
|
111 |
+
$this->setDBLicenseKey($licensekey);
|
112 |
+
$this->setDBCheckdate(date('Y-m-d'));
|
113 |
+
$this->setDBResponseCode((int)$responsecode);
|
114 |
+
$this->setDBSumcode($this->getSumcode($responsecode));
|
115 |
+
$this->_saveLicenseLog();
|
116 |
+
}
|
117 |
+
|
118 |
+
// Check Packaged Trial License Key
|
119 |
+
if (!$licensekey || $responsecode < Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS) {
|
120 |
+
$moduleConfig = $config->getNode('Abserve_'.$extensionName);
|
121 |
+
if ($moduleConfig !== false
|
122 |
+
&& (string)$moduleConfig->type == Abserve_Magenotification_Model_Config::TRIAL_LICENSE
|
123 |
+
&& (string)$moduleConfig->trial_key
|
124 |
+
) {
|
125 |
+
$licensekey = trim((string)$moduleConfig->trial_key);
|
126 |
+
|
127 |
+
//get cached data
|
128 |
+
if($this->getDBLicenseKey() == $licensekey
|
129 |
+
&& $this->getDBCheckdate() == date('Y-m-d')
|
130 |
+
&& $this->getDBSumcode() == $this->getSumcode()){
|
131 |
+
$responsecode = $this->getDBResponseCode();
|
132 |
+
} else {
|
133 |
+
//check license key online
|
134 |
+
$responsecode = Mage::getSingleton('magenotification/keygen')->checkLicenseKey($licensekey,$extensionName,$domain);
|
135 |
+
//save data into database
|
136 |
+
$this->setDBLicenseKey($licensekey);
|
137 |
+
$this->setDBCheckdate(date('Y-m-d'));
|
138 |
+
$this->setDBResponseCode((int)$responsecode);
|
139 |
+
$this->setDBSumcode($this->getSumcode($responsecode));
|
140 |
+
$this->_saveLicenseLog();
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
//save error message
|
146 |
+
$this->_errorMessage = $this->getLicenseKeyError($responsecode);
|
147 |
+
return $this->isValidCode($responsecode);
|
148 |
+
}
|
149 |
+
|
150 |
+
public function getErrorMessage()
|
151 |
+
{
|
152 |
+
return $this->_errorMessage;
|
153 |
+
}
|
154 |
+
|
155 |
+
public function isValidCode($code)
|
156 |
+
{
|
157 |
+
if(in_array((int)$code,array(Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS,
|
158 |
+
Abserve_Magenotification_Model_Keygen::EXISTED_DOMAIN_SUCCESS,
|
159 |
+
Abserve_Magenotification_Model_Keygen::SUB_DOMAIN_SUCCESS,
|
160 |
+
))){
|
161 |
+
return true;
|
162 |
+
}
|
163 |
+
return false;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function getLicenseInfo($licensekey,$extensionName)
|
167 |
+
{
|
168 |
+
if(strpos('a'.$extensionName,'Abserve')){
|
169 |
+
$arrName = explode('_',$extensionName);
|
170 |
+
$extensionName = isset($arrName[1]) ? $arrName[1] : str_replace('Abserve','',$extensionName);
|
171 |
+
}
|
172 |
+
$this->_extension = $extensionName;
|
173 |
+
$configPath = str_replace('{{extension_name}}',$extensionName,self::LICENSE_INFO_PATH);
|
174 |
+
//$baseUrl = Mage::getBaseUrl();
|
175 |
+
$baseUrl = Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)->getBaseUrl();
|
176 |
+
$domain = $this->getDomain($baseUrl);
|
177 |
+
|
178 |
+
//get cached data
|
179 |
+
if($this->getDBLicenseKey() == $licensekey
|
180 |
+
&& $this->getDBCheckdate() == date('Y-m-d')
|
181 |
+
&& $this->getDBSumcode() == $this->getSumcode()){
|
182 |
+
//return Mage::getStoreConfig($configPath);
|
183 |
+
}
|
184 |
+
|
185 |
+
$licenseinfo = Mage::getSingleton('magenotification/keygen')->getLicenseInfo($licensekey,$extensionName,$domain);
|
186 |
+
$responsecode = $licenseinfo->getResponseCode();
|
187 |
+
$licenseType = $licenseinfo->getType();
|
188 |
+
if((int)$licenseinfo->getResponseCode() == 101){ // error when get license info
|
189 |
+
return Mage::getStoreConfig($configPath);
|
190 |
+
}
|
191 |
+
|
192 |
+
if((int)$licenseinfo->getResponseCode() >= Abserve_Magenotification_Model_Keygen::NEW_DOMAIN_SUCCESS){
|
193 |
+
//save license type
|
194 |
+
$this->_licenseType[$extensionName] = $licenseinfo->getType();
|
195 |
+
//get license info html format
|
196 |
+
$licenseinfo = $this->fomatLicenseInfo($licenseinfo);
|
197 |
+
$response = 1;
|
198 |
+
} else{
|
199 |
+
//get license info
|
200 |
+
$message = $this->getLicenseKeyError((int)$licenseinfo->getResponseCode());
|
201 |
+
$showLicenseinfo = null;
|
202 |
+
if(in_array((int)$licenseinfo->getResponseCode(),array( Abserve_Magenotification_Model_Keygen::EXPIRED_TRIAL_LICENSE_KEY_ERROR,
|
203 |
+
Abserve_Magenotification_Model_Keygen::LIMITED_DOMAIN_ERROR,
|
204 |
+
))){
|
205 |
+
$showLicenseinfo = $this->fomatLicenseInfo($licenseinfo);
|
206 |
+
}
|
207 |
+
//save license type
|
208 |
+
$this->_licenseType[$extensionName] = -1;
|
209 |
+
if((int)$licenseinfo->getResponseCode() == Abserve_Magenotification_Model_Keygen::LIMITED_DOMAIN_ERROR){
|
210 |
+
$this->_licenseType[$extensionName] = $licenseinfo->getType();
|
211 |
+
}
|
212 |
+
$licenseinfo = '<hr width="345" /><span class="licensekey-warning" style="font-weight:bold;color:#FF0000;">'.$message.'</span><br/>'.$showLicenseinfo.'<hr width="345" />';
|
213 |
+
$reponse = 0;
|
214 |
+
}
|
215 |
+
//save data into cookie
|
216 |
+
$this->setDBLicenseKey($licensekey);
|
217 |
+
$this->setDBLicenseType($licenseType);
|
218 |
+
$this->setDBCheckdate(date('Y-m-d'));
|
219 |
+
$this->setDBResponseCode((int)$responsecode);
|
220 |
+
$this->setDBSumcode($this->getSumcode($responsecode));
|
221 |
+
$this->_saveLicenseLog();
|
222 |
+
Mage::getSingleton('core/config')->saveConfig($configPath,$licenseinfo);
|
223 |
+
|
224 |
+
return $licenseinfo;
|
225 |
+
}
|
226 |
+
|
227 |
+
public function getLicenseType($extension)
|
228 |
+
{
|
229 |
+
$extension = $this->getExtensionName($extension);
|
230 |
+
if(!isset($this->_licenseType[$extension]))
|
231 |
+
return 0;
|
232 |
+
return $this->_licenseType[$extension];
|
233 |
+
}
|
234 |
+
|
235 |
+
public function fomatLicenseInfo($info)
|
236 |
+
{
|
237 |
+
$helper = Mage::helper('magenotification');
|
238 |
+
$html = self::LICENSE_INFO_FORMAT1;
|
239 |
+
$licensetype = Abserve_Magenotification_Model_Keygen::getLicenseTitle((int)$info->getType());
|
240 |
+
$activetime = Mage::helper('core')->formatDate($info->getActivatedTime(),'medium',false);
|
241 |
+
$domains = $info->getDomains();
|
242 |
+
$expired_info = null;
|
243 |
+
if((int)$info->getType() == Abserve_Magenotification_Model_Keygen::TRIAL_VERSION
|
244 |
+
|| (int)$info->getType() == Abserve_Magenotification_Model_Keygen::DEVELOPMENT){
|
245 |
+
$expired_time = strtotime($info->getActivatedTime()) + (int) $info->getExpiredTime() *3600*24;
|
246 |
+
$expired_time = date('Y-m-d H:i:s',$expired_time);
|
247 |
+
$expired_info = '<b>'.$helper->__('Expired Date').':</b> '.Mage::helper('core')->formatDate($expired_time,'medium',false);
|
248 |
+
$expired_info = " <br/> ".$expired_info;
|
249 |
+
$this->setDBExpiredTime(Mage::helper('core')->formatDate($expired_time,'medium',false));
|
250 |
+
}
|
251 |
+
|
252 |
+
$html = str_replace('{{license_type}}',$licensetype,$html);
|
253 |
+
$html = str_replace('{{activated_time}}','<b>'.$helper->__('Active Date').':</b> '.$activetime,$html);
|
254 |
+
$html = str_replace('{{domains}}','<b>'.$helper->__('Domain').':</b> '.$info->getDomains(),$html);
|
255 |
+
$html = str_replace('{{expired_info}}',$expired_info,$html);
|
256 |
+
return $html;
|
257 |
+
}
|
258 |
+
|
259 |
+
public function getSumcode($reponse=null)
|
260 |
+
{
|
261 |
+
$reponse = $reponse ? $reponse : $this->getDBResponseCode();
|
262 |
+
return md5(date('Y-m-d').'$295@-abserve_checklicensekey'.$reponse);
|
263 |
+
}
|
264 |
+
|
265 |
+
/***********/
|
266 |
+
/* Use cookie for storeing license info */
|
267 |
+
/***********/
|
268 |
+
|
269 |
+
public function setCookieData($key,$value)
|
270 |
+
{
|
271 |
+
$cookie = Mage::getSingleton('core/cookie');
|
272 |
+
$cookie->set($key.'_'.$this->_extension,$value);
|
273 |
+
return $this;
|
274 |
+
}
|
275 |
+
|
276 |
+
public function getCookieData($key)
|
277 |
+
{
|
278 |
+
$cookie = Mage::getSingleton('core/cookie');
|
279 |
+
return $cookie->get($key.'_'.$this->_extension);
|
280 |
+
}
|
281 |
+
|
282 |
+
public function setCookieLicenseType($licenseType)
|
283 |
+
{
|
284 |
+
$cookie = Mage::getSingleton('core/cookie');
|
285 |
+
$cookie->set('licensetype_'.$this->_extension,$licenseType);
|
286 |
+
return $this;
|
287 |
+
}
|
288 |
+
|
289 |
+
public function getCookieLicenseType()
|
290 |
+
{
|
291 |
+
$cookie = Mage::getSingleton('core/cookie');
|
292 |
+
return $cookie->get('licensetype_'.$this->_extension);
|
293 |
+
}
|
294 |
+
|
295 |
+
public function getCookieLicenseKey()
|
296 |
+
{
|
297 |
+
$cookie = Mage::getSingleton('core/cookie');
|
298 |
+
return $cookie->get('licensekey_'.$this->_extension);
|
299 |
+
}
|
300 |
+
|
301 |
+
public function setCookieLicenseKey($key)
|
302 |
+
{
|
303 |
+
$cookie = Mage::getSingleton('core/cookie');
|
304 |
+
return $cookie->set('licensekey_'.$this->_extension,$key);
|
305 |
+
}
|
306 |
+
|
307 |
+
public function getCookieCheckdate()
|
308 |
+
{
|
309 |
+
$cookie = Mage::getSingleton('core/cookie');
|
310 |
+
return $cookie->get('checkdate_'.$this->_extension);
|
311 |
+
}
|
312 |
+
|
313 |
+
public function setCookieCheckdate($date)
|
314 |
+
{
|
315 |
+
$cookie = Mage::getSingleton('core/cookie');
|
316 |
+
return $cookie->set('checkdate_'.$this->_extension,$date);
|
317 |
+
}
|
318 |
+
|
319 |
+
public function getCookieSumcode()
|
320 |
+
{
|
321 |
+
$cookie = Mage::getSingleton('core/cookie');
|
322 |
+
return $cookie->get('sumcode_'.$this->_extension);
|
323 |
+
}
|
324 |
+
|
325 |
+
public function setCookieSumcode($sumcode)
|
326 |
+
{
|
327 |
+
$cookie = Mage::getSingleton('core/cookie');
|
328 |
+
return $cookie->set('sumcode_'.$this->_extension,$sumcode);
|
329 |
+
}
|
330 |
+
|
331 |
+
public function getCookieResponseCode()
|
332 |
+
{
|
333 |
+
$cookie = Mage::getSingleton('core/cookie');
|
334 |
+
return $cookie->get('reponsecode_'.$this->_extension);
|
335 |
+
}
|
336 |
+
|
337 |
+
public function setCookieResponseCode($reponseCode)
|
338 |
+
{
|
339 |
+
$cookie = Mage::getSingleton('core/cookie');
|
340 |
+
return $cookie->set('reponsecode_'.$this->_extension,$reponseCode);
|
341 |
+
}
|
342 |
+
|
343 |
+
public function getCookieIsvalid()
|
344 |
+
{
|
345 |
+
$cookie = Mage::getSingleton('core/cookie');
|
346 |
+
return $cookie->get('valid_'.$this->_extension);
|
347 |
+
}
|
348 |
+
|
349 |
+
public function setCookieIsvalid($isvalid)
|
350 |
+
{
|
351 |
+
$cookie = Mage::getSingleton('core/cookie');
|
352 |
+
return $cookie->set('valid_'.$this->_extension,$isvalid);
|
353 |
+
}
|
354 |
+
|
355 |
+
/* End of using cookie for storeing license info */
|
356 |
+
|
357 |
+
|
358 |
+
/***********/
|
359 |
+
/*Use database for storeing license info*/
|
360 |
+
/***********/
|
361 |
+
|
362 |
+
public function setDBLicenseType($licenseType)
|
363 |
+
{
|
364 |
+
$this->_getLogger()->setData('license_type',$licenseType);
|
365 |
+
}
|
366 |
+
|
367 |
+
public function getDBLicenseType()
|
368 |
+
{
|
369 |
+
return $this->_getLogger()->getData('license_type');
|
370 |
+
}
|
371 |
+
|
372 |
+
public function setDBLicenseKey($key)
|
373 |
+
{
|
374 |
+
$this->_getLogger()->setData('license_key',$key);
|
375 |
+
}
|
376 |
+
|
377 |
+
public function getDBLicenseKey()
|
378 |
+
{
|
379 |
+
return $this->_getLogger()->getData('license_key');
|
380 |
+
}
|
381 |
+
|
382 |
+
public function setDBCheckdate($checkdate)
|
383 |
+
{
|
384 |
+
$this->_getLogger()->setData('check_date',$checkdate);
|
385 |
+
}
|
386 |
+
|
387 |
+
public function getDBCheckdate()
|
388 |
+
{
|
389 |
+
return $this->_getLogger()->getData('check_date');
|
390 |
+
}
|
391 |
+
|
392 |
+
public function setDBSumCode($sumcode)
|
393 |
+
{
|
394 |
+
$this->_getLogger()->setData('sum_code',$sumcode);
|
395 |
+
}
|
396 |
+
|
397 |
+
public function getDBSumCode()
|
398 |
+
{
|
399 |
+
return $this->_getLogger()->getData('sum_code');
|
400 |
+
}
|
401 |
+
|
402 |
+
public function setDBResponseCode($response_code)
|
403 |
+
{
|
404 |
+
$this->_getLogger()->setData('response_code',$response_code);
|
405 |
+
}
|
406 |
+
|
407 |
+
public function getDBResponseCode()
|
408 |
+
{
|
409 |
+
return $this->_getLogger()->getData('response_code');
|
410 |
+
}
|
411 |
+
|
412 |
+
public function setDBIsvalid($is_valid)
|
413 |
+
{
|
414 |
+
$this->_getLogger()->setData('is_valid',$is_valid);
|
415 |
+
}
|
416 |
+
|
417 |
+
public function getDBIsvalid()
|
418 |
+
{
|
419 |
+
return $this->_getLogger()->getData('is_valid');
|
420 |
+
}
|
421 |
+
|
422 |
+
public function setDBExpiredTime($expired_time)
|
423 |
+
{
|
424 |
+
$this->_getLogger()->setData('expired_time',$expired_time);
|
425 |
+
}
|
426 |
+
|
427 |
+
public function getDBExpiredTime()
|
428 |
+
{
|
429 |
+
return $this->_getLogger()->getData('expired_time');
|
430 |
+
}
|
431 |
+
|
432 |
+
protected function _getLogger()
|
433 |
+
{
|
434 |
+
//if($this->_logger == null){
|
435 |
+
if (!isset($this->_logger[$this->_extension])){
|
436 |
+
$this->_logger[$this->_extension] = Mage::getResourceModel('magenotification/logger_collection')
|
437 |
+
->addFieldToFilter('extension_code',$this->_extension)
|
438 |
+
->getFirstItem();
|
439 |
+
$this->_logger[$this->_extension]->setData('extension_code',$this->_extension);
|
440 |
+
}
|
441 |
+
return $this->_logger[$this->_extension];
|
442 |
+
}
|
443 |
+
|
444 |
+
protected function _saveLicenseLog()
|
445 |
+
{
|
446 |
+
if($this->_extension != null){
|
447 |
+
$this->_getLogger()->save();
|
448 |
+
}
|
449 |
+
}
|
450 |
+
|
451 |
+
/* End of using database for storeing license info */
|
452 |
+
|
453 |
+
public function getDomain($baseUrl){
|
454 |
+
$parseUrl = parse_url(trim($baseUrl));
|
455 |
+
$domain = trim($parseUrl['host'] ? $parseUrl['host'] : array_shift(explode('/', $parseUrl['path'], 2)));
|
456 |
+
if (strpos($domain,'www.') === 0) $domain = substr($domain,4);
|
457 |
+
return $domain;
|
458 |
+
}
|
459 |
+
|
460 |
+
public function getExtensionList()
|
461 |
+
{
|
462 |
+
$list = array();
|
463 |
+
$modules = (array) Mage::getConfig()->getNode('modules')->children();
|
464 |
+
|
465 |
+
foreach ($modules as $moduleName => $moduleInfo) {
|
466 |
+
if ($moduleName==='Abserve_Magenotification') {
|
467 |
+
continue;
|
468 |
+
}
|
469 |
+
if(strpos('a'.$moduleName,'Abserve') == 0){
|
470 |
+
continue;
|
471 |
+
}
|
472 |
+
if((string)$moduleInfo->codePool != 'community'){
|
473 |
+
continue;
|
474 |
+
}
|
475 |
+
$moduleName = str_replace('Abserve_','',$moduleName);
|
476 |
+
$list[$moduleName] = $moduleName;
|
477 |
+
}
|
478 |
+
return $list;
|
479 |
+
}
|
480 |
+
|
481 |
+
public function getExtensionOption()
|
482 |
+
{
|
483 |
+
$options = array();
|
484 |
+
$list = $this->getExtensionList();
|
485 |
+
if(count($list)){
|
486 |
+
foreach($list as $key=>$item){
|
487 |
+
$options[] = array('value'=>$key,'label'=>$item);
|
488 |
+
}
|
489 |
+
}
|
490 |
+
return $options;
|
491 |
+
}
|
492 |
+
|
493 |
+
public function getFeedbackStatusList()
|
494 |
+
{
|
495 |
+
$list = array();
|
496 |
+
$list[1] = $this->__('Approved');
|
497 |
+
$list[2] = $this->__('Canceled');
|
498 |
+
$list[3] = $this->__('Pending');
|
499 |
+
return $list;
|
500 |
+
}
|
501 |
+
|
502 |
+
public function getFeedbackStatusOption()
|
503 |
+
{
|
504 |
+
$options = array();
|
505 |
+
$list = $this->getFeedbackStatusList();
|
506 |
+
if(count($list)){
|
507 |
+
foreach($list as $key=>$item){
|
508 |
+
$options[] = array('value'=>$key,'label'=>$item);
|
509 |
+
}
|
510 |
+
}
|
511 |
+
return $options;
|
512 |
+
}
|
513 |
+
|
514 |
+
public function getExtensionVersion($extension)
|
515 |
+
{
|
516 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
517 |
+
$modules = (array) $modules;
|
518 |
+
if(isset($modules[$extension])){
|
519 |
+
return (string)$modules[$extension]->version;
|
520 |
+
}
|
521 |
+
if(isset($modules['Abserve_'.$extension])){
|
522 |
+
return (string)$modules['Abserve_'.$extension]->version;
|
523 |
+
}
|
524 |
+
return null;
|
525 |
+
}
|
526 |
+
|
527 |
+
public function getExtensionName($extension)
|
528 |
+
{
|
529 |
+
if(strpos('a'.$extension,'Abserve')){
|
530 |
+
$arrName = explode('_',$extension);
|
531 |
+
$extension = isset($arrName[1]) ? $arrName[1] : str_replace('Abserve','',$extension);
|
532 |
+
}
|
533 |
+
return $extension;
|
534 |
+
}
|
535 |
+
|
536 |
+
public function getInvalidKeyNotice()
|
537 |
+
{
|
538 |
+
$extensionkey_link = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/system_config/edit',array('section'=>'magenotificationsecure','_secure'=>true));
|
539 |
+
$extensionkey_link = '<a href="'.$extensionkey_link.'">'.$this->__('extension key management section').'</a>';
|
540 |
+
$message = $this->getErrorMessage();
|
541 |
+
$message = $message ? $message : $this->__('Invalid License Key');
|
542 |
+
$message .= '! '.$this->__('Please go to %s for more information.',$extensionkey_link);
|
543 |
+
$message = '<div id="messages"><ul class="messages"><li class="error-msg"><ul><li>'.$message.'</li></ul></li></ul></div>';
|
544 |
+
return $message;
|
545 |
+
}
|
546 |
+
|
547 |
+
public function getLicenseKeyError($error_code)
|
548 |
+
{
|
549 |
+
switch($error_code){
|
550 |
+
case Abserve_Magenotification_Model_Keygen::GENERAL_ERROR :
|
551 |
+
return $this->__('Invalid License Key');
|
552 |
+
case Abserve_Magenotification_Model_Keygen::NOT_EXIST_LICENSE_KEY_ERROR :
|
553 |
+
return $this->__('Invalid License Key');
|
554 |
+
case Abserve_Magenotification_Model_Keygen::DISABLED_LICENSE_KEY_ERROR :
|
555 |
+
return $this->__('Invalid License Key');
|
556 |
+
case Abserve_Magenotification_Model_Keygen::EXPIRED_TRIAL_LICENSE_KEY_ERROR :
|
557 |
+
return $this->__('Expired License');
|
558 |
+
case Abserve_Magenotification_Model_Keygen::LIMITED_DOMAIN_ERROR :
|
559 |
+
return $this->__('License key does not match');
|
560 |
+
}
|
561 |
+
return null;
|
562 |
+
}
|
563 |
+
|
564 |
+
}
|
app/code/community/Abserve/Magenotification/Helper/Feedback.php
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Helper_Feedback extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
public function getResumeCode($feedbackcode)
|
15 |
+
{
|
16 |
+
return md5($feedbackcode.'abserve-extension-feedback-59*47@');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function postFeedback($feedback)
|
20 |
+
{
|
21 |
+
$baseUrl = Mage::getBaseUrl();
|
22 |
+
$resume = $this->getResumeCode($feedback->getCode());
|
23 |
+
$customeremail = Mage::getStoreConfig('abserve_extension_feedback/email/contactemail');
|
24 |
+
$customername = Mage::getStoreConfig('abserve_extension_feedback/email/contactname');
|
25 |
+
if(!$customeremail){
|
26 |
+
$customeremail = Mage::getStoreConfig('trans_email/ident_general/email');
|
27 |
+
$customername = Mage::getStoreConfig('trans_email/ident_general/name');
|
28 |
+
}
|
29 |
+
/* try{
|
30 |
+
$xmlRpc = new Zend_XmlRpc_Client(Abserve_Magenotification_Model_Keygen::SERVER_URL.'api/xmlrpc/');
|
31 |
+
$session = $xmlRpc->call('login', array('username'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_USER,'password'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_PASS));
|
32 |
+
$result = $xmlRpc->call('call', array('sessionId' => $session,
|
33 |
+
'apiPath' => 'licensemanager_extensionfeedback.feedbackupdate',
|
34 |
+
'args' => array( $baseUrl,
|
35 |
+
$feedback->getCode(),
|
36 |
+
$feedback->getExtension(),
|
37 |
+
$feedback->getExtensionVersion(),
|
38 |
+
$feedback->getContent(),
|
39 |
+
$feedback->getFile(),
|
40 |
+
$feedback->getMessage(),
|
41 |
+
$customeremail,
|
42 |
+
$customername,
|
43 |
+
$resume,
|
44 |
+
)));
|
45 |
+
if((int)$result < 210){ //error
|
46 |
+
throw new Exception($this->__('Can not sent feedback! Please try later').$result);
|
47 |
+
}
|
48 |
+
} catch(Exception $e){
|
49 |
+
throw new Exception($this->__('Can not sent feedback! Please try later').'<br/>'.$e->getMessage());
|
50 |
+
} */
|
51 |
+
}
|
52 |
+
|
53 |
+
public function postMessage($message)
|
54 |
+
{
|
55 |
+
$resume = $this->getResumeCode($message->getFeedbackCode());
|
56 |
+
$customeremail = Mage::getStoreConfig('abserve_extension_feedback/email/contactemail');
|
57 |
+
$customername = Mage::getStoreConfig('abserve_extension_feedback/email/contactname');
|
58 |
+
if(!$customeremail){
|
59 |
+
$customeremail = Mage::getStoreConfig('trans_email/ident_general/email');
|
60 |
+
$customername = Mage::getStoreConfig('trans_email/ident_general/name');
|
61 |
+
}
|
62 |
+
/* try{
|
63 |
+
$xmlRpc = new Zend_XmlRpc_Client(Abserve_Magenotification_Model_Keygen::SERVER_URL.'api/xmlrpc/');
|
64 |
+
$session = $xmlRpc->call('login', array('username'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_USER,'password'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_PASS));
|
65 |
+
$result = $xmlRpc->call('call', array('sessionId' => $session,
|
66 |
+
'apiPath' => 'licensemanager_extensionfeedback.addmessage',
|
67 |
+
'args' => array( $message->getFeedbackCode(),
|
68 |
+
$customername,
|
69 |
+
$message->getMessage(),
|
70 |
+
$message->getFile(),
|
71 |
+
$message->getPostedTime(),
|
72 |
+
$resume,
|
73 |
+
)));
|
74 |
+
if((int)$result < 210){ //error
|
75 |
+
throw new Exception($this->__('Can not sent message! Please try later').$result);
|
76 |
+
}
|
77 |
+
} catch(Exception $e){
|
78 |
+
throw new Exception($this->__('Can not sent message! Please try later').'<br/>'.$e->getMessage());
|
79 |
+
} */
|
80 |
+
}
|
81 |
+
|
82 |
+
public function updateFeedback($feedback)
|
83 |
+
{
|
84 |
+
$resume = $this->getResumeCode($feedback->getCode());
|
85 |
+
/* try{
|
86 |
+
$xmlRpc = new Zend_XmlRpc_Client(Abserve_Magenotification_Model_Keygen::SERVER_URL.'api/xmlrpc/');
|
87 |
+
$session = $xmlRpc->call('login', array('username'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_USER,'password'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_PASS));
|
88 |
+
$result = $xmlRpc->call('call', array('sessionId' => $session,
|
89 |
+
'apiPath' => 'licensemanager_extensionfeedback.feedbackinfo',
|
90 |
+
'args' => array($feedback->getCode(),
|
91 |
+
$resume,
|
92 |
+
)));
|
93 |
+
$feedback->updateData($result);
|
94 |
+
} catch(Exception $e){
|
95 |
+
Mage::getSingleton('core/session')->addError($e->getMessage());
|
96 |
+
} */
|
97 |
+
}
|
98 |
+
|
99 |
+
public function needUpdate($feedback)
|
100 |
+
{
|
101 |
+
if(!$feedback->getId())
|
102 |
+
return false;
|
103 |
+
$updated = $feedback->getUpdated();
|
104 |
+
if((int)$updated + 60 < time()){
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getSentStatusList()
|
111 |
+
{
|
112 |
+
$list = array();
|
113 |
+
$list[1] = $this->__('Sent');
|
114 |
+
$list[2] = $this->__('Not Sent');
|
115 |
+
return $list;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getSentStatusOption()
|
119 |
+
{
|
120 |
+
$options = array();
|
121 |
+
$list = $this->getSentStatusList();
|
122 |
+
if(count($list)){
|
123 |
+
foreach($list as $key=>$item){
|
124 |
+
$options[] = array('value'=>$key,'label'=>$item);
|
125 |
+
}
|
126 |
+
}
|
127 |
+
return $options;
|
128 |
+
}
|
129 |
+
}
|
app/code/community/Abserve/Magenotification/Helper/License.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Helper_License extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
public function getResumeCode($licensekey)
|
15 |
+
{
|
16 |
+
return md5($licensekey.'abserve-extension-upgrade-license-59*47@');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getUpgradePrice($licensekey,$licensetype)
|
20 |
+
{
|
21 |
+
$resume = $this->getResumeCode($licensekey);
|
22 |
+
/* try{
|
23 |
+
$xmlRpc = new Zend_XmlRpc_Client(Abserve_Magenotification_Model_Keygen::SERVER_URL.'api/xmlrpc/');
|
24 |
+
$session = $xmlRpc->call('login', array('username'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_USER,'password'=>Abserve_Magenotification_Model_Keygen::WEBSERVICE_PASS));
|
25 |
+
$result = $xmlRpc->call('call', array('sessionId' => $session,
|
26 |
+
'apiPath' => 'licensemanager.getupgradeprice',
|
27 |
+
'args' => array( $licensekey,
|
28 |
+
$licensetype,
|
29 |
+
$resume,
|
30 |
+
)));
|
31 |
+
if(!$result){ //error
|
32 |
+
throw new Exception($this->__('Error! please try again.'));
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
return $result;
|
36 |
+
} catch(Exception $e){
|
37 |
+
throw new Exception($this->__('Error! please try again.').'<br/>'.$e->getMessage());
|
38 |
+
} */
|
39 |
+
}
|
40 |
+
}
|
app/code/community/Abserve/Magenotification/Helper/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Config.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Config extends Varien_Simplexml_Config
|
13 |
+
{
|
14 |
+
const COMMERCIAL_LICENSE = 'commercial';
|
15 |
+
const DEPEND_LICENSE = 'depend';
|
16 |
+
const TRIAL_LICENSE = 'trial';
|
17 |
+
const FREE_LICENSE = 'free';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Init License Config Information
|
21 |
+
* XML Path: app/code/community/Abserve/license_certificates
|
22 |
+
*
|
23 |
+
* @param type $sourceData
|
24 |
+
*/
|
25 |
+
public function __construct($sourceData=null)
|
26 |
+
{
|
27 |
+
$certificateFolder = 'app/code/community/Abserve/license_certificates';
|
28 |
+
$certificateFolder = str_replace('/', DS, $certificateFolder);
|
29 |
+
$configFiles = glob(BP . DS . $certificateFolder . DS . '*.xml');
|
30 |
+
$this->loadFile(current($configFiles));
|
31 |
+
while ($file = next($configFiles)) {
|
32 |
+
$merge = new Varien_Simplexml_Config;
|
33 |
+
$merge->loadFile($file);
|
34 |
+
$this->extend($merge);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Feedback.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Feedback extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/feedback');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function updateData($data)
|
21 |
+
{
|
22 |
+
$is_updated = false;
|
23 |
+
$dataObject = new Varien_Object($data);
|
24 |
+
$feedbackDataObject = new Varien_Object($dataObject->getFeedback());
|
25 |
+
$messages = $dataObject->getMessage();
|
26 |
+
|
27 |
+
$helper = Mage::helper('magenotification');
|
28 |
+
|
29 |
+
// update feedback
|
30 |
+
if($feedbackDataObject->getStatus() != $this->getStatus()){
|
31 |
+
$this->setStatus($feedbackDataObject->getStatus());
|
32 |
+
$is_updated = true;
|
33 |
+
}
|
34 |
+
|
35 |
+
if($feedbackDataObject->getCouponCode() != $this->getCouponCode()){
|
36 |
+
$this->setCouponCode($feedbackDataObject->getCouponCode());
|
37 |
+
$is_updated = true;
|
38 |
+
}
|
39 |
+
|
40 |
+
if($feedbackDataObject->getCouponValue() != $this->getCouponValue()){
|
41 |
+
$this->setCouponValue($feedbackDataObject->getCouponValue());
|
42 |
+
$is_updated = true;
|
43 |
+
}
|
44 |
+
|
45 |
+
if($feedbackDataObject->getExpiredCoupon() != $this->getExpiredCoupon()){
|
46 |
+
$this->setExpiredCoupon($feedbackDataObject->getExpiredCoupon());
|
47 |
+
$is_updated = true;
|
48 |
+
}
|
49 |
+
|
50 |
+
$this->setUpdated(time());
|
51 |
+
$this->save();
|
52 |
+
|
53 |
+
//update message
|
54 |
+
if(count($messages)){
|
55 |
+
$messageModel = Mage::getModel('magenotification/feedbackmessage');
|
56 |
+
foreach($messages as $message){
|
57 |
+
$messageDataObject = new Varien_Object($message);
|
58 |
+
$messageModel->import($messageDataObject);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getMessages()
|
66 |
+
{
|
67 |
+
return Mage::getResourceModel('magenotification/feedbackmessage_collection')
|
68 |
+
->addFieldToFilter('feedback_code',$this->getCode())
|
69 |
+
->setOrder('posted_time','DESC');
|
70 |
+
}
|
71 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Feedbackmessage.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Feedbackmessage extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/feedbackmessage');
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getAttachedFile()
|
21 |
+
{
|
22 |
+
$html = '';
|
23 |
+
$attachedfiles = $this->getFile();
|
24 |
+
if($attachedfiles){
|
25 |
+
$attachedfiles = explode(',',$attachedfiles);
|
26 |
+
$siteUrl = ((int)$this->getIsCustomer() == 1) ? Mage::getBaseUrl() : Abserve_Magenotification_Model_Keygen::SERVER_URL;
|
27 |
+
$siteUrl = str_replace('index.php/','',$siteUrl);
|
28 |
+
if(count($attachedfiles)){
|
29 |
+
$count = 1;
|
30 |
+
foreach($attachedfiles as $attachedfile){
|
31 |
+
$html .= '<br/>'.($count++).'. <a href="'.$siteUrl.'media/feedback'.$attachedfile.'">'.$this->getFileName($attachedfile).'</a>';
|
32 |
+
}
|
33 |
+
}
|
34 |
+
$html .= '<br/><br/>';
|
35 |
+
}
|
36 |
+
return $html;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getFileName($path)
|
40 |
+
{
|
41 |
+
return substr($path,strrpos($path,'/')+1);
|
42 |
+
}
|
43 |
+
|
44 |
+
public function import($dataObject)
|
45 |
+
{
|
46 |
+
$message = $this->getCollection()
|
47 |
+
->addFieldToFilter('feedback_code',$dataObject->getFeedbackCode())
|
48 |
+
->addFieldToFilter('message',$dataObject->getMessage())
|
49 |
+
->addFieldToFilter('file',$dataObject->getFile())
|
50 |
+
->getFirstItem()
|
51 |
+
;
|
52 |
+
if(!$message->getId()){
|
53 |
+
$dataObject->setFeedbackmessageId(null);
|
54 |
+
$message->addData($dataObject->getData())
|
55 |
+
->save();
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Keygen.php
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Keygen
|
13 |
+
{
|
14 |
+
const DOMAIN1 = 1;
|
15 |
+
const DOMAIN2 = 2;
|
16 |
+
const DOMAIN5 = 3;
|
17 |
+
const DOMAIN10 = 4;
|
18 |
+
const UNLIMITED = 5;
|
19 |
+
const DEVELOPER = 6;
|
20 |
+
const DEVELOPMENT = 7;
|
21 |
+
const TRIAL_VERSION = 10;
|
22 |
+
|
23 |
+
const GENERAL_ERROR = 200;
|
24 |
+
const NOT_EXIST_LICENSE_KEY_ERROR = 201;
|
25 |
+
const DISABLED_LICENSE_KEY_ERROR = 202;
|
26 |
+
const EXPIRED_TRIAL_LICENSE_KEY_ERROR = 203;
|
27 |
+
const LIMITED_DOMAIN_ERROR = 204;
|
28 |
+
const NEW_DOMAIN_SUCCESS = 210;
|
29 |
+
const EXISTED_DOMAIN_SUCCESS = 211;
|
30 |
+
const SUB_DOMAIN_SUCCESS = 212;
|
31 |
+
|
32 |
+
const SERVER_NAME = 'MageStore.com';
|
33 |
+
const SERVER_URL = 'http://www.abserve.com/';
|
34 |
+
const WEBSERVICE_USER = 'license_checker';
|
35 |
+
const WEBSERVICE_PASS = 'Ki97@M0$l!';
|
36 |
+
|
37 |
+
private $_publicKey = '-----BEGIN PUBLIC KEY-----
|
38 |
+
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ8EDi+a0lilUChsDba33FrcHLZZZIMx
|
39 |
+
T7XhyEP3J3llQXNJkflG+5GzBvFTd+B1pvpc45WOktNReyPDZ/OMNukCAwEAAQ==
|
40 |
+
-----END PUBLIC KEY-----';
|
41 |
+
|
42 |
+
public function checkLicenseKey($licensekey,$extensionName,$domain){
|
43 |
+
if ($licenseInfo = $this->getLicenseInfo($licensekey,$extensionName,$domain)){
|
44 |
+
if ($licenseInfo->getResponseCode() == 101) return self::NEW_DOMAIN_SUCCESS;
|
45 |
+
return $licenseInfo->getResponseCode();
|
46 |
+
}
|
47 |
+
return self::GENERAL_ERROR;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getLicenseInfo($licensekey,$extensionName,$domain){
|
51 |
+
$licensekey = trim($licensekey);
|
52 |
+
// check license for old license key
|
53 |
+
if ($oldLicenseInfo = $this->_decrypt($licensekey)){
|
54 |
+
$license = Mage::getModel('magenotification/license')->loadByLicenseExtension($licensekey,$extensionName);
|
55 |
+
if (!$license->getId()){
|
56 |
+
// Request first time when using old license key
|
57 |
+
try {
|
58 |
+
$xmlRpc = new Zend_XmlRpc_Client(self::SERVER_URL.'api/xmlrpc/');
|
59 |
+
$session = $xmlRpc->call('login', array('username' => self::WEBSERVICE_USER,
|
60 |
+
'password' => self::WEBSERVICE_PASS));
|
61 |
+
$result = $xmlRpc->call('call', array('sessionId' => $session,
|
62 |
+
'apiPath' => 'licensemanager.active',
|
63 |
+
'args' => array($licensekey,$extensionName,$domain)));
|
64 |
+
$dataObject = new Varien_Object($result);
|
65 |
+
} catch (Exception $e){
|
66 |
+
return new Varien_Object(array('response_code' => 101));
|
67 |
+
}
|
68 |
+
$license->setResponseCode($dataObject->getResponseCode())
|
69 |
+
->setDomains($dataObject->getDomains());
|
70 |
+
if ($dataObject->getActivatedTime()){
|
71 |
+
$license->setActiveAt(substr($dataObject->getActivatedTime(),0,10));
|
72 |
+
} else {
|
73 |
+
$license->setActiveAt(now(true));
|
74 |
+
}
|
75 |
+
try {
|
76 |
+
$license->setSumCode($this->_getSumCode($license));
|
77 |
+
$license->save();
|
78 |
+
} catch(Exception $e) {}
|
79 |
+
return $dataObject;
|
80 |
+
}
|
81 |
+
$result = new Varien_Object($license->getData());
|
82 |
+
$result->addData(array(
|
83 |
+
'users' => 1,
|
84 |
+
'created_time' => date('Y-m-d H:m:s',$oldLicenseInfo['created_time']),
|
85 |
+
'activated_time' => $license->getActiveAt(),
|
86 |
+
'type' => $oldLicenseInfo['type'],
|
87 |
+
'status' => 1,
|
88 |
+
'expired_time' => $oldLicenseInfo['expired_time'],
|
89 |
+
));
|
90 |
+
if ($license->getSumCode() != $this->_getSumCode($license)){
|
91 |
+
try {
|
92 |
+
$license->setResponseCode(self::GENERAL_ERROR);
|
93 |
+
$license->setSumCode($this->_getSumCode($license))->save();
|
94 |
+
} catch (Exception $e){}
|
95 |
+
} elseif ($result->getType() == self::TRIAL_VERSION && $license->getResponseCode() > self::LIMITED_DOMAIN_ERROR){
|
96 |
+
$expiredTime = strtotime($license->getActiveAt()) + (int)$result->getExpiredTime() * 24*3600;
|
97 |
+
if ($expiredTime < time()){
|
98 |
+
try {
|
99 |
+
$license->setResponseCode(self::EXPIRED_TRIAL_LICENSE_KEY_ERROR);
|
100 |
+
$license->setSumCode($this->_getSumCode($license))->save();
|
101 |
+
} catch (Exception $e){}
|
102 |
+
}
|
103 |
+
}
|
104 |
+
return $result->setResponseCode($license->getResponseCode());
|
105 |
+
}
|
106 |
+
// check new license key
|
107 |
+
if ($licenseInfo = $this->_newkeyDecrypt($licensekey,$extensionName,$domain)){
|
108 |
+
$license = Mage::getModel('magenotification/license')->loadByLicenseExtension($licensekey,$extensionName);
|
109 |
+
if (!$license->getId()){
|
110 |
+
$license->setActiveAt(now(true))
|
111 |
+
->setDomains($licenseInfo->getDomains());
|
112 |
+
$responseCode = self::NEW_DOMAIN_SUCCESS;
|
113 |
+
$licenseDomain = (strlen($domain) > 38) ? substr($domain,0,38) : $domain;
|
114 |
+
if ($licenseDomain != $licenseInfo->getDomains())
|
115 |
+
$responseCode = self::LIMITED_DOMAIN_ERROR;
|
116 |
+
try {
|
117 |
+
$license->setResponseCode($responseCode);
|
118 |
+
$license->setSumCode($this->_getSumCode($license))->save();
|
119 |
+
} catch (Exception $e){}
|
120 |
+
}
|
121 |
+
$result = new Varien_Object($license->getData());
|
122 |
+
$createdTime = $licenseInfo->getCreatedDate() ? $licenseInfo->getCreatedDate() : $license->getActiveAt();
|
123 |
+
$result->addData(array(
|
124 |
+
'users' => 1,
|
125 |
+
'created_time' => date('Y-m-d H:m:s',strtotime($createdTime)),
|
126 |
+
'activated_time' => $license->getActiveAt(),
|
127 |
+
'type' => $this->getOldLicenseType($licenseInfo->getType()),
|
128 |
+
'status' => 1,
|
129 |
+
'expired_time' => $licenseInfo->getExpiredTime(),
|
130 |
+
));
|
131 |
+
if ($license->getSumCode() != $this->_getSumCode($license)){
|
132 |
+
try {
|
133 |
+
$license->setResponseCode(self::GENERAL_ERROR);
|
134 |
+
$license->setSumCode($this->_getSumCode($license))->save();
|
135 |
+
} catch (Exception $e){}
|
136 |
+
} elseif (($result->getType() == self::TRIAL_VERSION || $result->getType() == self::DEVELOPMENT)
|
137 |
+
&& $license->getResponseCode() > self::LIMITED_DOMAIN_ERROR){
|
138 |
+
$expiredTime = strtotime($license->getActiveAt()) + (int)$result->getExpiredTime() * 24*3600;
|
139 |
+
if ($expiredTime < time()){
|
140 |
+
try {
|
141 |
+
$license->setResponseCode(self::EXPIRED_TRIAL_LICENSE_KEY_ERROR);
|
142 |
+
$license->setSumCode($this->_getSumCode($license))->save();
|
143 |
+
} catch (Exception $e){}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
return $result->setResponseCode($license->getResponseCode());
|
147 |
+
}
|
148 |
+
return new Varien_Object(array('response_code' => self::GENERAL_ERROR));
|
149 |
+
}
|
150 |
+
|
151 |
+
public function getOldLicenseType($newType){
|
152 |
+
if ($newType == 'C')
|
153 |
+
return self::DOMAIN1;
|
154 |
+
if ($newType == 'D')
|
155 |
+
return self::DEVELOPMENT;
|
156 |
+
return self::TRIAL_VERSION;
|
157 |
+
}
|
158 |
+
|
159 |
+
private function _newkeyDecrypt($licensekey,$extensionName,$domain){
|
160 |
+
if (strlen($licensekey) < 68) return false;
|
161 |
+
$crc32Pos = abs(crc32(substr($licensekey,0,10).$extensionName) & 0x7FFFFFFF % 49) + 10;
|
162 |
+
$crc32 = substr($licensekey,$crc32Pos,8);
|
163 |
+
$key = substr($licensekey,0,$crc32Pos).substr($licensekey,$crc32Pos+11);
|
164 |
+
try {
|
165 |
+
$rsa = new Zend_Crypt_Rsa();
|
166 |
+
$publicKey = new Zend_Crypt_Rsa_Key_Public($this->_publicKey);
|
167 |
+
while(strlen($key)%4) $key .= '=';
|
168 |
+
$licenseString = $rsa->decrypt(base64_decode($key),$publicKey);
|
169 |
+
if (!$licenseString) return false;
|
170 |
+
if (substr($licenseString,0,3) != substr($licensekey,$crc32Pos+8,3)) return false;
|
171 |
+
$type = substr($licenseString,0,1);
|
172 |
+
$expiredTime = hexdec(substr($licenseString,1,2));
|
173 |
+
$extensionHash = substr($licenseString,3,8);
|
174 |
+
if ($extensionHash != hash('crc32',$extensionName)) return false;
|
175 |
+
$licenseDomain = trim(substr($licenseString,15));
|
176 |
+
if (hash('crc32',substr($licensekey,0,$crc32Pos).substr($licensekey,$crc32Pos+8).$extensionName.$licenseDomain) != $crc32) return false;
|
177 |
+
return new Varien_Object(array(
|
178 |
+
'type' => $type,
|
179 |
+
'created_date' => date('Y-m-d',hexdec(substr($licenseString,11,4))*24*3600),
|
180 |
+
'expired_time' => $expiredTime,
|
181 |
+
'domains' => $licenseDomain,
|
182 |
+
));
|
183 |
+
} catch (Exception $e) {
|
184 |
+
$licenseDomain = (strlen($domain) > 38) ? substr($domain,0,38) : $domain;
|
185 |
+
if (hash('crc32',substr($licensekey,0,$crc32Pos).substr($licensekey,$crc32Pos+8).$extensionName.$licenseDomain) != $crc32) return false;
|
186 |
+
$type = substr($licensekey,$crc32Pos+8,1);
|
187 |
+
$expiredTime = hexdec(substr($licensekey,$crc32Pos+9,2));
|
188 |
+
return new Varien_Object(array(
|
189 |
+
'type' => $type,
|
190 |
+
'expired_time' => $expiredTime,
|
191 |
+
'domains' => $licenseDomain,
|
192 |
+
));
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
private function _getSumCode($license){
|
197 |
+
return md5('start^'.$license->getLicenseKey().$license->getExtensionCode().$license->getActiveAt().$license->getResponseCode().'$end');
|
198 |
+
}
|
199 |
+
|
200 |
+
private function _decrypt($key)
|
201 |
+
{
|
202 |
+
$decrypted = base64_decode($key);
|
203 |
+
$decrypted = explode('****',$decrypted);
|
204 |
+
if(!isset($decrypted[0]) || !isset($decrypted[1]) || !isset($decrypted[2]) || !isset($decrypted[3]))
|
205 |
+
return false;
|
206 |
+
if (!preg_match('/^[a-f0-9]{32}$/',$decrypted[0])) return false;
|
207 |
+
if ($decrypted[3] < strtotime('2010-01-01 01:01:01')
|
208 |
+
|| $decrypted[3] > strtotime('2013-01-01 01:01:01')) return false;
|
209 |
+
return array(
|
210 |
+
'type' => $decrypted[1],
|
211 |
+
'expired_time' => $decrypted[2],
|
212 |
+
'created_time' => $decrypted[3],
|
213 |
+
);
|
214 |
+
}
|
215 |
+
|
216 |
+
static function getLicenseTitle($licensetype){
|
217 |
+
$helper = Mage::helper('magenotification');
|
218 |
+
if ($licensetype == self::TRIAL_VERSION)
|
219 |
+
return $helper->__('Trial License');
|
220 |
+
if ($licensetype == self::DEVELOPMENT)
|
221 |
+
return $helper->__('Development License');
|
222 |
+
return $helper->__('Commercial License');
|
223 |
+
}
|
224 |
+
}
|
app/code/community/Abserve/Magenotification/Model/License.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_License extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function _construct(){
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('magenotification/license');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function loadByLicenseExtension($licenseKey, $extensionName){
|
20 |
+
$item = $this->getCollection()
|
21 |
+
->addFieldToFilter('extension_code',$extensionName)
|
22 |
+
->addFieldToFilter('license_key',$licenseKey)
|
23 |
+
->getFirstItem();
|
24 |
+
if ($item && $item->getId()){
|
25 |
+
$this->addData($item->getData());
|
26 |
+
}
|
27 |
+
$this->setData('extension_code',$extensionName)
|
28 |
+
->setData('license_key',$licenseKey);
|
29 |
+
return $this;
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Logger.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Logger extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/logger');
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Magenotification.php
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Magenotification extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
const XML_FREQUENCY_PATH = 'magenotification/general/frequency';
|
15 |
+
const XML_LAST_UPDATE_PATH = 'magenotification/general/last_update';
|
16 |
+
const XML_MAGESTORE_URL_PATH = 'magenotification/general/abserve_url';
|
17 |
+
|
18 |
+
public function _construct()
|
19 |
+
{
|
20 |
+
parent::_construct();
|
21 |
+
$this->_init('magenotification/magenotification');
|
22 |
+
}
|
23 |
+
|
24 |
+
public function checkUpdate()
|
25 |
+
{
|
26 |
+
$timestamp = Mage::getModel('core/date')->timestamp(time());
|
27 |
+
|
28 |
+
if (($this->getFrequency() + $this->getLastUpdate()) > $timestamp)
|
29 |
+
{
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
$notificationXml = $this->getNotificationData();
|
34 |
+
$noticeData = array();
|
35 |
+
if ($notificationXml && $notificationXml->item)
|
36 |
+
{
|
37 |
+
foreach ($notificationXml->item as $item) {
|
38 |
+
$item_data = array(
|
39 |
+
'severity' => (int)$item->severity,
|
40 |
+
'date_added' => $this->getDate((string)$item->date_added),
|
41 |
+
'title' => (string)$item->title,
|
42 |
+
'description' => (string)$item->description,
|
43 |
+
'url' => (string)$item->url,
|
44 |
+
'added_date' => $this->getDate((string)$item->date_added),
|
45 |
+
'related_extensions' => strtolower($item->related_extensions)
|
46 |
+
);
|
47 |
+
|
48 |
+
if($this->allowGetFeed($item_data)){
|
49 |
+
$noticeData[] = $item_data;
|
50 |
+
}
|
51 |
+
}
|
52 |
+
if($noticeData)
|
53 |
+
{
|
54 |
+
$this->parse(array_reverse($noticeData));
|
55 |
+
|
56 |
+
$this->setLastUpdate();
|
57 |
+
}
|
58 |
+
}
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function allowGetFeed($item)
|
63 |
+
{
|
64 |
+
if($item['related_extensions'] == null || $item['related_extensions'] == '0'){
|
65 |
+
return true;
|
66 |
+
}
|
67 |
+
|
68 |
+
$modules = Mage::getConfig()->getNode('modules')->children();
|
69 |
+
foreach ($modules as $moduleName => $moduleInfo) {
|
70 |
+
if ($moduleName==='Mage_Adminhtml') {
|
71 |
+
continue;
|
72 |
+
}
|
73 |
+
if ($moduleName==='Abserve_Magenotification') {
|
74 |
+
continue;
|
75 |
+
}
|
76 |
+
if(strpos('a'.$moduleName,'Abserve') == 0){
|
77 |
+
continue;
|
78 |
+
}
|
79 |
+
$extension_code = str_replace('Abserve_','',$moduleName);
|
80 |
+
$related_extensions = explode(',',$item['related_extensions']);
|
81 |
+
if(count($related_extensions)){
|
82 |
+
foreach($related_extensions as $related_extension){
|
83 |
+
if(strtolower($related_extension) == strtolower($extension_code)){
|
84 |
+
return true;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
return false;
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getLastUpdate()
|
93 |
+
{
|
94 |
+
$timestring = Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);
|
95 |
+
return strtotime($timestring);
|
96 |
+
}
|
97 |
+
|
98 |
+
public function setLastUpdate()
|
99 |
+
{
|
100 |
+
$config = Mage::getModel('core/config');
|
101 |
+
$timestamp = Mage::getModel('core/date')->timestamp(time());
|
102 |
+
|
103 |
+
$config ->saveConfig(self::XML_LAST_UPDATE_PATH,$timestamp);
|
104 |
+
$config->cleanCache();
|
105 |
+
}
|
106 |
+
|
107 |
+
public function getFrequency()
|
108 |
+
{
|
109 |
+
return Mage::getStoreConfig(self::XML_FREQUENCY_PATH) * 3600;
|
110 |
+
}
|
111 |
+
|
112 |
+
public function getAbserveUrl()
|
113 |
+
{
|
114 |
+
$lastTimeNotice = strtotime($this->getLastNotice()->getAddedDate());
|
115 |
+
return Mage::getStoreConfig(self::XML_MAGESTORE_URL_PATH) .'/magenotification/service/getfeed3/lastupdatetime/'. $lastTimeNotice;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function getNotificationData()
|
119 |
+
{
|
120 |
+
$curl = new Varien_Http_Adapter_Curl();
|
121 |
+
$curl->setConfig(array(
|
122 |
+
'timeout' => 2
|
123 |
+
));
|
124 |
+
$curl->write(Zend_Http_Client::GET, $this->getAbserveUrl(), '1.0');
|
125 |
+
$data = $curl->read();
|
126 |
+
|
127 |
+
if ($data === false) {
|
128 |
+
return false;
|
129 |
+
}
|
130 |
+
$data = preg_split('/^\r?$/m', $data, 2);
|
131 |
+
$data = trim($data[1]);
|
132 |
+
$curl->close();
|
133 |
+
|
134 |
+
try {
|
135 |
+
$xml = new SimpleXMLElement($data);
|
136 |
+
}
|
137 |
+
catch (Exception $e) {
|
138 |
+
return false;
|
139 |
+
}
|
140 |
+
return $xml;
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getNotificationXml()
|
144 |
+
{
|
145 |
+
try {
|
146 |
+
$data = $this->getNotificationData();
|
147 |
+
$xml = new SimpleXMLElement($data);
|
148 |
+
}
|
149 |
+
catch (Exception $e) {
|
150 |
+
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?>');
|
151 |
+
}
|
152 |
+
|
153 |
+
return $xml;
|
154 |
+
}
|
155 |
+
|
156 |
+
public function getDate($rssDate)
|
157 |
+
{
|
158 |
+
return gmdate('Y-m-d H:i:s', strtotime($rssDate));
|
159 |
+
}
|
160 |
+
|
161 |
+
public function parse($data)
|
162 |
+
{
|
163 |
+
if(count($data))
|
164 |
+
{
|
165 |
+
try{
|
166 |
+
foreach($data as $item)
|
167 |
+
{
|
168 |
+
if(!$this->is_existedUrl($item['url']) )
|
169 |
+
{
|
170 |
+
$this->setData($item)->save();
|
171 |
+
$this->setId(null);
|
172 |
+
}
|
173 |
+
}
|
174 |
+
} catch(Exception $e) {
|
175 |
+
Mage::getSingleton('core/session')->addError($e->getMessage());
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
public function is_existedUrl($url)
|
181 |
+
{
|
182 |
+
$collection = $this->getCollection()
|
183 |
+
->addFieldToFilter('url',(string)$url);
|
184 |
+
if($collection->getSize())
|
185 |
+
return true;
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
|
189 |
+
public function getLastNotice()
|
190 |
+
{
|
191 |
+
$item = $this->getCollection()
|
192 |
+
->setOrder('added_date','DESC')
|
193 |
+
->getFirstItem();
|
194 |
+
return $item;
|
195 |
+
}
|
196 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Feedback extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
$this->_init('magenotification/feedback', 'feedback_id');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Abserve_Magenotification_Model_Mysql4_Feedback_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('magenotification/feedback');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedback/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Feedbackmessage extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
$this->_init('magenotification/feedbackmessage', 'feedbackmessage_id');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage/Collection.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Feedbackmessage_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/feedbackmessage');
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Feedbackmessage/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Mysql4/License.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_License extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
protected function _construct(){
|
15 |
+
$this->_init('magenotification/license', 'license_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/License/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_License_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
13 |
+
{
|
14 |
+
public function _construct(){
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('magenotification/license');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/License/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Logger.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Logger extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
$this->_init('magenotification/logger', 'log_id');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Logger/Collection.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Logger_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/logger');
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Logger/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Magenotification extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
protected function _construct()
|
15 |
+
{
|
16 |
+
$this->_init('magenotification/magenotification', 'magenotification_id');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification/Collection.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Mysql4_Magenotification_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('magenotification/magenotification');
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Mysql4/Magenotification/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Mysql4/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Observer.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Observer
|
13 |
+
{
|
14 |
+
public function controllerActionPredispatch($observer)
|
15 |
+
{
|
16 |
+
try{
|
17 |
+
Mage::getModel('magenotification/magenotification')->checkUpdate();
|
18 |
+
}catch(Exception $e){
|
19 |
+
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Rewrite/AdminnotificationMysql4Inbox.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Rewrite_AdminnotificationMysql4Inbox extends Mage_AdminNotification_Model_Mysql4_Inbox
|
13 |
+
{
|
14 |
+
public function loadLatestNotice(Mage_AdminNotification_Model_Inbox $object)
|
15 |
+
{
|
16 |
+
$select = $this->_getReadAdapter()->select()
|
17 |
+
->from($this->getMainTable())
|
18 |
+
->order($this->getIdFieldName() . ' desc')
|
19 |
+
->where('is_read <> 1')
|
20 |
+
->where('is_remove <> 1')
|
21 |
+
->limit(1);
|
22 |
+
|
23 |
+
$data = $this->_getReadAdapter()->fetchRow($select);
|
24 |
+
|
25 |
+
if ($data) {
|
26 |
+
$object->setData($data);
|
27 |
+
}
|
28 |
+
|
29 |
+
$this->_afterLoad($object);
|
30 |
+
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)
|
35 |
+
{
|
36 |
+
$select = $this->_getReadAdapter()->select()
|
37 |
+
->from($this->getMainTable(), array(
|
38 |
+
'severity' => 'severity',
|
39 |
+
'count_notice' => 'COUNT(' . $this->getIdFieldName() . ')'))
|
40 |
+
->group('severity')
|
41 |
+
->where('is_remove=?', 0)
|
42 |
+
->where('is_read=?', 0);
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
$return = array();
|
47 |
+
$rowSet = $this->_getReadAdapter()->fetchAll($select);
|
48 |
+
foreach ($rowSet as $row) {
|
49 |
+
$return[$row['severity']] = $row['count_notice'];
|
50 |
+
}
|
51 |
+
return $return;
|
52 |
+
}
|
53 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Rewrite/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Source/Time.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Source_Time extends Mage_Core_Model_Config_Data
|
13 |
+
{
|
14 |
+
protected function _afterLoad()
|
15 |
+
{
|
16 |
+
$value = (string)$this->getValue();
|
17 |
+
if($value == '')
|
18 |
+
{
|
19 |
+
$timestamp = $this->getTimestamp();
|
20 |
+
|
21 |
+
$html = date('Y-m-d H:i:s',$timestamp);
|
22 |
+
|
23 |
+
} else {
|
24 |
+
$html = date('Y-m-d H:i:s',intval($value));
|
25 |
+
}
|
26 |
+
|
27 |
+
$this->setValue($html);
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _beforeSave()
|
32 |
+
{
|
33 |
+
$value = $this->getValue();
|
34 |
+
$value = strtotime($value);
|
35 |
+
$this->setValue($value);
|
36 |
+
}
|
37 |
+
|
38 |
+
private function getTimestamp()
|
39 |
+
{
|
40 |
+
return Mage::getModel('core/date')->timestamp(time());
|
41 |
+
}
|
42 |
+
|
43 |
+
public function toOptionArray()
|
44 |
+
{
|
45 |
+
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Abserve/Magenotification/Model/Source/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/Model/Status.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Model_Status extends Varien_Object
|
13 |
+
{
|
14 |
+
const STATUS_ENABLED = 1;
|
15 |
+
const STATUS_DISABLED = 2;
|
16 |
+
|
17 |
+
static public function getOptionArray()
|
18 |
+
{
|
19 |
+
return array(
|
20 |
+
self::STATUS_ENABLED => Mage::helper('magenotification')->__('Enabled'),
|
21 |
+
self::STATUS_DISABLED => Mage::helper('magenotification')->__('Disabled')
|
22 |
+
);
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Abserve/Magenotification/Model/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/controllers/Adminhtml/FeedbackController.php
ADDED
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Adminhtml_FeedbackController extends Mage_Adminhtml_Controller_Action
|
13 |
+
{
|
14 |
+
|
15 |
+
protected function _initAction() {
|
16 |
+
$this->loadLayout()
|
17 |
+
->_setActiveMenu('system/abserve_extension')
|
18 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('Extension Feedbacks'), Mage::helper('adminhtml')->__('Extension Feedbacks'));
|
19 |
+
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function indexAction() {
|
24 |
+
$this->getResponse()->setRedirect('http://support.abserve.com/');
|
25 |
+
//$this->_initAction()
|
26 |
+
// ->renderLayout();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function resendAction()
|
30 |
+
{
|
31 |
+
$id = $this->getRequest()->getParam('id');
|
32 |
+
$feedback = Mage::getModel('magenotification/feedback')->load($id);
|
33 |
+
if($feedback->getId()){
|
34 |
+
if($feedback->getIsSent() == '1'){
|
35 |
+
Mage::getSingleton('core/session')->addNotice(Mage::helper('magenotification')->__('This feedback is already sent to Abserve.com'));
|
36 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback->getId()));
|
37 |
+
}
|
38 |
+
$feedback->setMessage($feedback->getLatestMessage());
|
39 |
+
try{
|
40 |
+
Mage::helper('magenotification/feedback')->postFeedback($feedback);
|
41 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('magenotification')->__('This feedback had been sent to Abserve.com'));
|
42 |
+
$feedback->setIsSent(1)
|
43 |
+
->save();
|
44 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback->getId()));
|
45 |
+
} catch(Exception $e) {
|
46 |
+
Mage::getSingleton('core/session')->addError($e->getMessage());
|
47 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback->getId()));
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('magenotification')->__('Item does not exist'));
|
52 |
+
$this->_redirect('*/*');
|
53 |
+
}
|
54 |
+
|
55 |
+
public function resendmessageAction()
|
56 |
+
{
|
57 |
+
$id = $this->getRequest()->getParam('id');
|
58 |
+
$feedback_id = $this->getRequest()->getParam('feedback_id');
|
59 |
+
$message = Mage::getModel('magenotification/feedbackmessage')->load($id);
|
60 |
+
if($message->getId()){
|
61 |
+
if((int)$message->getIsSent() == 1){
|
62 |
+
Mage::getSingleton('core/session')->addNotice(Mage::helper('magenotification')->__('This message is already sent'));
|
63 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback_id));
|
64 |
+
}
|
65 |
+
try{
|
66 |
+
Mage::helper('magenotification/feedback')->postMessage($message);
|
67 |
+
Mage::getSingleton('core/session')->addSuccess(Mage::helper('magenotification')->__('This message had been sent'));
|
68 |
+
$message->setIsSent(1)
|
69 |
+
->save();
|
70 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback_id));
|
71 |
+
} catch(Exception $e) {
|
72 |
+
Mage::getSingleton('core/session')->addError($e->getMessage());
|
73 |
+
return $this->_redirect('*/*/edit', array('id' => $feedback_id));
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('magenotification')->__('Item does not exist'));
|
78 |
+
$this->_redirect('*/*');
|
79 |
+
}
|
80 |
+
|
81 |
+
public function editAction(){
|
82 |
+
$id = $this->getRequest()->getParam('id');
|
83 |
+
$model = Mage::getModel('magenotification/feedback')->load($id);
|
84 |
+
if(Mage::helper('magenotification/feedback')->needUpdate($model)){
|
85 |
+
Mage::helper('magenotification/feedback')->updateFeedback($model);
|
86 |
+
}
|
87 |
+
|
88 |
+
if ($model->getId() || $id == 0) {
|
89 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
90 |
+
if (!empty($data)) {
|
91 |
+
$model->setData($data);
|
92 |
+
}
|
93 |
+
|
94 |
+
Mage::register('feedback_data', $model);
|
95 |
+
|
96 |
+
$this->loadLayout();
|
97 |
+
$this->_setActiveMenu('system/abserve_extension');
|
98 |
+
|
99 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Feedbacks Manager'), Mage::helper('adminhtml')->__('Feedbacks Manager'));
|
100 |
+
|
101 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
102 |
+
|
103 |
+
$this->_addContent($this->getLayout()->createBlock('magenotification/adminhtml_feedback_edit'))
|
104 |
+
->_addLeft($this->getLayout()->createBlock('magenotification/adminhtml_feedback_edit_tabs'));
|
105 |
+
|
106 |
+
$this->renderLayout();
|
107 |
+
} else {
|
108 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('magenotification')->__('Item does not exist'));
|
109 |
+
$this->_redirect('*/*/');
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
public function newAction() {
|
114 |
+
$this->_forward('edit');
|
115 |
+
}
|
116 |
+
|
117 |
+
public function saveAction(){
|
118 |
+
if ($data = $this->getRequest()->getPost()) {
|
119 |
+
$model = Mage::getModel('magenotification/feedback');
|
120 |
+
$model->load($this->getRequest()->getParam('id'));
|
121 |
+
$model->addData($data);
|
122 |
+
$helper = Mage::helper('magenotification');
|
123 |
+
//upload files
|
124 |
+
$attachedfiles = array();
|
125 |
+
if(count($_FILES)){
|
126 |
+
$path = Mage::getBaseDir('media').DS.'feedback';
|
127 |
+
foreach($_FILES as $fileId=>$file){
|
128 |
+
if(!$file['name'])
|
129 |
+
continue;
|
130 |
+
$uploader = new Varien_File_Uploader($fileId);
|
131 |
+
$uploader->setAllowRenameFiles(false);
|
132 |
+
$uploader->setFilesDispersion(true);
|
133 |
+
$uploader->save($path,$file['name']);
|
134 |
+
$attachedfiles[] = $uploader->getDispretionPath($file['name']).DS.$file['name'];
|
135 |
+
}
|
136 |
+
}
|
137 |
+
if(count($attachedfiles)){
|
138 |
+
$attachedfiles = implode(',',$attachedfiles);
|
139 |
+
$attachedfiles = str_replace(DS,'/',$attachedfiles);
|
140 |
+
$data['file'] = $attachedfiles;
|
141 |
+
}
|
142 |
+
//save message
|
143 |
+
$message = Mage::getModel('magenotification/feedbackmessage');
|
144 |
+
if($model->getId() && isset($data['message']) && $data['message']){
|
145 |
+
$message->setData($data)
|
146 |
+
->setFeedbackId($model->getId())
|
147 |
+
->setFeedbackCode($model->getCode())
|
148 |
+
->setPostedTime(now())
|
149 |
+
->setIsCustomer(1)
|
150 |
+
->setIsSent(2)
|
151 |
+
->setUser(Mage::getSingleton('admin/session')->getUser()->getUsername())
|
152 |
+
;
|
153 |
+
unset($data['file']);
|
154 |
+
}
|
155 |
+
|
156 |
+
$model->addData($data);
|
157 |
+
$model->setExtensionVersion($helper->getExtensionVersion($model->getExtension()));
|
158 |
+
if(!$model->getId()){
|
159 |
+
$code = strtoupper($helper->getDomain(Mage::getBaseUrl())).time();
|
160 |
+
$code = str_replace('WWW.','',$code);
|
161 |
+
$model->setCode($code);
|
162 |
+
}
|
163 |
+
if ($model->getCreated() == NULL || $model->getUpdated() == NULL) {
|
164 |
+
$model->setCreated(now());
|
165 |
+
}
|
166 |
+
// post feedback
|
167 |
+
if(!$model->getId() || ($model->getId() && $model->getMessage())){
|
168 |
+
try{
|
169 |
+
Mage::helper('magenotification/feedback')->postFeedback($model);
|
170 |
+
$model->setIsSent(1);
|
171 |
+
} catch (Exception $e) {
|
172 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
173 |
+
$model->setIsSent(2);
|
174 |
+
}
|
175 |
+
}
|
176 |
+
// post message
|
177 |
+
if($message->getData()){
|
178 |
+
try{
|
179 |
+
Mage::helper('magenotification/feedback')->postMessage($message);
|
180 |
+
$message->setIsSent(1);
|
181 |
+
} catch (Exception $e) {
|
182 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
183 |
+
$message->setIsSent(2);
|
184 |
+
}
|
185 |
+
}
|
186 |
+
try{
|
187 |
+
$model->save();
|
188 |
+
//save message
|
189 |
+
if($message->getData()){
|
190 |
+
$message->save();
|
191 |
+
}
|
192 |
+
|
193 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('magenotification')->__('Item was successfully saved'));
|
194 |
+
Mage::getSingleton('adminhtml/session')->setFormData(false);
|
195 |
+
|
196 |
+
if ($this->getRequest()->getParam('back')) {
|
197 |
+
$this->_redirect('*/*/edit', array('id' => $model->getId()));
|
198 |
+
return;
|
199 |
+
}
|
200 |
+
$this->_redirect('*/*/');
|
201 |
+
return;
|
202 |
+
} catch (Exception $e) {
|
203 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
204 |
+
Mage::getSingleton('adminhtml/session')->setFormData($data);
|
205 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
}
|
209 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('magenotification')->__('Unable to find item to save'));
|
210 |
+
$this->_redirect('*/*/');
|
211 |
+
}
|
212 |
+
|
213 |
+
public function deleteAction() {
|
214 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
215 |
+
try {
|
216 |
+
$model = Mage::getModel('magenotification/feedback');
|
217 |
+
|
218 |
+
$model->setId($this->getRequest()->getParam('id'))
|
219 |
+
->delete();
|
220 |
+
|
221 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
|
222 |
+
$this->_redirect('*/*/');
|
223 |
+
} catch (Exception $e) {
|
224 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
225 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
226 |
+
}
|
227 |
+
}
|
228 |
+
$this->_redirect('*/*/');
|
229 |
+
}
|
230 |
+
|
231 |
+
public function massDeleteAction() {
|
232 |
+
$feedbackIds = $this->getRequest()->getParam('feedback');
|
233 |
+
if(!is_array($feedbackIds)) {
|
234 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
|
235 |
+
} else {
|
236 |
+
try {
|
237 |
+
foreach ($feedbackIds as $feedbackId) {
|
238 |
+
$feedback = Mage::getModel('magenotification/feedback')->load($feedbackId);
|
239 |
+
$feedback->delete();
|
240 |
+
}
|
241 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(
|
242 |
+
Mage::helper('adminhtml')->__(
|
243 |
+
'Total of %d record(s) were successfully deleted', count($feedbackIds)
|
244 |
+
)
|
245 |
+
);
|
246 |
+
} catch (Exception $e) {
|
247 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
248 |
+
}
|
249 |
+
}
|
250 |
+
$this->_redirect('*/*/index');
|
251 |
+
}
|
252 |
+
|
253 |
+
public function massStatusAction()
|
254 |
+
{
|
255 |
+
$feedbackIds = $this->getRequest()->getParam('feedback');
|
256 |
+
if(!is_array($feedbackIds)) {
|
257 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
|
258 |
+
} else {
|
259 |
+
try {
|
260 |
+
foreach ($feedbackIds as $feedbackId) {
|
261 |
+
$feedback = Mage::getSingleton('magenotification/feedback')
|
262 |
+
->load($feedbackId)
|
263 |
+
->setStatus($this->getRequest()->getParam('status'))
|
264 |
+
->setIsMassupdate(true)
|
265 |
+
->save();
|
266 |
+
}
|
267 |
+
$this->_getSession()->addSuccess(
|
268 |
+
$this->__('Total of %d record(s) were successfully updated', count($feedbackIds))
|
269 |
+
);
|
270 |
+
} catch (Exception $e) {
|
271 |
+
$this->_getSession()->addError($e->getMessage());
|
272 |
+
}
|
273 |
+
}
|
274 |
+
$this->_redirect('*/*/index');
|
275 |
+
}
|
276 |
+
|
277 |
+
public function exportCsvAction()
|
278 |
+
{
|
279 |
+
$fileName = 'feedbacks.csv';
|
280 |
+
$content = $this->getLayout()->createBlock('magenotification/adminhtml_feedback_grid')
|
281 |
+
->getCsv();
|
282 |
+
|
283 |
+
$this->_sendUploadResponse($fileName, $content);
|
284 |
+
}
|
285 |
+
|
286 |
+
public function exportXmlAction()
|
287 |
+
{
|
288 |
+
$fileName = 'feedbacks.xml';
|
289 |
+
$content = $this->getLayout()->createBlock('magenotification/adminhtml_feedback_grid')
|
290 |
+
->getXml();
|
291 |
+
|
292 |
+
$this->_sendUploadResponse($fileName, $content);
|
293 |
+
}
|
294 |
+
|
295 |
+
protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
|
296 |
+
{
|
297 |
+
$response = $this->getResponse();
|
298 |
+
$response->setHeader('HTTP/1.1 200 OK','');
|
299 |
+
$response->setHeader('Pragma', 'public', true);
|
300 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
301 |
+
$response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
|
302 |
+
$response->setHeader('Last-Modified', date('r'));
|
303 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
304 |
+
$response->setHeader('Content-Length', strlen($content));
|
305 |
+
$response->setHeader('Content-type', $contentType);
|
306 |
+
$response->setBody($content);
|
307 |
+
$response->sendResponse();
|
308 |
+
die;
|
309 |
+
}
|
310 |
+
}
|
app/code/community/Abserve/Magenotification/controllers/Adminhtml/LicenseController.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Adminhtml_LicenseController extends Mage_Adminhtml_Controller_Action
|
13 |
+
{
|
14 |
+
public function upgradeAction()
|
15 |
+
{
|
16 |
+
$licensekey = $this->getRequest()->getParam('licensekey');
|
17 |
+
$licensetype = $this->getRequest()->getParam('licensetype');
|
18 |
+
$redirectUrl = Abserve_Magenotification_Model_Keygen::SERVER_URL.'licensemanager/license/upgrade/licensekey/'.$licensekey.'/licensetype/'.$licensetype;
|
19 |
+
$this->_redirectUrl($redirectUrl);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function purchaseAction()
|
23 |
+
{
|
24 |
+
$extension = $this->getRequest()->getParam('extension');
|
25 |
+
$redirectUrl = Abserve_Magenotification_Model_Keygen::SERVER_URL.'licensemanager/license/purchase/extension/'.$extension;
|
26 |
+
$this->_redirectUrl($redirectUrl);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function viewpriceAction()
|
30 |
+
{
|
31 |
+
$licensekey = $this->getRequest()->getParam('licensekey');
|
32 |
+
$licensetype = $this->getRequest()->getParam('licensetype');
|
33 |
+
$upgradePrice = Mage::helper('magenotification/license')->getUpgradePrice($licensekey,$licensetype);
|
34 |
+
$html = '<b>'.$upgradePrice.'</b>';
|
35 |
+
$html .= ' '.Mage::helper('magenotification')->__('for upgrade to');
|
36 |
+
$html .= ' '. Mage::getModel('magenotification/keygen')->getLicenseTitle($licensetype);
|
37 |
+
$html .= '<br/><br/><button style="" onclick="updateLicensePurchase(\''.$licensekey.'\')" class="scalable add" type="button" >
|
38 |
+
<span>'.Mage::helper('magenotification')->__('Upgrade Now').'</span></button>';
|
39 |
+
echo $html;
|
40 |
+
}
|
41 |
+
}
|
app/code/community/Abserve/Magenotification/controllers/Adminhtml/MagenotificationController.php
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Magenotification_Adminhtml_MagenotificationController extends Mage_Adminhtml_Controller_Action
|
13 |
+
{
|
14 |
+
|
15 |
+
public function readdetailAction()
|
16 |
+
{
|
17 |
+
$id = $this->getRequest()->getParam('id');
|
18 |
+
$notice = Mage::getModel('magenotification/inbox')->load($id);
|
19 |
+
$notice->setIsRead(1);
|
20 |
+
$notice->save();
|
21 |
+
return $this->_redirectUrl($notice->getUrl());
|
22 |
+
}
|
23 |
+
public function indexAction(){
|
24 |
+
$this->_title($this->__('System'))->_title($this->__('Notifications'));
|
25 |
+
|
26 |
+
$this->loadLayout()
|
27 |
+
->_setActiveMenu('system/abserve_extension')
|
28 |
+
->_addBreadcrumb(Mage::helper('magenotification')->__('Messages Inbox'), Mage::helper('magenotification')->__('Messages Inbox'))
|
29 |
+
->_addContent($this->getLayout()->createBlock('magenotification/adminhtml_notification_inbox'))
|
30 |
+
//->_addContent($this->getLayout()->createBlock('magenotification/adminhtml_notification_inbox_grid'))
|
31 |
+
->renderLayout();
|
32 |
+
}
|
33 |
+
public function gridAction(){
|
34 |
+
$this->_title($this->__('System'))->_title($this->__('Notifications'));
|
35 |
+
|
36 |
+
$this->loadLayout()
|
37 |
+
->_setActiveMenu('system/abserve_extension')
|
38 |
+
->_addBreadcrumb(Mage::helper('magenotification')->__('Messages Inbox'), Mage::helper('magenotification')->__('Messages Inbox'))
|
39 |
+
->_addContent($this->getLayout()->createBlock('magenotification/adminhtml_notification_inbox'))
|
40 |
+
//->_addContent($this->getLayout()->createBlock('magenotification/adminhtml_notification_inbox_grid'))
|
41 |
+
->renderLayout();
|
42 |
+
}
|
43 |
+
public function markAsReadAction()
|
44 |
+
{
|
45 |
+
if ($id = $this->getRequest()->getParam('id')) {
|
46 |
+
$session = Mage::getSingleton('adminhtml/session');
|
47 |
+
$model = Mage::getModel('magenotification/magenotification')
|
48 |
+
->load($id);
|
49 |
+
|
50 |
+
if (!$model->getId()) {
|
51 |
+
$session->addError(Mage::helper('magenotification')->__('Unable to proceed. Please, try again.'));
|
52 |
+
$this->_redirect('*/*/');
|
53 |
+
return ;
|
54 |
+
}
|
55 |
+
|
56 |
+
try {
|
57 |
+
$model->setIsRead(1)
|
58 |
+
->save();
|
59 |
+
$session->addSuccess(Mage::helper('magenotification')->__('The message has been marked as read.'));
|
60 |
+
} catch (Mage_Core_Exception $e) {
|
61 |
+
$session->addError($e->getMessage());
|
62 |
+
} catch (Exception $e) {
|
63 |
+
$session->addException($e, Mage::helper('magenotification')->__('An error occurred while marking notification as read.'));
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->_redirectReferer();
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
$this->_redirect('*/*/');
|
70 |
+
}
|
71 |
+
public function removeAction()
|
72 |
+
{
|
73 |
+
if ($id = $this->getRequest()->getParam('id')) {
|
74 |
+
$session = Mage::getSingleton('adminhtml/session');
|
75 |
+
$model = Mage::getModel('magenotification/magenotification')
|
76 |
+
->load($id);
|
77 |
+
|
78 |
+
if (!$model->getId()) {
|
79 |
+
$this->_redirect('*/*/');
|
80 |
+
return ;
|
81 |
+
}
|
82 |
+
|
83 |
+
try {
|
84 |
+
$model->setIsRemove(1)
|
85 |
+
->save();
|
86 |
+
$session->addSuccess(Mage::helper('magenotification')->__('The message has been removed.'));
|
87 |
+
} catch (Mage_Core_Exception $e) {
|
88 |
+
$session->addError($e->getMessage());
|
89 |
+
} catch (Exception $e) {
|
90 |
+
$session->addException($e, Mage::helper('magenotification')->__('An error occurred while removing the message.'));
|
91 |
+
}
|
92 |
+
|
93 |
+
$this->_redirect('*/*/');
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
$this->_redirect('*/*/');
|
97 |
+
}
|
98 |
+
public function massRemoveAction()
|
99 |
+
{
|
100 |
+
$session = Mage::getSingleton('adminhtml/session');
|
101 |
+
$ids = $this->getRequest()->getParam('notification');
|
102 |
+
if (!is_array($ids)) {
|
103 |
+
$session->addError(Mage::helper('magenotification')->__('Please select messages.'));
|
104 |
+
} else {
|
105 |
+
try {
|
106 |
+
foreach ($ids as $id) {
|
107 |
+
$model = Mage::getModel('magenotification/magenotification')
|
108 |
+
->load($id);
|
109 |
+
if ($model->getId()) {
|
110 |
+
$model->setIsRemove(1)
|
111 |
+
->save();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$this->_getSession()->addSuccess(
|
115 |
+
Mage::helper('magenotification')->__('Total of %d record(s) have been removed.', count($ids))
|
116 |
+
);
|
117 |
+
} catch (Mage_Core_Exception $e) {
|
118 |
+
$session->addError($e->getMessage());
|
119 |
+
} catch (Exception $e) {
|
120 |
+
$session->addException($e, Mage::helper('magenotification')->__('An error occurred while removing messages.'));
|
121 |
+
}
|
122 |
+
}
|
123 |
+
$this->_redirectReferer();
|
124 |
+
}
|
125 |
+
public function massMarkAsReadAction()
|
126 |
+
{
|
127 |
+
$session = Mage::getSingleton('adminhtml/session');
|
128 |
+
$ids = $this->getRequest()->getParam('notification');
|
129 |
+
if (!is_array($ids)) {
|
130 |
+
$session->addError(Mage::helper('magenotification')->__('Please select messages.'));
|
131 |
+
} else {
|
132 |
+
try {
|
133 |
+
foreach ($ids as $id) {
|
134 |
+
$model = Mage::getModel('magenotification/magenotification')
|
135 |
+
->load($id);
|
136 |
+
if ($model->getId()) {
|
137 |
+
$model->setIsRead(1)
|
138 |
+
->save();
|
139 |
+
}
|
140 |
+
}
|
141 |
+
$this->_getSession()->addSuccess(
|
142 |
+
Mage::helper('magenotification')->__('Total of %d record(s) have been marked as read.', count($ids))
|
143 |
+
);
|
144 |
+
} catch (Mage_Core_Exception $e) {
|
145 |
+
$session->addError($e->getMessage());
|
146 |
+
} catch (Exception $e) {
|
147 |
+
$session->addException($e, Mage::helper('magenotification')->__('An error occurred while marking the messages as read.'));
|
148 |
+
}
|
149 |
+
}
|
150 |
+
$this->_redirect('*/*/');
|
151 |
+
}
|
152 |
+
protected function _isAllowed()
|
153 |
+
{
|
154 |
+
return Mage::getSingleton('admin/session')->isAllowed('magenotification');
|
155 |
+
}
|
156 |
+
}
|
app/code/community/Abserve/Magenotification/controllers/Adminhtml/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/etc/adminhtml.xml
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<menu>
|
13 |
+
<system>
|
14 |
+
<children>
|
15 |
+
<adminnotification>
|
16 |
+
<children>
|
17 |
+
<magenotification translate="title">
|
18 |
+
<title>Abserve</title>
|
19 |
+
<sort_order>10</sort_order>
|
20 |
+
<action>magenotification/adminhtml_magenotification</action>
|
21 |
+
</magenotification>
|
22 |
+
<adminnotificationchild translate="title" >
|
23 |
+
<title>System</title>
|
24 |
+
<action>adminhtml/notification</action>
|
25 |
+
<sort_order>15</sort_order>
|
26 |
+
</adminnotificationchild>
|
27 |
+
</children>
|
28 |
+
</adminnotification>
|
29 |
+
</children>
|
30 |
+
</system>
|
31 |
+
</menu>
|
32 |
+
<acl>
|
33 |
+
<resources>
|
34 |
+
<all>
|
35 |
+
<title>Allow Everything</title>
|
36 |
+
</all>
|
37 |
+
<admin>
|
38 |
+
<children>
|
39 |
+
<system>
|
40 |
+
<children>
|
41 |
+
<config>
|
42 |
+
<children>
|
43 |
+
<magenotificationcerts translate="title">
|
44 |
+
<title>License Certificates Information</title>
|
45 |
+
<sort_order>0</sort_order>
|
46 |
+
</magenotificationcerts>
|
47 |
+
<magenotificationsecure translate="title">
|
48 |
+
<title>Extension Key Management</title>
|
49 |
+
<sort_order>1</sort_order>
|
50 |
+
</magenotificationsecure>
|
51 |
+
<abserve_extension_feedback translate="title">
|
52 |
+
<title>License Keys</title>
|
53 |
+
<sort_order>2</sort_order>
|
54 |
+
</abserve_extension_feedback>
|
55 |
+
<magenotification translate="title">
|
56 |
+
<title>MageNotification</title>
|
57 |
+
<sort_order>50</sort_order>
|
58 |
+
</magenotification>
|
59 |
+
</children>
|
60 |
+
</config>
|
61 |
+
<adminnotification>
|
62 |
+
<children>
|
63 |
+
<magenotification translate="title">
|
64 |
+
<title>Abserve</title>
|
65 |
+
<sort_order>10</sort_order>
|
66 |
+
<action>adminhtml/system_config/edit/section/magenotificationcerts</action>
|
67 |
+
</magenotification>
|
68 |
+
<adminnotificationchild translate="title" >
|
69 |
+
<title>System</title>
|
70 |
+
<action>adminhtml/notification</action>
|
71 |
+
<sort_order>15</sort_order>
|
72 |
+
</adminnotificationchild>
|
73 |
+
</children>
|
74 |
+
</adminnotification>
|
75 |
+
<abserve_extension translate="title">
|
76 |
+
<title>Abserve Extensions</title>
|
77 |
+
<sort_order>10</sort_order>
|
78 |
+
<children>
|
79 |
+
<magenotificationcerts translate="title">
|
80 |
+
<title>License Certificates</title>
|
81 |
+
<sort_order>0</sort_order>
|
82 |
+
</magenotificationcerts>
|
83 |
+
<extension_key translate="title">
|
84 |
+
<title>License Keys</title>
|
85 |
+
<sort_order>1</sort_order>
|
86 |
+
<action>adminhtml/system_config/edit/section/magenotificationsecure</action>
|
87 |
+
</extension_key>
|
88 |
+
<extension_feedback translate="title">
|
89 |
+
<title>Extension Feedbacks</title>
|
90 |
+
<sort_order>10</sort_order>
|
91 |
+
<action>adminhtml/system_config/edit/section/licensemanager</action>
|
92 |
+
</extension_feedback>
|
93 |
+
</children>
|
94 |
+
</abserve_extension>
|
95 |
+
</children>
|
96 |
+
</system>
|
97 |
+
</children>
|
98 |
+
</admin>
|
99 |
+
</resources>
|
100 |
+
</acl>
|
101 |
+
</config>
|
app/code/community/Abserve/Magenotification/etc/config.xml
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_Magenotification>
|
14 |
+
<version>0.1.4</version>
|
15 |
+
</Abserve_Magenotification>
|
16 |
+
</modules>
|
17 |
+
<admin>
|
18 |
+
<routers>
|
19 |
+
<magenotification>
|
20 |
+
<use>admin</use>
|
21 |
+
<args>
|
22 |
+
<module>Abserve_Magenotification</module>
|
23 |
+
<frontName>magenotification</frontName>
|
24 |
+
</args>
|
25 |
+
</magenotification>
|
26 |
+
</routers>
|
27 |
+
</admin>
|
28 |
+
<adminhtml>
|
29 |
+
<events>
|
30 |
+
<controller_action_predispatch>
|
31 |
+
<observers>
|
32 |
+
<abserve_magenotification_observer>
|
33 |
+
<type>singleton</type>
|
34 |
+
<class>magenotification/observer</class>
|
35 |
+
<method>controllerActionPredispatch</method>
|
36 |
+
</abserve_magenotification_observer>
|
37 |
+
</observers>
|
38 |
+
</controller_action_predispatch>
|
39 |
+
</events>
|
40 |
+
<layout>
|
41 |
+
<updates>
|
42 |
+
<magenotification>
|
43 |
+
<file>magenotification.xml</file>
|
44 |
+
</magenotification>
|
45 |
+
</updates>
|
46 |
+
</layout>
|
47 |
+
</adminhtml>
|
48 |
+
<global>
|
49 |
+
<models>
|
50 |
+
<magenotification>
|
51 |
+
<class>Abserve_Magenotification_Model</class>
|
52 |
+
<resourceModel>magenotification_mysql4</resourceModel>
|
53 |
+
</magenotification>
|
54 |
+
<magenotification_mysql4>
|
55 |
+
<class>Abserve_Magenotification_Model_Mysql4</class>
|
56 |
+
<entities>
|
57 |
+
<magenotification>
|
58 |
+
<table>magenotification</table>
|
59 |
+
</magenotification>
|
60 |
+
<feedback>
|
61 |
+
<table>magenotification_extension_feedback</table>
|
62 |
+
</feedback>
|
63 |
+
<feedbackmessage>
|
64 |
+
<table>magenotification_extension_feedbackmessage</table>
|
65 |
+
</feedbackmessage>
|
66 |
+
<logger>
|
67 |
+
<table>magenotification_log</table>
|
68 |
+
</logger>
|
69 |
+
<license>
|
70 |
+
<table>magenotification_license</table>
|
71 |
+
</license>
|
72 |
+
</entities>
|
73 |
+
</magenotification_mysql4>
|
74 |
+
</models>
|
75 |
+
<resources>
|
76 |
+
<magenotification_setup>
|
77 |
+
<setup>
|
78 |
+
<module>Abserve_Magenotification</module>
|
79 |
+
</setup>
|
80 |
+
<connection>
|
81 |
+
<use>core_setup</use>
|
82 |
+
</connection>
|
83 |
+
</magenotification_setup>
|
84 |
+
<magenotification_write>
|
85 |
+
<connection>
|
86 |
+
<use>core_write</use>
|
87 |
+
</connection>
|
88 |
+
</magenotification_write>
|
89 |
+
<magenotification_read>
|
90 |
+
<connection>
|
91 |
+
<use>core_read</use>
|
92 |
+
</connection>
|
93 |
+
</magenotification_read>
|
94 |
+
</resources>
|
95 |
+
<blocks>
|
96 |
+
<magenotification>
|
97 |
+
<class>Abserve_Magenotification_Block</class>
|
98 |
+
</magenotification>
|
99 |
+
<adminhtml>
|
100 |
+
<rewrite>
|
101 |
+
<notification_window>Abserve_Magenotification_Block_Adminhtml_Notification_Window</notification_window>
|
102 |
+
</rewrite>
|
103 |
+
</adminhtml>
|
104 |
+
</blocks>
|
105 |
+
<helpers>
|
106 |
+
<magenotification>
|
107 |
+
<class>Abserve_Magenotification_Helper</class>
|
108 |
+
</magenotification>
|
109 |
+
</helpers>
|
110 |
+
</global>
|
111 |
+
<default>
|
112 |
+
<magenotification>
|
113 |
+
<general>
|
114 |
+
<frequency>24</frequency>
|
115 |
+
<last_update backend_model="magenotification/source_time"></last_update>
|
116 |
+
<abserve_url>http://www.abserve.com/index.php</abserve_url>
|
117 |
+
</general>
|
118 |
+
</magenotification>
|
119 |
+
</default>
|
120 |
+
</config>
|
app/code/community/Abserve/Magenotification/etc/system.xml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<abserve translate="label">
|
14 |
+
<label>Abserve Extension</label>
|
15 |
+
<sort_order>400</sort_order>
|
16 |
+
</abserve>
|
17 |
+
</tabs>
|
18 |
+
<!-- <sections>
|
19 |
+
<magenotification translate="label" module="magenotification">
|
20 |
+
<class>separator-top</class>
|
21 |
+
<label>MageNotification</label>
|
22 |
+
<tab>abserve</tab>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>300</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<groups>
|
29 |
+
<general translate="label">
|
30 |
+
<label>General Infomation</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<fields>
|
37 |
+
<frequency translate="label">
|
38 |
+
<label>Update frequency</label>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>adminhtml/system_config_source_notification_frequency</source_model>
|
41 |
+
<sort_order>1</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</frequency>
|
46 |
+
<last_update translate="label">
|
47 |
+
<label>Last update</label>
|
48 |
+
<frontend_type>label</frontend_type>
|
49 |
+
<backend_model>magenotification/source_time</backend_model>
|
50 |
+
<sort_order>2</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>0</show_in_website>
|
53 |
+
<show_in_store>0</show_in_store>
|
54 |
+
</last_update>
|
55 |
+
<abserve_url translate="label">
|
56 |
+
<label>Abserve Url</label>
|
57 |
+
<frontend_type>label</frontend_type>
|
58 |
+
<sort_order>3</sort_order>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>0</show_in_website>
|
61 |
+
<show_in_store>0</show_in_store>
|
62 |
+
</abserve_url>
|
63 |
+
</fields>
|
64 |
+
</general>
|
65 |
+
</groups>
|
66 |
+
</magenotification>
|
67 |
+
</sections> -->
|
68 |
+
</config>
|
app/code/community/Abserve/Magenotification/etc/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification')};
|
10 |
+
|
11 |
+
CREATE TABLE {$this->getTable('magenotification')} (
|
12 |
+
`magenotification_id` int(11) unsigned NOT NULL auto_increment,
|
13 |
+
`notification_id` int(10) unsigned NOT NULL,
|
14 |
+
`url` varchar(255) NOT NULL default '',
|
15 |
+
`added_date` datetime NOT NULL,
|
16 |
+
UNIQUE (`notification_id`, `url`),
|
17 |
+
PRIMARY KEY (`magenotification_id`)
|
18 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
19 |
+
|
20 |
+
");
|
21 |
+
|
22 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.1.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
|
10 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedbackmessage')};
|
11 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedback')};
|
12 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification')};
|
13 |
+
|
14 |
+
CREATE TABLE {$this->getTable('magenotification')} (
|
15 |
+
`magenotification_id` int(11) unsigned NOT NULL auto_increment,
|
16 |
+
`notification_id` int(10) unsigned NOT NULL,
|
17 |
+
`url` varchar(255) NOT NULL default '',
|
18 |
+
`added_date` datetime NOT NULL,
|
19 |
+
UNIQUE (`notification_id`, `url`),
|
20 |
+
PRIMARY KEY (`magenotification_id`)
|
21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22 |
+
|
23 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedback')} (
|
24 |
+
`feedback_id` int(11) unsigned NOT NULL auto_increment,
|
25 |
+
`code` varchar(255) NOT NULL default '',
|
26 |
+
`extension` varchar(255) NOT NULL default '',
|
27 |
+
`extension_version` varchar(50) NOT NULL default '',
|
28 |
+
`coupon_code` varchar(255) NOT NULL default '',
|
29 |
+
`coupon_value` varchar(50) NOT NULL default '',
|
30 |
+
`expired_counpon` datetime NOT NULL,
|
31 |
+
`content` text NOT NULL default '',
|
32 |
+
`file` text NOT NULL default '',
|
33 |
+
`comment` text NOT NULL default '',
|
34 |
+
`latest_message` text NOT NULL default '',
|
35 |
+
`latest_response` text NOT NULL default '',
|
36 |
+
`latest_response_time` datetime,
|
37 |
+
`status` tinyint(1) NOT NULL DEFAULT '3',
|
38 |
+
`is_sent` tinyint(1) NOT NULL DEFAULT '2',
|
39 |
+
`created` datetime NOT NULL,
|
40 |
+
`updated` datetime NOT NULL,
|
41 |
+
PRIMARY KEY (`feedback_id`)
|
42 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
43 |
+
|
44 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedbackmessage')} (
|
45 |
+
`feedbackmessage_id` int(11) unsigned NOT NULL auto_increment,
|
46 |
+
`feedback_id` int(11) unsigned NOT NULL,
|
47 |
+
`feedback_code` varchar(255) NOT NULL default '',
|
48 |
+
`user` varchar(255) NOT NULL default '',
|
49 |
+
`is_customer` tinyint(1) default '2',
|
50 |
+
`message` text NOT NULL default '',
|
51 |
+
`file` text NOT NULL default '',
|
52 |
+
`posted_time` datetime NULL,
|
53 |
+
`is_sent` tinyint(1) default '2',
|
54 |
+
PRIMARY KEY (`feedbackmessage_id`)
|
55 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
56 |
+
|
57 |
+
");
|
58 |
+
|
59 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-install-0.1.2.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
|
10 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedbackmessage')};
|
11 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedback')};
|
12 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_log')};
|
13 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification')};
|
14 |
+
|
15 |
+
CREATE TABLE {$this->getTable('magenotification')} (
|
16 |
+
`magenotification_id` int(11) unsigned NOT NULL auto_increment,
|
17 |
+
`notification_id` int(10) unsigned NOT NULL,
|
18 |
+
`url` varchar(255) NOT NULL default '',
|
19 |
+
`added_date` datetime NOT NULL,
|
20 |
+
UNIQUE (`notification_id`, `url`),
|
21 |
+
PRIMARY KEY (`magenotification_id`)
|
22 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
23 |
+
|
24 |
+
CREATE TABLE {$this->getTable('magenotification_log')} (
|
25 |
+
`log_id` int(11) unsigned NOT NULL auto_increment,
|
26 |
+
`extension_code` varchar(100) NOT NULL default '',
|
27 |
+
`license_type` varchar(50) NOT NULL default '',
|
28 |
+
`license_key` text NOT NULL default '',
|
29 |
+
`check_date` date NOT NULL,
|
30 |
+
`sum_code` varchar(255),
|
31 |
+
`response_code` smallint(5),
|
32 |
+
`expired_time` varchar(255),
|
33 |
+
`is_valid` tinyint(1),
|
34 |
+
PRIMARY KEY (`log_id`)
|
35 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
36 |
+
|
37 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedback')} (
|
38 |
+
`feedback_id` int(11) unsigned NOT NULL auto_increment,
|
39 |
+
`code` varchar(255) NOT NULL default '',
|
40 |
+
`extension` varchar(255) NOT NULL default '',
|
41 |
+
`extension_version` varchar(50) NOT NULL default '',
|
42 |
+
`coupon_code` varchar(255) NOT NULL default '',
|
43 |
+
`coupon_value` varchar(50) NOT NULL default '',
|
44 |
+
`expired_counpon` datetime NOT NULL,
|
45 |
+
`content` text NOT NULL default '',
|
46 |
+
`file` text NOT NULL default '',
|
47 |
+
`comment` text NOT NULL default '',
|
48 |
+
`latest_message` text NOT NULL default '',
|
49 |
+
`latest_response` text NOT NULL default '',
|
50 |
+
`latest_response_time` datetime,
|
51 |
+
`status` tinyint(1) NOT NULL DEFAULT '3',
|
52 |
+
`is_sent` tinyint(1) NOT NULL DEFAULT '2',
|
53 |
+
`created` datetime NOT NULL,
|
54 |
+
`updated` datetime NOT NULL,
|
55 |
+
PRIMARY KEY (`feedback_id`)
|
56 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
57 |
+
|
58 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedbackmessage')} (
|
59 |
+
`feedbackmessage_id` int(11) unsigned NOT NULL auto_increment,
|
60 |
+
`feedback_id` int(11) unsigned NOT NULL,
|
61 |
+
`feedback_code` varchar(255) NOT NULL default '',
|
62 |
+
`user` varchar(255) NOT NULL default '',
|
63 |
+
`is_customer` tinyint(1) default '2',
|
64 |
+
`message` text NOT NULL default '',
|
65 |
+
`file` text NOT NULL default '',
|
66 |
+
`posted_time` datetime NULL,
|
67 |
+
`is_sent` tinyint(1) default '2',
|
68 |
+
PRIMARY KEY (`feedbackmessage_id`)
|
69 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
70 |
+
|
71 |
+
");
|
72 |
+
|
73 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.0-0.1.1.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedbackmessage')};
|
10 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedback')};
|
11 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification')};
|
12 |
+
|
13 |
+
CREATE TABLE {$this->getTable('magenotification')} (
|
14 |
+
`magenotification_id` int(11) unsigned NOT NULL auto_increment,
|
15 |
+
`notification_id` int(10) unsigned NOT NULL,
|
16 |
+
`url` varchar(255) NOT NULL default '',
|
17 |
+
`added_date` datetime NOT NULL,
|
18 |
+
UNIQUE (`notification_id`, `url`),
|
19 |
+
PRIMARY KEY (`magenotification_id`)
|
20 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
21 |
+
|
22 |
+
|
23 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedback')} (
|
24 |
+
`feedback_id` int(11) unsigned NOT NULL auto_increment,
|
25 |
+
`code` varchar(255) NOT NULL default '',
|
26 |
+
`extension` varchar(255) NOT NULL default '',
|
27 |
+
`extension_version` varchar(50) NOT NULL default '',
|
28 |
+
`coupon_code` varchar(255) NOT NULL default '',
|
29 |
+
`coupon_value` varchar(50) NOT NULL default '',
|
30 |
+
`expired_counpon` datetime NOT NULL,
|
31 |
+
`content` text NOT NULL default '',
|
32 |
+
`file` text NOT NULL default '',
|
33 |
+
`comment` text NOT NULL default '',
|
34 |
+
`latest_message` text NOT NULL default '',
|
35 |
+
`latest_response` text NOT NULL default '',
|
36 |
+
`latest_response_time` datetime,
|
37 |
+
`status` tinyint(1) NOT NULL DEFAULT '3',
|
38 |
+
`is_sent` tinyint(1) NOT NULL DEFAULT '2',
|
39 |
+
`created` datetime NOT NULL,
|
40 |
+
`updated` datetime NOT NULL,
|
41 |
+
PRIMARY KEY (`feedback_id`)
|
42 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
43 |
+
|
44 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedbackmessage')} (
|
45 |
+
`feedbackmessage_id` int(11) unsigned NOT NULL auto_increment,
|
46 |
+
`feedback_id` int(11) unsigned NOT NULL,
|
47 |
+
`feedback_code` varchar(255) NOT NULL default '',
|
48 |
+
`user` varchar(255) NOT NULL default '',
|
49 |
+
`is_customer` tinyint(1) default '2',
|
50 |
+
`message` text NOT NULL default '',
|
51 |
+
`file` text NOT NULL default '',
|
52 |
+
`posted_time` datetime NULL,
|
53 |
+
`is_sent` tinyint(1) default '2',
|
54 |
+
PRIMARY KEY (`feedbackmessage_id`)
|
55 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
56 |
+
|
57 |
+
");
|
58 |
+
|
59 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.0-0.1.2.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedbackmessage')};
|
10 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_extension_feedback')};
|
11 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_log')};
|
12 |
+
|
13 |
+
|
14 |
+
CREATE TABLE {$this->getTable('magenotification_log')} (
|
15 |
+
`log_id` int(11) unsigned NOT NULL auto_increment,
|
16 |
+
`extension_code` varchar(100) NOT NULL default '',
|
17 |
+
`license_type` varchar(50) NOT NULL default '',
|
18 |
+
`license_key` text NOT NULL default '',
|
19 |
+
`check_date` date NOT NULL,
|
20 |
+
`sum_code` varchar(255),
|
21 |
+
`response_code` smallint(5),
|
22 |
+
`expired_time` varchar(255),
|
23 |
+
`is_valid` tinyint(1),
|
24 |
+
PRIMARY KEY (`log_id`)
|
25 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
26 |
+
|
27 |
+
|
28 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedback')} (
|
29 |
+
`feedback_id` int(11) unsigned NOT NULL auto_increment,
|
30 |
+
`code` varchar(255) NOT NULL default '',
|
31 |
+
`extension` varchar(255) NOT NULL default '',
|
32 |
+
`extension_version` varchar(50) NOT NULL default '',
|
33 |
+
`coupon_code` varchar(255) NOT NULL default '',
|
34 |
+
`coupon_value` varchar(50) NOT NULL default '',
|
35 |
+
`expired_counpon` datetime NOT NULL,
|
36 |
+
`content` text NOT NULL default '',
|
37 |
+
`file` text NOT NULL default '',
|
38 |
+
`comment` text NOT NULL default '',
|
39 |
+
`latest_message` text NOT NULL default '',
|
40 |
+
`latest_response` text NOT NULL default '',
|
41 |
+
`latest_response_time` datetime,
|
42 |
+
`status` tinyint(1) NOT NULL DEFAULT '3',
|
43 |
+
`is_sent` tinyint(1) NOT NULL DEFAULT '2',
|
44 |
+
`created` datetime NOT NULL,
|
45 |
+
`updated` datetime NOT NULL,
|
46 |
+
PRIMARY KEY (`feedback_id`)
|
47 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
48 |
+
|
49 |
+
CREATE TABLE {$this->getTable('magenotification_extension_feedbackmessage')} (
|
50 |
+
`feedbackmessage_id` int(11) unsigned NOT NULL auto_increment,
|
51 |
+
`feedback_id` int(11) unsigned NOT NULL,
|
52 |
+
`feedback_code` varchar(255) NOT NULL default '',
|
53 |
+
`user` varchar(255) NOT NULL default '',
|
54 |
+
`is_customer` tinyint(1) default '2',
|
55 |
+
`message` text NOT NULL default '',
|
56 |
+
`file` text NOT NULL default '',
|
57 |
+
`posted_time` datetime NULL,
|
58 |
+
`is_sent` tinyint(1) default '2',
|
59 |
+
PRIMARY KEY (`feedbackmessage_id`)
|
60 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
61 |
+
|
62 |
+
");
|
63 |
+
|
64 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.1-0.1.2.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_log')};
|
10 |
+
|
11 |
+
CREATE TABLE {$this->getTable('magenotification_log')} (
|
12 |
+
`log_id` int(11) unsigned NOT NULL auto_increment,
|
13 |
+
`extension_code` varchar(100) NOT NULL default '',
|
14 |
+
`license_type` varchar(50) NOT NULL default '',
|
15 |
+
`license_key` text NOT NULL default '',
|
16 |
+
`check_date` date NOT NULL,
|
17 |
+
`sum_code` varchar(255),
|
18 |
+
`response_code` smallint(5),
|
19 |
+
`expired_time` varchar(255),
|
20 |
+
`is_valid` tinyint(1),
|
21 |
+
PRIMARY KEY (`log_id`)
|
22 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
23 |
+
|
24 |
+
");
|
25 |
+
|
26 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.2-0.1.3.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
|
9 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification_license')};
|
10 |
+
|
11 |
+
CREATE TABLE {$this->getTable('magenotification_license')} (
|
12 |
+
`license_id` int(11) unsigned NOT NULL auto_increment,
|
13 |
+
`extension_code` varchar(100) NOT NULL default '',
|
14 |
+
`license_key` text NOT NULL default '',
|
15 |
+
`active_at` date NOT NULL,
|
16 |
+
`sum_code` varchar(255),
|
17 |
+
`response_code` smallint(5),
|
18 |
+
`domains` varchar(255),
|
19 |
+
`is_valid` tinyint(1),
|
20 |
+
PRIMARY KEY (`license_id`)
|
21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22 |
+
|
23 |
+
");
|
24 |
+
|
25 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/mysql4-upgrade-0.1.3-0.1.4.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$installer->run("
|
7 |
+
|
8 |
+
DROP TABLE IF EXISTS {$this->getTable('magenotification')};
|
9 |
+
|
10 |
+
CREATE TABLE {$this->getTable('magenotification')} (
|
11 |
+
`magenotification_id` int(11) unsigned NOT NULL auto_increment,
|
12 |
+
`title` varchar(255) NOT NULL,
|
13 |
+
`description` text default '',
|
14 |
+
`url` varchar(255) NOT NULL default '',
|
15 |
+
`severity` smallint(5) UNSIGNED NOT NULL default 0,
|
16 |
+
`is_read` tinyint default 0,
|
17 |
+
`is_remove` tinyint default 0,
|
18 |
+
`related_extensions` varchar(255) default '',
|
19 |
+
`added_date` datetime NOT NULL,
|
20 |
+
PRIMARY KEY (`magenotification_id`)
|
21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
22 |
+
|
23 |
+
");
|
24 |
+
|
25 |
+
$installer->endSetup();
|
app/code/community/Abserve/Magenotification/sql/magenotification_setup/vssver2.scc
ADDED
Binary file
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Config/Edit.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Config_Edit extends Mage_Adminhtml_Block_System_Config_Edit
|
13 |
+
{
|
14 |
+
protected function _prepareLayout()
|
15 |
+
{
|
16 |
+
parent::_prepareLayout();
|
17 |
+
if($this->getRequest()->getModuleName() == 'admin' && $this->getRequest()->getControllerName() == 'system_config'
|
18 |
+
&& $this->getRequest()->getActionName() == 'edit' && $this->getRequest()->getParam('section') == 'onestepcheckout'){
|
19 |
+
$this->setChild('save_button',
|
20 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')
|
21 |
+
->setData(array(
|
22 |
+
'label' => Mage::helper('adminhtml')->__('Save Config'),
|
23 |
+
'onclick' => 'checkValueRequire()',
|
24 |
+
'class' => 'save',
|
25 |
+
))
|
26 |
+
);
|
27 |
+
}else{
|
28 |
+
$this->setChild('save_button',
|
29 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')
|
30 |
+
->setData(array(
|
31 |
+
'label' => Mage::helper('adminhtml')->__('Save Config'),
|
32 |
+
'onclick' => 'configForm.submit()',
|
33 |
+
'class' => 'save',
|
34 |
+
))
|
35 |
+
);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country extends Mage_Core_Block_Template
|
12 |
+
{
|
13 |
+
protected $_website_id = null;
|
14 |
+
|
15 |
+
protected function _construct()
|
16 |
+
{
|
17 |
+
parent::_construct();
|
18 |
+
$this->_website_id = $this->getRequest()->getParam('website');
|
19 |
+
}
|
20 |
+
|
21 |
+
public function _prepareLayout()
|
22 |
+
{
|
23 |
+
parent::_prepareLayout();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getCountryid()
|
27 |
+
{
|
28 |
+
return $this->getRequest()->getParam('id');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getWebsiteId()
|
32 |
+
{
|
33 |
+
return $this->_website_id;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getImageLink()
|
37 |
+
{
|
38 |
+
return $this->getSkinUrl('images/transfer-ajax-loader.gif');
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getImageLinkStop()
|
42 |
+
{
|
43 |
+
return $this->getSkinUrl('images/ajax-loader.jpg');
|
44 |
+
}
|
45 |
+
|
46 |
+
public function checkDataImport()
|
47 |
+
{
|
48 |
+
$parameter = $this->getCountryid();
|
49 |
+
$countryids = explode(',', $parameter);
|
50 |
+
foreach($countryids as $countryid){
|
51 |
+
$countryList = Mage::getModel('onestepcheckout/countrylist')->load($countryid);
|
52 |
+
$countryCode = $countryList->getCountryCode();
|
53 |
+
$lastVersion = $countryList->getLastVersion();
|
54 |
+
if($lastVersion == '1.0')
|
55 |
+
$fileUrl = 'version1.0'.DS.$countryCode.'.csv';
|
56 |
+
else
|
57 |
+
$fileUrl = 'nextversion'.DS.$countryCode.'_'.$lastVersion.'.csv';
|
58 |
+
$fileImport = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'abserve_geoip'.DS.'countrypostcode'.DS.$fileUrl;
|
59 |
+
// return $fileImport;
|
60 |
+
if(file_exists($fileImport))
|
61 |
+
return file_exists($fileImport);
|
62 |
+
}
|
63 |
+
return false;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function actionImport()
|
67 |
+
{
|
68 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_country/importCountryip',array(
|
69 |
+
'website' => $this->getWebsiteId(),
|
70 |
+
'countryid' => $this->getCountryid()
|
71 |
+
));
|
72 |
+
return $link;
|
73 |
+
}
|
74 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
parent::__construct();
|
16 |
+
|
17 |
+
$this->_objectId = 'id';
|
18 |
+
$this->_blockGroup = 'onestepcheckout';
|
19 |
+
$this->_controller = 'adminhtml_country';
|
20 |
+
|
21 |
+
$this->_updateButton('save', 'label', Mage::helper('onestepcheckout')->__('Upload'));
|
22 |
+
|
23 |
+
$this->_addButton('saveandcontinue', array(
|
24 |
+
'label' => Mage::helper('adminhtml')->__('Upload and Continue'),
|
25 |
+
'onclick' => 'saveAndContinueEdit()',
|
26 |
+
'class' => 'save',
|
27 |
+
), -100);
|
28 |
+
|
29 |
+
$this->_formScripts[] = "
|
30 |
+
function toggleEditor() {
|
31 |
+
if (tinyMCE.getInstanceById('geoip_content') == null)
|
32 |
+
tinyMCE.execCommand('mceAddControl', false, 'geoip_content');
|
33 |
+
else
|
34 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'geoip_content');
|
35 |
+
}
|
36 |
+
|
37 |
+
function saveAndContinueEdit(){
|
38 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
39 |
+
}
|
40 |
+
//edit back button in import
|
41 |
+
function backEdit()
|
42 |
+
{
|
43 |
+
window.history.back();
|
44 |
+
}
|
45 |
+
";
|
46 |
+
}
|
47 |
+
/**
|
48 |
+
* get text to show in header when edit an item
|
49 |
+
*
|
50 |
+
* @return string
|
51 |
+
*/
|
52 |
+
public function getHeaderText()
|
53 |
+
{
|
54 |
+
return Mage::helper('onestepcheckout')->__('Upload New Country Postcode Database');
|
55 |
+
}
|
56 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Form.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* prepare form's information for block
|
15 |
+
*
|
16 |
+
* @return Abserve_Onestepcheckout_Block_Adminhtml_Country_Edit_Form
|
17 |
+
*/
|
18 |
+
protected function _prepareForm()
|
19 |
+
{
|
20 |
+
$form = new Varien_Data_Form(array(
|
21 |
+
'id' => 'edit_form',
|
22 |
+
'action' => $this->getUrl('*/*/save', array(
|
23 |
+
'id' => $this->getRequest()->getParam('id'),
|
24 |
+
)),
|
25 |
+
'method' => 'post',
|
26 |
+
'enctype' => 'multipart/form-data'
|
27 |
+
));
|
28 |
+
|
29 |
+
$form->setUseContainer(true);
|
30 |
+
$this->setForm($form);
|
31 |
+
return parent::_prepareForm();
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
13 |
+
{
|
14 |
+
protected function _prepareForm()
|
15 |
+
{
|
16 |
+
$form = new Varien_Data_Form();
|
17 |
+
$this->setForm($form);
|
18 |
+
$fieldset = $form->addFieldset('import_form', array('legend'=>Mage::helper('onestepcheckout')->__('Upload File')));
|
19 |
+
|
20 |
+
$fieldset->addField('csv_country', 'file', array(
|
21 |
+
'label' => Mage::helper('onestepcheckout')->__('CSV File'),
|
22 |
+
'class' => 'required-entry',
|
23 |
+
'required' => true,
|
24 |
+
'name' => 'csv_country',
|
25 |
+
'note' => Mage::helper('onestepcheckout')->__("Use Zip code database only to avoid error
|
26 |
+
<br/>Link download").": <a href='http://www.abserve.com/geoip-databases.html'>Here</a>",
|
27 |
+
));
|
28 |
+
|
29 |
+
return parent::_prepareForm();
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Edit/Tabs.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
parent::__construct();
|
16 |
+
$this->setId('geoip_tabs');
|
17 |
+
$this->setDestElementId('edit_form');
|
18 |
+
$this->setTitle(Mage::helper('onestepcheckout')->__('Upload New Country Postcode Database'));
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* prepare before render block to html
|
23 |
+
*
|
24 |
+
* @return Abserve_Geoip_Block_Adminhtml_Geoip_Edit_Tabs
|
25 |
+
*/
|
26 |
+
protected function _beforeToHtml()
|
27 |
+
{
|
28 |
+
$this->addTab('form_section', array(
|
29 |
+
'label' => Mage::helper('onestepcheckout')->__('Upload New Country Postcode Database'),
|
30 |
+
'title' => Mage::helper('onestepcheckout')->__('Upload New Country Postcode Database'),
|
31 |
+
'content' => $this->getLayout()
|
32 |
+
->createBlock('onestepcheckout/adminhtml_country_edit_tab_form')
|
33 |
+
->toHtml(),
|
34 |
+
));
|
35 |
+
return parent::_beforeToHtml();
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Country/Grid.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Country_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* prepare tab form's information
|
15 |
+
*
|
16 |
+
* @return Abserve_Geoip_Block_Adminhtml_Geoip_Edit_Tab_Form
|
17 |
+
*/
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
parent::__construct();
|
21 |
+
$this->setId('countryGrid');
|
22 |
+
$this->setDefaultDir('DESC');
|
23 |
+
$this->setUseAjax(true);
|
24 |
+
$this->setSaveParametersInSession(true);
|
25 |
+
$up_version = $this->getRequest()->getParam('up_version');
|
26 |
+
if(isset($up_version) && $up_version == 1)
|
27 |
+
$this->setDefaultSort('last_version');
|
28 |
+
else
|
29 |
+
$this->setDefaultSort('update_date');
|
30 |
+
}
|
31 |
+
|
32 |
+
public function decorateStatus($value, $row, $column, $isExport)
|
33 |
+
{
|
34 |
+
$class = '';
|
35 |
+
switch ($row->getStatus()) {
|
36 |
+
case 0:
|
37 |
+
$class = 'grid-severity-major';
|
38 |
+
break;
|
39 |
+
case 1:
|
40 |
+
$class = 'grid-severity-notice';
|
41 |
+
break;
|
42 |
+
}
|
43 |
+
return '<span class="'.$class.'"><span>'.$value.'</span></span>';
|
44 |
+
}
|
45 |
+
|
46 |
+
protected function _addColumnFilterToCollection($column)
|
47 |
+
{
|
48 |
+
return parent::_addColumnFilterToCollection($column);
|
49 |
+
}
|
50 |
+
|
51 |
+
protected function _prepareCollection()
|
52 |
+
{
|
53 |
+
$collection = Mage::getModel('onestepcheckout/countrylist')->getCollection()
|
54 |
+
->addFieldToFilter('type',array('neq'=>1));
|
55 |
+
// $collection = Mage::getResourceModel('directory/country_collection');//->loadData()->toOptionArray(false);
|
56 |
+
$this->setCollection($collection);
|
57 |
+
return parent::_prepareCollection();
|
58 |
+
}
|
59 |
+
|
60 |
+
protected function _prepareColumns()
|
61 |
+
{
|
62 |
+
|
63 |
+
$this->addColumn('country_code', array(
|
64 |
+
'header' => Mage::helper('onestepcheckout')->__('Country Code'),
|
65 |
+
'sortable' => true,
|
66 |
+
'width' => 70,
|
67 |
+
'index' => 'country_code',
|
68 |
+
));
|
69 |
+
|
70 |
+
$this->addColumn('country_name', array(
|
71 |
+
'header' => Mage::helper('onestepcheckout')->__('Country Name'),
|
72 |
+
'sortable' => true,
|
73 |
+
'index' => 'country_name',
|
74 |
+
// 'renderer' => 'Abserve_Onestepcheckout_Block_Adminhtml_Renderer_Country',
|
75 |
+
));
|
76 |
+
|
77 |
+
$this->addColumn('current_version', array(
|
78 |
+
'header' => Mage::helper('onestepcheckout')->__('Current Version'),
|
79 |
+
'sortable' => true,
|
80 |
+
'width' => 70,
|
81 |
+
'index' => 'current_version',
|
82 |
+
));
|
83 |
+
|
84 |
+
$this->addColumn('last_version', array(
|
85 |
+
'header' => Mage::helper('onestepcheckout')->__('Latest version'),
|
86 |
+
'sortable' => true,
|
87 |
+
'width' => 70,
|
88 |
+
'index' => 'last_version',
|
89 |
+
));
|
90 |
+
|
91 |
+
$this->addColumn('current_records', array(
|
92 |
+
'header' => Mage::helper('onestepcheckout')->__('Records Updated'),
|
93 |
+
'sortable' => true,
|
94 |
+
'width' => 70,
|
95 |
+
'index' => 'current_records',
|
96 |
+
));
|
97 |
+
|
98 |
+
$this->addColumn('total_records', array(
|
99 |
+
'header' => Mage::helper('onestepcheckout')->__('Records Total'),
|
100 |
+
'sortable' => true,
|
101 |
+
'width' => 70,
|
102 |
+
'index' => 'total_records',
|
103 |
+
));
|
104 |
+
|
105 |
+
$this->addColumn('status', array(
|
106 |
+
'header' => Mage::helper('onestepcheckout')->__('Status'),
|
107 |
+
'sortable' => true,
|
108 |
+
'index' => 'status',
|
109 |
+
'width' => 120,
|
110 |
+
'type' => 'options',
|
111 |
+
'options' => Mage::getModel('onestepcheckout/countrylist')->getStatuses(),
|
112 |
+
'frame_callback' => array($this, 'decorateStatus'),
|
113 |
+
));
|
114 |
+
|
115 |
+
$this->addColumn('update_date', array(
|
116 |
+
'header' => Mage::helper('onestepcheckout')->__('Latest update time'),
|
117 |
+
'sortable' => true,
|
118 |
+
'width' => 200,
|
119 |
+
'type' => 'datetime',
|
120 |
+
'index' => 'update_date',
|
121 |
+
));
|
122 |
+
|
123 |
+
|
124 |
+
$this->addColumn('action',
|
125 |
+
array(
|
126 |
+
'header' => Mage::helper('onestepcheckout')->__('Action'),
|
127 |
+
'width' => '100',
|
128 |
+
'type' => 'action',
|
129 |
+
'getter' => 'getId',
|
130 |
+
'actions' => array(
|
131 |
+
array(
|
132 |
+
'caption' => Mage::helper('onestepcheckout')->__('Update Now'),
|
133 |
+
'url' => array('base'=> 'onestepcheckoutadmin/adminhtml_country/showCountryIp'),
|
134 |
+
'field' => 'id',
|
135 |
+
// 'onclick' => 'importCountry(\''.$this->linkImport().'\');return false;',
|
136 |
+
'popup' => '',
|
137 |
+
)
|
138 |
+
),
|
139 |
+
'filter' => false,
|
140 |
+
'sortable' => false,
|
141 |
+
'index' => 'stores',
|
142 |
+
'is_system' => true,
|
143 |
+
));
|
144 |
+
|
145 |
+
return parent::_prepareColumns();
|
146 |
+
}
|
147 |
+
public function getGridUrl()
|
148 |
+
{
|
149 |
+
return $this->getData('grid_url')
|
150 |
+
? $this->getData('grid_url')
|
151 |
+
: $this->getUrl('*/*/grid', array(
|
152 |
+
'_current'=>true
|
153 |
+
));
|
154 |
+
}
|
155 |
+
|
156 |
+
protected function _prepareMassaction()
|
157 |
+
{
|
158 |
+
$this->setMassactionIdField('country_code');
|
159 |
+
$this->getMassactionBlock()->setFormFieldName('countryid');
|
160 |
+
|
161 |
+
$this->getMassactionBlock()->addItem('import', array(
|
162 |
+
'label'=> Mage::helper('onestepcheckout')->__('Import Geoip Database'),
|
163 |
+
//'url' => $this->getUrl('*/*/showGeoip', array('_current'=>true)),
|
164 |
+
// 'onclick' => 'alert("3")',
|
165 |
+
));
|
166 |
+
return $this;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function linkImport()
|
170 |
+
{
|
171 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_geoip/showGeoip',array(
|
172 |
+
'website' => $this->getRequest()->getParam('website'),
|
173 |
+
));
|
174 |
+
return $link;
|
175 |
+
}
|
176 |
+
|
177 |
+
public function getRowUrl($row)
|
178 |
+
{
|
179 |
+
return false;
|
180 |
+
}
|
181 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Countrygrid.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Countrygrid extends Mage_Adminhtml_Block_Widget_Grid_Container
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->_controller = 'adminhtml_country';
|
16 |
+
$this->_blockGroup = 'onestepcheckout';
|
17 |
+
$this->_headerText = Mage::helper('onestepcheckout')->__('Update Country Postcode Database');
|
18 |
+
|
19 |
+
$this->_addButton('importcountry', array(
|
20 |
+
'label' => Mage::helper('onestepcheckout')->__('Update Selected Database'),
|
21 |
+
'onclick' => 'getLinkImport(\''.$this->linkImport().'\')',
|
22 |
+
'class' => 'save',
|
23 |
+
),-100);
|
24 |
+
|
25 |
+
$this->_addButtonLabel = Mage::helper('onestepcheckout')->__('Upload New Database Version');
|
26 |
+
parent::__construct();
|
27 |
+
// $this->_removeButton('add');
|
28 |
+
}
|
29 |
+
public function linkImport()
|
30 |
+
{
|
31 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_country/showCountryIp',array(
|
32 |
+
'website' => $this->getRequest()->getParam('website'),
|
33 |
+
// '_query' => array('isAjax' => 'true')
|
34 |
+
));
|
35 |
+
return $link;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip extends Mage_Core_Block_Template
|
12 |
+
{
|
13 |
+
protected $_website_id = null;
|
14 |
+
|
15 |
+
protected function _construct()
|
16 |
+
{
|
17 |
+
parent::_construct();
|
18 |
+
$this->_website_id = $this->getRequest()->getParam('website');
|
19 |
+
}
|
20 |
+
|
21 |
+
public function _prepareLayout()
|
22 |
+
{
|
23 |
+
parent::_prepareLayout();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getGeoipVersion()
|
27 |
+
{
|
28 |
+
return $this->getRequest()->getParam('version');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getWebsiteId()
|
32 |
+
{
|
33 |
+
return $this->_website_id;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getImageLink()
|
37 |
+
{
|
38 |
+
return $this->getSkinUrl('images/transfer-ajax-loader.gif');
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getImageLinkStop()
|
42 |
+
{
|
43 |
+
return $this->getSkinUrl('images/ajax-loader.jpg');
|
44 |
+
}
|
45 |
+
|
46 |
+
public function checkDataImport()
|
47 |
+
{
|
48 |
+
|
49 |
+
$geoip = Mage::getModel('onestepcheckout/countrylist')->load(1, 'type');
|
50 |
+
$lastVersion = $geoip->getLastVersion();
|
51 |
+
if($lastVersion == '1.0')
|
52 |
+
$fileUrl = 'version1.0'.DS.'geoip.csv';
|
53 |
+
else
|
54 |
+
$fileUrl = 'nextversion'.DS.'geoip_'.$lastVersion.'.csv';
|
55 |
+
$fileImport = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'abserve_geoip'.DS.'geoip'.DS.$fileUrl;
|
56 |
+
// return $fileImport;
|
57 |
+
if(file_exists($fileImport))
|
58 |
+
return file_exists($fileImport);
|
59 |
+
|
60 |
+
return false;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function actionImport()
|
64 |
+
{
|
65 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_geoip/importGeoip',array(
|
66 |
+
'website' => $this->getWebsiteId(),
|
67 |
+
'version' => $this->getGeoipVersion(),
|
68 |
+
));
|
69 |
+
return $link;
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
11 |
+
{
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
|
16 |
+
$this->_objectId = 'id';
|
17 |
+
$this->_blockGroup = 'onestepcheckout';
|
18 |
+
$this->_controller = 'adminhtml_geoip';
|
19 |
+
|
20 |
+
$this->_updateButton('save', 'label', Mage::helper('onestepcheckout')->__('Upload'));
|
21 |
+
|
22 |
+
$this->_addButton('saveandcontinue', array(
|
23 |
+
'label' => Mage::helper('adminhtml')->__('Upload and Continue'),
|
24 |
+
'onclick' => 'saveAndContinueEdit()',
|
25 |
+
'class' => 'save',
|
26 |
+
), -100);
|
27 |
+
|
28 |
+
$this->_formScripts[] = "
|
29 |
+
function toggleEditor() {
|
30 |
+
if (tinyMCE.getInstanceById('geoip_content') == null)
|
31 |
+
tinyMCE.execCommand('mceAddControl', false, 'geoip_content');
|
32 |
+
else
|
33 |
+
tinyMCE.execCommand('mceRemoveControl', false, 'geoip_content');
|
34 |
+
}
|
35 |
+
|
36 |
+
function saveAndContinueEdit(){
|
37 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
38 |
+
}
|
39 |
+
//edit back button in import
|
40 |
+
function backEdit()
|
41 |
+
{
|
42 |
+
window.history.back();
|
43 |
+
}
|
44 |
+
";
|
45 |
+
}
|
46 |
+
/**
|
47 |
+
* get text to show in header when edit an item
|
48 |
+
*
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function getHeaderText()
|
52 |
+
{
|
53 |
+
return Mage::helper('onestepcheckout')->__('Upload new GeoIP database');
|
54 |
+
}
|
55 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Form.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* prepare form's information for block
|
14 |
+
*
|
15 |
+
* @return Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Edit_Form
|
16 |
+
*/
|
17 |
+
protected function _prepareForm()
|
18 |
+
{
|
19 |
+
$form = new Varien_Data_Form(array(
|
20 |
+
'id' => 'edit_form',
|
21 |
+
'action' => $this->getUrl('*/*/save', array(
|
22 |
+
'id' => $this->getRequest()->getParam('id'),
|
23 |
+
)),
|
24 |
+
'method' => 'post',
|
25 |
+
'enctype' => 'multipart/form-data'
|
26 |
+
));
|
27 |
+
|
28 |
+
$form->setUseContainer(true);
|
29 |
+
$this->setForm($form);
|
30 |
+
return parent::_prepareForm();
|
31 |
+
}
|
32 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
12 |
+
{
|
13 |
+
protected function _prepareForm()
|
14 |
+
{
|
15 |
+
$form = new Varien_Data_Form();
|
16 |
+
$this->setForm($form);
|
17 |
+
$fieldset = $form->addFieldset('import_form', array('legend'=>Mage::helper('onestepcheckout')->__('Upload File')));
|
18 |
+
|
19 |
+
$fieldset->addField('csv_geoip', 'file', array(
|
20 |
+
'label' => Mage::helper('onestepcheckout')->__('CSV File'),
|
21 |
+
'class' => 'required-entry',
|
22 |
+
'required' => true,
|
23 |
+
'name' => 'csv_geoip',
|
24 |
+
'note' => Mage::helper('onestepcheckout')->__("Use Geoip database only to avoid error
|
25 |
+
<br/>Link download").": <a href='http://www.abserve.com/geoip-databases.html'>Here</a>",
|
26 |
+
));
|
27 |
+
|
28 |
+
return parent::_prepareForm();
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Edit/Tabs.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
11 |
+
{
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
$this->setId('geoip_tabs');
|
16 |
+
$this->setDestElementId('edit_form');
|
17 |
+
$this->setTitle(Mage::helper('onestepcheckout')->__('Upload New GeoIP Database'));
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* prepare before render block to html
|
22 |
+
*
|
23 |
+
* @return Abserve_Geoip_Block_Adminhtml_Geoip_Edit_Tabs
|
24 |
+
*/
|
25 |
+
protected function _beforeToHtml()
|
26 |
+
{
|
27 |
+
$this->addTab('form_section', array(
|
28 |
+
'label' => Mage::helper('onestepcheckout')->__('Upload new GeoIP Database'),
|
29 |
+
'title' => Mage::helper('onestepcheckout')->__('Upload new GeoIP Database'),
|
30 |
+
'content' => $this->getLayout()
|
31 |
+
->createBlock('onestepcheckout/adminhtml_geoip_edit_tab_form')
|
32 |
+
->toHtml(),
|
33 |
+
));
|
34 |
+
return parent::_beforeToHtml();
|
35 |
+
}
|
36 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoip/Grid.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoip_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* prepare tab form's information
|
13 |
+
*
|
14 |
+
* @return Abserve_Geoip_Block_Adminhtml_Geoip_Edit_Tab_Form
|
15 |
+
*/
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
parent::__construct();
|
19 |
+
$this->setUseAjax(false);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getGeoip()
|
23 |
+
{
|
24 |
+
return Mage::getModel('onestepcheckout/countrylist')->load(1, 'type');
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
public function _prepareLayout()
|
29 |
+
{
|
30 |
+
$this->setTemplate('onestepcheckout/geoipgrid.phtml');
|
31 |
+
}
|
32 |
+
|
33 |
+
public function linkUpdateGeoip()
|
34 |
+
{
|
35 |
+
$geoIp = Mage::getModel('onestepcheckout/countrylist')->load(1, 'type');
|
36 |
+
if($geoIp->getCurrentVersion() == $geoIp->getLastVersion() && $geoIp->getStatus()=='1'){
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
else{
|
40 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_geoip/showGeoip',array(
|
41 |
+
'website' => $this->getRequest()->getParam('website'),
|
42 |
+
'_query' => array('isAjax' => 'false'),
|
43 |
+
));
|
44 |
+
return $link;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Geoipgrid.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Geoipgrid extends Mage_Adminhtml_Block_Widget_Grid_Container
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->_controller = 'adminhtml_geoip';
|
16 |
+
$this->_blockGroup = 'onestepcheckout';
|
17 |
+
$this->_headerText = Mage::helper('onestepcheckout')->__('Update GeoIP Database');
|
18 |
+
|
19 |
+
// $this->_addButton('importcountry', array(
|
20 |
+
// 'label' => Mage::helper('onestepcheckout')->__('Import Geoip Database Version1.0'),
|
21 |
+
// 'onclick' => 'importCountryIp(\''.$this->linkImportGeoip().'\')',
|
22 |
+
// 'class' => 'save',
|
23 |
+
// ),-100);
|
24 |
+
|
25 |
+
$this->_addButtonLabel = Mage::helper('onestepcheckout')->__('Upload New GeoIP Database Version');
|
26 |
+
|
27 |
+
parent::__construct();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function linkImportGeoip()
|
31 |
+
{
|
32 |
+
$link = Mage::getSingleton('adminhtml/url')->getUrl('onestepcheckoutadmin/adminhtml_geoip/showGeoip',array(
|
33 |
+
'website' => $this->getRequest()->getParam('website'),
|
34 |
+
'_query' => array('isAjax' => 'false'),
|
35 |
+
'version' => '1',
|
36 |
+
));
|
37 |
+
return $link;
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Sales/Order/View/Tab/Delivery.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Sales_Order_View_Tab_Delivery
|
12 |
+
extends Mage_Adminhtml_Block_Template
|
13 |
+
implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
public function _construct() {
|
18 |
+
parent::_construct();
|
19 |
+
$this->setTemplate('onestepcheckout/sales/order/view/tab/delivery.phtml');
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getTabLabel() {
|
23 |
+
return Mage::helper('onestepcheckout')->__('Delivery Information');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getTabTitle() {
|
27 |
+
return Mage::helper('onestepcheckout')->__('Delivery Information');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function canShowTab() {
|
31 |
+
return true;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function isHidden() {
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getOrder() {
|
39 |
+
return Mage::registry('current_order');
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getLastItem($orderId=null) {
|
43 |
+
if(!$orderId){
|
44 |
+
$order_id=Mage::app()->getRequest()->getParam('order_id');
|
45 |
+
}else{
|
46 |
+
$order_id=$orderId;
|
47 |
+
}
|
48 |
+
$invoice_id=Mage::app()->getRequest()->getParam('invoice_id');
|
49 |
+
$shipment_id=Mage::app()->getRequest()->getParam('shipment_id');
|
50 |
+
$creditmemo_id=Mage::app()->getRequest()->getParam('creditmemo_id');
|
51 |
+
if($order_id){
|
52 |
+
$order=Mage::getModel('sales/order')->load($order_id);
|
53 |
+
}else if($invoice_id){
|
54 |
+
$order=Mage::getModel('sales/order_invoice')->load($invoice_id)->getOrder();
|
55 |
+
}else if($shipment_id){
|
56 |
+
$order=Mage::getModel('sales/order_shipment')->load($shipment_id)->getOrder();
|
57 |
+
}else if($creditmemo_id){
|
58 |
+
$order=Mage::getModel('sales/order_creditmemo')->load($creditmemo_id)->getOrder();
|
59 |
+
}
|
60 |
+
$itemcollection=$order->getItemsCollection()
|
61 |
+
;
|
62 |
+
//Zend_Debug::dump(get_class_methods($itemcollection));die();
|
63 |
+
|
64 |
+
$item=$this->getParentBlock()->getItem();
|
65 |
+
$lastItem=$itemcollection->getLastItem();
|
66 |
+
if($lastItem->getParentItemId()){
|
67 |
+
$lastId=$lastItem->getParentItemId();
|
68 |
+
}else{
|
69 |
+
$lastId=$lastItem->getId();
|
70 |
+
}
|
71 |
+
if($lastId != $this->getParentBlock()->getItem()->getId()){
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
return true;
|
76 |
+
}
|
77 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/Sales/Order/View/Tab/Survey.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_Sales_Order_View_Tab_Survey
|
12 |
+
extends Mage_Adminhtml_Block_Template
|
13 |
+
implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
public function _construct() {
|
18 |
+
parent::_construct();
|
19 |
+
$this->setTemplate('onestepcheckout/sales/order/view/tab/survey.phtml');
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getTabLabel() {
|
23 |
+
return Mage::helper('onestepcheckout')->__('Survey Information');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getTabTitle() {
|
27 |
+
return Mage::helper('onestepcheckout')->__('Survey Information');
|
28 |
+
}
|
29 |
+
|
30 |
+
public function canShowTab() {
|
31 |
+
return true;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function isHidden() {
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getOrder() {
|
39 |
+
return Mage::registry('current_order');
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getLastItem($orderId=null) {
|
43 |
+
if(!$orderId){
|
44 |
+
$order_id=Mage::app()->getRequest()->getParam('order_id');
|
45 |
+
}else{
|
46 |
+
$order_id=$orderId;
|
47 |
+
}
|
48 |
+
$invoice_id=Mage::app()->getRequest()->getParam('invoice_id');
|
49 |
+
$shipment_id=Mage::app()->getRequest()->getParam('shipment_id');
|
50 |
+
$creditmemo_id=Mage::app()->getRequest()->getParam('creditmemo_id');
|
51 |
+
if($order_id){
|
52 |
+
$order=Mage::getModel('sales/order')->load($order_id);
|
53 |
+
}else if($invoice_id){
|
54 |
+
$order=Mage::getModel('sales/order_invoice')->load($invoice_id)->getOrder();
|
55 |
+
}else if($shipment_id){
|
56 |
+
$order=Mage::getModel('sales/order_shipment')->load($shipment_id)->getOrder();
|
57 |
+
}else if($creditmemo_id){
|
58 |
+
$order=Mage::getModel('sales/order_creditmemo')->load($creditmemo_id)->getOrder();
|
59 |
+
}
|
60 |
+
$itemcollection=$order->getItemsCollection()
|
61 |
+
;
|
62 |
+
//Zend_Debug::dump(get_class_methods($itemcollection));die();
|
63 |
+
|
64 |
+
$item=$this->getParentBlock()->getItem();
|
65 |
+
$lastItem=$itemcollection->getLastItem();
|
66 |
+
if($lastItem->getParentItemId()){
|
67 |
+
$lastId=$lastItem->getParentItemId();
|
68 |
+
}else{
|
69 |
+
$lastId=$lastItem->getId();
|
70 |
+
}
|
71 |
+
if($lastId != $this->getParentBlock()->getItem()->getId()){
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
return true;
|
76 |
+
}
|
77 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Field/Position.php
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_System_Config_Field_Position extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
13 |
+
|
14 |
+
protected $_dummyElement;
|
15 |
+
protected $_fieldRenderer;
|
16 |
+
protected $_values;
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
21 |
+
$storecode = Mage::app()->getRequest()->getParam('store');
|
22 |
+
$website = Mage::app()->getRequest()->getParam('website');
|
23 |
+
$helper = Mage::helper('onestepcheckout');
|
24 |
+
|
25 |
+
if ($storecode) {
|
26 |
+
$store = $helper->getStoreByCode($storecode);
|
27 |
+
$scope = 'stores';
|
28 |
+
$scopeId = (int) Mage::getConfig()->getNode('stores/' . $storecode . '/system/store/id');
|
29 |
+
} elseif ($website) {
|
30 |
+
$scope = 'websites';
|
31 |
+
$scopeId = (int) Mage::getConfig()->getNode('websites/' . $website . '/system/website/id');
|
32 |
+
} else {
|
33 |
+
$scope = 'default';
|
34 |
+
$scopeId = 0;
|
35 |
+
}
|
36 |
+
|
37 |
+
$html = $this->_getHeaderHtml($element);
|
38 |
+
$checkNull = 1;
|
39 |
+
|
40 |
+
for ($i = 0; $i < 20; $i++) {
|
41 |
+
// var_dump($helper->getFieldEnable($i));
|
42 |
+
if ($helper->getDefaultField($i) && $helper->getDefaultField($i) != '0') {
|
43 |
+
$checkNull = 0;
|
44 |
+
break;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
if ($checkNull == 1) {
|
48 |
+
$arrayDefaults = $helper->getDefaultPositionArray();
|
49 |
+
foreach($arrayDefaults as $number => $value){
|
50 |
+
$model = Mage::getModel('onestepcheckout/config');
|
51 |
+
$model->setScope('default')
|
52 |
+
->setScopeId(0)
|
53 |
+
->setPath('onestepcheckout/field_position_management/row_'.$number)
|
54 |
+
->setValue($value);
|
55 |
+
$model->save();
|
56 |
+
}
|
57 |
+
}
|
58 |
+
$html .= '<div class="user_guide">Configure positions of fields in Section Billing and Shipping Address. You can display fields into 2 columns (eg: First name + Last name) or 1 full column (eg: Address + Null)</div>';
|
59 |
+
|
60 |
+
$fieldArrays = array();
|
61 |
+
for ($i = 0; $i < 20; $i++) {
|
62 |
+
$fieldArrays[] = 'onestepcheckout_field_position_management_row_' . $i;
|
63 |
+
$html .= $this->_getFieldHtml($element, $i, $scope, $scopeId);
|
64 |
+
}
|
65 |
+
|
66 |
+
$html .='
|
67 |
+
<style type="text/css">
|
68 |
+
#onestepcheckout_field_position_management_position{
|
69 |
+
display:none;
|
70 |
+
}
|
71 |
+
#onestepcheckout_field_position_management .collapseable{
|
72 |
+
display:none;
|
73 |
+
}
|
74 |
+
.user_guide{
|
75 |
+
background:none repeat scroll 0 0 #EAF0EE;
|
76 |
+
border:1px dotted #FF0000;
|
77 |
+
margin-bottom: 20px;
|
78 |
+
padding: 20px;
|
79 |
+
}
|
80 |
+
</style>
|
81 |
+
<script type="text/javascript">
|
82 |
+
var previous;
|
83 |
+
function forcus(field)
|
84 |
+
{
|
85 |
+
previous = field.value;
|
86 |
+
}
|
87 |
+
function checkfield(field){
|
88 |
+
for (var k=0; k<20; k++){
|
89 |
+
if((field.value == $("onestepcheckout_field_position_management_row_"+k).value)
|
90 |
+
&& (field.id != "onestepcheckout_field_position_management_row_"+k)
|
91 |
+
&&(field.value!="0")
|
92 |
+
){
|
93 |
+
field.value = previous;
|
94 |
+
alert("This field already exists!");
|
95 |
+
break;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
function changeValueSelect(){
|
100 |
+
if($("affiliateplus_payment_moneybooker_user_mechant_email_default").value == "1"){
|
101 |
+
if($("row_affiliateplus_payment_moneybooker_moneybooker_email"))
|
102 |
+
$("row_affiliateplus_payment_moneybooker_moneybooker_email").style.display = "none";
|
103 |
+
}else{
|
104 |
+
if($("row_affiliateplus_payment_moneybooker_moneybooker_email"))
|
105 |
+
$("row_affiliateplus_payment_moneybooker_moneybooker_email").style.display = "";
|
106 |
+
}
|
107 |
+
}
|
108 |
+
function checkValueRequire(){
|
109 |
+
var firstnameRequire = "1";
|
110 |
+
var lastnameRequire = "1";
|
111 |
+
var emailRequire = "1";
|
112 |
+
var message = "In Field Position Management\n\n";
|
113 |
+
for (var k=0; k<20; k++){
|
114 |
+
if($("onestepcheckout_field_position_management_row_"+k).value == "firstname"){
|
115 |
+
firstnameRequire = "0";
|
116 |
+
}
|
117 |
+
if($("onestepcheckout_field_position_management_row_"+k).value == "lastname"){
|
118 |
+
lastnameRequire = "0";
|
119 |
+
}
|
120 |
+
if($("onestepcheckout_field_position_management_row_"+k).value == "email"){
|
121 |
+
emailRequire = "0";
|
122 |
+
}
|
123 |
+
}
|
124 |
+
if(firstnameRequire=="1" || lastnameRequire=="1" || emailRequire=="1"){
|
125 |
+
if(firstnameRequire=="1")
|
126 |
+
message += "The First Name field is missing!\n";
|
127 |
+
if(lastnameRequire=="1")
|
128 |
+
message += "The Last Name field is missing!\n";
|
129 |
+
if(emailRequire=="1")
|
130 |
+
message += "The Email field is missing!\n";
|
131 |
+
message += "\n\n Please select the position for them!";
|
132 |
+
alert(message);
|
133 |
+
}else{
|
134 |
+
configForm.submit();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
</script>';
|
138 |
+
|
139 |
+
return $html;
|
140 |
+
}
|
141 |
+
|
142 |
+
protected function _getDummyElement() {
|
143 |
+
if (empty($this->_dummyElement)) {
|
144 |
+
$this->_dummyElement = new Varien_Object(array('show_in_default' => 1, 'show_in_website' => 1));
|
145 |
+
}
|
146 |
+
return $this->_dummyElement;
|
147 |
+
}
|
148 |
+
|
149 |
+
protected function _getFieldRenderer() {
|
150 |
+
if (empty($this->_fieldRenderer)) {
|
151 |
+
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
152 |
+
}
|
153 |
+
return $this->_fieldRenderer;
|
154 |
+
}
|
155 |
+
|
156 |
+
protected function _showAllOption() {
|
157 |
+
return array(
|
158 |
+
'0' => Mage::helper('onestepcheckout')->__('Null'),
|
159 |
+
'firstname' => Mage::helper('onestepcheckout')->__('First Name'),
|
160 |
+
'lastname' => Mage::helper('onestepcheckout')->__('Last Name'),
|
161 |
+
'prefix' => Mage::helper('onestepcheckout')->__('Prefix Name'),
|
162 |
+
'middlename' => Mage::helper('onestepcheckout')->__('Middle Name'),
|
163 |
+
'suffix' => Mage::helper('onestepcheckout')->__('Suffix Name'),
|
164 |
+
'email' => Mage::helper('onestepcheckout')->__('Email Address'),
|
165 |
+
'company' => Mage::helper('onestepcheckout')->__('Company'),
|
166 |
+
'street' => Mage::helper('onestepcheckout')->__('Address'),
|
167 |
+
'country' => Mage::helper('onestepcheckout')->__('Country'),
|
168 |
+
'region' => Mage::helper('onestepcheckout')->__('State/Province'),
|
169 |
+
'city' => Mage::helper('onestepcheckout')->__('City'),
|
170 |
+
'postcode' => Mage::helper('onestepcheckout')->__('Zip/Postal Code'),
|
171 |
+
'telephone' => Mage::helper('onestepcheckout')->__('Telephone'),
|
172 |
+
'fax' => Mage::helper('onestepcheckout')->__('Fax'),
|
173 |
+
'birthday' => Mage::helper('onestepcheckout')->__('Date of Birth'),
|
174 |
+
'gender' => Mage::helper('onestepcheckout')->__('Gender'),
|
175 |
+
'taxvat' => Mage::helper('onestepcheckout')->__('Tax/VAT number'),
|
176 |
+
);
|
177 |
+
}
|
178 |
+
|
179 |
+
protected function _optionToHtml($option, $selected) {
|
180 |
+
$html = '<option value="' . $option["key"] . '"';
|
181 |
+
$html.= isset($option['value']) ? 'title="' . $option['value'] . '"' : '';
|
182 |
+
//$html.= isset($option['style']) ? 'style="'.$option['style'].'"' : '';
|
183 |
+
if ($option['key'] == $selected) {
|
184 |
+
$html.= ' selected="selected"';
|
185 |
+
}
|
186 |
+
$html.= '>' . $option['value'] . '</option>' . "\n";
|
187 |
+
return $html;
|
188 |
+
}
|
189 |
+
|
190 |
+
protected function _getFieldHtml($fieldset, $number, $scope, $scopeId) {
|
191 |
+
$configData = $this->getConfigData();
|
192 |
+
$defaultLabel = Mage::helper('onestepcheckout')->__('Use Default');
|
193 |
+
$defaultTitle = Mage::helper('onestepcheckout')->__('-- Please Select --');
|
194 |
+
$scopeLabel = Mage::helper('onestepcheckout')->__('STORE VIEW');
|
195 |
+
$path = 'onestepcheckout/field_position_management/row_' . $number;
|
196 |
+
$helper = Mage::helper('onestepcheckout');
|
197 |
+
$data = $helper->getFieldEnableBackEnd($number, $scope, $scopeId); //isset($helper->getFieldEnable($number)) ? $helper->getFieldEnable($number) : '';
|
198 |
+
$e = $this->_getDummyElement();
|
199 |
+
$html = '';
|
200 |
+
if($number % 2 == 0){
|
201 |
+
$html.= '<tr>';
|
202 |
+
}
|
203 |
+
$active = true;
|
204 |
+
if($scope != 'default' && count($data)==0)
|
205 |
+
$active = false;
|
206 |
+
$html .= '<td class="value">';
|
207 |
+
$html .= '<select style="width: 280px;margin-left:30px;" onfocus="forcus(this);" onchange="checkfield(this);" id="onestepcheckout_field_position_management_row_' . $number . '" name="groups[field_position_management][fields][row_' . $number . '][value]" ' . ($active ? '' : 'disabled=""') . ' class="select">';
|
208 |
+
$allOptions = $this->_showAllOption();
|
209 |
+
foreach ($allOptions as $key => $value) {
|
210 |
+
$option['value'] = $value;
|
211 |
+
$option['key'] = $key;
|
212 |
+
if(count($data)){
|
213 |
+
$selected = $data;
|
214 |
+
}else{
|
215 |
+
$selected = $helper->getDefaultField($number);
|
216 |
+
}
|
217 |
+
$html.= $this->_optionToHtml($option, $selected);
|
218 |
+
}
|
219 |
+
$html.= '</select></td>';
|
220 |
+
if ($scope != 'default') {
|
221 |
+
$html .= '<td class="use-default">
|
222 |
+
<input id="onestepcheckout_field_position_management_row_' . $number . '_inherit" name="groups[field_position_management][fields][row_' . $number . '][inherit]" type="checkbox" value="1" class="checkbox config-inherit" ' . (count($data) ? '' : 'checked="checked"') . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" />
|
223 |
+
<label for="onestepcheckout_field_position_management_row_' . $number . '_inherit" class="inherit" title="' . $defaultTitle . '">' . $defaultLabel . '</label>
|
224 |
+
</td>';
|
225 |
+
} else {
|
226 |
+
$html .= '<td class="scope-label">[' . $scopeLabel . ']</td>';
|
227 |
+
}
|
228 |
+
if ($number % 2 != 0 || $number == 19) {
|
229 |
+
$html .= '</tr>';
|
230 |
+
}
|
231 |
+
return $html;
|
232 |
+
}
|
233 |
+
|
234 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Field/Style.php
ADDED
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_System_Config_Field_Style extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
13 |
+
|
14 |
+
protected $_dummyElement;
|
15 |
+
protected $_fieldRenderer;
|
16 |
+
protected $_values;
|
17 |
+
|
18 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
19 |
+
$helper = Mage::helper('onestepcheckout');
|
20 |
+
$storecode = Mage::app()->getRequest()->getParam('store');
|
21 |
+
$website = Mage::app()->getRequest()->getParam('website');
|
22 |
+
|
23 |
+
if ($storecode) {
|
24 |
+
$store = $helper->getStoreByCode($storecode);
|
25 |
+
$scope = 'stores';
|
26 |
+
$scopeId = (int) Mage::getConfig()->getNode('stores/' . $storecode . '/system/store/id');
|
27 |
+
} elseif ($website) {
|
28 |
+
$scope = 'websites';
|
29 |
+
$scopeId = (int) Mage::getConfig()->getNode('websites/' . $website . '/system/website/id');
|
30 |
+
} else {
|
31 |
+
$scope = 'default';
|
32 |
+
$scopeId = 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
$path = 'onestepcheckout/style_management/style';
|
36 |
+
$style = Mage::getModel('onestepcheckout/config')->getCollection()
|
37 |
+
->addFieldToFilter('scope',$scope)
|
38 |
+
->addFieldToFilter('path', $path)
|
39 |
+
->addFieldToFilter('scope_id', $scopeId)
|
40 |
+
->getFirstItem()
|
41 |
+
->getValue();
|
42 |
+
|
43 |
+
$html = $this->_getHeaderHtml($element);
|
44 |
+
$html .= '<div style="margin-top: 10px; font-weight: bold; border-bottom: 1px solid rgb(223, 223, 223);"> '.Mage::helper('onestepcheckout')->__('Style Color').'</div>';
|
45 |
+
$fieldArrays = array();
|
46 |
+
$fieldArrays[] = 'onestepcheckout_style_management_style';
|
47 |
+
$html .= '</table>';
|
48 |
+
$html .= $this->_getFieldHtml($element, $scope, $scopeId);
|
49 |
+
|
50 |
+
if (!$style) {
|
51 |
+
$style = Mage::getModel('onestepcheckout/config')->getCollection()
|
52 |
+
->addFieldToFilter('scope','default')
|
53 |
+
->addFieldToFilter('path', $path)
|
54 |
+
->addFieldToFilter('scope_id', 0)
|
55 |
+
->getFirstItem()
|
56 |
+
->getValue();
|
57 |
+
}
|
58 |
+
$customPath = 'onestepcheckout/style_management/custom';
|
59 |
+
$custom = Mage::getModel('onestepcheckout/config')->getCollection()
|
60 |
+
->addFieldToFilter('scope',$scope)
|
61 |
+
->addFieldToFilter('path', $customPath)
|
62 |
+
->addFieldToFilter('scope_id', $scopeId)
|
63 |
+
->getFirstItem()
|
64 |
+
->getValue();
|
65 |
+
|
66 |
+
if (!$custom) {
|
67 |
+
$custom = Mage::getModel('onestepcheckout/config')->getCollection()
|
68 |
+
->addFieldToFilter('scope','default')
|
69 |
+
->addFieldToFilter('path', $customPath)
|
70 |
+
->addFieldToFilter('scope_id', 0)
|
71 |
+
->getFirstItem()
|
72 |
+
->getValue();
|
73 |
+
}
|
74 |
+
if($style=='custom'){
|
75 |
+
$html .='<div id="showreview">
|
76 |
+
<input value="'.$custom.'" style="background-color: #'.$custom.';margin-left: 36px;" name="groups[style_management][fields][style][custom]" id="onestepcheckout_style_management_custom" onclick="loadColor_onestepcheckout(\'click\')"/>
|
77 |
+
</div>';
|
78 |
+
|
79 |
+
}else{
|
80 |
+
$html .='<div id="showreview">
|
81 |
+
<img width="957px" src="' . Mage::getBlockSingleton('core/template')->getSkinUrl('images/onestepcheckout/style/') . $style . '.png" />
|
82 |
+
</div>';
|
83 |
+
}
|
84 |
+
$html .= '
|
85 |
+
<style type="text/css">
|
86 |
+
#onestepcheckout_style_management .collapseable{
|
87 |
+
display:none;
|
88 |
+
}
|
89 |
+
</style>
|
90 |
+
<script type="text/javascript">
|
91 |
+
loadColor_onestepcheckout(\'click\');
|
92 |
+
function showreview(style)
|
93 |
+
{
|
94 |
+
if(style.value=="custom"){
|
95 |
+
var show = "<input value=\"'.$custom.'\" style=\"background-color: #'.$custom.';margin-left: 36px;\" name=\"groups[style_management][fields][style][custom]\" id=\"onestepcheckout_style_management_custom\" onclick=\"loadColor_onestepcheckout(\'click\')\"/>";
|
96 |
+
$("showreview").innerHTML = show;
|
97 |
+
}else{
|
98 |
+
var show = "<img width=\"957px\" src=\"' . Mage::getBlockSingleton('core/template')->getSkinUrl('images/onestepcheckout/style/') . '";
|
99 |
+
show +=style.value+".png\" />";
|
100 |
+
$("showreview").innerHTML=show;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
</script>
|
104 |
+
';
|
105 |
+
|
106 |
+
/*Checkout button - Michael20140609*/
|
107 |
+
$buttonPath = 'onestepcheckout/style_management/button';
|
108 |
+
$buttonStyle = Mage::getModel('onestepcheckout/config')->getCollection()
|
109 |
+
->addFieldToFilter('scope',$scope)
|
110 |
+
->addFieldToFilter('path', $buttonPath)
|
111 |
+
->addFieldToFilter('scope_id', $scopeId)
|
112 |
+
->getFirstItem()
|
113 |
+
->getValue();
|
114 |
+
|
115 |
+
$html .= '<div style="margin-top: 10px; font-weight: bold; border-bottom: 1px solid rgb(223, 223, 223);"> '.Mage::helper('onestepcheckout')->__('"Place Order Now" button Color').'</div>';
|
116 |
+
$fieldArrays = array();
|
117 |
+
$fieldArrays[] = 'onestepcheckout_style_management_button';
|
118 |
+
$html .= $this->_getButtonHtml($element, $scope, $scopeId);
|
119 |
+
if (!$buttonStyle) {
|
120 |
+
$buttonStyle = Mage::getModel('onestepcheckout/config')->getCollection()
|
121 |
+
->addFieldToFilter('scope','default')
|
122 |
+
->addFieldToFilter('path', $buttonPath)
|
123 |
+
->addFieldToFilter('scope_id', 0)
|
124 |
+
->getFirstItem()
|
125 |
+
->getValue();
|
126 |
+
}
|
127 |
+
$customButtonPath = 'onestepcheckout/style_management/custombutton';
|
128 |
+
$customButton = Mage::getModel('onestepcheckout/config')->getCollection()
|
129 |
+
->addFieldToFilter('scope',$scope)
|
130 |
+
->addFieldToFilter('path', $customButtonPath)
|
131 |
+
->addFieldToFilter('scope_id', $scopeId)
|
132 |
+
->getFirstItem()
|
133 |
+
->getValue();
|
134 |
+
|
135 |
+
if (!$customButton) {
|
136 |
+
$customButton = Mage::getModel('onestepcheckout/config')->getCollection()
|
137 |
+
->addFieldToFilter('scope','default')
|
138 |
+
->addFieldToFilter('path', $customButtonPath)
|
139 |
+
->addFieldToFilter('scope_id', 0)
|
140 |
+
->getFirstItem()
|
141 |
+
->getValue();
|
142 |
+
}
|
143 |
+
if($buttonStyle=='custom'){
|
144 |
+
$html .='<div id="showreviewbutton">
|
145 |
+
<input value="'.$customButton.'" style="background-color: #'.$customButton.';margin-left: 36px;" name="groups[style_management][fields][button][custombutton]" id="onestepcheckout_style_management_custombutton" onclick="loadColor_onestepcheckoutbutton(\'click\')"/>
|
146 |
+
</div>';
|
147 |
+
|
148 |
+
}else{
|
149 |
+
$html .='<div id="showreviewbutton">
|
150 |
+
</div>';
|
151 |
+
}
|
152 |
+
$html .= '
|
153 |
+
<script type="text/javascript">
|
154 |
+
loadColor_onestepcheckoutbutton(\'click\');
|
155 |
+
function showreviewbutton(style)
|
156 |
+
{
|
157 |
+
if(style.value=="custom"){
|
158 |
+
var show = "<input value=\"'.$customButton.'\" style=\"background-color: #'.$customButton.';margin-left: 36px;\" name=\"groups[style_management][fields][button][custombutton]\" id=\"onestepcheckout_style_management_custombutton\" onclick=\"loadColor_onestepcheckoutbutton(\'click\')\"/>";
|
159 |
+
$("showreviewbutton").innerHTML = show;
|
160 |
+
}else{
|
161 |
+
$("showreviewbutton").innerHTML="";
|
162 |
+
}
|
163 |
+
}
|
164 |
+
</script>
|
165 |
+
';
|
166 |
+
return $html;
|
167 |
+
}
|
168 |
+
|
169 |
+
protected function _getDummyElement() {
|
170 |
+
if (empty($this->_dummyElement)) {
|
171 |
+
$this->_dummyElement = new Varien_Object(array('show_in_default' => 1, 'show_in_website' => 1));
|
172 |
+
}
|
173 |
+
return $this->_dummyElement;
|
174 |
+
}
|
175 |
+
|
176 |
+
protected function _getFieldRenderer() {
|
177 |
+
if (empty($this->_fieldRenderer)) {
|
178 |
+
$this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
|
179 |
+
}
|
180 |
+
return $this->_fieldRenderer;
|
181 |
+
}
|
182 |
+
|
183 |
+
protected function _showAllOption() {
|
184 |
+
return array(
|
185 |
+
'orange' => Mage::helper('onestepcheckout')->__('Orange'),
|
186 |
+
'green' => Mage::helper('onestepcheckout')->__('Green'),
|
187 |
+
'black' => Mage::helper('onestepcheckout')->__('Black'),
|
188 |
+
'blue' => Mage::helper('onestepcheckout')->__('Blue'),
|
189 |
+
'darkblue' => Mage::helper('onestepcheckout')->__('Dark Blue'),
|
190 |
+
'pink' => Mage::helper('onestepcheckout')->__('Pink'),
|
191 |
+
'red' => Mage::helper('onestepcheckout')->__('Red'),
|
192 |
+
'violet' => Mage::helper('onestepcheckout')->__('Violet'),
|
193 |
+
);
|
194 |
+
}
|
195 |
+
|
196 |
+
protected function _optionToHtml($option, $selected) {
|
197 |
+
$html = '<option value="' . $option["key"] . '"';
|
198 |
+
$html.= isset($option['value']) ? 'title="' . $option['value'] . '"' : '';
|
199 |
+
if ($option['key'] == $selected) {
|
200 |
+
$html.= ' selected="selected"';
|
201 |
+
}
|
202 |
+
$html.= '>' . $option['value'] . '</option>' . "\n";
|
203 |
+
return $html;
|
204 |
+
}
|
205 |
+
|
206 |
+
protected function _getFieldHtml($fieldset, $scope, $scopeId) {
|
207 |
+
|
208 |
+
$defaultLabel = Mage::helper('onestepcheckout')->__('Use Default');
|
209 |
+
$defaultTitle = Mage::helper('onestepcheckout')->__('-- Please Select --');
|
210 |
+
$scopeLabel = Mage::helper('onestepcheckout')->__('STORE VIEW');
|
211 |
+
$helper = Mage::helper('onestepcheckout');
|
212 |
+
$path = 'onestepcheckout/style_management/style';
|
213 |
+
$data = Mage::getModel('onestepcheckout/config')->getCollection()
|
214 |
+
->addFieldToFilter('scope',$scope)
|
215 |
+
->addFieldToFilter('path', $path)
|
216 |
+
->addFieldToFilter('scope_id', $scopeId)
|
217 |
+
->getFirstItem()
|
218 |
+
->getValue();
|
219 |
+
|
220 |
+
$active = true;
|
221 |
+
if ($scope != 'default' && count($data) == 0)
|
222 |
+
$active = false;
|
223 |
+
|
224 |
+
if (!$data) {
|
225 |
+
$data = Mage::getModel('onestepcheckout/config')->getCollection()
|
226 |
+
->addFieldToFilter('scope','default')
|
227 |
+
->addFieldToFilter('path', $path)
|
228 |
+
->addFieldToFilter('scope_id', 0)
|
229 |
+
->getFirstItem()
|
230 |
+
->getValue();
|
231 |
+
}
|
232 |
+
|
233 |
+
$html = '';
|
234 |
+
$html .= '<table class="form-list" cell-spacing="0"><tr><td class="value">';
|
235 |
+
$html .= '<select style="width: 280px;margin-left:30px;" onchange="showreview(this);" id="onestepcheckout_style_management_style" name="groups[style_management][fields][style][value]" ' . ($active ? '' : 'disabled=""') . ' class="select">';
|
236 |
+
$allOptions = $this->_showAllOption();
|
237 |
+
foreach ($allOptions as $key => $value) {
|
238 |
+
$option['value'] = $value;
|
239 |
+
$option['key'] = $key;
|
240 |
+
$selected = $data;
|
241 |
+
$html.= $this->_optionToHtml($option, $selected);
|
242 |
+
}
|
243 |
+
//custom style - Michael 20140609
|
244 |
+
$option['value'] = Mage::helper('onestepcheckout')->__('Custom');
|
245 |
+
$option['key'] = 'custom';
|
246 |
+
$selected = $data;
|
247 |
+
//custom style end
|
248 |
+
$html.= $this->_optionToHtml($option, $selected);
|
249 |
+
$html.= '</select></td>';
|
250 |
+
if ($scope != 'default') {
|
251 |
+
$html .= '<td class="use-default">
|
252 |
+
<input id="onestepcheckout_style_management_style" name="groups[style_management][fields][style][inherit]" type="checkbox" value="1" class="checkbox config-inherit" ' . ($active ? '' : 'checked="checked"') . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" />
|
253 |
+
<label for="onestepcheckout_style_management_style" class="inherit" title="' . $defaultTitle . '">' . $defaultLabel . '</label></td>';
|
254 |
+
} else {
|
255 |
+
$html .= '<td class="scope-label">[' . $scopeLabel . ']</td>';
|
256 |
+
}
|
257 |
+
$html .= '</tr></table>';
|
258 |
+
return $html;
|
259 |
+
}
|
260 |
+
|
261 |
+
protected function _getButtonHtml($fieldset, $scope, $scopeId) {
|
262 |
+
|
263 |
+
$defaultLabel = Mage::helper('onestepcheckout')->__('Use Default');
|
264 |
+
$defaultTitle = Mage::helper('onestepcheckout')->__('-- Please Select --');
|
265 |
+
$scopeLabel = Mage::helper('onestepcheckout')->__('STORE VIEW');
|
266 |
+
$helper = Mage::helper('onestepcheckout');
|
267 |
+
$path = 'onestepcheckout/style_management/button';
|
268 |
+
$data = Mage::getModel('onestepcheckout/config')->getCollection()
|
269 |
+
->addFieldToFilter('scope',$scope)
|
270 |
+
->addFieldToFilter('path', $path)
|
271 |
+
->addFieldToFilter('scope_id', $scopeId)
|
272 |
+
->getFirstItem()
|
273 |
+
->getValue();
|
274 |
+
|
275 |
+
$active = true;
|
276 |
+
if ($scope != 'default' && count($data) == 0)
|
277 |
+
$active = false;
|
278 |
+
|
279 |
+
if (!$data) {
|
280 |
+
$data = Mage::getModel('onestepcheckout/config')->getCollection()
|
281 |
+
->addFieldToFilter('scope','default')
|
282 |
+
->addFieldToFilter('path', $path)
|
283 |
+
->addFieldToFilter('scope_id', 0)
|
284 |
+
->getFirstItem()
|
285 |
+
->getValue();
|
286 |
+
}
|
287 |
+
|
288 |
+
$html = '';
|
289 |
+
$html .= '<table class="form-list" cell-spacing="0"><tr><td class="value">';
|
290 |
+
$html .= '<select style="width: 280px;margin-left:30px;" onchange="showreviewbutton(this);" id="onestepcheckout_style_management_button" name="groups[style_management][fields][button][value]" ' . ($active ? '' : 'disabled=""') . ' class="select">';
|
291 |
+
$allOptions = $this->_showAllOption();
|
292 |
+
foreach ($allOptions as $key => $value) {
|
293 |
+
$option['value'] = $value;
|
294 |
+
$option['key'] = $key;
|
295 |
+
$selected = $data;
|
296 |
+
$html.= $this->_optionToHtml($option, $selected);
|
297 |
+
}
|
298 |
+
//custom style - Michael 20140609
|
299 |
+
$option['value'] = Mage::helper('onestepcheckout')->__('Custom');
|
300 |
+
$option['key'] = 'custom';
|
301 |
+
$selected = $data;
|
302 |
+
//custom style end
|
303 |
+
$html.= $this->_optionToHtml($option, $selected);
|
304 |
+
$html.= '</select></td>';
|
305 |
+
if ($scope != 'default') {
|
306 |
+
$html .= '<td class="use-default">
|
307 |
+
<input id="onestepcheckout_style_management_button" name="groups[style_management][fields][button][inherit]" type="checkbox" value="1" class="checkbox config-inherit" ' . ($active ? '' : 'checked="checked"') . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" />
|
308 |
+
<label for="onestepcheckout_style_management_button" class="inherit" title="' . $defaultTitle . '">' . $defaultLabel . '</label></td>';
|
309 |
+
} else {
|
310 |
+
$html .= '<td class="scope-label">[' . $scopeLabel . ']</td>';
|
311 |
+
}
|
312 |
+
$html .= '</tr></table>';
|
313 |
+
return $html;
|
314 |
+
}
|
315 |
+
|
316 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Adminhtml/System/Config/Form/Field/Separator.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
/**
|
12 |
+
* Abserve
|
13 |
+
*
|
14 |
+
* NOTICE OF LICENSE
|
15 |
+
*
|
16 |
+
* This source file is subject to the Abserve.com license that is
|
17 |
+
* available through the world-wide-web at this URL:
|
18 |
+
* http://www.abserve.com/license-agreement.html
|
19 |
+
*
|
20 |
+
* DISCLAIMER
|
21 |
+
*
|
22 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
23 |
+
* version in the future.
|
24 |
+
*
|
25 |
+
* @category Abserve
|
26 |
+
* @package Abserve_Onestepcheckout
|
27 |
+
* @copyright Copyright (c) 2012 Abserve (http://www.abserve.com/)
|
28 |
+
* @license http://www.abserve.com/license-agreement.html
|
29 |
+
*/
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Rewardpoints Config Field Separator Block
|
33 |
+
*
|
34 |
+
* @category Abserve
|
35 |
+
* @package Abserve_Onestepcheckout
|
36 |
+
* @author Abserve Developer
|
37 |
+
*/
|
38 |
+
class Abserve_Onestepcheckout_Block_Adminhtml_System_Config_Form_Field_Separator
|
39 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
40 |
+
{
|
41 |
+
/**
|
42 |
+
* render separator config row
|
43 |
+
*
|
44 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
48 |
+
{
|
49 |
+
$fieldConfig = $element->getFieldConfig();
|
50 |
+
$htmlId = $element->getHtmlId();
|
51 |
+
$html = '<tr id="row_' . $htmlId . '">'
|
52 |
+
. '<td class="label" colspan="3">';
|
53 |
+
|
54 |
+
$marginTop = $fieldConfig->margin_top ? (string)$fieldConfig->margin_top : '0px';
|
55 |
+
$customStyle = $fieldConfig->style ? (string)$fieldConfig->style : '';
|
56 |
+
|
57 |
+
$html .= '<div style="margin-top: ' . $marginTop
|
58 |
+
. '; font-weight: bold; border-bottom: 1px solid #dfdfdf;'
|
59 |
+
. $customStyle .'">';
|
60 |
+
$html .= $element->getLabel();
|
61 |
+
$html .= '</div></td></tr>';
|
62 |
+
return $html;
|
63 |
+
}
|
64 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Checkout/Links.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Checkout_Links extends Mage_Checkout_Block_Links
|
12 |
+
{
|
13 |
+
|
14 |
+
public function addCheckoutLink()
|
15 |
+
{
|
16 |
+
$parentBlock = $this->getParentBlock();
|
17 |
+
if(Mage::helper('onestepcheckout')->enabledOnestepcheckout() && Mage::helper('core')->isModuleOutputEnabled('Abserve_Onestepcheckout') ){
|
18 |
+
$text = $this->__('Checkout');
|
19 |
+
if($parentBlock)
|
20 |
+
$parentBlock->addLink(
|
21 |
+
$text, 'onestepcheckout/index', $text,
|
22 |
+
true, array('_secure' => true), 60, null,
|
23 |
+
'class="top-link-checkout"'
|
24 |
+
);
|
25 |
+
}else{
|
26 |
+
if (!$this->helper('checkout')->canOnepageCheckout()) {
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
if ($parentBlock && Mage::helper('core')->isModuleOutputEnabled('Mage_Checkout')) {
|
32 |
+
$text = $this->__('Checkout');
|
33 |
+
$parentBlock->addLink(
|
34 |
+
$text, 'checkout', $text,
|
35 |
+
true, array('_secure' => true), 60, null,
|
36 |
+
'class="top-link-checkout"'
|
37 |
+
);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
return $this;
|
42 |
+
}
|
43 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Onepage/Link.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Onepage_Link extends Mage_Checkout_Block_Onepage_Link
|
12 |
+
{
|
13 |
+
public function getCheckoutUrl()
|
14 |
+
{
|
15 |
+
if(Mage::helper('onestepcheckout')->enabledOnestepcheckout() && Mage::helper('core')->isModuleOutputEnabled('Abserve_Onestepcheckout') )
|
16 |
+
return Mage::getUrl('onestepcheckout/index', array('_secure' => true));
|
17 |
+
else
|
18 |
+
return $this->getUrl('checkout/onepage', array('_secure'=>true));
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
?>
|
app/code/community/Abserve/Onestepcheckout/Block/Onestepcheckout.php
ADDED
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Onestepcheckout extends Mage_Checkout_Block_Onepage_Abstract {
|
12 |
+
var $configData = array();
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->configData = $this->_getConfigData();
|
16 |
+
//when customer is logged in, we need to set postcode from customer address
|
17 |
+
if ($this->isCustomerLoggedIn() && !$this->getOnepage()->getQuote()->getBillingAddress()) {
|
18 |
+
$this->_setAddress();
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
if(!$this->allowDetectCountry()){
|
22 |
+
$this->_setDefaultBillingAddress();
|
23 |
+
$this->_setDefaultShippingAddress();
|
24 |
+
}else{
|
25 |
+
$this->_setCountryBillingDetected();
|
26 |
+
$this->_setCountryShippingDetected();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
//set default shipping && payment method
|
31 |
+
$this->_setDefaultShippingMethod();
|
32 |
+
$this->_setDefaultPaymentMethod();
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function _setAddress()
|
36 |
+
{
|
37 |
+
$billing_address = $this->getOnepage()->getQuote()->getBillingAddress();
|
38 |
+
$shipping_address = $this->getOnepage()->getQuote()->getShippingAddress();
|
39 |
+
$postcode = $shipping_address->getPostcode();
|
40 |
+
if (!$postcode) {
|
41 |
+
$primary = $this->getQuote()->getCustomer()->getPrimaryShippingAddress();
|
42 |
+
if ($primary) {
|
43 |
+
$postcode = $primary->getPostcode();
|
44 |
+
}
|
45 |
+
if (!$postcode || $postcode == '') {
|
46 |
+
$postcode = $billing_address->getPostcode();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
$shipping_address->setPostcode($postcode)->setCollectShippingRates(true)->save();
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _setDefaultShippingMethod()
|
53 |
+
{
|
54 |
+
$shipping_address = $this->getOnepage()->getQuote()->getShippingAddress();
|
55 |
+
$shipping_method = $shipping_address->getShippingMethod();
|
56 |
+
if (!$shipping_method || $shipping_method == '') {
|
57 |
+
//set default shipping method
|
58 |
+
$default_shipping_method = $this->configData['default_shipping'];
|
59 |
+
if ($default_shipping_method != '') {
|
60 |
+
//Mage::helper('onestepcheckout')->saveShippingMethod($default_shipping_method);
|
61 |
+
$this->getOnePage()->getQuote()->getShippingAddress()->setShippingMethod($default_shipping_method);
|
62 |
+
}
|
63 |
+
else {
|
64 |
+
// if no default shipping method and only one shipping method is available, set it as default
|
65 |
+
if ($method = $this->hasOnlyOneShippingMethod()){
|
66 |
+
//Mage::helper('onestepcheckout')->saveShippingMethod($method);
|
67 |
+
$this->getOnePage()->getQuote()->getShippingAddress()->setShippingMethod($method);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
$this->getOnePage()->getQuote()->collectTotals()->save();
|
72 |
+
}
|
73 |
+
|
74 |
+
/*
|
75 |
+
* set default payment method
|
76 |
+
*/
|
77 |
+
protected function _setDefaultPaymentMethod()
|
78 |
+
{
|
79 |
+
$paymentMethod = $this->getOnepage()->getQuote()->getPayment()->getMethod();
|
80 |
+
if (!$paymentMethod || $paymentMethod == '') {
|
81 |
+
$default_payment_method = $this->configData['default_payment'];
|
82 |
+
if ($default_payment_method != '') {
|
83 |
+
$payment = array('method' => $default_payment_method);
|
84 |
+
try {
|
85 |
+
Mage::helper('onestepcheckout')->savePaymentMethod($payment);
|
86 |
+
}
|
87 |
+
catch (Exception $e) {
|
88 |
+
// ignore error
|
89 |
+
}
|
90 |
+
}
|
91 |
+
else {
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
/*
|
97 |
+
* check if only one shipping method is enabled
|
98 |
+
*/
|
99 |
+
public function hasOnlyOneShippingMethod()
|
100 |
+
{
|
101 |
+
$rates = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingRatesCollection();
|
102 |
+
$rateCodes = array();
|
103 |
+
foreach($rates as $rate){
|
104 |
+
if(!in_array($rate->getCode(), $rateCodes)){
|
105 |
+
$rateCodes[] = $rate->getCode();
|
106 |
+
}
|
107 |
+
}
|
108 |
+
if(count($rateCodes) == 1) {
|
109 |
+
return $rateCodes[0];
|
110 |
+
}
|
111 |
+
return false;
|
112 |
+
}
|
113 |
+
|
114 |
+
protected function _getConfigData()
|
115 |
+
{
|
116 |
+
return Mage::helper('onestepcheckout')->getConfigData();
|
117 |
+
}
|
118 |
+
|
119 |
+
public function getCheckoutTitle()
|
120 |
+
{
|
121 |
+
return $this->configData['checkout_title'];
|
122 |
+
}
|
123 |
+
|
124 |
+
public function getCountryHtmlSelect($type)
|
125 |
+
{
|
126 |
+
if($type == 'billing') {
|
127 |
+
$address = $this->getQuote()->getBillingAddress();
|
128 |
+
}
|
129 |
+
else{
|
130 |
+
$address = $this->getQuote()->getShippingAddress();
|
131 |
+
}
|
132 |
+
|
133 |
+
$countryId = $address->getCountryId();
|
134 |
+
if (is_null($countryId)) {
|
135 |
+
$countryId = Mage::getStoreConfig('onestepcheckout/general/country_id',Mage::app()->getStore(true)->getId());
|
136 |
+
}
|
137 |
+
$select = $this->getLayout()->createBlock('core/html_select')
|
138 |
+
->setName($type.'[country_id]')
|
139 |
+
->setId($type.':country_id')
|
140 |
+
->setTitle(Mage::helper('onestepcheckout')->__('Country'))
|
141 |
+
->setClass('validate-select')
|
142 |
+
->setValue($countryId)
|
143 |
+
->setOptions($this->getCountryOptions())
|
144 |
+
->setExtraParams('style="width:135px"');
|
145 |
+
//if ($type === 'shipping') {
|
146 |
+
// $select->setExtraParams('onchange="shipping.setSameAsBilling(false);"');
|
147 |
+
//}
|
148 |
+
|
149 |
+
return $select->getHtml();
|
150 |
+
}
|
151 |
+
|
152 |
+
public function getCity()
|
153 |
+
{
|
154 |
+
$city = $this->getAddress()->getCity();
|
155 |
+
$primary = $this->getQuote()->getCustomer()->getPrimaryBillingAddress();
|
156 |
+
if(empty($city) && $this->_isLoggedIn() && $primary) {
|
157 |
+
return $this->getQuote()->getCustomer()->getPrimaryBillingAddress()->getCity();
|
158 |
+
}
|
159 |
+
return $city;
|
160 |
+
}
|
161 |
+
|
162 |
+
public function getCompany()
|
163 |
+
{
|
164 |
+
$company = $this->getAddress()->getCompany();
|
165 |
+
$primary = $this->getQuote()->getCustomer()->getPrimaryBillingAddress();
|
166 |
+
if(empty($company) && $this->_isLoggedIn() && $primary) {
|
167 |
+
return $this->getQuote()->getCustomer()->getPrimaryBillingAddress()->getCompany();
|
168 |
+
}
|
169 |
+
return $company;
|
170 |
+
}
|
171 |
+
|
172 |
+
public function getBillingAddress()
|
173 |
+
{
|
174 |
+
return $this->getQuote()->getBillingAddress();
|
175 |
+
}
|
176 |
+
|
177 |
+
public function getShippingAddress()
|
178 |
+
{
|
179 |
+
if (!$this->isCustomerLoggedIn()) {
|
180 |
+
return $this->getQuote()->getShippingAddress();
|
181 |
+
} else {
|
182 |
+
return Mage::getModel('sales/quote_address');
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
public function isAjaxBillingField($field_name)
|
187 |
+
{
|
188 |
+
$fields = explode(',', $this->configData['ajax_fields']);
|
189 |
+
if(in_array($field_name, $fields)) {
|
190 |
+
return true;
|
191 |
+
}
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
public function isShowShippingAddress()
|
196 |
+
{
|
197 |
+
if($this->getOnepage()->getQuote()->isVirtual()) {
|
198 |
+
return false;
|
199 |
+
}
|
200 |
+
if($this->configData['show_shipping_address']) {
|
201 |
+
return true;
|
202 |
+
}
|
203 |
+
return false;
|
204 |
+
}
|
205 |
+
|
206 |
+
public function isCustomerLoggedIn()
|
207 |
+
{
|
208 |
+
return Mage::getSingleton('customer/session')->isLoggedIn();
|
209 |
+
}
|
210 |
+
|
211 |
+
private function _setDefaultShippingAddress()
|
212 |
+
{
|
213 |
+
$quote = $this->getOnepage()->getQuote();
|
214 |
+
$shipping = $quote->getShippingAddress();
|
215 |
+
if ($shipping->getCountryId() == '') $shipping->setCountryId($this->configData['country_id']);
|
216 |
+
if ($shipping->getRegionId() == '') $shipping->setRegionId($this->configData['region_id']);
|
217 |
+
if ($shipping->getRegion() == '') $shipping->setRegion($this->configData['region_id']);
|
218 |
+
if ($shipping->getPostcode() == '') $shipping->setPostcode($this->configData['postcode']);
|
219 |
+
if ($shipping->getCity() == '') $shipping->setCity($this->configData['city']);
|
220 |
+
$shipping->setCollectShippingRates(true)->save();
|
221 |
+
}
|
222 |
+
|
223 |
+
private function _setDefaultBillingAddress()
|
224 |
+
{
|
225 |
+
$quote = $this->getOnepage()->getQuote();
|
226 |
+
$billing = $quote->getBillingAddress();
|
227 |
+
if ($billing->getCountryId() == '') $billing->setCountryId($this->configData['country_id']);
|
228 |
+
if ($billing->getRegionId() == '') $billing->setRegionId($this->configData['region_id']);
|
229 |
+
if ($billing->getRegion() == '') $billing->setRegion($this->configData['region_id']);
|
230 |
+
if ($billing->getPostcode() == '') $billing->setPostcode($this->configData['postcode']);
|
231 |
+
if ($billing->getCity() == '') $billing->setCity($this->configData['city']);
|
232 |
+
$billing->save();
|
233 |
+
}
|
234 |
+
|
235 |
+
private function _setCountryBillingDetected()
|
236 |
+
{
|
237 |
+
$quote = $this->getOnepage()->getQuote();
|
238 |
+
$billing = $quote->getBillingAddress();
|
239 |
+
$cookieCountryId = Mage::getSingleton('core/cookie')->get('detected_country_id');
|
240 |
+
if(!$cookieCountryId){
|
241 |
+
$countryId = Mage::helper('onestepcheckout')->detectCountryIp();
|
242 |
+
Mage::getSingleton('core/cookie')->set('detected_country_id', $countryId);
|
243 |
+
}else{
|
244 |
+
$countryId = $cookieCountryId;
|
245 |
+
}
|
246 |
+
$billing->setCountryId($countryId);
|
247 |
+
$billing->save();
|
248 |
+
}
|
249 |
+
|
250 |
+
private function _setCountryShippingDetected()
|
251 |
+
{
|
252 |
+
$quote = $this->getOnepage()->getQuote();
|
253 |
+
$shipping = $quote->getShippingAddress();
|
254 |
+
$cookieCountryId = Mage::getSingleton('core/cookie')->get('detected_country_id');
|
255 |
+
if(!$cookieCountryId){
|
256 |
+
$countryId = Mage::helper('onestepcheckout')->detectCountryIp();
|
257 |
+
Mage::getSingleton('core/cookie')->set('detected_country_id', $countryId);
|
258 |
+
}else{
|
259 |
+
$countryId = $cookieCountryId;
|
260 |
+
}
|
261 |
+
$shipping->setCountryId($countryId);
|
262 |
+
$shipping->setCollectShippingRates(true)->save();
|
263 |
+
}
|
264 |
+
|
265 |
+
public function allowDetectCountry()
|
266 |
+
{
|
267 |
+
$controllerName = $this->getRequest()->getControllerName();
|
268 |
+
if($controllerName=='index')
|
269 |
+
return Mage::helper('onestepcheckout')->allowDetectCountry();
|
270 |
+
else
|
271 |
+
return false;
|
272 |
+
}
|
273 |
+
|
274 |
+
public function getOnepage()
|
275 |
+
{
|
276 |
+
return Mage::getSingleton('checkout/type_onepage');
|
277 |
+
}
|
278 |
+
|
279 |
+
public function isShowLoginLink()
|
280 |
+
{
|
281 |
+
if ($this->configData['show_login_link']) {
|
282 |
+
return true;
|
283 |
+
}
|
284 |
+
return false;
|
285 |
+
}
|
286 |
+
|
287 |
+
public function getCheckoutUrl()
|
288 |
+
{
|
289 |
+
return $this->getUrl('onestepcheckout/index/saveOrder', array('_secure' => true));
|
290 |
+
}
|
291 |
+
|
292 |
+
public function getAddress()
|
293 |
+
{
|
294 |
+
if ($this->isCustomerLoggedIn()){
|
295 |
+
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
|
296 |
+
if ($customerAddressId){
|
297 |
+
$billing = Mage::getModel('customer/address')->load($customerAddressId);
|
298 |
+
}else{
|
299 |
+
$billing = $this->getQuote()->getBillingAddress();
|
300 |
+
}
|
301 |
+
if(!$billing->getCustomerAddressId()){
|
302 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
303 |
+
$default_address = $customer -> getDefaultBillingAddress();
|
304 |
+
if ($default_address) {
|
305 |
+
if ($default_address->getId()) {
|
306 |
+
if ($default_address->getPrefix()) {
|
307 |
+
$billing->setPrefix($default_address->getPrefix());
|
308 |
+
}
|
309 |
+
if ($default_address->getData('firstname')) {
|
310 |
+
$billing->setData('firstname', $default_address->getData('firstname'));
|
311 |
+
}
|
312 |
+
if ($default_address->getData('middlename')) {
|
313 |
+
$billing->setData('middlename', $default_address->getData('middlename'));
|
314 |
+
}if ($default_address->getData('lastname')) {
|
315 |
+
$billing->setData('lastname', $default_address->getData('lastname'));
|
316 |
+
}if ($default_address->getData('suffix')) {
|
317 |
+
$billing->setData('suffix', $default_address->getData('suffix'));
|
318 |
+
}if ($default_address->getData('company')) {
|
319 |
+
$billing->setData('company', $default_address->getData('company'));
|
320 |
+
}if ($default_address->getData('street')) {
|
321 |
+
$billing->setData('street', $default_address->getData('street'));
|
322 |
+
}if ($default_address->getData('city')) {
|
323 |
+
$billing->setData('city', $default_address->getData('city'));
|
324 |
+
}if ($default_address->getData('region')) {
|
325 |
+
$billing->setData('region', $default_address->getData('region'));
|
326 |
+
}if ($default_address->getData('region_id')) {
|
327 |
+
$billing->setData('region_id', $default_address->getData('region_id'));
|
328 |
+
}if ($default_address->getData('postcode')) {
|
329 |
+
$billing->setData('postcode', $default_address->getData('postcode'));
|
330 |
+
}if ($default_address->getData('country_id')) {
|
331 |
+
$billing->setData('country_id', $default_address->getData('country_id'));
|
332 |
+
}if ($default_address->getData('telephone')) {
|
333 |
+
$billing->setData('telephone', $default_address->getData('telephone'));
|
334 |
+
}if ($default_address->getData('fax')) {
|
335 |
+
$billing->setData('fax', $default_address->getData('fax'));
|
336 |
+
}
|
337 |
+
$billing->setCustomerAddressId($default_address->getId())
|
338 |
+
->save();
|
339 |
+
}
|
340 |
+
} else {
|
341 |
+
return $billing;
|
342 |
+
}
|
343 |
+
}
|
344 |
+
return $billing;
|
345 |
+
} else {
|
346 |
+
return Mage::getModel('sales/quote_address');
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
public function getAddressesHtmlSelect($type)
|
351 |
+
{
|
352 |
+
if ($this->isCustomerLoggedIn()) {
|
353 |
+
$options = array();
|
354 |
+
foreach ($this->getCustomer()->getAddresses() as $address) {
|
355 |
+
$options[] = array(
|
356 |
+
'value'=>$address->getId(),
|
357 |
+
'label'=>$address->format('oneline')
|
358 |
+
);
|
359 |
+
}
|
360 |
+
$addressId = $this->getAddress()->getId();
|
361 |
+
$shippingAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
|
362 |
+
if ($shippingAddressId != $addressId && $type == 'shipping'){
|
363 |
+
$addressId = $shippingAddressId;
|
364 |
+
}
|
365 |
+
if (empty($addressId)) {
|
366 |
+
if ($type=='billing') {
|
367 |
+
$address = $this->getCustomer()->getPrimaryBillingAddress();
|
368 |
+
} else {
|
369 |
+
$address = $this->getCustomer()->getPrimaryShippingAddress();
|
370 |
+
}
|
371 |
+
if ($address) {
|
372 |
+
$addressId = $address->getId();
|
373 |
+
}
|
374 |
+
}
|
375 |
+
$select = $this->getLayout()->createBlock('core/html_select')
|
376 |
+
->setName($type.'_address_id')
|
377 |
+
->setId($type.'-address-select')
|
378 |
+
->setClass('address-select')
|
379 |
+
->setExtraParams('style="width:350px"')
|
380 |
+
->setValue($addressId)
|
381 |
+
->setOptions($options);
|
382 |
+
$select->addOption('', Mage::helper('checkout')->__('New Address'));
|
383 |
+
return $select->getHtml();
|
384 |
+
}
|
385 |
+
return '';
|
386 |
+
}
|
387 |
+
|
388 |
+
public function isVirtual()
|
389 |
+
{
|
390 |
+
return $this->getQuote()->isVirtual();
|
391 |
+
}
|
392 |
+
|
393 |
+
public function _getDefaultShippingMethod()
|
394 |
+
{
|
395 |
+
$_helper = Mage::helper('onestepcheckout');
|
396 |
+
$_config = $_helper->getConfigData();
|
397 |
+
if($_config['default_shipping'] != '') {
|
398 |
+
return $_config['default_shipping'];
|
399 |
+
}else{
|
400 |
+
$check_single = $this->_checkSingleShippingMethod();
|
401 |
+
if($check_single) {
|
402 |
+
return $check_single;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
|
407 |
+
protected function _checkSingleShippingMethod()
|
408 |
+
{
|
409 |
+
$rates = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingRatesCollection();
|
410 |
+
$rateCodes = array();
|
411 |
+
foreach($rates as $rate){
|
412 |
+
if(!in_array($rate->getCode(), $rateCodes)){
|
413 |
+
$rateCodes[] = $rate->getCode();
|
414 |
+
}
|
415 |
+
}
|
416 |
+
if(count($rateCodes) == 1) {
|
417 |
+
return $rateCodes[0];
|
418 |
+
}
|
419 |
+
return false;
|
420 |
+
}
|
421 |
+
|
422 |
+
public function getCountryHtmlSelectBackend($type) {
|
423 |
+
if($type == 'billing') {
|
424 |
+
$address = $this->getQuote()->getBillingAddress();
|
425 |
+
}
|
426 |
+
else{
|
427 |
+
$address = $this->getQuote()->getShippingAddress();
|
428 |
+
}
|
429 |
+
|
430 |
+
$countryId = $address->getCountryId();
|
431 |
+
if (is_null($countryId)) {
|
432 |
+
$countryId = Mage::getStoreConfig('onestepcheckout/general/country_id',Mage::app()->getStore(true)->getId());
|
433 |
+
}
|
434 |
+
$select = $this->getLayout()->createBlock('core/html_select')
|
435 |
+
->setName('order['.$type.'_address][country_id]')
|
436 |
+
->setId('order-'.$type.'_address_country_id')
|
437 |
+
->setTitle(Mage::helper('onestepcheckout')->__('Country'))
|
438 |
+
->setClass('validate-select')
|
439 |
+
->setValue($countryId)
|
440 |
+
->setOptions($this->getCountryOptions())
|
441 |
+
->setExtraParams('style="width:135px"');
|
442 |
+
return $select->getHtml();
|
443 |
+
}
|
444 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Postcode.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Postcode extends Mage_Core_Block_Template
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* prepare block's layout
|
15 |
+
*
|
16 |
+
* @return Abserve_Onestepcheckout_Block_Postcode
|
17 |
+
*/
|
18 |
+
|
19 |
+
protected function _toHtml()
|
20 |
+
{
|
21 |
+
// Mage::dispatchEvent('adminhtml_block_html_before', array('block' => $this));
|
22 |
+
return parent::_toHtml();
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Reload.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Reload extends Mage_Checkout_Block_Onepage_Abstract {
|
12 |
+
public function __construct() {
|
13 |
+
$this->configData = $this->_getConfigData();
|
14 |
+
}
|
15 |
+
|
16 |
+
protected function _getConfigData() {
|
17 |
+
return Mage::helper('onestepcheckout')->getConfigData();
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Review.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Review extends Mage_Checkout_Block_Onepage_Abstract {
|
12 |
+
public function __construct() {
|
13 |
+
parent::_construct();
|
14 |
+
$this->getQuote()->collectTotals()->save();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function getItems() {
|
18 |
+
return $this->getQuote()->getAllVisibleItems();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function getTotals() {
|
22 |
+
return $this->getQuote()->getTotals();
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Delivery.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Sales_Order_Totals_Delivery extends Mage_Sales_Block_Order_Totals
|
12 |
+
{
|
13 |
+
public function _prepareLayout()
|
14 |
+
{
|
15 |
+
return parent::_prepareLayout();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getDelivery($order){
|
19 |
+
$delivery = Mage::getModel('onestepcheckout/delivery')->load($order->getId(), 'order_id');
|
20 |
+
return $delivery;
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _beforeToHtml()
|
24 |
+
{
|
25 |
+
if(!Mage::helper('magenotification')->checkLicenseKey('onestepcheckout')){
|
26 |
+
$this->setTemplate(null);
|
27 |
+
}
|
28 |
+
return parent::_beforeToHtml();
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Discount.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Sales_Order_Totals_Discount extends Mage_Sales_Block_Order_Totals
|
12 |
+
{
|
13 |
+
public function initTotals()
|
14 |
+
{
|
15 |
+
// var_dump($this->discountAmount());
|
16 |
+
if($this->discountAmount() != 0){
|
17 |
+
$total = new Varien_Object();
|
18 |
+
$total->setCode('onestepcheckoutdiscount');
|
19 |
+
$total->setValue(-$this->discountAmount());
|
20 |
+
$total->setBaseValue(0);
|
21 |
+
$total->setLabel('Discount(Admin)');
|
22 |
+
$parent = $this->getParentBlock();
|
23 |
+
$parent->addTotal($total,'subtotal');
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function discountAmount() {
|
28 |
+
$order = $this->getParentBlock()->getOrder();
|
29 |
+
// $order->setData('onestepcheckout_discount_amount',123)->save();
|
30 |
+
// var_dump($order->getData());
|
31 |
+
$discountAmount = $order->getOnestepcheckoutDiscountAmount();
|
32 |
+
return $discountAmount;
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Sales/Order/Totals/Giftwrap.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Block_Sales_Order_Totals_Giftwrap extends Mage_Sales_Block_Order_Totals
|
12 |
+
{
|
13 |
+
public function initTotals()
|
14 |
+
{
|
15 |
+
if($this->giftwrapAmount() > 0){
|
16 |
+
$total = new Varien_Object();
|
17 |
+
$total->setCode('giftwrap');
|
18 |
+
$total->setValue($this->giftwrapAmount());
|
19 |
+
$total->setBaseValue(0);
|
20 |
+
$total->setLabel('Gift wrap');
|
21 |
+
$parent = $this->getParentBlock();
|
22 |
+
$parent->addTotal($total,'subtotal');
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
public function giftwrapAmount() {
|
27 |
+
$order = $this->getParentBlock()->getOrder();
|
28 |
+
$giftwrapAmount = $order->getOnestepcheckoutGiftwrapAmount();
|
29 |
+
return $giftwrapAmount;
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/System/Config/Form/Field/Survey.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_OneStepCheckout_Block_System_Config_Form_Field_Survey extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
12 |
+
{
|
13 |
+
public function __construct()
|
14 |
+
{
|
15 |
+
$this->addColumn('value', array(
|
16 |
+
'label' => Mage::helper('onestepcheckout')->__('Label'),
|
17 |
+
'style' => 'width:250px',
|
18 |
+
));
|
19 |
+
$this->_addAfter = false;
|
20 |
+
$this->_addButtonLabel = Mage::helper('onestepcheckout')->__('Add label');
|
21 |
+
parent::__construct();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Block/Widget/Dob.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Block_Widget_Dob extends Mage_Customer_Block_Widget_Dob
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* Date inputs
|
16 |
+
*
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
protected $_dateInputs = array();
|
20 |
+
|
21 |
+
public function _construct()
|
22 |
+
{
|
23 |
+
parent::_construct();
|
24 |
+
|
25 |
+
// default template location
|
26 |
+
$this->setTemplate('onestepcheckout/widget/dob.phtml');
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
public function isRequired()
|
31 |
+
{
|
32 |
+
return (bool)Mage::getStoreConfig('onestepcheckout/field_require_management/birthday');
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setDate($date)
|
36 |
+
{
|
37 |
+
$this->setTime($date ? strtotime($date) : false);
|
38 |
+
$this->setData('date', $date);
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getDay()
|
43 |
+
{
|
44 |
+
return $this->getTime() ? date('d', $this->getTime()) : '';
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getMonth()
|
48 |
+
{
|
49 |
+
return $this->getTime() ? date('m', $this->getTime()) : '';
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getYear()
|
53 |
+
{
|
54 |
+
return $this->getTime() ? date('Y', $this->getTime()) : '';
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns format which will be applied for DOB in javascript
|
59 |
+
*
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
public function getDateFormat()
|
63 |
+
{
|
64 |
+
return Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Add date input html
|
69 |
+
*
|
70 |
+
* @param string $code
|
71 |
+
* @param string $html
|
72 |
+
*/
|
73 |
+
public function setDateInput($code, $html)
|
74 |
+
{
|
75 |
+
$this->_dateInputs[$code] = $html;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Sort date inputs by dateformat order of current locale
|
80 |
+
*
|
81 |
+
* @return string
|
82 |
+
*/
|
83 |
+
public function getSortedDateInputs()
|
84 |
+
{
|
85 |
+
$strtr = array(
|
86 |
+
'%b' => '%1$s',
|
87 |
+
'%B' => '%1$s',
|
88 |
+
'%m' => '%1$s',
|
89 |
+
'%d' => '%2$s',
|
90 |
+
'%e' => '%2$s',
|
91 |
+
'%Y' => '%3$s',
|
92 |
+
'%y' => '%3$s'
|
93 |
+
);
|
94 |
+
|
95 |
+
$dateFormat = preg_replace('/[^\%\w]/', '\\1', $this->getDateFormat());
|
96 |
+
|
97 |
+
return sprintf(strtr($dateFormat, $strtr),
|
98 |
+
$this->_dateInputs['m'], $this->_dateInputs['d'], $this->_dateInputs['y']);
|
99 |
+
}
|
100 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Helper/Data.php
ADDED
@@ -0,0 +1,791 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Helper_Data extends Mage_Core_Helper_Abstract {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->settings = $this->getConfigData();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function enabledOnestepcheckout() {
|
19 |
+
if (Mage::getStoreConfig('onestepcheckout/general/active', Mage::app()->getStore(true)->getStoreId())) {
|
20 |
+
return true;
|
21 |
+
}
|
22 |
+
return false;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function enabledDelivery() {
|
26 |
+
if (Mage::getStoreConfig('onestepcheckout/general/delivery_time_date', Mage::app()->getStore(true)->getStoreId())) {
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
return false;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function enableRegistration() {
|
33 |
+
if ($this->settings['enable_registration']) {
|
34 |
+
return true;
|
35 |
+
}
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function loadDataforDisabledFields(&$data) {
|
40 |
+
$configData = $this->getConfigData();
|
41 |
+
if (!$configData['show_city']) {
|
42 |
+
$data['city'] = '-';
|
43 |
+
}
|
44 |
+
if (!$configData['show_zipcode']) {
|
45 |
+
$data['postcode'] = '-';
|
46 |
+
}
|
47 |
+
if (!$configData['show_company']) {
|
48 |
+
$data['company'] = '';
|
49 |
+
}
|
50 |
+
if (!$configData['show_fax']) {
|
51 |
+
$data['fax'] = '';
|
52 |
+
}
|
53 |
+
if (!$configData['show_telephone']) {
|
54 |
+
$data['telephone'] = '-';
|
55 |
+
}
|
56 |
+
if (!$configData['show_region']) {
|
57 |
+
$data['region'] = '-';
|
58 |
+
$data['region_id'] = '-';
|
59 |
+
}
|
60 |
+
return $data;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function loadEmptyData(&$data) {
|
64 |
+
if (!isset($data['city']) || $data['city'] == '') {
|
65 |
+
if ($this->settings['city'] != '') {
|
66 |
+
$data['city'] = $this->settings['city'];
|
67 |
+
} else {
|
68 |
+
$data['city'] = '-';
|
69 |
+
}
|
70 |
+
}
|
71 |
+
if (!isset($data['telephone']) || trim($data['telephone']) == '') {
|
72 |
+
$data['telephone'] = '-';
|
73 |
+
}
|
74 |
+
if (!isset($data['postcode']) || $data['postcode'] == '') {
|
75 |
+
if ($this->settings['postcode'] != '') {
|
76 |
+
$data['postcode'] = $this->settings['postcode'];
|
77 |
+
} else {
|
78 |
+
$data['postcode'] = '-';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
if (!isset($data['region']) || $data['region'] == '') {
|
82 |
+
$data['region'] = '-';
|
83 |
+
}
|
84 |
+
if (!isset($data['region_id']) || $data['region_id'] == '') {
|
85 |
+
if ($this->settings['region_id'] != '') {
|
86 |
+
$data['region_id'] = $this->settings['region_id'];
|
87 |
+
} else {
|
88 |
+
$data['region_id'] = '-';
|
89 |
+
}
|
90 |
+
}
|
91 |
+
if (!isset($data['country_id']) || $data['country_id'] == '') {
|
92 |
+
if ($this->settings['country_id'] != '') {
|
93 |
+
$data['country_id'] = $this->settings['country_id'];
|
94 |
+
} else {
|
95 |
+
$data['country_id'] = '-';
|
96 |
+
}
|
97 |
+
}
|
98 |
+
return $data;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function getConfigData() {
|
102 |
+
$configData = array();
|
103 |
+
$configItems = array('general/active', 'general/checkout_title', 'general/checkout_description',
|
104 |
+
'general/show_shipping_address', 'general/country_id',
|
105 |
+
'general/default_payment', 'general/default_shipping',
|
106 |
+
'general/postcode', 'general/region_id', 'general/city',
|
107 |
+
'general/use_for_disabled_fields', 'general/hide_shipping_method',
|
108 |
+
'general/page_layout',
|
109 |
+
'field_management/show_city', 'field_management/show_zipcode',
|
110 |
+
'field_management/show_company', 'field_management/show_fax',
|
111 |
+
'field_management/show_telephone', 'field_management/show_region',
|
112 |
+
'general/show_comment', 'general/show_newsletter',
|
113 |
+
'general/show_discount', 'general/newsletter_default_checked',
|
114 |
+
'field_management/enable_giftmessage',
|
115 |
+
'checkout_mode/show_login_link', 'checkout_mode/enable_registration',
|
116 |
+
'checkout_mode/allow_guest', 'checkout_mode/login_link_title',
|
117 |
+
'ajax_update/enable_ajax', 'ajax_update/ajax_fields',
|
118 |
+
'ajax_update/update_payment',
|
119 |
+
'ajax_update/reload_payment',
|
120 |
+
'terms_conditions/enable_terms', 'terms_conditions/term_html',
|
121 |
+
'terms_conditions/term_width', 'terms_conditions/term_height',
|
122 |
+
'order_notification/enable_notification', 'order_notification/notification_email');
|
123 |
+
foreach ($configItems as $configItem) {
|
124 |
+
$config = explode('/', $configItem);
|
125 |
+
$value = $config[1];
|
126 |
+
$configData[$value] = Mage::getStoreConfig('onestepcheckout/' . $configItem);
|
127 |
+
}
|
128 |
+
return $configData;
|
129 |
+
}
|
130 |
+
|
131 |
+
public function isShowShippingAddress() {
|
132 |
+
if ($this->getOnepage()->getQuote()->isVirtual()) {
|
133 |
+
return false;
|
134 |
+
}
|
135 |
+
if ($this->settings['show_shipping_address']) {
|
136 |
+
return true;
|
137 |
+
}
|
138 |
+
return false;
|
139 |
+
}
|
140 |
+
|
141 |
+
public function getOnePage() {
|
142 |
+
return Mage::getSingleton('checkout/type_onepage');
|
143 |
+
}
|
144 |
+
|
145 |
+
public function getCheckoutUrl() {
|
146 |
+
return Mage::getUrl('onestepcheckout');
|
147 |
+
}
|
148 |
+
|
149 |
+
public function savePaymentMethod($data) {
|
150 |
+
if (empty($data)) {
|
151 |
+
return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid data.'));
|
152 |
+
}
|
153 |
+
$onepage = Mage::getSingleton('checkout/session')->getQuote();
|
154 |
+
if ($onepage->isVirtual()) {
|
155 |
+
$onepage->getBillingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);
|
156 |
+
} else {
|
157 |
+
$onepage->getShippingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);
|
158 |
+
}
|
159 |
+
$payment = $onepage->getPayment();
|
160 |
+
$payment->importData($data);
|
161 |
+
|
162 |
+
$onepage->save();
|
163 |
+
|
164 |
+
return array();
|
165 |
+
}
|
166 |
+
|
167 |
+
public function saveShippingMethod($shippingMethod) {
|
168 |
+
if (empty($shippingMethod)) {
|
169 |
+
return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid shipping method.'));
|
170 |
+
}
|
171 |
+
$rate = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingRateByCode($shippingMethod);
|
172 |
+
if (!$rate) {
|
173 |
+
return array('error' => -1, 'message' => Mage::helper('checkout')->__('Invalid shipping method.'));
|
174 |
+
}
|
175 |
+
$this->getOnepage()->getQuote()->getShippingAddress()->setShippingMethod($shippingMethod);
|
176 |
+
$this->getOnepage()->getQuote()->collectTotals()->save();
|
177 |
+
return array();
|
178 |
+
}
|
179 |
+
|
180 |
+
public function allowGuestCheckout() {
|
181 |
+
$_quote = $this->getOnepage()->getQuote();
|
182 |
+
$_isAllowed = $this->settings['allow_guest'];
|
183 |
+
if ($_isAllowed) {
|
184 |
+
$isContain = false;
|
185 |
+
foreach ($_quote->getAllItems() as $item) {
|
186 |
+
if (($product = $item->getProduct()) &&
|
187 |
+
$product->getTypeId() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) {
|
188 |
+
$isContain = true;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
$store = Mage::app()->getStore()->getId();
|
192 |
+
if ($isContain && Mage::getStoreConfigFlag('catalog/downloadable/disable_guest_checkout', $store)) {
|
193 |
+
$_isAllowed = false;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
return $_isAllowed;
|
197 |
+
}
|
198 |
+
|
199 |
+
public function isUseDefaultDataforDisabledFields() {
|
200 |
+
return $this->settings['use_for_disabled_fields'];
|
201 |
+
}
|
202 |
+
|
203 |
+
public function isShowNewsletter() {
|
204 |
+
if ($this->settings['show_newsletter'] && !$this->isSignUpNewsletter())
|
205 |
+
return true;
|
206 |
+
else
|
207 |
+
return false;
|
208 |
+
}
|
209 |
+
|
210 |
+
public function isSignUpNewsletter() {
|
211 |
+
if ($this->isCustomerLoggedIn()) {
|
212 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
213 |
+
if (isset($customer))
|
214 |
+
$customerNewsletter = Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail());
|
215 |
+
if (isset($customerNewsletter) && $customerNewsletter->getId() != null && $customerNewsletter->getData('subscriber_status') == 1) {
|
216 |
+
return true;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
return false;
|
220 |
+
}
|
221 |
+
|
222 |
+
public function isSubscribeByDefault() {
|
223 |
+
return $this->settings['newsletter_default_checked'];
|
224 |
+
}
|
225 |
+
|
226 |
+
public function enableOrderComment() {
|
227 |
+
return $this->settings['show_comment'];
|
228 |
+
}
|
229 |
+
|
230 |
+
public function showDiscount() {
|
231 |
+
return $this->settings['show_discount'];
|
232 |
+
}
|
233 |
+
|
234 |
+
public function enableTermsAndConditions() {
|
235 |
+
return $this->settings['enable_terms'];
|
236 |
+
}
|
237 |
+
|
238 |
+
public function getTermPopupWidth() {
|
239 |
+
return $this->settings['term_width'];
|
240 |
+
}
|
241 |
+
|
242 |
+
public function getTermPopupHeight() {
|
243 |
+
return $this->settings['term_height'];
|
244 |
+
}
|
245 |
+
|
246 |
+
public function getTermsConditionsHtml() {
|
247 |
+
return $this->settings['term_html'];
|
248 |
+
}
|
249 |
+
|
250 |
+
public function enableNotifyAdmin() {
|
251 |
+
return $this->settings['enable_notification'];
|
252 |
+
}
|
253 |
+
|
254 |
+
public function getEmailArray() {
|
255 |
+
$email_string = (string) $this->settings['notification_email'];
|
256 |
+
if ($email_string != '') {
|
257 |
+
$email_array = explode(",", $email_string);
|
258 |
+
return $email_array;
|
259 |
+
}
|
260 |
+
return array();
|
261 |
+
}
|
262 |
+
|
263 |
+
public function getEmailTemplate() {
|
264 |
+
return Mage::getStoreConfig('onestepcheckout/order_notification/notification_email_template');
|
265 |
+
}
|
266 |
+
|
267 |
+
public function getStoreId() {
|
268 |
+
return Mage::app()->getStore()->getId();
|
269 |
+
}
|
270 |
+
|
271 |
+
public function enableGiftMessage() {
|
272 |
+
//return $this->settings['enable_giftmessage'];
|
273 |
+
// return Mage::getStoreConfig('sales/gift_options/allow_order');
|
274 |
+
$giftMessage = Mage::getStoreConfig('onestepcheckout/giftmessage/enable_giftmessage', $this->getStoreId());
|
275 |
+
if ($giftMessage) {
|
276 |
+
Mage::getConfig()->saveConfig('sales/gift_options/allow_order', 1);
|
277 |
+
Mage::getConfig()->saveConfig('sales/gift_options/allow_items', 1);
|
278 |
+
return true;
|
279 |
+
} else {
|
280 |
+
Mage::getConfig()->saveConfig('sales/gift_options/allow_order', 0);
|
281 |
+
Mage::getConfig()->saveConfig('sales/gift_options/allow_items', 0);
|
282 |
+
return false;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
public function enableCustomSize() {
|
287 |
+
return Mage::getStoreConfig('onestepcheckout/terms_conditions/enable_custom_size', $this->getStoreId());
|
288 |
+
}
|
289 |
+
|
290 |
+
public function getTermTitle() {
|
291 |
+
return Mage::getStoreConfig('onestepcheckout/terms_conditions/term_title', $this->getStoreId());
|
292 |
+
}
|
293 |
+
|
294 |
+
public function enableGiftWrap() {
|
295 |
+
return Mage::getStoreConfig('onestepcheckout/giftwrap/enable_giftwrap', $this->getStoreId());
|
296 |
+
}
|
297 |
+
|
298 |
+
public function getGiftwrapType() {
|
299 |
+
return Mage::getStoreConfig('onestepcheckout/giftwrap/giftwrap_type', $this->getStoreId());
|
300 |
+
}
|
301 |
+
|
302 |
+
public function getGiftwrapAmount() {
|
303 |
+
return Mage::getStoreConfig('onestepcheckout/giftwrap/giftwrap_amount', $this->getStoreId());
|
304 |
+
}
|
305 |
+
|
306 |
+
public function isCustomerLoggedIn() {
|
307 |
+
return Mage::getSingleton('customer/session')->isLoggedIn();
|
308 |
+
}
|
309 |
+
|
310 |
+
public function showLoginLink() {
|
311 |
+
return Mage::getStoreConfig('onestepcheckout/checkout_mode/show_login_link', $this->getStoreId());
|
312 |
+
}
|
313 |
+
|
314 |
+
public function checkGiftwrapSession() {
|
315 |
+
$session = Mage::getSingleton('checkout/session');
|
316 |
+
return $session->getData('onestepcheckout_giftwrap');
|
317 |
+
}
|
318 |
+
|
319 |
+
public function isHideShippingMethod() {
|
320 |
+
$_isHide = $this->settings['hide_shipping_method'];
|
321 |
+
if ($_isHide) {
|
322 |
+
$_quote = $this->getOnepage()->getQuote();
|
323 |
+
$rates = $_quote->getShippingAddress()->getShippingRatesCollection();
|
324 |
+
$rateCodes = array();
|
325 |
+
foreach ($rates as $rate) {
|
326 |
+
if (!in_array($rate->getCode(), $rateCodes)) {
|
327 |
+
$rateCodes[] = $rate->getCode();
|
328 |
+
}
|
329 |
+
}
|
330 |
+
if (count($rateCodes) > 1) {
|
331 |
+
$_isHide = false;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
return $_isHide;
|
336 |
+
}
|
337 |
+
|
338 |
+
/*
|
339 |
+
* Save customer comment to the order
|
340 |
+
*/
|
341 |
+
|
342 |
+
public function saveOrderComment($observer) {
|
343 |
+
$session = Mage::getSingleton('checkout/session');
|
344 |
+
$billing = $this->_getRequest()->getPost('billing');
|
345 |
+
$delivery = $this->_getRequest()->getPost('delivery');
|
346 |
+
$session = Mage::getSingleton('checkout/session');
|
347 |
+
if ($this->enableOrderComment()) {
|
348 |
+
$comment = $billing['onestepcheckout_comment'];
|
349 |
+
$comment = trim($comment);
|
350 |
+
if ($comment != '') {
|
351 |
+
$order = $observer->getEvent()->getOrder();
|
352 |
+
try {
|
353 |
+
// use custom attribute to save customer comment - magento 1.3
|
354 |
+
// $order->setOnestepcheckoutOrderComment($comment)
|
355 |
+
$order->addStatusHistoryComment($comment, false);
|
356 |
+
//Magento 1.4.1.1 - can not use custom attribute to save customer comment
|
357 |
+
//$order->setCustomerNote($comment);
|
358 |
+
//$order->save();
|
359 |
+
} catch (Exception $e) {
|
360 |
+
|
361 |
+
}
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
if ($this->enableSurvey()) {
|
366 |
+
$surveyQuestion = $this->getSurveyQuestion();
|
367 |
+
$surveyValues = unserialize($this->getSurveyValues());
|
368 |
+
$surveyValue = $billing['onestepcheckout-surveybilling'];
|
369 |
+
$surveyFreeText = $billing['onestepcheckout-survey-freetext'];
|
370 |
+
|
371 |
+
if (!empty($surveyValue)) {
|
372 |
+
if ($surveyValue != 'freetext') {
|
373 |
+
$surveyAnswer = $surveyValues[$surveyValue]['value'];
|
374 |
+
} else {
|
375 |
+
$surveyAnswer = $surveyFreeText;
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
$order = $observer->getEvent()->getOrder();
|
380 |
+
if ($surveyQuestion)
|
381 |
+
$session->setData('survey_question', $surveyQuestion);
|
382 |
+
if ($surveyAnswer)
|
383 |
+
$session->setData('survey_answer', $surveyAnswer);
|
384 |
+
}
|
385 |
+
|
386 |
+
//Save delivery
|
387 |
+
if ($this->enabledDelivery()) {
|
388 |
+
if ($delivery['onestepcheckout-date']) {
|
389 |
+
$delivery_date_time = $delivery['onestepcheckout-date'] . ' ' . $delivery['onestepcheckout-time'];
|
390 |
+
$session->setData('delivery_date_time', $delivery_date_time);
|
391 |
+
}
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
/*
|
396 |
+
* use to load default data for disabled fields
|
397 |
+
* only use if it is enabled
|
398 |
+
*/
|
399 |
+
|
400 |
+
public function setDefaultDataforDisabledFields(&$data) {
|
401 |
+
if (!$this->settings['show_city']) {
|
402 |
+
$data['city'] = $this->settings['city'];
|
403 |
+
}
|
404 |
+
if (!$this->settings['show_zipcode']) {
|
405 |
+
$data['postcode'] = $this->settings['postcode'];
|
406 |
+
}
|
407 |
+
if (!$this->settings['show_region']) {
|
408 |
+
$data['region_id'] = $this->settings['region_id'];
|
409 |
+
}
|
410 |
+
return $data;
|
411 |
+
}
|
412 |
+
|
413 |
+
public function getStyle() {
|
414 |
+
$path = 'onestepcheckout/style_management/style';
|
415 |
+
$value = Mage::getStoreConfig($path, Mage::app()->getStore()->getStoreId());
|
416 |
+
return $value;
|
417 |
+
}
|
418 |
+
|
419 |
+
// ver 3.1 - Michael 20140610
|
420 |
+
public function getStyleColor() {
|
421 |
+
$storeId = Mage::app()->getStore()->getId();
|
422 |
+
$websiteId = Mage::app()->getStore()->getWebsiteId();
|
423 |
+
$storecode = Mage::app()->getStore()->getCode();
|
424 |
+
$path = 'onestepcheckout/style_management/custom';
|
425 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
426 |
+
->addFieldToFilter('scope', 'website')
|
427 |
+
->addFieldToFilter('path', $path)
|
428 |
+
->addFieldToFilter('scope_id', $websiteId)
|
429 |
+
->getFirstItem()
|
430 |
+
->getValue();
|
431 |
+
|
432 |
+
if (!$value) {
|
433 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
434 |
+
->addFieldToFilter('path', $path)
|
435 |
+
->addFieldToFilter('scope', 'stores')
|
436 |
+
->addFieldToFilter('scope_id', $storeId)
|
437 |
+
->getFirstItem()
|
438 |
+
->getValue();
|
439 |
+
if(!$value)
|
440 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
441 |
+
->addFieldToFilter('scope', 'default')
|
442 |
+
->addFieldToFilter('path', $path)
|
443 |
+
->addFieldToFilter('scope_id', 0)
|
444 |
+
->getFirstItem()
|
445 |
+
->getValue();
|
446 |
+
}
|
447 |
+
return $value;
|
448 |
+
}
|
449 |
+
|
450 |
+
public function getCheckoutButtonColor() {
|
451 |
+
$storeId = Mage::app()->getStore()->getId();
|
452 |
+
$websiteId = Mage::app()->getStore()->getWebsiteId();
|
453 |
+
$storecode = Mage::app()->getStore()->getCode();
|
454 |
+
$path = 'onestepcheckout/style_management/button';
|
455 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
456 |
+
->addFieldToFilter('scope', 'stores')
|
457 |
+
->addFieldToFilter('path', $path)
|
458 |
+
->addFieldToFilter('scope_id', $storeId)
|
459 |
+
->getFirstItem()
|
460 |
+
->getValue();
|
461 |
+
|
462 |
+
if (!$value) {
|
463 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
464 |
+
->addFieldToFilter('path', $path)
|
465 |
+
->addFieldToFilter('scope', 'websites')
|
466 |
+
->addFieldToFilter('scope_id', $websiteId)
|
467 |
+
->getFirstItem()
|
468 |
+
->getValue();
|
469 |
+
if(!$value)
|
470 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
471 |
+
->addFieldToFilter('scope', 'default')
|
472 |
+
->addFieldToFilter('path', $path)
|
473 |
+
->addFieldToFilter('scope_id', 0)
|
474 |
+
->getFirstItem()
|
475 |
+
->getValue();
|
476 |
+
}
|
477 |
+
if(!$value){
|
478 |
+
$value = $this->getBackgroundColor('orange');
|
479 |
+
}elseif($value == 'custom'){
|
480 |
+
$pathButton = 'onestepcheckout/style_management/custombutton';
|
481 |
+
$valueCustom = Mage::getModel('onestepcheckout/config')->getCollection()
|
482 |
+
->addFieldToFilter('scope', 'stores')
|
483 |
+
->addFieldToFilter('path', $pathButton)
|
484 |
+
->addFieldToFilter('scope_id', $storeId)
|
485 |
+
->getFirstItem()
|
486 |
+
->getValue();
|
487 |
+
|
488 |
+
if (!$valueCustom) {
|
489 |
+
$valueCustom = Mage::getModel('onestepcheckout/config')->getCollection()
|
490 |
+
->addFieldToFilter('scope', 'websites')
|
491 |
+
->addFieldToFilter('path', $pathButton)
|
492 |
+
->addFieldToFilter('scope_id', $websiteId)
|
493 |
+
->getFirstItem()
|
494 |
+
->getValue();
|
495 |
+
if(!$valueCustom)
|
496 |
+
$valueCustom = Mage::getModel('onestepcheckout/config')->getCollection()
|
497 |
+
->addFieldToFilter('scope', 'default')
|
498 |
+
->addFieldToFilter('path', $pathButton)
|
499 |
+
->addFieldToFilter('scope_id', 0)
|
500 |
+
->getFirstItem()
|
501 |
+
->getValue();
|
502 |
+
}
|
503 |
+
if(!$valueCustom)
|
504 |
+
$value = $this->getBackgroundColor('orange');
|
505 |
+
else
|
506 |
+
$value = '#'.$valueCustom;
|
507 |
+
}else{
|
508 |
+
$value = $this->getBackgroundColor($value);
|
509 |
+
}
|
510 |
+
return $value;
|
511 |
+
}
|
512 |
+
|
513 |
+
//Onestepcheckout v2.0.0
|
514 |
+
public function getFieldEnableBackEnd($number, $scope, $scopeId) {
|
515 |
+
$path = 'onestepcheckout/field_position_management/row_' . $number;
|
516 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
517 |
+
->addFieldToFilter('scope', $scope)
|
518 |
+
->addFieldToFilter('path', $path)
|
519 |
+
->addFieldToFilter('scope_id', $scopeId)
|
520 |
+
->getFirstItem()
|
521 |
+
->getValue();
|
522 |
+
return $value;
|
523 |
+
}
|
524 |
+
|
525 |
+
public function getFieldEnables() {
|
526 |
+
$path = 'onestepcheckout/field_position_management/row_';
|
527 |
+
for ($i = 0; $i < 20; $i++) {
|
528 |
+
$fields[$i]['value'] = Mage::getStoreConfig($path . $i, Mage::app()->getStore()->getStoreId());
|
529 |
+
$fields[$i]['position'] = $i;
|
530 |
+
}
|
531 |
+
return $fields;
|
532 |
+
}
|
533 |
+
|
534 |
+
public function getFieldEnable($number) {
|
535 |
+
$storeId = Mage::app()->getStore()->getId();
|
536 |
+
$websiteId = Mage::app()->getStore()->getWebsiteId();
|
537 |
+
$storecode = Mage::app()->getStore()->getCode();
|
538 |
+
$path = 'onestepcheckout/field_position_management/row_' . $number;
|
539 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
540 |
+
->addFieldToFilter('path', $path)
|
541 |
+
->addFieldToFilter('scope', 'stores')
|
542 |
+
->addFieldToFilter('scope_id', $storeId)
|
543 |
+
->getFirstItem()
|
544 |
+
->getValue();
|
545 |
+
if (count($value) == 0 && $storecode == 'default') {
|
546 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
547 |
+
->addFieldToFilter('path', $path)
|
548 |
+
->addFieldToFilter('scope', 'websites')
|
549 |
+
->addFieldToFilter('scope_id', $websiteId)
|
550 |
+
->getFirstItem()
|
551 |
+
->getValue();
|
552 |
+
}
|
553 |
+
if (count($value) == 0) {
|
554 |
+
$value = $this->getDefaultField($number);
|
555 |
+
}
|
556 |
+
|
557 |
+
return $value;
|
558 |
+
}
|
559 |
+
|
560 |
+
public function getDefaultField($number) {
|
561 |
+
$path = 'onestepcheckout/field_position_management/row_' . $number;
|
562 |
+
$value = Mage::getModel('onestepcheckout/config')->getCollection()
|
563 |
+
->addFieldToFilter('path', $path)
|
564 |
+
->addFieldToFilter('scope_id', 0)
|
565 |
+
->addFieldToFilter('scope', 'default')
|
566 |
+
->getFirstItem()
|
567 |
+
->getValue();
|
568 |
+
return $value;
|
569 |
+
}
|
570 |
+
|
571 |
+
public function getFieldValue() {
|
572 |
+
return array(
|
573 |
+
'0' => Mage::helper('onestepcheckout')->__('Null'),
|
574 |
+
'firstname' => Mage::helper('onestepcheckout')->__('First Name'),
|
575 |
+
'lastname' => Mage::helper('onestepcheckout')->__('Last Name'),
|
576 |
+
'prefix' => Mage::helper('onestepcheckout')->__('Prefix Name'),
|
577 |
+
'middlename' => Mage::helper('onestepcheckout')->__('Middle Name'),
|
578 |
+
'suffix' => Mage::helper('onestepcheckout')->__('Suffix Name'),
|
579 |
+
'email' => Mage::helper('onestepcheckout')->__('Email Address'),
|
580 |
+
'company' => Mage::helper('onestepcheckout')->__('Company'),
|
581 |
+
'street' => Mage::helper('onestepcheckout')->__('Address'),
|
582 |
+
'country' => Mage::helper('onestepcheckout')->__('Country'),
|
583 |
+
'region' => Mage::helper('onestepcheckout')->__('State/Province'),
|
584 |
+
'city' => Mage::helper('onestepcheckout')->__('City'),
|
585 |
+
'postcode' => Mage::helper('onestepcheckout')->__('Zip/Postal Code'),
|
586 |
+
'telephone' => Mage::helper('onestepcheckout')->__('Telephone'),
|
587 |
+
'fax' => Mage::helper('onestepcheckout')->__('Fax'),
|
588 |
+
'birthday' => Mage::helper('onestepcheckout')->__('Date of Birth'),
|
589 |
+
'gender' => Mage::helper('onestepcheckout')->__('Gender'),
|
590 |
+
'taxvat' => Mage::helper('onestepcheckout')->__('Tax/VAT number'),
|
591 |
+
);
|
592 |
+
}
|
593 |
+
|
594 |
+
public function getFieldLabel($field) {
|
595 |
+
if ($field == 'firstname')
|
596 |
+
return Mage::helper('onestepcheckout')->__('First Name');
|
597 |
+
if ($field == 'lastname')
|
598 |
+
return Mage::helper('onestepcheckout')->__('Last Name');
|
599 |
+
if ($field == 'prefix')
|
600 |
+
return Mage::helper('onestepcheckout')->__('Prefix Name');
|
601 |
+
if ($field == 'middlename')
|
602 |
+
return Mage::helper('onestepcheckout')->__('Middle Name');
|
603 |
+
if ($field == 'suffix')
|
604 |
+
return Mage::helper('onestepcheckout')->__('Suffix Name');
|
605 |
+
if ($field == 'email')
|
606 |
+
return Mage::helper('onestepcheckout')->__('Email Address');
|
607 |
+
if ($field == 'company')
|
608 |
+
return Mage::helper('onestepcheckout')->__('Company');
|
609 |
+
if ($field == 'street')
|
610 |
+
return Mage::helper('onestepcheckout')->__('Address');
|
611 |
+
if ($field == 'country')
|
612 |
+
return Mage::helper('onestepcheckout')->__('Country');
|
613 |
+
if ($field == 'region')
|
614 |
+
return Mage::helper('onestepcheckout')->__('State/Province');
|
615 |
+
if ($field == 'city')
|
616 |
+
return Mage::helper('onestepcheckout')->__('City');
|
617 |
+
if ($field == 'postcode')
|
618 |
+
return Mage::helper('onestepcheckout')->__('Zip/Postal Code');
|
619 |
+
if ($field == 'telephone')
|
620 |
+
return Mage::helper('onestepcheckout')->__('Telephone');
|
621 |
+
if ($field == 'fax')
|
622 |
+
return Mage::helper('onestepcheckout')->__('Fax');
|
623 |
+
if ($field == 'birthday')
|
624 |
+
return Mage::helper('onestepcheckout')->__('Date of Birth');
|
625 |
+
if ($field == 'gender')
|
626 |
+
return Mage::helper('onestepcheckout')->__('Gender');
|
627 |
+
if ($field == 'taxvat')
|
628 |
+
return Mage::helper('onestepcheckout')->__('Tax/VAT number');
|
629 |
+
}
|
630 |
+
|
631 |
+
public function getFieldRequire($field) {
|
632 |
+
return Mage::getStoreConfig('onestepcheckout/field_require_management/' . $field, Mage::app()->getStore()->getStoreId());
|
633 |
+
}
|
634 |
+
|
635 |
+
//Survey
|
636 |
+
public function enableSurvey() {
|
637 |
+
return Mage::getStoreConfig('onestepcheckout/survey/enable_survey', $this->getStoreId());
|
638 |
+
}
|
639 |
+
|
640 |
+
public function getSurveyQuestion() {
|
641 |
+
return Mage::getStoreConfig('onestepcheckout/survey/survey_question', $this->getStoreId());
|
642 |
+
}
|
643 |
+
|
644 |
+
public function enableFreeText() {
|
645 |
+
return Mage::getStoreConfig('onestepcheckout/survey/enable_survey_freetext', $this->getStoreId());
|
646 |
+
}
|
647 |
+
|
648 |
+
public function getSurveyValues() {
|
649 |
+
return Mage::getStoreConfig('onestepcheckout/survey/survey_values', $this->getStoreId());
|
650 |
+
}
|
651 |
+
|
652 |
+
public function enableGiftwrapModule() {
|
653 |
+
$moduleGiftwrap = Mage::getConfig()->getModuleConfig('Abserve_Giftwrap')->is('active', 'true');
|
654 |
+
return $moduleGiftwrap;
|
655 |
+
}
|
656 |
+
|
657 |
+
public function getOrderGiftwrapAmount() {
|
658 |
+
$amount = $this->getGiftwrapAmount();
|
659 |
+
$giftwrapAmount = 0;
|
660 |
+
// $freeBoxes = 0;
|
661 |
+
$items = Mage::getSingleton('checkout/cart')->getItems();
|
662 |
+
if ($this->getGiftwrapType() == 1) {
|
663 |
+
foreach ($items as $item) {
|
664 |
+
if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
|
665 |
+
continue;
|
666 |
+
}
|
667 |
+
$giftwrapAmount += $amount * ($item->getQty());
|
668 |
+
}
|
669 |
+
} elseif (count($items) > 0) {
|
670 |
+
$giftwrapAmount = $amount;
|
671 |
+
}
|
672 |
+
return $giftwrapAmount;
|
673 |
+
}
|
674 |
+
|
675 |
+
/*
|
676 |
+
Geoip
|
677 |
+
*/
|
678 |
+
|
679 |
+
public function enableGeoip() {
|
680 |
+
return false;
|
681 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/enable', $this->getStoreId());
|
682 |
+
}
|
683 |
+
|
684 |
+
public function allowDetectCountry() {
|
685 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/detect_by_ip', $this->getStoreId());
|
686 |
+
}
|
687 |
+
|
688 |
+
public function allowDetectByPostcode() {
|
689 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/detect_by_postcode', $this->getStoreId());
|
690 |
+
}
|
691 |
+
|
692 |
+
public function allowDetectByCity() {
|
693 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/detect_by_city', $this->getStoreId());
|
694 |
+
}
|
695 |
+
|
696 |
+
public function getMaxItemsEachImport() {
|
697 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/rows', $this->getStoreId());
|
698 |
+
}
|
699 |
+
|
700 |
+
public function getMinCharsPostcode() {
|
701 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/postcode_characters', $this->getStoreId());
|
702 |
+
}
|
703 |
+
|
704 |
+
public function getMinCharsCity() {
|
705 |
+
return Mage::getStoreConfig('onestepcheckout/geoip/city_characters', $this->getStoreId());
|
706 |
+
}
|
707 |
+
|
708 |
+
public function getRealIpAddr() {
|
709 |
+
//check ip from share internet
|
710 |
+
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
711 |
+
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
712 |
+
}
|
713 |
+
//to check ip is pass from proxy
|
714 |
+
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
715 |
+
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
716 |
+
} else {
|
717 |
+
$ip = $_SERVER['REMOTE_ADDR'];
|
718 |
+
}
|
719 |
+
return $ip;
|
720 |
+
}
|
721 |
+
|
722 |
+
public function detectCountryIp() {
|
723 |
+
$realIp = $this->getRealIpAddr();
|
724 |
+
$geoip = Mage::getModel('onestepcheckout/country');
|
725 |
+
$ipInteger = $geoip->convertIpToInteger($realIp);
|
726 |
+
$countryips = Mage::getModel('onestepcheckout/country')->getCollection()
|
727 |
+
->addFieldToFilter('first_ip_number', array('lteq' => $ipInteger['ip']))
|
728 |
+
->addFieldToFilter('last_ip_number', array('gteq' => $ipInteger['ip']))
|
729 |
+
;
|
730 |
+
if (isset($ipInteger['ip_lower'])) {
|
731 |
+
if ($ipInteger['ip_lower'] > 0) {
|
732 |
+
$countryips = $countryips->addFieldToFilter('last_ip_number_lower', array('gteq' => $ipInteger['ip_lower']))
|
733 |
+
// ->addFieldToFilter('first_ip_number_lower', array('lteq'=>$ipInteger['ip_lower']))
|
734 |
+
;
|
735 |
+
}
|
736 |
+
}
|
737 |
+
$countryip = $countryips->getFirstItem();
|
738 |
+
if ($countryip->getId())
|
739 |
+
return $countryip->getData('country');
|
740 |
+
return false;
|
741 |
+
}
|
742 |
+
|
743 |
+
public function getStoreByCode($storeCode) {
|
744 |
+
$stores = array_keys(Mage::app()->getStores());
|
745 |
+
foreach ($stores as $id) {
|
746 |
+
$store = Mage::app()->getStore($id);
|
747 |
+
if ($store->getCode() == $storeCode) {
|
748 |
+
return $store;
|
749 |
+
}
|
750 |
+
}
|
751 |
+
return null; // if not found
|
752 |
+
}
|
753 |
+
|
754 |
+
public function getDefaultPositionArray() {
|
755 |
+
$arrayDefault = array();
|
756 |
+
$arrayDefault[0] = 'firstname';
|
757 |
+
$arrayDefault[1] = 'lastname';
|
758 |
+
$arrayDefault[2] = 'email';
|
759 |
+
$arrayDefault[3] = 'telephone';
|
760 |
+
$arrayDefault[4] = 'street';
|
761 |
+
$arrayDefault[6] = 'country';
|
762 |
+
$arrayDefault[7] = 'city';
|
763 |
+
$arrayDefault[10] = 'postcode';
|
764 |
+
$arrayDefault[11] = 'region';
|
765 |
+
$arrayDefault[12] = 'company';
|
766 |
+
$arrayDefault[13] = 'fax';
|
767 |
+
return $arrayDefault;
|
768 |
+
}
|
769 |
+
|
770 |
+
public function getBackgroundColor($style) {
|
771 |
+
if ($style == 'orange')
|
772 |
+
return '#F39801';
|
773 |
+
if ($style == 'green')
|
774 |
+
return '#B6CE5E';
|
775 |
+
if ($style == 'black')
|
776 |
+
return '#000000';
|
777 |
+
if ($style == 'blue')
|
778 |
+
return '#3398CC';
|
779 |
+
if ($style == 'darkblue')
|
780 |
+
return '#004BA0';
|
781 |
+
if ($style == 'pink')
|
782 |
+
return '#E13B91';
|
783 |
+
if ($style == 'red')
|
784 |
+
return '#E10E03';
|
785 |
+
if ($style == 'violet')
|
786 |
+
return '#B962d5';
|
787 |
+
|
788 |
+
return '#F39801';
|
789 |
+
}
|
790 |
+
|
791 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Helper/Message.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Helper_Message extends Mage_GiftMessage_Helper_Message {
|
12 |
+
public function getInline($type, Varien_Object $entity, $dontDisplayContainer=false) {
|
13 |
+
if (in_array($type, array('onepage_checkout','multishipping_adress'))) {
|
14 |
+
if (!$this->isMessagesAvailable('items', $entity)) {
|
15 |
+
return '';
|
16 |
+
}
|
17 |
+
} elseif (!$this->isMessagesAvailable($type, $entity)) {
|
18 |
+
return '';
|
19 |
+
}
|
20 |
+
|
21 |
+
return Mage::getSingleton('core/layout')->createBlock('giftmessage/message_inline')
|
22 |
+
->setId('giftmessage_form_' . $this->_nextId++)
|
23 |
+
->setDontDisplayContainer($dontDisplayContainer)
|
24 |
+
->setEntity($entity)
|
25 |
+
->setType($type)
|
26 |
+
->setTemplate('onestepcheckout/giftmessage/inline.phtml')
|
27 |
+
->toHtml();
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Helper/Rewrite/Checkout/Url.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Helper_Rewrite_Checkout_Url extends Mage_Checkout_Helper_Url {
|
12 |
+
|
13 |
+
public function getCheckoutUrl()
|
14 |
+
{
|
15 |
+
if(Mage::helper('onestepcheckout')->enabledOnestepcheckout() && Mage::helper('core')->isModuleOutputEnabled('Abserve_Onestepcheckout') )
|
16 |
+
return Mage::getUrl('onestepcheckout/index', array('_secure' => true));
|
17 |
+
else
|
18 |
+
return $this->_getUrl('checkout/onepage');
|
19 |
+
}
|
20 |
+
|
21 |
+
|
22 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Address.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Address extends Mage_Sales_Model_Quote_Address {
|
12 |
+
public function validate() {
|
13 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
14 |
+
$errors = array();
|
15 |
+
$helper = Mage::helper('customer');
|
16 |
+
$this->implodeStreetAddress();
|
17 |
+
if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
|
18 |
+
$errors[] = $helper->__('Please enter the first name.');
|
19 |
+
}
|
20 |
+
|
21 |
+
if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
|
22 |
+
$errors[] = $helper->__('Please enter the last name.');
|
23 |
+
}
|
24 |
+
|
25 |
+
if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) {
|
26 |
+
$errors[] = $helper->__('Please enter the street.');
|
27 |
+
}
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
return parent::validate();
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Config.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Model_Config extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
parent::_construct();
|
17 |
+
$this->_init('onestepcheckout/config');
|
18 |
+
}
|
19 |
+
}
|
20 |
+
?>
|
app/code/community/Abserve/Onestepcheckout/Model/Country.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Country extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/country');
|
17 |
+
}
|
18 |
+
public function import()
|
19 |
+
{
|
20 |
+
$data = $this->getData();
|
21 |
+
if($data['country']){
|
22 |
+
$data['country'] = trim($data['country'], ' ');
|
23 |
+
$data['country'] = trim($data['country'], '"');
|
24 |
+
}
|
25 |
+
if($data['first_ip']){
|
26 |
+
$data['first_ip'] = trim($data['first_ip'], ' ');
|
27 |
+
$data['first_ip'] = trim($data['first_ip'], '"');
|
28 |
+
$firstIp = $this->convertIpToInteger($data['first_ip']);
|
29 |
+
$data['first_ip_number'] = $firstIp['ip'];
|
30 |
+
$data['first_ip_number_lower'] = $firstIp['ip_lower'];
|
31 |
+
}
|
32 |
+
if($data['last_ip']){
|
33 |
+
$data['last_ip'] = trim($data['last_ip'], ' ');
|
34 |
+
$data['last_ip'] = trim($data['last_ip'], '"');
|
35 |
+
$lastIp = $this->convertIpToInteger($data['last_ip']);
|
36 |
+
$data['last_ip_number'] = $lastIp['ip'];
|
37 |
+
$data['last_ip_number_lower'] = $lastIp['ip_lower'];
|
38 |
+
}
|
39 |
+
|
40 |
+
//check exited row
|
41 |
+
if(!$data['country']){
|
42 |
+
return false;
|
43 |
+
}else{
|
44 |
+
$collection = $this->getCollection()
|
45 |
+
->addFieldToFilter('country',$data['country'])
|
46 |
+
->addFieldToFilter('first_ip_number',$data['first_ip_number'])
|
47 |
+
->addFieldToFilter('last_ip_number',$data['last_ip_number'])
|
48 |
+
;
|
49 |
+
}
|
50 |
+
|
51 |
+
if(count($collection))
|
52 |
+
return false;
|
53 |
+
|
54 |
+
$this->setData($data);
|
55 |
+
$this->save();
|
56 |
+
|
57 |
+
return $this->getId();
|
58 |
+
}
|
59 |
+
|
60 |
+
public function convertIpToInteger($ipAddress)
|
61 |
+
{
|
62 |
+
$ipInteger = 0;
|
63 |
+
$ipIntegerLower = 0;
|
64 |
+
$ip = explode('.', $ipAddress);
|
65 |
+
if(count($ip) == 4){
|
66 |
+
$ipInteger = (int)$ip[0]*pow(2,24) + (int)$ip[1]*pow(2,16) + (int)$ip[2]*pow(2,8) + (int)$ip[3];
|
67 |
+
$ipIntegerLower = 0;
|
68 |
+
}else{
|
69 |
+
$ip = explode(':', $ipAddress);
|
70 |
+
$ip[0] = isset($ip[0]) ? $ip[0] : 0;
|
71 |
+
$ip[1] = isset($ip[1]) ? $ip[1] : 0;
|
72 |
+
$ip[2] = isset($ip[2]) ? $ip[2] : 0;
|
73 |
+
$ip[3] = isset($ip[3]) ? $ip[3] : 0;
|
74 |
+
$ip[4] = isset($ip[4]) ? $ip[4] : 0;
|
75 |
+
$ip[5] = isset($ip[5]) ? $ip[5] : 0;
|
76 |
+
$ip[6] = isset($ip[6]) ? $ip[6] : 0;
|
77 |
+
$ip[7] = isset($ip[7]) ? $ip[7] : 0;
|
78 |
+
$ipInteger = bcadd(bcadd(bcmul(hexdec($ip[0]), bcpow(2, 48)),bcmul(hexdec($ip[1]), bcpow(2, 32))),bcadd(bcmul(hexdec($ip[2]), bcpow(2, 16)),hexdec($ip[3])));
|
79 |
+
$ipIntegerLower = bcadd(bcadd(bcmul(hexdec($ip[4]), bcpow(2, 48)),bcmul(hexdec($ip[5]), bcpow(2, 32))),bcadd(bcmul(hexdec($ip[6]), bcpow(2, 16)),hexdec($ip[7])));
|
80 |
+
}
|
81 |
+
return array('ip' => $ipInteger,
|
82 |
+
'ip_lower' => $ipIntegerLower
|
83 |
+
);
|
84 |
+
}
|
85 |
+
|
86 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Countrylist.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Countrylist extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/countrylist');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getStatuses(){
|
20 |
+
$updated = Mage::helper('onestepcheckout')->__('Updated');
|
21 |
+
$needUpdate = Mage::helper('onestepcheckout')->__('Need Updated');
|
22 |
+
$status = array(
|
23 |
+
0 => $needUpdate,
|
24 |
+
1 => $updated,
|
25 |
+
);
|
26 |
+
return $status;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getStatusLabel($status)
|
30 |
+
{
|
31 |
+
if($status == 0) return Mage::helper('onestepcheckout')->__('Need Updated');
|
32 |
+
if($status == 1) return Mage::helper('onestepcheckout')->__('Updated');
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Countryversion.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Countryversion extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/countryversion');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getStatuses(){
|
20 |
+
$updated = Mage::helper('onestepcheckout')->__('Updated');
|
21 |
+
$needUpdate = Mage::helper('onestepcheckout')->__('Need Update');
|
22 |
+
$status = array(
|
23 |
+
0 => $needUpdate,
|
24 |
+
1 => $updated,
|
25 |
+
);
|
26 |
+
return $status;
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Customer/Customer.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Customer_Customer extends Mage_Customer_Model_Customer
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Validate customer attribute values.
|
16 |
+
* For existing customer password + confirmation will be validated only when password is set (i.e. its change is requested)
|
17 |
+
*
|
18 |
+
* @return bool
|
19 |
+
*/
|
20 |
+
public function validate()
|
21 |
+
{
|
22 |
+
if(Mage::helper('onestepcheckout')->enabledOnestepcheckout()){
|
23 |
+
return true;
|
24 |
+
}
|
25 |
+
|
26 |
+
return parent::validate();
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Customer/Form.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Customer_Form extends Mage_Customer_Model_Form
|
12 |
+
{
|
13 |
+
|
14 |
+
public function validateData(array $data)
|
15 |
+
{
|
16 |
+
if(Mage::helper('onestepcheckout')->enabledOnestepcheckout()){
|
17 |
+
return true;
|
18 |
+
}
|
19 |
+
$errors = array();
|
20 |
+
foreach ($this->getAttributes() as $attribute) {
|
21 |
+
if ($this->_isAttributeOmitted($attribute)) {
|
22 |
+
continue;
|
23 |
+
}
|
24 |
+
$dataModel = $this->_getAttributeDataModel($attribute);
|
25 |
+
$dataModel->setExtractedData($data);
|
26 |
+
if (!isset($data[$attribute->getAttributeCode()])) {
|
27 |
+
$data[$attribute->getAttributeCode()] = null;
|
28 |
+
}
|
29 |
+
$result = $dataModel->validateValue($data[$attribute->getAttributeCode()]);
|
30 |
+
if ($result !== true) {
|
31 |
+
$errors = array_merge($errors, $result);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if (count($errors) == 0) {
|
36 |
+
return true;
|
37 |
+
}
|
38 |
+
|
39 |
+
return $errors;
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Delivery.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Delivery extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/delivery');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Geoip.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Geoip extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/geoip');
|
17 |
+
}
|
18 |
+
public function import()
|
19 |
+
{
|
20 |
+
$data = $this->getData();
|
21 |
+
if($data['city']){
|
22 |
+
$data['city'] = mb_convert_encoding($data['city'], "UTF-8");
|
23 |
+
$data['city'] = trim($data['city'], ' ');
|
24 |
+
$data['city'] = trim($data['city'], '"');
|
25 |
+
}
|
26 |
+
if($data['region']){
|
27 |
+
$data['region'] = mb_convert_encoding($data['region'], "UTF-8");
|
28 |
+
$data['region'] = trim($data['region'], ' ');
|
29 |
+
$data['region'] = trim($data['region'], '"');
|
30 |
+
}
|
31 |
+
if($data['country']){
|
32 |
+
$data['country'] = trim($data['country'], ' ');
|
33 |
+
$data['country'] = trim($data['country'], '"');
|
34 |
+
}
|
35 |
+
if($data['postcode']){
|
36 |
+
$data['postcode'] = trim($data['postcode'], ' ');
|
37 |
+
$data['postcode'] = trim($data['postcode'], '"');
|
38 |
+
}
|
39 |
+
//prepare status
|
40 |
+
$data['status'] = 1;
|
41 |
+
//check exited row
|
42 |
+
if(!$data['postcode'] && !$data['city']){
|
43 |
+
return false;
|
44 |
+
}elseif($data['city'] && !$data['postcode']){
|
45 |
+
$collection = $this->getCollection()
|
46 |
+
->addFieldToFilter('country',$data['country'])
|
47 |
+
->addFieldToFilter('region',$data['region'])
|
48 |
+
->addFieldToFilter('city',$data['city'])
|
49 |
+
;
|
50 |
+
}elseif($data['postcode'] && !$data['city']){
|
51 |
+
$collection = $this->getCollection()
|
52 |
+
->addFieldToFilter('country',$data['country'])
|
53 |
+
->addFieldToFilter('region',$data['region'])
|
54 |
+
->addFieldToFilter('postcode',$data['postcode'])
|
55 |
+
;
|
56 |
+
}else{
|
57 |
+
$collection = $this->getCollection()
|
58 |
+
->addFieldToFilter('country',$data['country'])
|
59 |
+
->addFieldToFilter('region',$data['region'])
|
60 |
+
->addFieldToFilter('postcode',$data['postcode'])
|
61 |
+
->addFieldToFilter('city',$data['city'])
|
62 |
+
;
|
63 |
+
}
|
64 |
+
|
65 |
+
if(count($collection))
|
66 |
+
return false;
|
67 |
+
|
68 |
+
|
69 |
+
$this->setData($data);
|
70 |
+
$this->save();
|
71 |
+
|
72 |
+
return $this->getId();
|
73 |
+
}
|
74 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Giftwrap.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Model_Giftwrap extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
|
15 |
+
public function toOptionArray()
|
16 |
+
{
|
17 |
+
return array(
|
18 |
+
0 => Mage::helper('onestepcheckout')->__('Per Order'),
|
19 |
+
1 => Mage::helper('onestepcheckout')->__('Per Item')
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function paypal_prepare_line_items($observer)
|
24 |
+
{
|
25 |
+
$paypalCart = $observer->getEvent()->getPaypalCart();
|
26 |
+
if ($paypalCart){
|
27 |
+
$salesEntity = $paypalCart->getSalesEntity();
|
28 |
+
if(Mage::getModel('checkout/session')->getData('onestepcheckout_giftwrap_amount') > 0){
|
29 |
+
$paypalCart->updateTotal(Mage_Paypal_Model_Cart::TOTAL_SUBTOTAL,abs((float)Mage::getModel('core/session')->getData('onestepcheckout_giftwrap_amount')),Mage::helper('onestepcheckout')->__('Giftwrap'));
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Config.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Config extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/config', 'config_id');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
?>
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Config/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Config_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/config');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Country.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Country extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/country', 'geoip_country_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Country/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Country_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/country');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countrylist.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Countrylist extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/countrylist', 'country_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countrylist/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Countrylist_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/countrylist');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countryversion.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Countryversion extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/countryversion', 'version_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Countryversion/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Countryversion_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/countryversion');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Delivery.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Delivery extends Mage_Core_Model_Mysql4_Abstract
|
13 |
+
{
|
14 |
+
public function _construct()
|
15 |
+
{
|
16 |
+
$this->_init('onestepcheckout/delivery', 'delivery_id');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Geoip.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Geoip extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/geoip', 'geoip_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Geoip/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Geoip_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/geoip');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Survey.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Survey extends Mage_Core_Model_Mysql4_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
$this->_init('onestepcheckout/survey', 'survey_id');
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Mysql4/Survey/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Mysql4_Survey_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/survey');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Observer.php
ADDED
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Observer extends Mage_Core_Controller_Varien_Action {
|
12 |
+
|
13 |
+
public function __construct() {
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
/*
|
18 |
+
* init checkout
|
19 |
+
* if one step checkout is enabled, redirect checkout page to onestepcheckout
|
20 |
+
* otherwise, redirect to checkout/onepage
|
21 |
+
*/
|
22 |
+
|
23 |
+
public function initController($observer) {
|
24 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
25 |
+
$observer->getControllerAction()->_redirect('onestepcheckout/index', array('_secure' => true));
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
public function initCartController($observer) {
|
30 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
31 |
+
if (Mage::getStoreConfig('onestepcheckout/general/redirect_to_checkout', Mage::app()->getStore()->getStoreId()) && Mage::getStoreConfig('onestepcheckout/general/active', Mage::app()->getStore()->getStoreId())) {
|
32 |
+
$message = Mage::helper('onestepcheckout')->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($observer->getProduct()->getName()));
|
33 |
+
Mage::getSingleton('checkout/session')->addSuccess($message);
|
34 |
+
$redirect = Mage::getUrl('onestepcheckout/index', array('_secure' => true));
|
35 |
+
Header('Location: ' . $redirect);
|
36 |
+
exit();
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function controllerActionPredispatchCheckoutCartIndex($observer) {
|
42 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
43 |
+
if (Mage::getModel('checkout/session')->getData('redirectOnestepcheckout')) {
|
44 |
+
$observer->getControllerAction()->_redirect('onestepcheckout/index', array('_secure' => true));
|
45 |
+
Mage::getModel('checkout/session')->setData('redirectOnestepcheckout', false);
|
46 |
+
$smessages = Mage::getSingleton('checkout/session')->getMessages()->getItems();
|
47 |
+
if (count($smessages)) {
|
48 |
+
$output = array();
|
49 |
+
foreach ($smessages as $smessage) {
|
50 |
+
$output[] = $smessage->getText();
|
51 |
+
}
|
52 |
+
Mage::getModel('checkout/session')->setData('paymentMessages', serialize($output));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
public function controllerActionPredispatchIcepayProcessingResult($observer) {
|
59 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
60 |
+
$status = $observer->getControllerAction()->getRequest()->getParam('Status');
|
61 |
+
if ($status == 'ERR') {
|
62 |
+
Mage::getModel('checkout/session')->setData('redirectOnestepcheckout', true);
|
63 |
+
} else {
|
64 |
+
Mage::getSingleton('core/session')->setData('ic_quoteid', null);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
public function controllerActionPredispatchWirecardCheckoutPageProcessingCheckresponse($observer) {
|
70 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
71 |
+
$session = Mage::getSingleton('checkout/session');
|
72 |
+
$order = Mage::getModel('sales/order');
|
73 |
+
$order->load($session->getLastOrderId());
|
74 |
+
if ($order->isCanceled()) {
|
75 |
+
Mage::getModel('checkout/session')->setData('redirectOnestepcheckout', true);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
public function controllerActionPredispatchOnestepcheckoutIndex($observer) {
|
81 |
+
if (Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
82 |
+
$smessages = unserialize(Mage::getModel('checkout/session')->getData('paymentMessages'));
|
83 |
+
if (is_array($smessages)) {
|
84 |
+
foreach ($smessages as $smessage) {
|
85 |
+
Mage::getSingleton('checkout/session')->addError($smessage);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
Mage::getModel('checkout/session')->setData('paymentMessages', null);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
*
|
94 |
+
* Field Position change event
|
95 |
+
*/
|
96 |
+
public function changeFieldPosition($observer) {
|
97 |
+
if ($observer->getEvent()->getStore()) {
|
98 |
+
$scope = 'stores';
|
99 |
+
$scopeId = (int) Mage::getConfig()->getNode('stores/' . $observer->getEvent()->getStore() . '/system/store/id');
|
100 |
+
} elseif ($observer->getEvent()->getWebsite()) {
|
101 |
+
$scope = 'websites';
|
102 |
+
$scopeId = (int) Mage::getConfig()->getNode('websites/' . $observer->getEvent()->getWebsite() . '/system/website/id');
|
103 |
+
} else {
|
104 |
+
$scope = 'default';
|
105 |
+
$scopeId = 0;
|
106 |
+
}
|
107 |
+
|
108 |
+
$groups = Mage::app()->getRequest()->getPost('groups');
|
109 |
+
$fieldPositions = $groups['field_position_management']['fields'];
|
110 |
+
|
111 |
+
$deleteTransaction = Mage::getModel('core/resource_transaction');
|
112 |
+
/* @var $deleteTransaction Mage_Core_Model_Resource_Transaction */
|
113 |
+
$saveTransaction = Mage::getModel('core/resource_transaction');
|
114 |
+
/* @var $saveTransaction Mage_Core_Model_Resource_Transaction */
|
115 |
+
$deleteCustomTransaction = Mage::getModel('core/resource_transaction');
|
116 |
+
/* @var $deleteTransaction Mage_Core_Model_Resource_Transaction */
|
117 |
+
$saveCustomTransaction = Mage::getModel('core/resource_transaction');
|
118 |
+
/* @var $saveTransaction Mage_Core_Model_Resource_Transaction */
|
119 |
+
foreach ($fieldPositions as $row => $data) {
|
120 |
+
if ($data['value'] != null) {
|
121 |
+
$value = $data['value'];
|
122 |
+
} else {
|
123 |
+
$value = null;
|
124 |
+
}
|
125 |
+
$dataObject = Mage::getModel('onestepcheckout/config');
|
126 |
+
$positionPath = 'onestepcheckout/field_position_management/' . $row;
|
127 |
+
$dataObject
|
128 |
+
->setScope($scope)
|
129 |
+
->setScopeId($scopeId)
|
130 |
+
->setPath($positionPath)
|
131 |
+
->setValue($value);
|
132 |
+
$oldPath = Mage::getModel('onestepcheckout/config')->getCollection()
|
133 |
+
->addFieldToFilter('scope', $scope)
|
134 |
+
->addFieldToFilter('scope_id', $scopeId)
|
135 |
+
->addFieldToFilter('path', $positionPath)
|
136 |
+
->getFirstItem();
|
137 |
+
if ($oldPath) {
|
138 |
+
$dataObject->setConfigId($oldPath->getConfigId());
|
139 |
+
}
|
140 |
+
$inherit = !empty($data['inherit']);
|
141 |
+
if (!$inherit) {
|
142 |
+
$saveTransaction->addObject($dataObject);
|
143 |
+
} else {
|
144 |
+
$deleteTransaction->addObject($dataObject);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
//save style
|
149 |
+
$fieldStyles = $groups['style_management']['fields'];
|
150 |
+
// var_dump($fieldStyles);die();
|
151 |
+
// foreach($fieldStyles as $style){
|
152 |
+
// zend_debug::dump($style);
|
153 |
+
// }
|
154 |
+
// foreach ($fieldStyles as $style){
|
155 |
+
// zend_debug::dump($style);
|
156 |
+
// }
|
157 |
+
// zend_debug::dump($fieldStyles);die();
|
158 |
+
$style = $fieldStyles['style'];
|
159 |
+
// foreach ($fieldStyles as $style) {
|
160 |
+
$styleValue = $style['value'];
|
161 |
+
$styleDataObject = Mage::getModel('onestepcheckout/config');
|
162 |
+
$stylePath = 'onestepcheckout/style_management/style';
|
163 |
+
$oldStylePath = Mage::getModel('onestepcheckout/config')->getCollection()
|
164 |
+
->addFieldToFilter('scope', $scope)
|
165 |
+
->addFieldToFilter('scope_id', $scopeId)
|
166 |
+
->addFieldToFilter('path', $stylePath)
|
167 |
+
->getFirstItem();
|
168 |
+
$styleDataObject
|
169 |
+
->setScope($scope)
|
170 |
+
->setScopeId($scopeId)
|
171 |
+
->setPath($stylePath)
|
172 |
+
->setValue($styleValue);
|
173 |
+
|
174 |
+
if ($oldStylePath) {
|
175 |
+
$styleDataObject->setConfigId($oldStylePath->getConfigId());
|
176 |
+
}
|
177 |
+
$styleInherit = !empty($style['inherit']);
|
178 |
+
if($style['value']=='custom' || isset($style['custom']) || isset($style['inherit'])){
|
179 |
+
$customValue = $style['custom'];
|
180 |
+
$customDataObject = Mage::getModel('onestepcheckout/config');
|
181 |
+
$customPath = 'onestepcheckout/style_management/custom';
|
182 |
+
$oldCustomPath = Mage::getModel('onestepcheckout/config')->getCollection()
|
183 |
+
->addFieldToFilter('scope', $scope)
|
184 |
+
->addFieldToFilter('scope_id', $scopeId)
|
185 |
+
->addFieldToFilter('path', $customPath)
|
186 |
+
->getFirstItem();
|
187 |
+
$customDataObject
|
188 |
+
->setScope($scope)
|
189 |
+
->setScopeId($scopeId)
|
190 |
+
->setPath($customPath)
|
191 |
+
->setValue($customValue);
|
192 |
+
if($oldCustomPath){
|
193 |
+
$customDataObject->setConfigId($oldCustomPath->getConfigId());
|
194 |
+
}
|
195 |
+
if (!$styleInherit) {
|
196 |
+
$saveCustomTransaction->addObject($customDataObject);
|
197 |
+
} else {
|
198 |
+
$deleteCustomTransaction->addObject($customDataObject);
|
199 |
+
}
|
200 |
+
}
|
201 |
+
if (!$styleInherit) {
|
202 |
+
$saveTransaction->addObject($styleDataObject);
|
203 |
+
} else {
|
204 |
+
$deleteTransaction->addObject($styleDataObject);
|
205 |
+
}
|
206 |
+
// }
|
207 |
+
$deleteTransaction->delete();
|
208 |
+
$saveTransaction->save();
|
209 |
+
$deleteCustomTransaction->delete();
|
210 |
+
$saveCustomTransaction->save();
|
211 |
+
|
212 |
+
/*button*/
|
213 |
+
$deleteButtonTransaction = Mage::getModel('core/resource_transaction');
|
214 |
+
$saveButtonTransaction = Mage::getModel('core/resource_transaction');
|
215 |
+
$deleteCustomButtonTransaction = Mage::getModel('core/resource_transaction');
|
216 |
+
$saveCustomButtonTransaction = Mage::getModel('core/resource_transaction');
|
217 |
+
|
218 |
+
$button = $fieldStyles['button'];
|
219 |
+
// foreach ($fieldStyles as $style) {
|
220 |
+
$buttonValue = $button['value'];
|
221 |
+
$buttonDataObject = Mage::getModel('onestepcheckout/config');
|
222 |
+
$buttonPath = 'onestepcheckout/style_management/button';
|
223 |
+
$oldButtonPath = Mage::getModel('onestepcheckout/config')->getCollection()
|
224 |
+
->addFieldToFilter('scope', $scope)
|
225 |
+
->addFieldToFilter('scope_id', $scopeId)
|
226 |
+
->addFieldToFilter('path', $buttonPath)
|
227 |
+
->getFirstItem();
|
228 |
+
$buttonDataObject
|
229 |
+
->setScope($scope)
|
230 |
+
->setScopeId($scopeId)
|
231 |
+
->setPath($buttonPath)
|
232 |
+
->setValue($buttonValue);
|
233 |
+
|
234 |
+
if ($oldButtonPath) {
|
235 |
+
$buttonDataObject->setConfigId($oldButtonPath->getConfigId());
|
236 |
+
}
|
237 |
+
$buttonInherit = !empty($button['inherit']);
|
238 |
+
if($button['value']=='custombutton' || isset($button['custombutton']) || isset($button['inherit'])){
|
239 |
+
$customButtonValue = $button['custombutton'];
|
240 |
+
$customButtonDataObject = Mage::getModel('onestepcheckout/config');
|
241 |
+
$customButtonPath = 'onestepcheckout/style_management/custombutton';
|
242 |
+
$oldCustomButtonPath = Mage::getModel('onestepcheckout/config')->getCollection()
|
243 |
+
->addFieldToFilter('scope', $scope)
|
244 |
+
->addFieldToFilter('scope_id', $scopeId)
|
245 |
+
->addFieldToFilter('path', $customButtonPath)
|
246 |
+
->getFirstItem();
|
247 |
+
$customButtonDataObject
|
248 |
+
->setScope($scope)
|
249 |
+
->setScopeId($scopeId)
|
250 |
+
->setPath($customButtonPath)
|
251 |
+
->setValue($customButtonValue);
|
252 |
+
if($oldCustomButtonPath){
|
253 |
+
$customButtonDataObject->setConfigId($oldCustomButtonPath->getConfigId());
|
254 |
+
}
|
255 |
+
if (!$buttonInherit) {
|
256 |
+
$saveCustomButtonTransaction->addObject($customButtonDataObject);
|
257 |
+
} else {
|
258 |
+
$deleteCustomButtonTransaction->addObject($customButtonDataObject);
|
259 |
+
}
|
260 |
+
}
|
261 |
+
if (!$buttonInherit) {
|
262 |
+
$saveButtonTransaction->addObject($buttonDataObject);
|
263 |
+
} else {
|
264 |
+
$deleteButtonTransaction->addObject($buttonDataObject);
|
265 |
+
}
|
266 |
+
// }
|
267 |
+
$deleteButtonTransaction->delete();
|
268 |
+
$saveButtonTransaction->save();
|
269 |
+
$deleteCustomButtonTransaction->delete();
|
270 |
+
$saveCustomButtonTransaction->save();
|
271 |
+
}
|
272 |
+
|
273 |
+
/*
|
274 |
+
* the function is to save customer comment
|
275 |
+
*/
|
276 |
+
|
277 |
+
public function saveOrderComment($observer) {
|
278 |
+
$_order = $observer->getEvent()->getOrder();
|
279 |
+
$customerComment = Mage::getSingleton('checkout/session')->getCustomerComment();
|
280 |
+
if ($customerComment != "") {
|
281 |
+
try {
|
282 |
+
$_order->setOnestepcheckoutOrderComment($customerComment)
|
283 |
+
->addStatusHistoryComment($customerComment, false)
|
284 |
+
->save();
|
285 |
+
} catch (Exception $e) {
|
286 |
+
|
287 |
+
}
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
/*
|
292 |
+
* notify admin after order is placed
|
293 |
+
*/
|
294 |
+
|
295 |
+
public function notifyAdmin($observer) {
|
296 |
+
$helper = Mage::helper('onestepcheckout');
|
297 |
+
if ($helper->enableNotifyAdmin()) {
|
298 |
+
$_order = $observer->getEvent()->getOrder();
|
299 |
+
$translate = Mage::getSingleton('core/translate');
|
300 |
+
$translate->setTranslateInline(false);
|
301 |
+
$paymentBlock = Mage::helper('payment')->getInfoBlock($_order->getPayment())
|
302 |
+
->setIsSecureMode(true);
|
303 |
+
$paymentBlock->getMethod()->setStore($_order->getStore()->getId());
|
304 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
305 |
+
$template = Mage::getStoreConfig('onestepcheckout/order_notification/template', $_order->getStoreId());
|
306 |
+
$sendTo = array();
|
307 |
+
$email_array = $helper->getEmailArray();
|
308 |
+
if (!empty($email_array)) {
|
309 |
+
foreach ($email_array as $email) {
|
310 |
+
$sendTo[] = array('email' => trim($email),
|
311 |
+
'name' => '');
|
312 |
+
}
|
313 |
+
}
|
314 |
+
foreach ($sendTo as $recipient) {
|
315 |
+
$result = $mailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $_order->getStoreId()))
|
316 |
+
->sendTransactional(
|
317 |
+
$template, Mage::getStoreConfig('sales_email/order/identity', $_order->getStoreId()), $recipient['email'], $recipient['name'], array(
|
318 |
+
'order' => $_order,
|
319 |
+
'billing' => $_order->getBillingAddress(),
|
320 |
+
'payment_html' => $paymentBlock->toHtml(),
|
321 |
+
)
|
322 |
+
);
|
323 |
+
}
|
324 |
+
$translate->setTranslateInline(true);
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
public function controller_action_predispatch_adminhtml($observer) {
|
329 |
+
$controller = $observer->getControllerAction();
|
330 |
+
if ($controller->getRequest()->getControllerName() != 'system_config' || $controller->getRequest()->getActionName() != 'edit')
|
331 |
+
return;
|
332 |
+
$section = $controller->getRequest()->getParam('section');
|
333 |
+
if ($section != 'onestepcheckout')
|
334 |
+
return;
|
335 |
+
$magenotificationHelper = Mage::helper('magenotification');
|
336 |
+
if (!$magenotificationHelper->checkLicenseKey('Onestepcheckout')) {
|
337 |
+
$message = $magenotificationHelper->getInvalidKeyNotice();
|
338 |
+
echo $message;
|
339 |
+
die();
|
340 |
+
} elseif ((int) $magenotificationHelper->getCookieLicenseType() == Abserve_Magenotification_Model_Keygen::TRIAL_VERSION) {
|
341 |
+
Mage::getSingleton('adminhtml/session')->addNotice($magenotificationHelper->__('You are using a trial version of One Step Checkout extension. It will be expired on %s.', $magenotificationHelper->getCookieData('expired_time')
|
342 |
+
));
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
public function orderPlaceAfter($observers) {
|
347 |
+
$session = Mage::getSingleton('checkout/session');
|
348 |
+
$giftwrap = $session->getData('onestepcheckout_giftwrap');
|
349 |
+
$giftwrapAmount = $session->getData('onestepcheckout_giftwrap_amount');
|
350 |
+
if ($giftwrap || $giftwrapAmount) {
|
351 |
+
$session->unsetData('onestepcheckout_giftwrap');
|
352 |
+
$session->unsetData('onestepcheckout_giftwrap_amount');
|
353 |
+
}
|
354 |
+
//Save Comment
|
355 |
+
$order = $observers->getEvent()->getOrder();
|
356 |
+
$customerComment = $session->getData('customer_comment');
|
357 |
+
if ($customerComment != "") {
|
358 |
+
try {
|
359 |
+
$order->setOnestepcheckoutOrderComment($customerComment)
|
360 |
+
->addStatusHistoryComment($customerComment, false)
|
361 |
+
->save();
|
362 |
+
} catch (Exception $e) {
|
363 |
+
|
364 |
+
}
|
365 |
+
}
|
366 |
+
/* save OSC comment */
|
367 |
+
$OSCCM = $session->getOSCCM();
|
368 |
+
if($OSCCM != null){
|
369 |
+
$order->setOnestepcheckoutOrderComment($OSCCM)->save();
|
370 |
+
$session->setOSCCM(null);
|
371 |
+
}
|
372 |
+
//Save survey
|
373 |
+
$orderId = $order->getId();
|
374 |
+
$surveyQuestion = $session->getData('survey_question');
|
375 |
+
$surveyAnswer = $session->getData('survey_answer');
|
376 |
+
$survey = Mage::getModel('onestepcheckout/survey');
|
377 |
+
if ($surveyAnswer) {
|
378 |
+
try {
|
379 |
+
$survey->setData('question', $surveyQuestion)
|
380 |
+
->setData('answer', $surveyAnswer)
|
381 |
+
->setData('order_id', $orderId)
|
382 |
+
->save();
|
383 |
+
} catch (Exception $e) {
|
384 |
+
|
385 |
+
}
|
386 |
+
$session->unsetData('survey_question');
|
387 |
+
$session->unsetData('survey_answer');
|
388 |
+
}
|
389 |
+
|
390 |
+
$delivery_date_time = $session->getData('delivery_date_time');
|
391 |
+
$delivery = Mage::getModel('onestepcheckout/delivery');
|
392 |
+
if ($delivery_date_time) {
|
393 |
+
try {
|
394 |
+
$delivery->setData('delivery_time_date', $delivery_date_time)
|
395 |
+
->setData('order_id', $orderId)
|
396 |
+
->save();
|
397 |
+
} catch (Exception $e) {
|
398 |
+
|
399 |
+
}
|
400 |
+
$session->unsetData('delivery_date_time');
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Order/Pdf/Amount.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Order_Pdf_Amount
|
12 |
+
extends Mage_Sales_Model_Order_Pdf_Total_Default
|
13 |
+
{
|
14 |
+
public function getTotalsForDisplay()
|
15 |
+
{
|
16 |
+
|
17 |
+
$amount = $this->getAmount();
|
18 |
+
$fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
|
19 |
+
if(floatval($amount))
|
20 |
+
{
|
21 |
+
$amount = $this->getOrder()->formatPriceTxt($amount);
|
22 |
+
if ($this->getAmountPrefix())
|
23 |
+
{
|
24 |
+
$amount = $this->getAmountPrefix().$amount;
|
25 |
+
}
|
26 |
+
|
27 |
+
$totals = array(
|
28 |
+
array(
|
29 |
+
'label' => Mage::helper('onestepcheckout')->__('Giftwrap'),
|
30 |
+
'amount' => $amount,
|
31 |
+
'font_size' => $fontSize,
|
32 |
+
)
|
33 |
+
);
|
34 |
+
return $totals;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
public function getAmount()
|
38 |
+
{
|
39 |
+
return $this->getOrder()->getOnestepcheckoutGiftwrapAmount();
|
40 |
+
}
|
41 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Creditmemo/Total/Discount.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Order_Creditmemo_Total_Discount extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract {
|
12 |
+
|
13 |
+
public function collect(Mage_Sales_Model_Order_Invoice $creditmemo) {
|
14 |
+
$creditmemo->setOnestepcheckoutDiscountAmount(0);
|
15 |
+
$orderOnestepcheckoutDiscount = $creditmemo->getOrder()->getOnestepcheckoutDiscountAmount();
|
16 |
+
if ($orderOnestepcheckoutDiscount) {
|
17 |
+
$creditmemo->setOnestepcheckoutDiscountAmount($orderOnestepcheckoutDiscount);
|
18 |
+
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()-$orderOnestepcheckoutDiscount);
|
19 |
+
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()-$orderOnestepcheckoutDiscount);
|
20 |
+
}
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Creditmemo/Total/Giftwrap.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Order_Creditmemo_Total_Giftwrap extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract {
|
12 |
+
|
13 |
+
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo) {
|
14 |
+
$creditmemo->setOnestepcheckoutGiftwrapAmount(0);
|
15 |
+
|
16 |
+
$orderGiftwrapAmount = $creditmemo->getOrder()->getOnestepcheckoutGiftwrapAmount();
|
17 |
+
$baseOrderShippingAmount = $creditmemo->getOrder()->getOnestepcheckoutGiftwrapAmount();
|
18 |
+
if ($orderGiftwrapAmount) {
|
19 |
+
$creditmemo->setOnestepcheckoutGiftwrapAmount($orderGiftwrapAmount);
|
20 |
+
$creditmemo->setGrandTotal($creditmemo->getGrandTotal()+$orderGiftwrapAmount);
|
21 |
+
$creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal()+$orderGiftwrapAmount);
|
22 |
+
}
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Invoice/Total/Discount.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Order_Invoice_Total_Discount extends Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
12 |
+
|
13 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
|
14 |
+
$invoice->setOnestepcheckoutDiscountAmount(0);
|
15 |
+
$orderOnestepcheckoutDiscount = $invoice->getOrder()->getOnestepcheckoutDiscountAmount();
|
16 |
+
if ($orderOnestepcheckoutDiscount) {
|
17 |
+
$invoice->setOnestepcheckoutDiscountAmount($orderOnestepcheckoutDiscount);
|
18 |
+
$invoice->setGrandTotal($invoice->getGrandTotal()-$orderOnestepcheckoutDiscount);
|
19 |
+
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()-$orderOnestepcheckoutDiscount);
|
20 |
+
}
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Invoice/Total/Giftwrap.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Order_Invoice_Total_Giftwrap extends Mage_Sales_Model_Order_Invoice_Total_Abstract {
|
12 |
+
|
13 |
+
public function collect(Mage_Sales_Model_Order_Invoice $invoice) {
|
14 |
+
$invoice->setOnestepcheckoutGiftwrapAmount(0);
|
15 |
+
|
16 |
+
$orderGiftwrapAmount = $invoice->getOrder()->getOnestepcheckoutGiftwrapAmount();
|
17 |
+
$baseOrderShippingAmount = $invoice->getOrder()->getOnestepcheckoutGiftwrapAmount();
|
18 |
+
if ($orderGiftwrapAmount) {
|
19 |
+
$invoice->setGiftwrapAmount($orderGiftwrapAmount);
|
20 |
+
$invoice->setGrandTotal($invoice->getGrandTotal()+$orderGiftwrapAmount);
|
21 |
+
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal()+$orderGiftwrapAmount);
|
22 |
+
}
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Pdf/Invoice.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Order_Pdf_Invoice extends Mage_Sales_Model_Order_Pdf_Invoice
|
12 |
+
{
|
13 |
+
public function getPdf ($invoices = array())
|
14 |
+
{
|
15 |
+
$this->_beforeGetPdf();
|
16 |
+
$this->_initRenderer('invoice');
|
17 |
+
$pdf = new Zend_Pdf();
|
18 |
+
$this->_setPdf($pdf);
|
19 |
+
$style = new Zend_Pdf_Style();
|
20 |
+
$this->_setFontBold($style, 10);
|
21 |
+
foreach ($invoices as $invoice) {
|
22 |
+
if ($invoice->getStoreId()) {
|
23 |
+
Mage::app()->getLocale()->emulate($invoice->getStoreId());
|
24 |
+
Mage::app()->setCurrentStore($invoice->getStoreId());
|
25 |
+
}
|
26 |
+
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
|
27 |
+
$pdf->pages[] = $page;
|
28 |
+
$order = $invoice->getOrder();
|
29 |
+
/* Add image */
|
30 |
+
$this->insertLogo($page, $invoice->getStore());
|
31 |
+
/* Add address */
|
32 |
+
$this->insertAddress($page, $invoice->getStore());
|
33 |
+
/* Add head */
|
34 |
+
$this->insertOrder($page, $order,
|
35 |
+
Mage::getStoreConfigFlag(
|
36 |
+
self::XML_PATH_SALES_PDF_INVOICE_PUT_ORDER_ID, $order->getStoreId()));
|
37 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
38 |
+
$this->_setFontRegular($page);
|
39 |
+
$page->drawText(
|
40 |
+
Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId(),
|
41 |
+
35, 780, 'UTF-8');
|
42 |
+
/* Add table */
|
43 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
44 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
45 |
+
$page->setLineWidth(0.5);
|
46 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
47 |
+
$this->y -= 10;
|
48 |
+
/* Add table head */
|
49 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
50 |
+
$page->drawText(Mage::helper('sales')->__('Products'), 35, $this->y,
|
51 |
+
'UTF-8');
|
52 |
+
// $page->drawText(Mage::helper('sales')->__('SKU'), 255, $this->y, 'UTF-8');
|
53 |
+
$page->drawText(Mage::helper('sales')->__('Price'), 380,
|
54 |
+
$this->y, 'UTF-8');
|
55 |
+
$page->drawText(Mage::helper('sales')->__('Qty'), 430, $this->y,
|
56 |
+
'UTF-8');
|
57 |
+
$page->drawText(Mage::helper('sales')->__('Tax'), 480, $this->y,
|
58 |
+
'UTF-8');
|
59 |
+
$page->drawText(Mage::helper('sales')->__('Subtotal'), 530,
|
60 |
+
$this->y, 'UTF-8');
|
61 |
+
$this->y -= 15;
|
62 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
63 |
+
/* Add body */
|
64 |
+
foreach ($invoice->getAllItems() as $item) {
|
65 |
+
if ($item->getOrderItem()->getParentItem()) {
|
66 |
+
continue;
|
67 |
+
}
|
68 |
+
if ($this->y < 15) {
|
69 |
+
$page = $this->newPage(array('table_header' => true));
|
70 |
+
}
|
71 |
+
/* Draw item */
|
72 |
+
$page = $this->_drawItem($item, $page, $order);
|
73 |
+
$page->setLineWidth(0.5);
|
74 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
75 |
+
$page->drawLine(25, $this->y, 570, $this->y);
|
76 |
+
$this->y -= 10;
|
77 |
+
}
|
78 |
+
// Output Giftwrap Information
|
79 |
+
$gifBlock = Mage::getBlockSingleton(
|
80 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
81 |
+
$giftwrapItems = $gifBlock->getOrderItemGiftwrap($order->getId());
|
82 |
+
if (count($giftwrapItems)) {
|
83 |
+
/* Add table */
|
84 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
85 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
86 |
+
$page->setLineWidth(0.5);
|
87 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
88 |
+
$this->y -= 10;
|
89 |
+
/* Add table head */
|
90 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
91 |
+
$page->drawText(Mage::helper('sales')->__('Item #'), 35,
|
92 |
+
$this->y, 'UTF-8');
|
93 |
+
$page->drawText(Mage::helper('sales')->__('Product'), 70,
|
94 |
+
$this->y, 'UTF-8');
|
95 |
+
$page->drawText(Mage::helper('sales')->__('Giftwrap Style'),
|
96 |
+
200, $this->y, 'UTF-8');
|
97 |
+
$page->drawText(Mage::helper('sales')->__('Giftcard'), 300,
|
98 |
+
$this->y, 'UTF-8');
|
99 |
+
$page->drawText(Mage::helper('sales')->__('Message'), 450,
|
100 |
+
$this->y, 'UTF-8');
|
101 |
+
$this->y -= 15;
|
102 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
103 |
+
/* Add body */
|
104 |
+
$i = 0;
|
105 |
+
foreach ($giftwrapItems as $giftwrapItem) {
|
106 |
+
|
107 |
+
$i ++;
|
108 |
+
// var_dump($this->y);
|
109 |
+
// echo "<br />";
|
110 |
+
if ($this->y < 60) {
|
111 |
+
// var_dump($i);die();
|
112 |
+
$page = $this->newPage(
|
113 |
+
array('table_header' => true));
|
114 |
+
}
|
115 |
+
$page->drawText($i, 35, $this->y, 'UTF-8');
|
116 |
+
//$page->drawText($gifBlock->getProduct($giftwrapItem['itemId'])->getName(), 70, $this->y, 'UTF-8');
|
117 |
+
$item = Mage::getModel(
|
118 |
+
'sales/quote_item')->load($giftwrapItem['itemId']);
|
119 |
+
$this->drawGiftProduct($item->getProductId(), $pdf, $page);
|
120 |
+
$page->drawText(
|
121 |
+
$gifBlock->getGiftwrapStyleName($giftwrapItem['styleId']),
|
122 |
+
200, $this->y + 10, 'UTF-8');
|
123 |
+
$image = $gifBlock->getGiftwrapStyleImage(
|
124 |
+
$giftwrapItem['styleId']);
|
125 |
+
|
126 |
+
if ($image) {
|
127 |
+
$fileExtension = end(explode(".", $image));
|
128 |
+
$fileExtension=strtolower($fileExtension);
|
129 |
+
switch ($fileExtension) {
|
130 |
+
case 'tif':
|
131 |
+
$check = 1;
|
132 |
+
break;
|
133 |
+
case 'tiff':
|
134 |
+
$check = 1;
|
135 |
+
break;
|
136 |
+
case 'png':
|
137 |
+
$check = 1;
|
138 |
+
break;
|
139 |
+
case 'jpg':
|
140 |
+
$check = 1;
|
141 |
+
break;
|
142 |
+
case 'jpe':
|
143 |
+
$check = 1;
|
144 |
+
break;
|
145 |
+
case 'jpeg':
|
146 |
+
$check = 1;
|
147 |
+
break;
|
148 |
+
default:
|
149 |
+
$check = 0;
|
150 |
+
break;
|
151 |
+
}
|
152 |
+
if ($check == 1) {
|
153 |
+
/*$image = Mage::getStoreConfig(
|
154 |
+
'system/filesystem/media', $store) . '/giftwrap/' .
|
155 |
+
$image;*/
|
156 |
+
$image = Mage::getBaseDir('media').DS.'giftwrap'.DS.$image;
|
157 |
+
if ($image) {
|
158 |
+
$this->insertImageGif($page, $image,
|
159 |
+
$invoice->getStore(), $this->y);
|
160 |
+
} else {
|
161 |
+
$page->drawText(
|
162 |
+
Mage::helper('sales')->__('No Image'), 300,
|
163 |
+
$this->y, 'UTF-8');
|
164 |
+
}
|
165 |
+
} else {
|
166 |
+
$page->drawText(
|
167 |
+
Mage::helper('sales')->__('Unsupported type.'), 300,
|
168 |
+
$this->y, 'UTF-8');
|
169 |
+
}
|
170 |
+
} else {
|
171 |
+
$page->drawText(Mage::helper('sales')->__('No Image'),
|
172 |
+
300, $this->y, 'UTF-8');
|
173 |
+
}
|
174 |
+
$page->drawText(
|
175 |
+
$gifBlock->getGiftcardName($giftwrapItem['giftcardId']), 300,
|
176 |
+
$this->y + 10, 'UTF-8');
|
177 |
+
$this->drawGiftcard($page,$gifBlock,$giftwrapItem['giftcardId'],$invoice);
|
178 |
+
$this->drawGift($giftwrapItem, $pdf, $page);
|
179 |
+
if ($check == 1) {
|
180 |
+
$this->y -= 60;
|
181 |
+
} else {
|
182 |
+
$this->y -= 15;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
+
/* Add totals */
|
187 |
+
$page = $this->insertTotals($page, $invoice);
|
188 |
+
if ($invoice->getStoreId()) {
|
189 |
+
Mage::app()->getLocale()->revert();
|
190 |
+
}
|
191 |
+
}
|
192 |
+
$this->_afterGetPdf();
|
193 |
+
return $pdf;
|
194 |
+
}
|
195 |
+
public function drawGiftcard (&$page,$gifBlock,$giftcardId,$invoice)
|
196 |
+
{
|
197 |
+
|
198 |
+
$image = $gifBlock->getGiftcardImage($giftcardId);
|
199 |
+
if ($image) {
|
200 |
+
$fileExtension = end(explode(".", $image));
|
201 |
+
switch ($fileExtension) {
|
202 |
+
case 'tif':
|
203 |
+
$check = 1;
|
204 |
+
break;
|
205 |
+
case 'tiff':
|
206 |
+
$check = 1;
|
207 |
+
break;
|
208 |
+
case 'png':
|
209 |
+
$check = 1;
|
210 |
+
break;
|
211 |
+
case 'jpg':
|
212 |
+
$check = 1;
|
213 |
+
break;
|
214 |
+
case 'jpe':
|
215 |
+
$check = 1;
|
216 |
+
break;
|
217 |
+
case 'jpeg':
|
218 |
+
$check = 1;
|
219 |
+
break;
|
220 |
+
default:
|
221 |
+
$check = 0;
|
222 |
+
break;
|
223 |
+
}
|
224 |
+
|
225 |
+
if ($check == 1) {
|
226 |
+
/*$image = Mage::getStoreConfig('system/filesystem/media', $store) .
|
227 |
+
'/giftwrap/giftcard/' . $image;*/
|
228 |
+
$image = Mage::getBaseDir('media').DS.'giftwrap'.DS.'giftcard'.DS.$image;
|
229 |
+
if (is_file($image)) {
|
230 |
+
$this->insertImageGif($page, $image, $invoice->getStore(),
|
231 |
+
$this->y,290);
|
232 |
+
} else {
|
233 |
+
$page->drawText(Mage::helper('sales')->__('No Image'), 300,
|
234 |
+
$this->y, 'UTF-8');
|
235 |
+
}
|
236 |
+
} else {
|
237 |
+
$page->drawText(Mage::helper('sales')->__('Unsupported type.'),
|
238 |
+
300, $this->y, 'UTF-8');
|
239 |
+
}
|
240 |
+
} else {
|
241 |
+
$page->drawText(Mage::helper('sales')->__('No Image'), 300,
|
242 |
+
$this->y, 'UTF-8');
|
243 |
+
}
|
244 |
+
}
|
245 |
+
protected function insertImageGif (&$page, $image, $store = null, $y,$x=null)
|
246 |
+
{
|
247 |
+
$image = Zend_Pdf_Image::imageWithPath($image);
|
248 |
+
if(!$x){
|
249 |
+
$page->drawImage($image, 190, $y - 55, 250, $y + 5);
|
250 |
+
}else{
|
251 |
+
$page->drawImage($image, $x, $y - 55, $x+60, $y + 5);
|
252 |
+
}
|
253 |
+
return $page;
|
254 |
+
}
|
255 |
+
public function drawGift ($giftwrapItem, $pdf, $page)
|
256 |
+
{
|
257 |
+
$gifBlock = Mage::getBlockSingleton(
|
258 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
259 |
+
$lines = array();
|
260 |
+
$lines[0][] = array(
|
261 |
+
'text' => Mage::helper('core/string')->str_split(
|
262 |
+
$giftwrapItem['giftwrap_message'], 25), 'feed' => 450);
|
263 |
+
$lineBlock = array('lines' => $lines, 'height' => 10);
|
264 |
+
$page = $this->drawLineBlocks($page, array($lineBlock),
|
265 |
+
array('table_header' => true));
|
266 |
+
$this->setPage($page);
|
267 |
+
}
|
268 |
+
public function drawGiftProduct ($giftwrapItem, $pdf, $page)
|
269 |
+
{
|
270 |
+
$gifBlock = Mage::getBlockSingleton(
|
271 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
272 |
+
$lines = array();
|
273 |
+
$lines[0][] = array(
|
274 |
+
'text' => Mage::helper('core/string')->str_split(
|
275 |
+
$gifBlock->getProduct($giftwrapItem)
|
276 |
+
->getName(), 25), 'feed' => 70);
|
277 |
+
$lineBlock = array('lines' => $lines, 'height' => 10);
|
278 |
+
$page = $this->drawLineBlocks($page, array($lineBlock),
|
279 |
+
array('table_header' => true));
|
280 |
+
$this->setPage($page);
|
281 |
+
}
|
282 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Order/Pdf/Shipment.php
ADDED
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Giftwrap_Model_Sales_Order_Pdf_Shipment extends Mage_Sales_Model_Order_Pdf_Shipment
|
12 |
+
{
|
13 |
+
public function getPdf ($shipments = array())
|
14 |
+
{
|
15 |
+
$this->_beforeGetPdf();
|
16 |
+
$this->_initRenderer('shipment');
|
17 |
+
$pdf = new Zend_Pdf();
|
18 |
+
$this->_setPdf($pdf);
|
19 |
+
$style = new Zend_Pdf_Style();
|
20 |
+
$this->_setFontBold($style, 10);
|
21 |
+
foreach ($shipments as $shipment) {
|
22 |
+
if ($shipment->getStoreId()) {
|
23 |
+
Mage::app()->getLocale()->emulate($shipment->getStoreId());
|
24 |
+
}
|
25 |
+
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
|
26 |
+
$pdf->pages[] = $page;
|
27 |
+
$order = $shipment->getOrder();
|
28 |
+
/* Add image */
|
29 |
+
$this->insertLogo($page, $shipment->getStore());
|
30 |
+
/* Add address */
|
31 |
+
$this->insertAddress($page, $shipment->getStore());
|
32 |
+
/* Add head */
|
33 |
+
$this->insertOrder($page, $order,
|
34 |
+
Mage::getStoreConfigFlag(
|
35 |
+
self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()));
|
36 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
|
37 |
+
$this->_setFontRegular($page);
|
38 |
+
$page->drawText(
|
39 |
+
Mage::helper('sales')->__('Packingslip # ') .
|
40 |
+
$shipment->getIncrementId(), 35, 780, 'UTF-8');
|
41 |
+
/* Add table */
|
42 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
43 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
44 |
+
$page->setLineWidth(0.5);
|
45 |
+
/* Add table head */
|
46 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
47 |
+
$this->y -= 10;
|
48 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
49 |
+
$page->drawText(Mage::helper('sales')->__('Qty'), 35, $this->y,
|
50 |
+
'UTF-8');
|
51 |
+
$page->drawText(Mage::helper('sales')->__('Products'), 60, $this->y,
|
52 |
+
'UTF-8');
|
53 |
+
$page->drawText(Mage::helper('sales')->__('SKU'), 470, $this->y,
|
54 |
+
'UTF-8');
|
55 |
+
$this->y -= 15;
|
56 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
57 |
+
/* Add body */
|
58 |
+
foreach ($shipment->getAllItems() as $item) {
|
59 |
+
if ($item->getOrderItem()->getParentItem()) {
|
60 |
+
continue;
|
61 |
+
}
|
62 |
+
if ($this->y < 15) {
|
63 |
+
$page = $this->newPage(array('table_header' => true));
|
64 |
+
}
|
65 |
+
/* Draw item */
|
66 |
+
$page = $this->_drawItem($item, $page, $order);
|
67 |
+
}
|
68 |
+
// Output Giftwrap Information
|
69 |
+
$gifBlock = Mage::getBlockSingleton(
|
70 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
71 |
+
$giftwrapItems = $gifBlock->getOrderItemGiftwrap($order->getId());
|
72 |
+
if (count($giftwrapItems)) {
|
73 |
+
/* Add table */
|
74 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
75 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
76 |
+
$page->setLineWidth(0.5);
|
77 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
78 |
+
$this->y -= 10;
|
79 |
+
/* Add table head */
|
80 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
81 |
+
$page->drawText(Mage::helper('sales')->__('Item #'), 35,
|
82 |
+
$this->y, 'UTF-8');
|
83 |
+
$page->drawText(Mage::helper('sales')->__('Product'), 70,
|
84 |
+
$this->y, 'UTF-8');
|
85 |
+
$page->drawText(Mage::helper('sales')->__('Giftwrap Style'),
|
86 |
+
200, $this->y, 'UTF-8');
|
87 |
+
$page->drawText(Mage::helper('sales')->__('Giftwrap Image'),
|
88 |
+
300, $this->y, 'UTF-8');
|
89 |
+
$page->drawText(Mage::helper('sales')->__('Personal Message'),
|
90 |
+
450, $this->y, 'UTF-8');
|
91 |
+
$this->y -= 15;
|
92 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
93 |
+
/* Add body */
|
94 |
+
$i = 0;
|
95 |
+
foreach ($giftwrapItems as $giftwrapItem) {
|
96 |
+
$i ++;
|
97 |
+
if ($this->y < 60) {
|
98 |
+
$page = $this->newPage(array('table_header' => true));
|
99 |
+
}
|
100 |
+
$page->drawText($i, 35, $this->y, 'UTF-8');
|
101 |
+
// $page->drawText($gifBlock->getProduct($giftwrapItem['itemId'])->getName(), 70, $this->y, 'UTF-8');
|
102 |
+
$this->drawGiftProduct($giftwrapItem,
|
103 |
+
$pdf, $page);
|
104 |
+
//Zend_Debug::dump($gifBlock->getGiftwrapStyleName($giftwrapItem['styleId']));die();
|
105 |
+
$page->drawText(
|
106 |
+
$gifBlock->getGiftwrapStyleName($giftwrapItem['styleId']),
|
107 |
+
200, $this->y + 10, 'UTF-8');
|
108 |
+
$image = $gifBlock->getGiftwrapStyleImage(
|
109 |
+
$giftwrapItem['styleId']);
|
110 |
+
if ($image) {
|
111 |
+
$fileExtension = end(explode(".", $image));
|
112 |
+
switch ($fileExtension) {
|
113 |
+
case 'tif':
|
114 |
+
$check = 1;
|
115 |
+
break;
|
116 |
+
case 'tiff':
|
117 |
+
$check = 1;
|
118 |
+
break;
|
119 |
+
case 'png':
|
120 |
+
$check = 1;
|
121 |
+
break;
|
122 |
+
case 'jpg':
|
123 |
+
$check = 1;
|
124 |
+
break;
|
125 |
+
case 'jpe':
|
126 |
+
$check = 1;
|
127 |
+
break;
|
128 |
+
case 'jpeg':
|
129 |
+
$check = 1;
|
130 |
+
break;
|
131 |
+
default:
|
132 |
+
$check = 0;
|
133 |
+
break;
|
134 |
+
}
|
135 |
+
if ($check == 1) {
|
136 |
+
$image = Mage::getStoreConfig(
|
137 |
+
'system/filesystem/media', $store) . '/giftwrap/' .
|
138 |
+
$image;
|
139 |
+
if (is_file($image)) {
|
140 |
+
$this->insertImageGif($page, $image,
|
141 |
+
$order->getStore(), $this->y);
|
142 |
+
} else {
|
143 |
+
$page->drawText(
|
144 |
+
Mage::helper('sales')->__('No Image'), 300,
|
145 |
+
$this->y, 'UTF-8');
|
146 |
+
}
|
147 |
+
} else {
|
148 |
+
$page->drawText(
|
149 |
+
Mage::helper('sales')->__('Unsupported type.'), 300,
|
150 |
+
$this->y, 'UTF-8');
|
151 |
+
}
|
152 |
+
} else {
|
153 |
+
$page->drawText(Mage::helper('sales')->__('No Image'),
|
154 |
+
300, $this->y, 'UTF-8');
|
155 |
+
}
|
156 |
+
$page->drawText(
|
157 |
+
$gifBlock->getGiftcardName($giftwrapItem['giftcardId']), 300,
|
158 |
+
$this->y + 10, 'UTF-8');
|
159 |
+
$this->drawGiftcard($page, $gifBlock,
|
160 |
+
$giftwrapItem['giftcardId'], $shipment);
|
161 |
+
// $page->drawText($giftwrapItem['giftwrap_message'], 450, $this->y, 'UTF-8');
|
162 |
+
$this->drawGift($giftwrapItem, $pdf,
|
163 |
+
$page);
|
164 |
+
if ($check == 1) {
|
165 |
+
$this->y -= 60;
|
166 |
+
} else {
|
167 |
+
$this->y -= 15;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
$this->_afterGetPdf();
|
173 |
+
if ($shipment->getStoreId()) {
|
174 |
+
Mage::app()->getLocale()->revert();
|
175 |
+
}
|
176 |
+
return $pdf;
|
177 |
+
}
|
178 |
+
|
179 |
+
public function drawGiftcard (&$page,$gifBlock,$giftcardId,$shipment)
|
180 |
+
{
|
181 |
+
$image = $gifBlock->getGiftcardImage($giftcardId);
|
182 |
+
|
183 |
+
if ($image) {
|
184 |
+
$fileExtension = end(explode(".", $image));
|
185 |
+
$fileExtension=strtolower($fileExtension);
|
186 |
+
switch ($fileExtension) {
|
187 |
+
case 'tif':
|
188 |
+
$check = 1;
|
189 |
+
break;
|
190 |
+
case 'tiff':
|
191 |
+
$check = 1;
|
192 |
+
break;
|
193 |
+
case 'png':
|
194 |
+
$check = 1;
|
195 |
+
break;
|
196 |
+
case 'jpg':
|
197 |
+
$check = 1;
|
198 |
+
break;
|
199 |
+
case 'jpe':
|
200 |
+
$check = 1;
|
201 |
+
break;
|
202 |
+
case 'jpeg':
|
203 |
+
$check = 1;
|
204 |
+
break;
|
205 |
+
default:
|
206 |
+
$check = 0;
|
207 |
+
break;
|
208 |
+
}
|
209 |
+
if ($check == 1) {
|
210 |
+
$image = Mage::getStoreConfig('system/filesystem/media', $store) .
|
211 |
+
'/giftwrap/giftcard/' . $image;
|
212 |
+
if (is_file($image)) {
|
213 |
+
$this->insertImageGif($page, $image, $shipment->getStore(),
|
214 |
+
$this->y,290);
|
215 |
+
} else {
|
216 |
+
$page->drawText(Mage::helper('sales')->__('No Image'), 300,
|
217 |
+
$this->y, 'UTF-8');
|
218 |
+
}
|
219 |
+
} else {
|
220 |
+
$page->drawText(Mage::helper('sales')->__('Unsupported type.'),
|
221 |
+
300, $this->y, 'UTF-8');
|
222 |
+
}
|
223 |
+
} else {
|
224 |
+
$page->drawText(Mage::helper('sales')->__('No Image'), 300,
|
225 |
+
$this->y, 'UTF-8');
|
226 |
+
}
|
227 |
+
}
|
228 |
+
public function getPdf1 ($shipments = array())
|
229 |
+
{
|
230 |
+
$this->_beforeGetPdf();
|
231 |
+
$this->_initRenderer('shipment');
|
232 |
+
$pdf = new Zend_Pdf();
|
233 |
+
$this->_setPdf($pdf);
|
234 |
+
$style = new Zend_Pdf_Style();
|
235 |
+
$this->_setFontBold($style, 10);
|
236 |
+
foreach ($shipments as $shipment) {
|
237 |
+
if ($shipment->getStoreId()) {
|
238 |
+
Mage::app()->getLocale()->emulate($shipment->getStoreId());
|
239 |
+
Mage::app()->setCurrentStore($shipment->getStoreId());
|
240 |
+
}
|
241 |
+
$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
|
242 |
+
$pdf->pages[] = $page;
|
243 |
+
$order = $shipment->getOrder();
|
244 |
+
/* Add image */
|
245 |
+
$this->insertLogo($page, $shipment->getStore());
|
246 |
+
/* Add address */
|
247 |
+
$this->insertAddress($page, $shipment->getStore());
|
248 |
+
/* Add head */
|
249 |
+
$this->insertOrder($page, $shipment,
|
250 |
+
Mage::getStoreConfigFlag(
|
251 |
+
self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()));
|
252 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
253 |
+
$this->_setFontRegular($page);
|
254 |
+
$page->drawText(
|
255 |
+
Mage::helper('sales')->__('Packingslip # ') .
|
256 |
+
$shipment->getIncrementId(), 35, 780, 'UTF-8');
|
257 |
+
/* Add table */
|
258 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
259 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
260 |
+
$page->setLineWidth(0.5);
|
261 |
+
/* Add table head */
|
262 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
263 |
+
$this->y -= 10;
|
264 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
265 |
+
$page->drawText(Mage::helper('sales')->__('Qty'), 35, $this->y,
|
266 |
+
'UTF-8');
|
267 |
+
$page->drawText(Mage::helper('sales')->__('Products'), 60, $this->y,
|
268 |
+
'UTF-8');
|
269 |
+
// $page->drawText(Mage::helper('sales')->__('SKU'), 470, $this->y, 'UTF-8');
|
270 |
+
$this->y -= 15;
|
271 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
272 |
+
/* Add body */
|
273 |
+
foreach ($shipment->getAllItems() as $item) {
|
274 |
+
if ($item->getOrderItem()->getParentItem()) {
|
275 |
+
continue;
|
276 |
+
}
|
277 |
+
if ($this->y < 15) {
|
278 |
+
$page = $this->newPage(array('table_header' => true));
|
279 |
+
}
|
280 |
+
/* Draw item */
|
281 |
+
$page = $this->_drawItem($item, $page, $order);
|
282 |
+
$page->setLineWidth(0.5);
|
283 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
284 |
+
$page->drawLine(25, $this->y, 570, $this->y);
|
285 |
+
$this->y -= 10;
|
286 |
+
}
|
287 |
+
// Output Giftwrap Information
|
288 |
+
$gifBlock = Mage::getBlockSingleton(
|
289 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
290 |
+
$giftwrapItems = $gifBlock->getOrderItemGiftwrap($order->getId());
|
291 |
+
if (count($giftwrapItems)) {
|
292 |
+
/* Add table */
|
293 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
|
294 |
+
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
|
295 |
+
$page->setLineWidth(0.5);
|
296 |
+
$page->drawRectangle(25, $this->y, 570, $this->y - 15);
|
297 |
+
$this->y -= 10;
|
298 |
+
/* Add table head */
|
299 |
+
$page->setFillColor(new Zend_Pdf_Color_RGB(0.4, 0.4, 0.4));
|
300 |
+
$page->drawText(Mage::helper('sales')->__('Item #'), 35,
|
301 |
+
$this->y, 'UTF-8');
|
302 |
+
$page->drawText(Mage::helper('sales')->__('Product'), 70,
|
303 |
+
$this->y, 'UTF-8');
|
304 |
+
$page->drawText(Mage::helper('sales')->__('Giftwrap Style'),
|
305 |
+
200, $this->y, 'UTF-8');
|
306 |
+
$page->drawText(Mage::helper('sales')->__('Giftwrap Image'),
|
307 |
+
300, $this->y, 'UTF-8');
|
308 |
+
$page->drawText(Mage::helper('sales')->__('Personal Message'),
|
309 |
+
450, $this->y, 'UTF-8');
|
310 |
+
$this->y -= 15;
|
311 |
+
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
|
312 |
+
/* Add body */
|
313 |
+
$i = 0;
|
314 |
+
foreach ($giftwrapItems as $giftwrapItem) {
|
315 |
+
$i ++;
|
316 |
+
if ($this->y < 60) {
|
317 |
+
$page = $this->newPage(array('table_header' => true));
|
318 |
+
}
|
319 |
+
$page->drawText($i, 35, $this->y, 'UTF-8');
|
320 |
+
$item = Mage::getModel('sales/quote_item')->load(
|
321 |
+
$giftwrapItem['itemId']);
|
322 |
+
$page->drawText('doanhbk', 70, $this->y, 'UTF-8');
|
323 |
+
$page->drawText(
|
324 |
+
$gifBlock->getGiftwrapStyleName($giftwrapItem['styleId']),
|
325 |
+
200, $this->y, 'UTF-8');
|
326 |
+
$image = $gifBlock->getGiftwrapStyleImage(
|
327 |
+
$giftwrapItem['styleId']);
|
328 |
+
if ($image) {
|
329 |
+
$fileExtension = end(explode(".", $image));
|
330 |
+
switch ($fileExtension) {
|
331 |
+
case 'tif':
|
332 |
+
$check = 1;
|
333 |
+
break;
|
334 |
+
case 'tiff':
|
335 |
+
$check = 1;
|
336 |
+
break;
|
337 |
+
case 'png':
|
338 |
+
$check = 1;
|
339 |
+
break;
|
340 |
+
case 'jpg':
|
341 |
+
$check = 1;
|
342 |
+
break;
|
343 |
+
case 'jpe':
|
344 |
+
$check = 1;
|
345 |
+
break;
|
346 |
+
case 'jpeg':
|
347 |
+
$check = 1;
|
348 |
+
break;
|
349 |
+
default:
|
350 |
+
$check = 0;
|
351 |
+
break;
|
352 |
+
}
|
353 |
+
if ($check == 1) {
|
354 |
+
$image = Mage::getStoreConfig(
|
355 |
+
'system/filesystem/media', $store) . '/giftwrap/' .
|
356 |
+
$image;
|
357 |
+
if (is_file($image)) {
|
358 |
+
$this->insertImageGif($page, $image,
|
359 |
+
$order->getStore(), $this->y);
|
360 |
+
} else {
|
361 |
+
$page->drawText(
|
362 |
+
Mage::helper('sales')->__('No Image'), 300,
|
363 |
+
$this->y, 'UTF-8');
|
364 |
+
}
|
365 |
+
} else {
|
366 |
+
$page->drawText(
|
367 |
+
Mage::helper('sales')->__('Unsupported type.'), 300,
|
368 |
+
$this->y, 'UTF-8');
|
369 |
+
}
|
370 |
+
} else {
|
371 |
+
$page->drawText(Mage::helper('sales')->__('No Image'),
|
372 |
+
300, $this->y, 'UTF-8');
|
373 |
+
}
|
374 |
+
// $page->drawText($giftwrapItem['giftwrap_message'], 450, $this->y, 'UTF-8');
|
375 |
+
$this->drawGift($giftwrapItem, $pdf,
|
376 |
+
$page);
|
377 |
+
if ($check == 1) {
|
378 |
+
$this->y -= 60;
|
379 |
+
} else {
|
380 |
+
$this->y -= 15;
|
381 |
+
}
|
382 |
+
}
|
383 |
+
}
|
384 |
+
}
|
385 |
+
$this->_afterGetPdf();
|
386 |
+
if ($shipment->getStoreId()) {
|
387 |
+
Mage::app()->getLocale()->revert();
|
388 |
+
}
|
389 |
+
return $pdf;
|
390 |
+
}
|
391 |
+
protected function insertImageGif (&$page, $image, $store = null, $y,$x=null)
|
392 |
+
{
|
393 |
+
$image = Zend_Pdf_Image::imageWithPath($image);
|
394 |
+
|
395 |
+
if(!$x){
|
396 |
+
$page->drawImage($image, 200, $y - 55, 260, $y + 5);
|
397 |
+
}else{
|
398 |
+
//Zend_Debug::dump($x);Zend_Debug::dump($y);die();
|
399 |
+
$page->drawImage($image, $x, $y - 55, $x+60, $y + 5);
|
400 |
+
|
401 |
+
}
|
402 |
+
return $page;
|
403 |
+
}
|
404 |
+
public function drawGift ($giftwrapItem, $pdf, $page)
|
405 |
+
{
|
406 |
+
$gifBlock = Mage::getBlockSingleton(
|
407 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
408 |
+
$lines = array();
|
409 |
+
$lines[0][] = array(
|
410 |
+
'text' => Mage::helper('core/string')->str_split(
|
411 |
+
$giftwrapItem['giftwrap_message'], 25), 'feed' => 450);
|
412 |
+
$lineBlock = array('lines' => $lines, 'height' => 10);
|
413 |
+
$page = $this->drawLineBlocks($page, array($lineBlock),
|
414 |
+
array('table_header' => true));
|
415 |
+
$this->setPage($page);
|
416 |
+
}
|
417 |
+
public function drawGiftProduct ($giftwrapItem, $pdf, $page)
|
418 |
+
{
|
419 |
+
$gifBlock = Mage::getBlockSingleton(
|
420 |
+
'giftwrap/adminhtml_sales_order_view_tab_giftwrap');
|
421 |
+
$lines = array();
|
422 |
+
$item = Mage::getModel('sales/quote_item')->load(
|
423 |
+
$giftwrapItem['itemId']);
|
424 |
+
$lines[0][] = array(
|
425 |
+
'text' => Mage::helper('core/string')->str_split(
|
426 |
+
Mage::getModel('catalog/product')->load($item->getProductId())
|
427 |
+
->getName(), 25), 'feed' => 70);
|
428 |
+
$lineBlock = array('lines' => $lines, 'height' => 10);
|
429 |
+
$page = $this->drawLineBlocks($page, array($lineBlock),
|
430 |
+
array('table_header' => true));
|
431 |
+
$this->setPage($page);
|
432 |
+
}
|
433 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Quote/Address/Total/Discount.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Quote_Address_Total_Discount extends Mage_Sales_Model_Quote_Address_Total_Abstract {
|
12 |
+
public function collect(Mage_Sales_Model_Quote_Address $address) {
|
13 |
+
$session = Mage::getSingleton('checkout/session');
|
14 |
+
$discount = $session->getData('onestepcheckout_admin_discount');
|
15 |
+
if(!$discount){
|
16 |
+
return $this;
|
17 |
+
}
|
18 |
+
|
19 |
+
$items = $address->getAllItems();
|
20 |
+
if (!count($items)) {
|
21 |
+
return $this;
|
22 |
+
}
|
23 |
+
$session->setData('onestepcheckout_admin_discount',$discount);
|
24 |
+
$address->setOnestepcheckoutDiscountAmount($discount);
|
25 |
+
$address->setData('onestepcheckout_discount_amount',$discount);
|
26 |
+
$address->setGrandTotal($address->getGrandTotal() - $address->getOnestepcheckoutDiscountAmount());
|
27 |
+
$address->setBaseGrandTotal($address->getBaseGrandTotal() - $address->getOnestepcheckoutDiscountAmount());
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
32 |
+
{
|
33 |
+
$amount = $address->getOnestepcheckoutDiscountAmount();
|
34 |
+
$title = Mage::helper('sales')->__('Discount(Admin)');
|
35 |
+
if ($amount!=0) {
|
36 |
+
$address->addTotal(array(
|
37 |
+
'code'=>$this->getCode(),
|
38 |
+
'title'=>$title,
|
39 |
+
'value'=>'-'.$amount
|
40 |
+
));
|
41 |
+
}
|
42 |
+
return $this;
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Sales/Quote/Address/Total/Giftwrap.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Sales_Quote_Address_Total_Giftwrap extends Mage_Sales_Model_Quote_Address_Total_Abstract {
|
12 |
+
public function collect(Mage_Sales_Model_Quote_Address $address) {
|
13 |
+
|
14 |
+
$_helper = Mage::helper('onestepcheckout');
|
15 |
+
$active = $_helper->enableGiftWrap();
|
16 |
+
if (!$active)
|
17 |
+
{
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
$session = Mage::getSingleton('checkout/session');
|
21 |
+
$giftwrap = $session->getData('onestepcheckout_giftwrap');
|
22 |
+
if(!$giftwrap){
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
$items = $address->getAllItems();
|
27 |
+
if (!count($items)) {
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
$giftwrapType = $_helper->getGiftwrapType();
|
32 |
+
$giftwrapAmount = $_helper->getGiftwrapAmount();
|
33 |
+
|
34 |
+
$wrapTotal = 0;
|
35 |
+
if($giftwrapType == 1) {
|
36 |
+
foreach ($items as $item){
|
37 |
+
if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
|
41 |
+
// if ($item->getHasChildren() && $item->isShipSeparately()) {
|
42 |
+
// foreach ($item->getChildren() as $child) {
|
43 |
+
// if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
|
44 |
+
// $freeBoxes += $item->getQty() * $child->getQty();
|
45 |
+
// }
|
46 |
+
// elseif ($item->getFreeShipping()) {
|
47 |
+
// $freeBoxes += $item->getQty();
|
48 |
+
// }
|
49 |
+
// }
|
50 |
+
// }
|
51 |
+
$wrapTotal += $giftwrapAmount * ($item->getQty());
|
52 |
+
}
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
$wrapTotal = $giftwrapAmount;
|
56 |
+
}
|
57 |
+
// var_dump($wrapTotal);
|
58 |
+
// $giftwrapAmount = Mage::helper('giftwrap')->giftwrapAmount(null,$address_id);
|
59 |
+
$session->setData('onestepcheckout_giftwrap_amount', $wrapTotal);
|
60 |
+
$address->setOnestepcheckoutGiftwrapAmount($wrapTotal);
|
61 |
+
$address->setGrandTotal($address->getGrandTotal() + $address->getOnestepcheckoutGiftwrapAmount());
|
62 |
+
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getOnestepcheckoutGiftwrapAmount());
|
63 |
+
return $this;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
67 |
+
{
|
68 |
+
$_helper = Mage::helper('onestepcheckout');
|
69 |
+
$active = $_helper->enableGiftWrap();
|
70 |
+
if (!$active)
|
71 |
+
{
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
$amount = $address->getOnestepcheckoutGiftwrapAmount();
|
75 |
+
$title = Mage::helper('sales')->__('Gift Wrap');
|
76 |
+
if ($amount!=0) {
|
77 |
+
$address->addTotal(array(
|
78 |
+
'code'=>$this->getCode(),
|
79 |
+
'title'=>$title,
|
80 |
+
'value'=>$amount
|
81 |
+
));
|
82 |
+
}
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
// public function getCheckoutSession() {
|
87 |
+
// return Mage::getSingleton('checkout/session');
|
88 |
+
// }
|
89 |
+
//
|
90 |
+
// public function getQuote() {
|
91 |
+
// return $this->getCheckoutSession()->getQuote();
|
92 |
+
// }
|
93 |
+
//
|
94 |
+
// public function getProductName($itemId) {
|
95 |
+
// $item = $this->getQuote()->getItemById($itemId);
|
96 |
+
// if($item){
|
97 |
+
// return $item->getProduct()->getName();
|
98 |
+
// }else{
|
99 |
+
// return '';
|
100 |
+
// }
|
101 |
+
// }
|
102 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Source/Ajaxbilling.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_OneStepCheckout_Model_Source_Ajaxbilling {
|
12 |
+
public function toOptionArray() {
|
13 |
+
$fields = array('Country', 'Postcode', 'State/region', 'City');
|
14 |
+
$options = array();
|
15 |
+
foreach($fields as $field) {
|
16 |
+
$options[] = array('label' => $field, 'value' => strtolower($field));
|
17 |
+
}
|
18 |
+
return $options;
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Source/Layout.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Source_Layout {
|
12 |
+
public function toOptionArray() {
|
13 |
+
$options = array();
|
14 |
+
|
15 |
+
$options[] = array(
|
16 |
+
'label' => '2 Columns',
|
17 |
+
'value' => '2columns'
|
18 |
+
);
|
19 |
+
|
20 |
+
$options[] = array(
|
21 |
+
'label' => '3 Columns',
|
22 |
+
'value' => '3columns'
|
23 |
+
);
|
24 |
+
|
25 |
+
return $options;
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Source/Payment.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Source_Payment {
|
12 |
+
public function toOptionArray() {
|
13 |
+
$options = array();
|
14 |
+
$options[] = array(
|
15 |
+
'label' => '',
|
16 |
+
'value' => ''
|
17 |
+
);
|
18 |
+
$quote = Mage::helper("onestepcheckout")->getOnePage()->getQuote();
|
19 |
+
$store = $quote ? $quote->getStoreId() : null;
|
20 |
+
$methods = Mage::helper('payment')->getStoreMethods($store, $quote);
|
21 |
+
foreach ($methods as $key => $method) {
|
22 |
+
$options[] = array(
|
23 |
+
'label' => $method->getTitle(),
|
24 |
+
'value' => $method->getCode()
|
25 |
+
);
|
26 |
+
}
|
27 |
+
return $options;
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Source/Reloadpayment.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_OneStepCheckout_Model_Source_Reloadpayment {
|
12 |
+
|
13 |
+
public function toOptionArray()
|
14 |
+
{
|
15 |
+
$options = array();
|
16 |
+
$options[] = array('label' => 'When all required fields are filled', 'value' => '1');
|
17 |
+
$options[] = array('label' => 'When any triggering fields change', 'value' => '2');
|
18 |
+
return $options;
|
19 |
+
}
|
20 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Source/Shipping.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Source_Shipping {
|
12 |
+
public function toOptionArray() {
|
13 |
+
$options = array();
|
14 |
+
$carriers = Mage::getStoreConfig('carriers');
|
15 |
+
foreach($carriers as $code => $carrier) {
|
16 |
+
$active = $carrier['active'];
|
17 |
+
if($active == 1 || $active == true) {
|
18 |
+
if(isset($carrier['title'])) {
|
19 |
+
$options[] = array(
|
20 |
+
'label' => $carrier['title'],
|
21 |
+
'value' => $code
|
22 |
+
);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
}
|
26 |
+
return $options;
|
27 |
+
}
|
28 |
+
}
|
app/code/community/Abserve/Onestepcheckout/Model/Survey.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Model_Survey extends Mage_Core_Model_Abstract
|
12 |
+
{
|
13 |
+
public function _construct()
|
14 |
+
{
|
15 |
+
parent::_construct();
|
16 |
+
$this->_init('onestepcheckout/survey');
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/CountryController.php
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Adminhtml_CountryController extends Mage_Adminhtml_Controller_Action
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* init layout and set active for current menu
|
15 |
+
*
|
16 |
+
* @return Abserve_Onestepcheckout_Adminhtml_CountryController
|
17 |
+
*/
|
18 |
+
protected function _initAction()
|
19 |
+
{
|
20 |
+
$this->loadLayout()
|
21 |
+
->_setActiveMenu('onestepcheckout/geoip')
|
22 |
+
->_addBreadcrumb(
|
23 |
+
Mage::helper('adminhtml')->__('Update Country Postcode Database'),
|
24 |
+
Mage::helper('adminhtml')->__('Update Country Postcode Database')
|
25 |
+
);
|
26 |
+
return $this;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function indexAction()
|
30 |
+
{
|
31 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
32 |
+
$this->_title($this->__('Update Country Postcode Database'))
|
33 |
+
->_title($this->__('Update Country Postcode Database'));
|
34 |
+
$this->_initAction()->renderLayout();
|
35 |
+
}
|
36 |
+
|
37 |
+
public function newAction()
|
38 |
+
{
|
39 |
+
$this->_forward('edit');
|
40 |
+
}
|
41 |
+
|
42 |
+
public function editAction()
|
43 |
+
{
|
44 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
45 |
+
|
46 |
+
$this->loadLayout();
|
47 |
+
$this->_setActiveMenu('onestepcheckout/countrylist');
|
48 |
+
|
49 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Rule Manager'), Mage::helper('adminhtml')->__('Upload New Database Version'));
|
50 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Rule News'), Mage::helper('adminhtml')->__('Upload New Database Version'));
|
51 |
+
|
52 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
53 |
+
$this->_addContent($this->getLayout()->createBlock('onestepcheckout/adminhtml_country_edit'))
|
54 |
+
->_addLeft($this->getLayout()->createBlock('onestepcheckout/adminhtml_country_edit_tabs'));
|
55 |
+
$this->renderLayout();
|
56 |
+
}
|
57 |
+
|
58 |
+
public function saveAction()
|
59 |
+
{
|
60 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
61 |
+
if(isset($_FILES['csv_country']['name']) && $_FILES['csv_country']['name'] != ''){
|
62 |
+
try {
|
63 |
+
$uploader = new Varien_File_Uploader('csv_country');
|
64 |
+
$uploader->setAllowedExtensions(array('csv'));
|
65 |
+
$uploader->setAllowRenameFiles(false);
|
66 |
+
$uploader->setFilesDispersion(false);
|
67 |
+
$path = Mage::getBaseDir('app').DS.'locale'.DS.'abserve_geoip'.DS.'countrypostcode'.DS.'nextversion';
|
68 |
+
$uploader->save($path, $_FILES['csv_country']['name']);
|
69 |
+
Mage::getSingleton('core/session')->addSuccess('CSV file was uploaded successfully!');
|
70 |
+
|
71 |
+
$fileNameFull = $_FILES['csv_country']['name'];
|
72 |
+
$fileName = explode('.', $fileNameFull);
|
73 |
+
$countryVersion = explode('_', $fileName[0]);
|
74 |
+
$countryCode = $countryVersion[0];
|
75 |
+
$version = $countryVersion[1].'.0';
|
76 |
+
|
77 |
+
$total = 0;
|
78 |
+
$oFile = new Varien_File_Csv();
|
79 |
+
$url = $path.DS.$_FILES['csv_country']['name'];
|
80 |
+
try{
|
81 |
+
$data = $oFile->getData($url);
|
82 |
+
$total = count($data);
|
83 |
+
}catch(Exception $e){
|
84 |
+
}
|
85 |
+
$country = Mage::getModel('onestepcheckout/countrylist')->load($countryCode, 'country_code');
|
86 |
+
if($version != $country->getLastVersion()){
|
87 |
+
try{
|
88 |
+
$country->setLastVersion($version)
|
89 |
+
->setStatus(0)
|
90 |
+
->setTotalRecords($country->getTotalRecords() + $total-1)
|
91 |
+
->save();
|
92 |
+
}catch(Exception $e){}
|
93 |
+
}
|
94 |
+
} catch (Exception $e) {
|
95 |
+
Mage::getSingleton('core/session')->addError('Invalid format of file! ');
|
96 |
+
$this->_redirect('*/*/new');
|
97 |
+
}
|
98 |
+
}else{
|
99 |
+
Mage::getSingleton('core/session')->addError('Not selected file!');
|
100 |
+
$this->_redirect('*/*/');
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
if ($this->getRequest()->getParam('back')) {
|
104 |
+
$this->_redirect('*/*/new');
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
$this->_redirect('*/*', array('up_version'=>'1'));
|
108 |
+
}
|
109 |
+
|
110 |
+
/* public function checkDataImport($countryCode)
|
111 |
+
{
|
112 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
113 |
+
$countryCode = $countryList->load($countryid)->getCountryCode();
|
114 |
+
$lastVersion = $countryList->load($countryid,'country_code')->getLastVersion();
|
115 |
+
if($lastVersion == '1.0')
|
116 |
+
$fileUrl = 'version1.0'.DS.$countryCode.'.csv';
|
117 |
+
else
|
118 |
+
$fileUrl = 'nextversion'.DS.$countryCode.$lastVersion.'.csv';
|
119 |
+
// $fileImport = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'Abserve_Geoip_SortbyCountry'.DS.$countryid.'.csv';
|
120 |
+
$fileImport = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'abserve_geoip'.DS.'countrypostcode'.DS.$fileUrl;
|
121 |
+
if(file_exists($fileImport))
|
122 |
+
return file_exists($fileImport);
|
123 |
+
return false;
|
124 |
+
} */
|
125 |
+
|
126 |
+
public function showCountryIpAction()
|
127 |
+
{
|
128 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
129 |
+
$this->loadLayout();
|
130 |
+
$html = $this->getLayout()->getBlock('head')->toHtml();
|
131 |
+
$html .= $this->getLayout()->getBlock('country')->toHtml();
|
132 |
+
$this->getResponse()->setBody($html);
|
133 |
+
}
|
134 |
+
|
135 |
+
public function importCountryipAction()
|
136 |
+
{
|
137 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
138 |
+
$parameter = $this->getRequest()->getParam('countryid');
|
139 |
+
$countryids = explode(',', $parameter);
|
140 |
+
$helper = Mage::helper('onestepcheckout');
|
141 |
+
$times = $helper->getMaxItemsEachImport();
|
142 |
+
$timeImported = 0;
|
143 |
+
$errors = 0;
|
144 |
+
$countryList = Mage::getModel('onestepcheckout/countrylist');
|
145 |
+
$timeStamp = date("Y-m-d H:i:s");
|
146 |
+
$size = 0;
|
147 |
+
$total = 0;
|
148 |
+
// $timeStamp = Mage::getModel('core/date')->timestamp($timeNow);
|
149 |
+
foreach($countryids as $countryid){
|
150 |
+
$countryCode = $countryList->load($countryid)->getCountryCode();
|
151 |
+
$lastVersion = $countryList->load($countryid)->getLastVersion();
|
152 |
+
if($lastVersion == '1.0')
|
153 |
+
$fileUrl = 'version1.0'.DS.$countryCode.'.csv';
|
154 |
+
else
|
155 |
+
$fileUrl = 'nextversion'.DS.$countryCode.'_'.$lastVersion.'.csv';
|
156 |
+
$oFile = new Varien_File_Csv();
|
157 |
+
$url = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'abserve_geoip'.DS.'countrypostcode'.DS.$fileUrl;
|
158 |
+
try{
|
159 |
+
$data = $oFile->getData($url);
|
160 |
+
}catch(Exception $e){
|
161 |
+
}
|
162 |
+
if(isset($data)){
|
163 |
+
$numberRows = 0;
|
164 |
+
$geoip = Mage::getModel('onestepcheckout/geoip');
|
165 |
+
$storeData = array();
|
166 |
+
$total += count($data);
|
167 |
+
foreach($data as $col=>$row)
|
168 |
+
{
|
169 |
+
$size ++;
|
170 |
+
if($col == 0)
|
171 |
+
{
|
172 |
+
$index_row = $row;
|
173 |
+
} else {
|
174 |
+
for($i=0;$i<count($row);$i++)
|
175 |
+
{
|
176 |
+
$storeData[$index_row[$i]] = $row[$i];
|
177 |
+
}
|
178 |
+
$geoip->setData($storeData);
|
179 |
+
$geoip->setId(null);
|
180 |
+
try{
|
181 |
+
if($geoip->import()){
|
182 |
+
$timeImported++;
|
183 |
+
$numberRows++;
|
184 |
+
}
|
185 |
+
}catch(Exception $e){
|
186 |
+
$errors++;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
if(isset($times) && $times > 0){
|
190 |
+
if ($timeImported == $times) {
|
191 |
+
break;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
if($numberRows>0){
|
196 |
+
$currentRecords = $countryList->load($countryCode)->getCurrentRecords();
|
197 |
+
$countryList->load($countryCode)
|
198 |
+
->setData('update_date', $timeStamp)
|
199 |
+
->setData('current_version', $lastVersion)
|
200 |
+
->setData('current_records', $currentRecords + $numberRows)
|
201 |
+
;
|
202 |
+
try{
|
203 |
+
$countryList->save();
|
204 |
+
}catch(Exception $e){
|
205 |
+
}
|
206 |
+
}else{
|
207 |
+
$countryList->load($countryCode)
|
208 |
+
->setData('status', 1);
|
209 |
+
try{
|
210 |
+
$countryList->save();
|
211 |
+
}catch(Exception $e){
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
if ($errors && $errors>0){
|
217 |
+
$result = $this->__('row(s) have been updated. And %s row(s) was failed.',$errors);
|
218 |
+
$action = 'failed';
|
219 |
+
} else {
|
220 |
+
$result = $this->__('row(s) have been updated successfully!');
|
221 |
+
$action = 'success';
|
222 |
+
}
|
223 |
+
if($timeImported == 0 && $size == $total) {
|
224 |
+
$result .= '-complete';
|
225 |
+
}else{
|
226 |
+
$result .= '-'.$timeImported;
|
227 |
+
// $result .= '-'.$size;
|
228 |
+
}
|
229 |
+
$result .= '-'.$action;
|
230 |
+
$this->getResponse()->setBody($result);
|
231 |
+
}
|
232 |
+
|
233 |
+
public function gridAction()
|
234 |
+
{
|
235 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
236 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock('onestepcheckout/adminhtml_country_grid')->toHtml());
|
237 |
+
}
|
238 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/GeoipController.php
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Adminhtml_GeoipController extends Mage_Adminhtml_Controller_Action
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* init layout and set active for current menu
|
15 |
+
*
|
16 |
+
* @return Abserve_Onestepcheckout_Adminhtml_GeoipController
|
17 |
+
*/
|
18 |
+
protected function _initAction()
|
19 |
+
{
|
20 |
+
$this->loadLayout()
|
21 |
+
->_setActiveMenu('onestepcheckout/geoip')
|
22 |
+
->_addBreadcrumb(
|
23 |
+
Mage::helper('adminhtml')->__('Update Geoip Database'),
|
24 |
+
Mage::helper('adminhtml')->__('Update Geoip Database')
|
25 |
+
);
|
26 |
+
return $this;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function indexAction()
|
30 |
+
{
|
31 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
32 |
+
$this->_title($this->__('Update Geoip Database'))
|
33 |
+
->_title($this->__('Update Geoip Database'));
|
34 |
+
$this->_initAction()->renderLayout();
|
35 |
+
}
|
36 |
+
|
37 |
+
public function newAction()
|
38 |
+
{
|
39 |
+
$this->_forward('edit');
|
40 |
+
}
|
41 |
+
|
42 |
+
public function editAction()
|
43 |
+
{
|
44 |
+
$data = Mage::getSingleton('adminhtml/session')->getFormData(true);
|
45 |
+
|
46 |
+
$this->loadLayout();
|
47 |
+
$this->_setActiveMenu('onestepcheckout/countrylist');
|
48 |
+
|
49 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Rule Manager'), Mage::helper('adminhtml')->__('Upload New Database Version'));
|
50 |
+
$this->_addBreadcrumb(Mage::helper('adminhtml')->__('Rule News'), Mage::helper('adminhtml')->__('Upload New Database Version'));
|
51 |
+
|
52 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
53 |
+
$this->_addContent($this->getLayout()->createBlock('onestepcheckout/adminhtml_geoip_edit'))
|
54 |
+
->_addLeft($this->getLayout()->createBlock('onestepcheckout/adminhtml_geoip_edit_tabs'));
|
55 |
+
$this->renderLayout();
|
56 |
+
}
|
57 |
+
|
58 |
+
public function saveAction()
|
59 |
+
{
|
60 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
61 |
+
if(isset($_FILES['csv_geoip']['name']) && $_FILES['csv_geoip']['name'] != ''){
|
62 |
+
try {
|
63 |
+
$uploader = new Varien_File_Uploader('csv_geoip');
|
64 |
+
$uploader->setAllowedExtensions(array('csv'));
|
65 |
+
$uploader->setAllowRenameFiles(false);
|
66 |
+
$uploader->setFilesDispersion(false);
|
67 |
+
$path = Mage::getBaseDir('app').DS.'locale'.DS.'abserve_geoip'.DS.'geoip'.DS.'nextversion';
|
68 |
+
$uploader->save($path, $_FILES['csv_geoip']['name']);
|
69 |
+
|
70 |
+
Mage::getSingleton('core/session')->addSuccess('CSV file was uploaded successfully!');
|
71 |
+
$fileNameFull = $_FILES['csv_geoip']['name'];
|
72 |
+
$fileName = explode('.', $fileNameFull);
|
73 |
+
$geoipVersion = explode('_', $fileName[0]);
|
74 |
+
$version = $geoipVersion[1].'.0';
|
75 |
+
|
76 |
+
$total = 0;
|
77 |
+
$oFile = new Varien_File_Csv();
|
78 |
+
$url = $path.DS.$_FILES['csv_geoip']['name'];
|
79 |
+
try{
|
80 |
+
$data = $oFile->getData($url);
|
81 |
+
$total = count($data);
|
82 |
+
}catch(Exception $e){
|
83 |
+
}
|
84 |
+
$geoipVersion = Mage::getModel('onestepcheckout/countrylist')->load(1, 'type');
|
85 |
+
if($version != $geoipVersion->getLastVersion()){
|
86 |
+
try{
|
87 |
+
$geoipVersion->setLastVersion($version)
|
88 |
+
->setStatus(0)
|
89 |
+
->setTotalRecords($geoipVersion->getTotalRecords() + $total-1)
|
90 |
+
->save();
|
91 |
+
}catch(Exception $e){}
|
92 |
+
}
|
93 |
+
} catch (Exception $e) {
|
94 |
+
Mage::getSingleton('core/session')->addError('Invalid format of file! ');
|
95 |
+
$this->_redirect('*/*/new');
|
96 |
+
}
|
97 |
+
}else{
|
98 |
+
Mage::getSingleton('core/session')->addError('Not selected file!');
|
99 |
+
$this->_redirect('*/*/');
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
if ($this->getRequest()->getParam('back')) {
|
103 |
+
$this->_redirect('*/*/new');
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
$this->_redirect('*/*');
|
107 |
+
}
|
108 |
+
|
109 |
+
public function showGeoipAction()
|
110 |
+
{
|
111 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
112 |
+
$this->loadLayout();
|
113 |
+
$html = $this->getLayout()->getBlock('head')->toHtml();
|
114 |
+
$html .= $this->getLayout()->getBlock('geoip')->toHtml();
|
115 |
+
$this->getResponse()->setBody($html);
|
116 |
+
}
|
117 |
+
|
118 |
+
public function importGeoipAction()
|
119 |
+
{
|
120 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
121 |
+
$filename = 'geoip';
|
122 |
+
$helper = Mage::helper('onestepcheckout');
|
123 |
+
$times = $helper->getMaxItemsEachImport();
|
124 |
+
$timeImported = 0;
|
125 |
+
$geoipVersion = Mage::getModel('onestepcheckout/countrylist')->load(1, 'type');
|
126 |
+
$versionParam = $this->getRequest()->getParam('version');
|
127 |
+
if(isset($versionParam) && $versionParam == '1'){
|
128 |
+
$fileUrl = 'version1.0'.DS.'geoip.csv';
|
129 |
+
$lastVersion = '1.0';
|
130 |
+
}else{
|
131 |
+
$lastVersion = $geoipVersion->getLastVersion();
|
132 |
+
if($lastVersion == '1.0')
|
133 |
+
$fileUrl = 'version1.0'.DS.'geoip.csv';
|
134 |
+
else
|
135 |
+
$fileUrl = 'nextversion'.DS.'geoip_'.$lastVersion.'.csv';
|
136 |
+
}
|
137 |
+
$errors = 0;
|
138 |
+
$size = 0;
|
139 |
+
$total = 0;
|
140 |
+
// foreach($versions as $version){
|
141 |
+
$oFile = new Varien_File_Csv();
|
142 |
+
// $url = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'Abserve_Geoip_SortbyCountry'.DS.'GeoIPCountry_'.$version.'.csv';
|
143 |
+
$url = Mage::getBaseDir().DS.'app'.DS.'locale'.DS.'abserve_geoip'.DS.'geoip'.DS.$fileUrl;
|
144 |
+
try{
|
145 |
+
$data = $oFile->getData($url);
|
146 |
+
}catch(Exception $e){
|
147 |
+
}
|
148 |
+
if(isset($data)){
|
149 |
+
$numberRows = 0;
|
150 |
+
$total += count($data);
|
151 |
+
$geoip = Mage::getModel('onestepcheckout/country');
|
152 |
+
$storeData = array();
|
153 |
+
foreach($data as $col=>$row)
|
154 |
+
{
|
155 |
+
$size ++;
|
156 |
+
if($col == 0)
|
157 |
+
{
|
158 |
+
$index_row = $row;
|
159 |
+
} else {
|
160 |
+
for($i=0;$i<count($row);$i++)
|
161 |
+
{
|
162 |
+
$storeData[$index_row[$i]] = $row[$i];
|
163 |
+
}
|
164 |
+
$geoip->setData($storeData);
|
165 |
+
$geoip->setId(null);
|
166 |
+
try{
|
167 |
+
if($geoip->import()){
|
168 |
+
$timeImported++;
|
169 |
+
$numberRows++;
|
170 |
+
}
|
171 |
+
}catch(Exception $e){
|
172 |
+
$errors++;
|
173 |
+
}
|
174 |
+
}
|
175 |
+
if(isset($times) && $times > 0){
|
176 |
+
if ($timeImported == $times) {
|
177 |
+
break;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
if($numberRows>0){
|
182 |
+
$currentRecords = $geoipVersion->getCurrentRecords();
|
183 |
+
$geoipVersion->setData('current_version', $lastVersion)
|
184 |
+
->setData('current_records', $currentRecords + $timeImported)
|
185 |
+
;
|
186 |
+
try{
|
187 |
+
$geoipVersion->save();
|
188 |
+
}catch(Exception $e){
|
189 |
+
}
|
190 |
+
}else{
|
191 |
+
$geoipVersion->setData('status', 1);
|
192 |
+
try{
|
193 |
+
$geoipVersion->save();
|
194 |
+
}catch(Exception $e){
|
195 |
+
}
|
196 |
+
}
|
197 |
+
}
|
198 |
+
// }
|
199 |
+
if ($errors && $errors>0){
|
200 |
+
$result = $this->__('row(s) have been updated. And %s row(s) was failed.',$errors);
|
201 |
+
$action = 'failed';
|
202 |
+
} else {
|
203 |
+
$result = $this->__('row(s) have been updated successfully!');
|
204 |
+
$action = 'success';
|
205 |
+
}
|
206 |
+
if($timeImported == 0 && $size == $total) {
|
207 |
+
$result .= '-complete';
|
208 |
+
}else{
|
209 |
+
$result .= '-'.$timeImported;
|
210 |
+
}
|
211 |
+
$result .= '-'.$action;
|
212 |
+
$this->getResponse()->setBody($result);
|
213 |
+
}
|
214 |
+
|
215 |
+
public function gridAction()
|
216 |
+
{
|
217 |
+
if(!Mage::helper('magenotification')->checkLicenseKeyAdminController($this)){ return; }
|
218 |
+
$this->getResponse()->setBody($this->getLayout()->createBlock('onestepcheckout/adminhtml_geoip_edit_tab_form')->toHtml());
|
219 |
+
}
|
220 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/Adminhtml/SimiController.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_Adminhtml_SimiController extends Mage_Adminhtml_Controller_Action
|
12 |
+
{
|
13 |
+
public function indexAction(){
|
14 |
+
$url = "https://www.simicart.com/usermanagement/checkout/buyProfessional/?extension=3&utm_source=abservebuyer&utm_medium=backend&utm_campaign=Abserve Buyer Backend";
|
15 |
+
|
16 |
+
Mage::app()->getResponse()->setRedirect($url)->sendResponse();
|
17 |
+
exit();
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/AjaxController.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_AjaxController extends Mage_Core_Controller_Front_Action {
|
12 |
+
|
13 |
+
public function add_giftwrapAction()
|
14 |
+
{
|
15 |
+
$remove = $this->getRequest()->getPost('remove', false);
|
16 |
+
$session = Mage::getSingleton('checkout/session');
|
17 |
+
if(!$remove){
|
18 |
+
$session->setData('onestepcheckout_giftwrap', 1);
|
19 |
+
}else{
|
20 |
+
$session->unsetData('onestepcheckout_giftwrap');
|
21 |
+
$session->unsetData('onestepcheckout_giftwrap_amount');
|
22 |
+
}
|
23 |
+
$this->loadLayout(false);
|
24 |
+
$this->renderLayout();
|
25 |
+
}
|
26 |
+
|
27 |
+
public function forgotPasswordAction()
|
28 |
+
{
|
29 |
+
$email = $this->getRequest()->getPost('email', false);
|
30 |
+
|
31 |
+
if (!Zend_Validate::is($email, 'EmailAddress')) {
|
32 |
+
$result = array('success'=>false);
|
33 |
+
}
|
34 |
+
else{
|
35 |
+
$customer = Mage::getModel('customer/customer')
|
36 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
37 |
+
->loadByEmail($email);
|
38 |
+
if ($customer->getId()) {
|
39 |
+
try {
|
40 |
+
$newPassword = $customer->generatePassword();
|
41 |
+
$customer->changePassword($newPassword, false);
|
42 |
+
$customer->sendPasswordReminderEmail();
|
43 |
+
$result = array('success'=>true);
|
44 |
+
}catch (Exception $e){
|
45 |
+
$result = array('success'=>false, 'error'=>$e->getMessage());
|
46 |
+
}
|
47 |
+
}else{
|
48 |
+
$result = array('success'=>false, 'error'=>'notfound');
|
49 |
+
}
|
50 |
+
}
|
51 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
52 |
+
}
|
53 |
+
|
54 |
+
public function loginAction()
|
55 |
+
{
|
56 |
+
$username = $this->getRequest()->getPost('onestepcheckout_username', false);
|
57 |
+
$password = $this->getRequest()->getPost('onestepcheckout_password', false);
|
58 |
+
$session = Mage::getSingleton('customer/session');
|
59 |
+
$result = array('success' => false);
|
60 |
+
if ($username && $password) {
|
61 |
+
try {
|
62 |
+
$session->login($username, $password);
|
63 |
+
} catch (Exception $e) {
|
64 |
+
$result['error'] = $e->getMessage();
|
65 |
+
}
|
66 |
+
if (! isset($result['error'])) {
|
67 |
+
$result['success'] = true;
|
68 |
+
}
|
69 |
+
} else {
|
70 |
+
$result['error'] = $this->__('Please enter a username and password.');
|
71 |
+
}
|
72 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
73 |
+
}
|
74 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/GeoipController.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
header('Content-Encoding: UTF-8');
|
12 |
+
header('Content-Type: text/html; charset=utf-8');
|
13 |
+
// header('Content-type: application/csv; charset=UTF-8');
|
14 |
+
class Abserve_Onestepcheckout_GeoipController extends Mage_Core_Controller_Front_Action
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* index action
|
18 |
+
*/
|
19 |
+
public function indexAction()
|
20 |
+
{
|
21 |
+
$this->loadLayout();
|
22 |
+
$this->renderLayout();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function checkPostcodeAction(){
|
26 |
+
$postcode = $this->getRequest()->getPost('postcode');
|
27 |
+
$geoips = Mage::getModel('onestepcheckout/geoip')->getCollection()
|
28 |
+
->setOrder('geoip_id', 'DESC')
|
29 |
+
->addFieldToFilter('postcode', array('like'=>$postcode.'%'));
|
30 |
+
$items = array();
|
31 |
+
if($geoips->getSize()){
|
32 |
+
foreach($geoips as $geoip){
|
33 |
+
$country = $geoip->getData('country');
|
34 |
+
// Zend_Debug::dump($country);die('2');
|
35 |
+
$region = $geoip->getData('region');
|
36 |
+
$city = $geoip->getData('city');
|
37 |
+
$geoipPostcode = $geoip->getData('postcode');
|
38 |
+
if($region){
|
39 |
+
$directory = Mage::getModel('directory/region')->getCollection()
|
40 |
+
->addFieldToFilter('country_id', $country)
|
41 |
+
->addFieldToFilter('code', $region);
|
42 |
+
if($directory->getSize()) {
|
43 |
+
$region_id = $directory->getFirstItem()->getId();
|
44 |
+
$region = $directory->getFirstItem()->getData('default_name');
|
45 |
+
}
|
46 |
+
}
|
47 |
+
$items[] = array( 'id' => $geoip->getId(),
|
48 |
+
'country' => $country,
|
49 |
+
'region' => $region,
|
50 |
+
'region_id' => $region_id,
|
51 |
+
'city' => $city,
|
52 |
+
'postcode' => $geoipPostcode,
|
53 |
+
);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
$block = $this->getLayout()->createBlock('onestepcheckout/postcode')
|
57 |
+
->setTemplate('onestepcheckout/geoip/postcode.phtml')
|
58 |
+
->assign('items', $items);
|
59 |
+
$this->getResponse()->setBody($block->toHtml());
|
60 |
+
// $this->getResponse()->setBody(Zend_Json::encode($result));
|
61 |
+
}
|
62 |
+
|
63 |
+
public function checkCityAction(){
|
64 |
+
$city = $this->getRequest()->getPost('city');
|
65 |
+
$geoips = Mage::getModel('onestepcheckout/geoip')->getCollection()
|
66 |
+
->setOrder('geoip_id', 'DESC')
|
67 |
+
->addFieldToFilter('city', array('like'=>$city.'%'));
|
68 |
+
$items = array();
|
69 |
+
if($geoips->getSize()){
|
70 |
+
foreach($geoips as $geoip){
|
71 |
+
$country = $geoip->getData('country');
|
72 |
+
// Zend_Debug::dump($country);die('2');
|
73 |
+
$region = $geoip->getData('region');
|
74 |
+
$city = $geoip->getData('city');
|
75 |
+
$geoipPostcode = $geoip->getData('postcode');
|
76 |
+
if($region){
|
77 |
+
$directory = Mage::getModel('directory/region')->getCollection()
|
78 |
+
->addFieldToFilter('country_id', $country)
|
79 |
+
->addFieldToFilter('code', $region);
|
80 |
+
if($directory->getSize()) {
|
81 |
+
$region_id = $directory->getFirstItem()->getId();
|
82 |
+
$region = $directory->getFirstItem()->getData('default_name');
|
83 |
+
}
|
84 |
+
}
|
85 |
+
$items[] = array( 'id' => $geoip->getId(),
|
86 |
+
'country' => $country,
|
87 |
+
'region' => $region,
|
88 |
+
'region_id' => $region_id,
|
89 |
+
'city' => $city,
|
90 |
+
'postcode' => $geoipPostcode,
|
91 |
+
);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
$block = $this->getLayout()->createBlock('onestepcheckout/postcode')
|
95 |
+
->setTemplate('onestepcheckout/geoip/postcode.phtml')
|
96 |
+
->assign('items', $items);
|
97 |
+
$this->getResponse()->setBody($block->toHtml());
|
98 |
+
// $this->getResponse()->setBody(Zend_Json::encode($result));
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/IndexController.php
ADDED
@@ -0,0 +1,1106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Onestepcheckout_IndexController extends Mage_Core_Controller_Front_Action {
|
12 |
+
public function testAction(){
|
13 |
+
$values = Mage::helper('onestepcheckout')->getFieldEnables();
|
14 |
+
$i = 0;
|
15 |
+
$fields = array();
|
16 |
+
|
17 |
+
Zend_Debug::dump(Mage::app()->getWebsite()->getData());
|
18 |
+
Zend_Debug::dump(Mage::app()->getStore()->getData());
|
19 |
+
foreach($values as $value){
|
20 |
+
Zend_Debug::dump($value);
|
21 |
+
}
|
22 |
+
die('---');
|
23 |
+
}
|
24 |
+
public function indexAction() {
|
25 |
+
if (!Mage::helper('magenotification')->checkLicenseKey('Onestepcheckout')) {
|
26 |
+
Mage::getSingleton('core/config')->saveConfig('onestepcheckout/general/active', 0);
|
27 |
+
return $this->_redirect('checkout/onepage');
|
28 |
+
}
|
29 |
+
|
30 |
+
if (!Mage::helper('onestepcheckout')->enabledOnestepcheckout()) {
|
31 |
+
$this->_redirect('checkout/onepage');
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
$this->enableCustomerFields();
|
35 |
+
$quote = $this->getOnepage()->getQuote();
|
36 |
+
if (!$quote->hasItems() || $quote->getHasError()) {
|
37 |
+
$this->_redirect('checkout/cart');
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
if (!$quote->validateMinimumAmount()) {
|
41 |
+
$error = Mage::getStoreConfig('sales/minimum_order/error_message');
|
42 |
+
Mage::getSingleton('checkout/session')->addError($error);
|
43 |
+
$this->_redirect('checkout/cart');
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
|
47 |
+
if (!Mage::getModel('checkout/session')->getQuote()->getBillingAddress()->getData('country_id')) {
|
48 |
+
if (Mage::getStoreConfig('onestepcheckout/general/country_id')) {
|
49 |
+
Mage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id', Mage::getStoreConfig('onestepcheckout/general/country_id'))->save();
|
50 |
+
}
|
51 |
+
}
|
52 |
+
$checkNull = 1;
|
53 |
+
$helper = Mage::helper('onestepcheckout');
|
54 |
+
for ($i = 0; $i < 15; $i++) {
|
55 |
+
if ($helper->getDefaultField($i)) {
|
56 |
+
$checkNull = 0;
|
57 |
+
break;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
if ($checkNull == 1) {
|
61 |
+
$arrayDefaults = $helper->getDefaultPositionArray();
|
62 |
+
foreach ($arrayDefaults as $number => $value) {
|
63 |
+
$model = Mage::getModel('onestepcheckout/config');
|
64 |
+
$model->setScope('default')
|
65 |
+
->setScopeId(0)
|
66 |
+
->setPath('onestepcheckout/field_position_management/row_' . $number)
|
67 |
+
->setValue($value);
|
68 |
+
$model->save();
|
69 |
+
}
|
70 |
+
}
|
71 |
+
$this->loadLayout();
|
72 |
+
$this->_initLayoutMessages('checkout/session');
|
73 |
+
$this->getLayout()->getBlock('head')->setTitle($this->__('One Step Checkout'));
|
74 |
+
$this->renderLayout();
|
75 |
+
}
|
76 |
+
|
77 |
+
//check if email is registered
|
78 |
+
private function _emailIsRegistered($email_address) {
|
79 |
+
$model = Mage::getModel('customer/customer');
|
80 |
+
$model->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email_address);
|
81 |
+
if ($model->getId()) {
|
82 |
+
return true;
|
83 |
+
} else {
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getOnepage() {
|
89 |
+
return Mage::getSingleton('checkout/type_onepage');
|
90 |
+
}
|
91 |
+
|
92 |
+
public function getSession() {
|
93 |
+
return Mage::getSingleton('checkout/session');
|
94 |
+
}
|
95 |
+
|
96 |
+
/*
|
97 |
+
* check if an email is valid
|
98 |
+
*/
|
99 |
+
|
100 |
+
public function is_valid_emailAction() {
|
101 |
+
$validator = new Zend_Validate_EmailAddress();
|
102 |
+
$email_address = $this->getRequest()->getPost('email_address');
|
103 |
+
$message = 'Invalid';
|
104 |
+
if ($email_address != '') {
|
105 |
+
// Check if email is in valid format
|
106 |
+
if (!$validator->isValid($email_address)) {
|
107 |
+
$message = 'invalid';
|
108 |
+
} else {
|
109 |
+
//if email is valid, check if this email is registered
|
110 |
+
if ($this->_emailIsRegistered($email_address)) {
|
111 |
+
$message = 'exists';
|
112 |
+
} else {
|
113 |
+
$message = 'valid';
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
$result = array('message' => $message);
|
118 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
119 |
+
}
|
120 |
+
|
121 |
+
public function show_loginAction() {
|
122 |
+
$this->loadLayout();
|
123 |
+
$this->renderLayout();
|
124 |
+
}
|
125 |
+
|
126 |
+
public function show_passwordAction() {
|
127 |
+
$this->loadLayout();
|
128 |
+
$this->renderLayout();
|
129 |
+
}
|
130 |
+
|
131 |
+
/*
|
132 |
+
* send new password to customer
|
133 |
+
*/
|
134 |
+
|
135 |
+
public function retrievePasswordAction() {
|
136 |
+
$email = $this->getRequest()->getPost('email', false);
|
137 |
+
$result = array();
|
138 |
+
if ($email) {
|
139 |
+
$customer = Mage::getModel('customer/customer')
|
140 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
141 |
+
->loadByEmail($email);
|
142 |
+
if ($customer->getId()) {
|
143 |
+
try {
|
144 |
+
$newPassword = $customer->generatePassword();
|
145 |
+
$customer->changePassword($newPassword, false);
|
146 |
+
$customer->sendPasswordReminderEmail();
|
147 |
+
$result = array('success' => true);
|
148 |
+
} catch (Exception $e) {
|
149 |
+
$result = array('success' => false, 'error' => $e->getMessage());
|
150 |
+
}
|
151 |
+
} else {
|
152 |
+
$result = array('success' => false, 'error' => 'This email address was not found in our records.');
|
153 |
+
}
|
154 |
+
}
|
155 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
156 |
+
}
|
157 |
+
|
158 |
+
/*
|
159 |
+
* show term and condition pop up
|
160 |
+
*/
|
161 |
+
|
162 |
+
public function show_term_conditionAction() {
|
163 |
+
$helper = Mage::helper('onestepcheckout');
|
164 |
+
if ($helper->enableTermsAndConditions()) {
|
165 |
+
$html = $helper->getTermsConditionsHtml();
|
166 |
+
echo $html;
|
167 |
+
echo '<p class="a-right"><a href="#" onclick="javascript:TINY.box.hide();return false;">Close</a></p>';
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
/*
|
172 |
+
* add coupon to the order
|
173 |
+
* copy from CartController.php
|
174 |
+
*/
|
175 |
+
|
176 |
+
public function add_couponAction() {
|
177 |
+
$couponCode = (string) $this->getRequest()->getPost('coupon_code', '');
|
178 |
+
|
179 |
+
$quote = $this->getOnepage()->getQuote();
|
180 |
+
if ($this->getRequest()->getParam('remove') == '1') {
|
181 |
+
$couponCode = '';
|
182 |
+
}
|
183 |
+
|
184 |
+
$oldCouponCode = $quote->getCouponCode();
|
185 |
+
if (!strlen($couponCode) && !strlen($oldCouponCode)) {
|
186 |
+
return;
|
187 |
+
}
|
188 |
+
try {
|
189 |
+
$error = false;
|
190 |
+
$quote->getShippingAddress()->setCollectShippingRates(true);
|
191 |
+
$quote->setCouponCode(strlen($couponCode) ? $couponCode : '')
|
192 |
+
->collectTotals()
|
193 |
+
->save();
|
194 |
+
if ($couponCode) {
|
195 |
+
if ($couponCode == $quote->getCouponCode()) {
|
196 |
+
$message = $this->__('Coupon code "%s" was applied.', Mage::helper('core')->htmlEscape($couponCode));
|
197 |
+
} else {
|
198 |
+
$error = true;
|
199 |
+
$message = $this->__('Coupon code "%s" is not valid.', Mage::helper('core')->htmlEscape($couponCode));
|
200 |
+
}
|
201 |
+
} else {
|
202 |
+
$message = $this->__('Coupon code was canceled.');
|
203 |
+
}
|
204 |
+
} catch (Mage_Core_Exception $e) {
|
205 |
+
$error = true;
|
206 |
+
$message = $e->getMessage();
|
207 |
+
} catch (Exception $e) {
|
208 |
+
$error = true;
|
209 |
+
$message = $this->__('Cannot apply the coupon code.');
|
210 |
+
}
|
211 |
+
//reload HTML for review order section
|
212 |
+
$reviewHtml = $this->_getReviewTotalHtml();
|
213 |
+
$result = array(
|
214 |
+
'error' => $error,
|
215 |
+
'message' => $message,
|
216 |
+
'review_html' => $reviewHtml
|
217 |
+
);
|
218 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
219 |
+
}
|
220 |
+
|
221 |
+
/*
|
222 |
+
* process login action in check out.
|
223 |
+
*/
|
224 |
+
|
225 |
+
public function loginPostAction() {
|
226 |
+
$email = $this->getRequest()->getPost('email', false);
|
227 |
+
$password = $this->getRequest()->getPost('password', false);
|
228 |
+
|
229 |
+
$error = '';
|
230 |
+
if ($email && $password) {
|
231 |
+
try {
|
232 |
+
$this->_getCustomerSession()->login($email, $password);
|
233 |
+
} catch (Exception $ex) {
|
234 |
+
$error = $ex->getMessage();
|
235 |
+
}
|
236 |
+
}
|
237 |
+
$result = array();
|
238 |
+
$result['error'] = $error;
|
239 |
+
if ($error == '')
|
240 |
+
$result['success'] = true;
|
241 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
242 |
+
}
|
243 |
+
|
244 |
+
/*
|
245 |
+
* save billing & shipping address
|
246 |
+
*/
|
247 |
+
/* Thinhnd */
|
248 |
+
|
249 |
+
public function saveAddressOnestepcheckoutAction() {
|
250 |
+
$billing_data = $this->getRequest()->getPost('billing', false);
|
251 |
+
$shipping_data = $this->getRequest()->getPost('shipping', false);
|
252 |
+
$shipping_method = $this->getRequest()->getPost('shipping_method', false);
|
253 |
+
$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);
|
254 |
+
|
255 |
+
if(isset($billing_data['onestepcheckout_comment']))
|
256 |
+
Mage::getModel('checkout/session')->setOSCCM($billing_data['onestepcheckout_comment']);
|
257 |
+
|
258 |
+
//load default data for disabled fields
|
259 |
+
if (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {
|
260 |
+
Mage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);
|
261 |
+
Mage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);
|
262 |
+
}
|
263 |
+
|
264 |
+
if (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {
|
265 |
+
$shipping_address_data = $billing_data;
|
266 |
+
} else {
|
267 |
+
$shipping_address_data = $shipping_data;
|
268 |
+
}
|
269 |
+
|
270 |
+
$billing_street = trim(implode("\n", $billing_data['street']));
|
271 |
+
$shipping_street = trim(implode("\n", $shipping_address_data['street']));
|
272 |
+
|
273 |
+
if (isset($billing_data['email'])) {
|
274 |
+
$billing_data['email'] = trim($billing_data['email']);
|
275 |
+
}
|
276 |
+
|
277 |
+
//2014.18.11 update VAT apply start
|
278 |
+
if (isset($billing_data['taxvat'])) {
|
279 |
+
$billing_data['vat_id'] = trim($billing_data['taxvat']);
|
280 |
+
$shipping_data['vat_id'] = trim($billing_data['taxvat']);
|
281 |
+
}
|
282 |
+
//2014.18.11 update VAT apply end
|
283 |
+
//
|
284 |
+
// Ignore disable fields validation --- Only for 1.4.1.1
|
285 |
+
$this->setIgnoreValidation();
|
286 |
+
if (Mage::helper('onestepcheckout')->isShowShippingAddress()) {
|
287 |
+
if (!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1') {
|
288 |
+
$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);
|
289 |
+
$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);
|
290 |
+
}else $this->getOnepage()->saveShipping($billing_data, $billing_address_id);
|
291 |
+
}else $this->getOnepage()->saveShipping($billing_data, $billing_address_id);
|
292 |
+
$this->getOnepage()->saveBilling($billing_data, $billing_address_id);
|
293 |
+
if(!$billing_address_id || $billing_address_id == '' || $billing_address_id == null){
|
294 |
+
if ($billing_data['country_id']) {
|
295 |
+
Mage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id', $billing_data['country_id'])->save();
|
296 |
+
}
|
297 |
+
}
|
298 |
+
// if different shipping address is enabled and customer ship to another address, save it
|
299 |
+
|
300 |
+
|
301 |
+
if ($shipping_method && $shipping_method != '') {
|
302 |
+
Mage::helper('onestepcheckout')->saveShippingMethod($shipping_method);
|
303 |
+
}
|
304 |
+
$this->loadLayout(false);
|
305 |
+
$this->renderLayout();
|
306 |
+
}
|
307 |
+
|
308 |
+
/*
|
309 |
+
* save shipping & payment method
|
310 |
+
*/
|
311 |
+
|
312 |
+
public function save_shippingAction() {
|
313 |
+
$shipping_method = $this->getRequest()->getPost('shipping_method', '');
|
314 |
+
$payment_method = $this->getRequest()->getPost('payment_method', false);
|
315 |
+
$old_shipping_method = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingMethod();
|
316 |
+
$billing_data = $this->getRequest()->getPost('billing', false);
|
317 |
+
if ($billing_data['country_id']) {
|
318 |
+
Mage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id', $billing_data['country_id'])->save();
|
319 |
+
}
|
320 |
+
// if ($shipping_method && $shipping_method != '' && $shipping_method != $old_shipping_method) {
|
321 |
+
Mage::helper('onestepcheckout')->saveShippingMethod($shipping_method);
|
322 |
+
$this->getOnepage()->saveShippingMethod($shipping_method);
|
323 |
+
// }
|
324 |
+
// if ($payment_method != '') {
|
325 |
+
try {
|
326 |
+
$payment = $this->getRequest()->getPost('payment', array());
|
327 |
+
$payment['method'] = $payment_method;
|
328 |
+
$this->getOnepage()->savePayment($payment);
|
329 |
+
Mage::helper('onestepcheckout')->savePaymentMethod($payment);
|
330 |
+
} catch (Exception $e) {
|
331 |
+
//
|
332 |
+
}
|
333 |
+
// }
|
334 |
+
$this->loadLayout(false);
|
335 |
+
$this->renderLayout();
|
336 |
+
}
|
337 |
+
|
338 |
+
public function saveOrderAction() {
|
339 |
+
$post = $this->getRequest()->getPost();
|
340 |
+
|
341 |
+
if (!$post)
|
342 |
+
return;
|
343 |
+
$error = false;
|
344 |
+
$helper = Mage::helper('onestepcheckout');
|
345 |
+
|
346 |
+
$billing_data = $this->getRequest()->getPost('billing', array());
|
347 |
+
$shipping_data = $this->getRequest()->getPost('shipping', array());
|
348 |
+
|
349 |
+
if(isset($billing_data['onestepcheckout_comment']))
|
350 |
+
Mage::getModel('checkout/session')->setOSCCM($billing_data['onestepcheckout_comment']);
|
351 |
+
|
352 |
+
//JSON reponse array for wirecard payment method
|
353 |
+
$JSONresponse = array();
|
354 |
+
|
355 |
+
//isAjax variable is the code name of payment method
|
356 |
+
$isAjax = $this->getRequest()->getParam('isAjax');
|
357 |
+
//set checkout method
|
358 |
+
$checkoutMethod = '';
|
359 |
+
if (!$this->_isLoggedIn()) {
|
360 |
+
$checkoutMethod = 'guest';
|
361 |
+
if ($helper->enableRegistration() || !$helper->allowGuestCheckout()) {
|
362 |
+
$is_create_account = $this->getRequest()->getPost('create_account_checkbox');
|
363 |
+
$email_address = $billing_data['email'];
|
364 |
+
if ($is_create_account || !$helper->allowGuestCheckout()) {
|
365 |
+
if ($this->_emailIsRegistered($email_address)) {
|
366 |
+
$error = true;
|
367 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Email is already registered.'));
|
368 |
+
$this->_redirect('*/*/index');
|
369 |
+
} else {
|
370 |
+
if (!$billing_data['customer_password'] || $billing_data['customer_password'] == '') {
|
371 |
+
$error = true;
|
372 |
+
} else if (!$billing_data['confirm_password'] || $billing_data['confirm_password'] == '') {
|
373 |
+
$error = true;
|
374 |
+
} else if ($billing_data['confirm_password'] !== $billing_data['customer_password']) {
|
375 |
+
$error = true;
|
376 |
+
}
|
377 |
+
if ($error) {
|
378 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Please correct your password.'));
|
379 |
+
if ($isAjax) {
|
380 |
+
$JSONresponse['url'] = Mage::getUrl('onestepcheckout/index/index');
|
381 |
+
} else {
|
382 |
+
$this->_redirect('*/*/index');
|
383 |
+
}
|
384 |
+
} else {
|
385 |
+
$checkoutMethod = 'register';
|
386 |
+
}
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
if ($checkoutMethod != '')
|
392 |
+
$this->getOnepage()->saveCheckoutMethod($checkoutMethod);
|
393 |
+
|
394 |
+
//to ignore validation for disabled fields
|
395 |
+
$this->setIgnoreValidation();
|
396 |
+
|
397 |
+
//resave billing address to make sure there is no error if customer change something in billing section before finishing order
|
398 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
399 |
+
$result = $this->getOnepage()->saveBilling($billing_data, $customerAddressId);
|
400 |
+
if (isset($result['error'])) {
|
401 |
+
$error = true;
|
402 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
403 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
404 |
+
else
|
405 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
406 |
+
if ($isAjax) {
|
407 |
+
$JSONresponse['url'] = Mage::getUrl('onestepcheckout/index/index');
|
408 |
+
} else {
|
409 |
+
$this->_redirect('*/*/index');
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
//re-save shipping address
|
414 |
+
$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);
|
415 |
+
if ($helper->isShowShippingAddress()) {
|
416 |
+
if (!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1') {
|
417 |
+
$result = $this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);
|
418 |
+
if (isset($result['error'])) {
|
419 |
+
$error = true;
|
420 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
421 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
422 |
+
else
|
423 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
424 |
+
$this->_redirect('*/*/index');
|
425 |
+
}
|
426 |
+
}
|
427 |
+
else {
|
428 |
+
$result['allow_sections'] = array('shipping');
|
429 |
+
$result['duplicateBillingInfo'] = 'true';
|
430 |
+
// $result = $this->getOnepage()->saveShipping($billing_data, $shipping_address_id);
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
//re-save shipping method
|
435 |
+
$shipping_method = $this->getRequest()->getPost('shipping_method', '');
|
436 |
+
if (!$this->isVirtual()) {
|
437 |
+
$result = $this->getOnepage()->saveShippingMethod($shipping_method);
|
438 |
+
if (isset($result['error'])) {
|
439 |
+
$error = true;
|
440 |
+
if (is_array($result['message']) && isset($result['message'][0])) {
|
441 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
442 |
+
} else {
|
443 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
444 |
+
}
|
445 |
+
if ($isAjax) {
|
446 |
+
$JSONresponse['url'] = Mage::getUrl('onestepcheckout/index/index');
|
447 |
+
} else {
|
448 |
+
$this->_redirect('*/*/index');
|
449 |
+
}
|
450 |
+
} else {
|
451 |
+
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote()));
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
$paymentRedirect = false;
|
456 |
+
//save payment method
|
457 |
+
try {
|
458 |
+
$result = array();
|
459 |
+
$payment = $this->getRequest()->getPost('payment', array());
|
460 |
+
$result = $helper->savePaymentMethod($payment);
|
461 |
+
if ($payment) {
|
462 |
+
$this->getOnepage()->getQuote()->getPayment()->importData($payment);
|
463 |
+
}
|
464 |
+
$paymentRedirect = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
|
465 |
+
} catch (Mage_Payment_Exception $e) {
|
466 |
+
if ($e->getFields()) {
|
467 |
+
$result['fields'] = $e->getFields();
|
468 |
+
}
|
469 |
+
$result['error'] = $e->getMessage();
|
470 |
+
} catch (Mage_Core_Exception $e) {
|
471 |
+
$result['error'] = $e->getMessage();
|
472 |
+
} catch (Exception $e) {
|
473 |
+
Mage::logException($e);
|
474 |
+
$result['error'] = $this->__('Unable to set Payment Method.');
|
475 |
+
}
|
476 |
+
|
477 |
+
if (isset($result['error'])) {
|
478 |
+
$error = true;
|
479 |
+
Mage::getSingleton('checkout/session')->addError($result['error']);
|
480 |
+
if ($isAjax) {
|
481 |
+
$JSONresponse['url'] = Mage::getUrl('onestepcheckout/index/index');
|
482 |
+
} else {
|
483 |
+
$this->_redirect('*/*/index');
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
+
if ($paymentRedirect && $paymentRedirect != '') {
|
488 |
+
Header('Location: ' . $paymentRedirect);
|
489 |
+
exit();
|
490 |
+
}
|
491 |
+
|
492 |
+
//only continue to process order if there is no error
|
493 |
+
if (!$error) {
|
494 |
+
//newsletter subscribe
|
495 |
+
if ($helper->isShowNewsletter()) {
|
496 |
+
$news_billing = $this->getRequest()->getPost('billing');
|
497 |
+
// $is_subscriber = $this->getRequest()->getPost('newsletter_subscriber_checkbox', false);
|
498 |
+
$is_subscriber = null;
|
499 |
+
if(isset($news_billing['newsletter_subscriber_checkbox']))
|
500 |
+
$is_subscriber = $news_billing['newsletter_subscriber_checkbox'];
|
501 |
+
if ($is_subscriber) {
|
502 |
+
$subscribe_email = '';
|
503 |
+
//pull subscriber email from billing data
|
504 |
+
if (isset($billing_data['email']) && $billing_data['email'] != '') {
|
505 |
+
$subscribe_email = $billing_data['email'];
|
506 |
+
} else if ($this->_isLoggedIn()) {
|
507 |
+
$subscribe_email = Mage::helper('customer')->getCustomer()->getEmail();
|
508 |
+
}
|
509 |
+
//check if email is already subscribed
|
510 |
+
$subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($subscribe_email);
|
511 |
+
if ($subscriberModel->getId() === NULL) {
|
512 |
+
Mage::getModel('newsletter/subscriber')->subscribe($subscribe_email);
|
513 |
+
} else if ($subscriberModel->getData('subscriber_status') != 1) {
|
514 |
+
$subscriberModel->setData('subscriber_status', 1);
|
515 |
+
try {
|
516 |
+
$subscriberModel->save();
|
517 |
+
} catch (Exception $e) {
|
518 |
+
|
519 |
+
}
|
520 |
+
}
|
521 |
+
}
|
522 |
+
}
|
523 |
+
try {
|
524 |
+
$result = $this->getOnepage()->saveOrder();
|
525 |
+
$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
|
526 |
+
} catch (Mage_Core_Exception $e) {
|
527 |
+
Mage::logException($e);
|
528 |
+
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
529 |
+
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
530 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
531 |
+
if ($isAjax) {
|
532 |
+
$JSONresponse['url'] = $redirect;
|
533 |
+
} else {
|
534 |
+
Header('Location: ' . $redirect);
|
535 |
+
exit();
|
536 |
+
}
|
537 |
+
} catch (Exception $e) {
|
538 |
+
Mage::logException($e);
|
539 |
+
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
540 |
+
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
541 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
542 |
+
if ($isAjax) {
|
543 |
+
$JSONresponse['url'] = $redirect;
|
544 |
+
} else {
|
545 |
+
Header('Location: ' . $redirect);
|
546 |
+
exit();
|
547 |
+
}
|
548 |
+
}
|
549 |
+
|
550 |
+
$this->getOnepage()->getQuote()->save();
|
551 |
+
Mage::dispatchEvent('controller_action_postdispatch_checkout_onepage_saveOrder', array('post' => $post, 'controller_action' => $this));
|
552 |
+
|
553 |
+
if ($redirectUrl) {
|
554 |
+
$redirect = $redirectUrl;
|
555 |
+
} else {
|
556 |
+
$redirect = Mage::getUrl('checkout/onepage/success');
|
557 |
+
}
|
558 |
+
|
559 |
+
if ($isAjax == 'wirecard') {
|
560 |
+
$this->getResponse()->setBody(json_encode($JSONresponse));
|
561 |
+
} elseif ($isAjax == 'tco') {
|
562 |
+
//Nothing to do here
|
563 |
+
//tco payment response the JSON code automatically
|
564 |
+
} else {
|
565 |
+
Header('Location: ' . $redirect);
|
566 |
+
exit();
|
567 |
+
}
|
568 |
+
} else {
|
569 |
+
$this->_redirect('*/*/index');
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
public function saveOrderProAction() {
|
574 |
+
$post = $this->getRequest()->getPost();
|
575 |
+
$result = new stdClass();
|
576 |
+
if (!$post)
|
577 |
+
return;
|
578 |
+
$error = false;
|
579 |
+
$helper = Mage::helper('onestepcheckout');
|
580 |
+
|
581 |
+
$billing_data = $this->getRequest()->getPost('billing', array());
|
582 |
+
$shipping_data = $this->getRequest()->getPost('shipping', array());
|
583 |
+
|
584 |
+
if(isset($billing_data['onestepcheckout_comment']))
|
585 |
+
Mage::getModel('checkout/session')->setOSCCM($billing_data['onestepcheckout_comment']);
|
586 |
+
|
587 |
+
//set checkout method
|
588 |
+
$checkoutMethod = '';
|
589 |
+
if (!$this->_isLoggedIn()) {
|
590 |
+
$checkoutMethod = 'guest';
|
591 |
+
if ($helper->enableRegistration() || !$helper->allowGuestCheckout()) {
|
592 |
+
$is_create_account = $this->getRequest()->getPost('create_account_checkbox');
|
593 |
+
$email_address = $billing_data['email'];
|
594 |
+
if ($is_create_account || !$helper->allowGuestCheckout()) {
|
595 |
+
if ($this->_emailIsRegistered($email_address)) {
|
596 |
+
$error = true;
|
597 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Email is already registered.'));
|
598 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
599 |
+
// Header('Location: ' . $redirect);
|
600 |
+
// exit();
|
601 |
+
$result->url = $redirect;
|
602 |
+
$this->getResponse()->setBody(json_encode($result));
|
603 |
+
} else {
|
604 |
+
if (!$billing_data['customer_password'] || $billing_data['customer_password'] == '') {
|
605 |
+
$error = true;
|
606 |
+
} else if (!$billing_data['confirm_password'] || $billing_data['confirm_password'] == '') {
|
607 |
+
$error = true;
|
608 |
+
} else if ($billing_data['confirm_password'] !== $billing_data['customer_password']) {
|
609 |
+
$error = true;
|
610 |
+
}
|
611 |
+
if ($error) {
|
612 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Please correct your password.'));
|
613 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
614 |
+
// Header('Location: ' . $redirect);
|
615 |
+
// exit();
|
616 |
+
$result->url = $redirect;
|
617 |
+
$this->getResponse()->setBody(json_encode($result));
|
618 |
+
} else {
|
619 |
+
$checkoutMethod = 'register';
|
620 |
+
}
|
621 |
+
}
|
622 |
+
}
|
623 |
+
}
|
624 |
+
}
|
625 |
+
if ($checkoutMethod != '')
|
626 |
+
$this->getOnepage()->saveCheckoutMethod($checkoutMethod);
|
627 |
+
|
628 |
+
//to ignore validation for disabled fields
|
629 |
+
$this->setIgnoreValidation();
|
630 |
+
|
631 |
+
//resave billing address to make sure there is no error if customer change something in billing section before finishing order
|
632 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
633 |
+
$result = $this->getOnepage()->saveBilling($billing_data, $customerAddressId);
|
634 |
+
if (isset($result['error'])) {
|
635 |
+
$error = true;
|
636 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
637 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
638 |
+
else
|
639 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
640 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
641 |
+
// Header('Location: ' . $redirect);
|
642 |
+
// exit();
|
643 |
+
$result->url = $redirect;
|
644 |
+
$this->getResponse()->setBody(json_encode($result));
|
645 |
+
}
|
646 |
+
|
647 |
+
//re-save shipping address
|
648 |
+
$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);
|
649 |
+
if ($helper->isShowShippingAddress()) {
|
650 |
+
if (!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1') {
|
651 |
+
$result = $this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);
|
652 |
+
if (isset($result['error'])) {
|
653 |
+
$error = true;
|
654 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
655 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
656 |
+
else
|
657 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
658 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
659 |
+
// Header('Location: ' . $redirect);
|
660 |
+
// exit();
|
661 |
+
$result->url = $redirect;
|
662 |
+
$this->getResponse()->setBody(json_encode($result));
|
663 |
+
}
|
664 |
+
}
|
665 |
+
else {
|
666 |
+
$result['allow_sections'] = array('shipping');
|
667 |
+
$result['duplicateBillingInfo'] = 'true';
|
668 |
+
// $result = $this->getOnepage()->saveShipping($billing_data, $shipping_address_id);
|
669 |
+
}
|
670 |
+
}
|
671 |
+
|
672 |
+
//re-save shipping method
|
673 |
+
$shipping_method = $this->getRequest()->getPost('shipping_method', '');
|
674 |
+
if (!$this->isVirtual()) {
|
675 |
+
$result = $this->getOnepage()->saveShippingMethod($shipping_method);
|
676 |
+
if (isset($result['error'])) {
|
677 |
+
$error = true;
|
678 |
+
if (is_array($result['message']) && isset($result['message'][0])) {
|
679 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
680 |
+
} else {
|
681 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
682 |
+
}
|
683 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
684 |
+
// Header('Location: ' . $redirect);
|
685 |
+
// exit();
|
686 |
+
$result->url = $redirect;
|
687 |
+
$this->getResponse()->setBody(json_encode($result));
|
688 |
+
} else {
|
689 |
+
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote()));
|
690 |
+
}
|
691 |
+
}
|
692 |
+
|
693 |
+
$paymentRedirect = false;
|
694 |
+
//save payment method
|
695 |
+
try {
|
696 |
+
$result = array();
|
697 |
+
$payment_method = $this->getRequest()->getPost('payment', array());
|
698 |
+
$payment['method'] = $payment_method;
|
699 |
+
$result = $helper->savePaymentMethod($payment);
|
700 |
+
if ($payment) {
|
701 |
+
$this->getOnepage()->getQuote()->getPayment()->importData($payment);
|
702 |
+
}
|
703 |
+
$paymentRedirect = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
|
704 |
+
} catch (Mage_Payment_Exception $e) {
|
705 |
+
|
706 |
+
if ($e->getFields()) {
|
707 |
+
$result['fields'] = $e->getFields();
|
708 |
+
}
|
709 |
+
$result['error'] = $e->getMessage();
|
710 |
+
} catch (Mage_Core_Exception $e) {
|
711 |
+
|
712 |
+
$result['error'] = $e->getMessage();
|
713 |
+
} catch (Exception $e) {
|
714 |
+
|
715 |
+
Mage::logException($e);
|
716 |
+
$result['error'] = $this->__('Unable to set Payment Method.');
|
717 |
+
}
|
718 |
+
|
719 |
+
if (isset($result['error'])) {
|
720 |
+
$error = true;
|
721 |
+
Mage::getSingleton('checkout/session')->addError($result['error']);
|
722 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
723 |
+
$result->url = $redirect;
|
724 |
+
$this->getResponse()->setBody(json_encode($result));
|
725 |
+
}
|
726 |
+
|
727 |
+
if ($paymentRedirect && $paymentRedirect != '') {
|
728 |
+
$result = new stdClass();
|
729 |
+
$result->url = $paymentRedirect;
|
730 |
+
$this->getResponse()->setBody(json_encode($result));
|
731 |
+
} else {
|
732 |
+
|
733 |
+
//only continue to process order if there is no error
|
734 |
+
if (!$error) {
|
735 |
+
//newsletter subscribe
|
736 |
+
if ($helper->isShowNewsletter()) {
|
737 |
+
$news_billing = $this->getRequest()->getPost('billing');
|
738 |
+
$is_subscriber = null;
|
739 |
+
if(isset($news_billing['newsletter_subscriber_checkbox']))
|
740 |
+
$is_subscriber = $news_billing['newsletter_subscriber_checkbox'];
|
741 |
+
// var_dump($is_subscriber);die();
|
742 |
+
if ($is_subscriber) {
|
743 |
+
$subscribe_email = '';
|
744 |
+
//pull subscriber email from billing data
|
745 |
+
if (isset($billing_data['email']) && $billing_data['email'] != '') {
|
746 |
+
$subscribe_email = $billing_data['email'];
|
747 |
+
} else if ($this->_isLoggedIn()) {
|
748 |
+
$subscribe_email = Mage::helper('customer')->getCustomer()->getEmail();
|
749 |
+
}
|
750 |
+
//check if email is already subscribed
|
751 |
+
$subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($subscribe_email);
|
752 |
+
if ($subscriberModel->getId() === NULL) {
|
753 |
+
Mage::getModel('newsletter/subscriber')->subscribe($subscribe_email);
|
754 |
+
} else if ($subscriberModel->getData('subscriber_status') != 1) {
|
755 |
+
$subscriberModel->setData('subscriber_status', 1);
|
756 |
+
try {
|
757 |
+
$subscriberModel->save();
|
758 |
+
} catch (Exception $e) {
|
759 |
+
|
760 |
+
}
|
761 |
+
}
|
762 |
+
}
|
763 |
+
}
|
764 |
+
|
765 |
+
try {
|
766 |
+
$result = $this->getOnepage()->saveOrder();
|
767 |
+
$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();
|
768 |
+
} catch (Mage_Core_Exception $e) {
|
769 |
+
Mage::logException($e);
|
770 |
+
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
771 |
+
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
772 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
773 |
+
// Header('Location: ' . $redirect);
|
774 |
+
// exit();
|
775 |
+
$result->url = $redirect;
|
776 |
+
$this->getResponse()->setBody(json_encode($result));
|
777 |
+
} catch (Exception $e) {
|
778 |
+
Mage::logException($e);
|
779 |
+
Mage::getSingleton('checkout/session')->addError($e->getMessage());
|
780 |
+
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
|
781 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
782 |
+
// Header('Location: ' . $redirect);
|
783 |
+
// exit();
|
784 |
+
$result->url = $redirect;
|
785 |
+
$this->getResponse()->setBody(json_encode($result));
|
786 |
+
}
|
787 |
+
$this->getOnepage()->getQuote()->save();
|
788 |
+
|
789 |
+
if ($payment['method'] == 'hosted_pro') {
|
790 |
+
$this->loadLayout('checkout_onepage_review');
|
791 |
+
$html = $this->getLayout()->getBlock('paypal.iframe')->toHtml();
|
792 |
+
|
793 |
+
$result->html = $html;
|
794 |
+
$result->url = 'null';
|
795 |
+
|
796 |
+
$this->getResponse()->setBody(json_encode($result));
|
797 |
+
} else {
|
798 |
+
if ($redirectUrl) {
|
799 |
+
$redirect = $redirectUrl;
|
800 |
+
} else {
|
801 |
+
$redirect = Mage::getUrl('checkout/onepage/success');
|
802 |
+
}
|
803 |
+
$result->html = '';
|
804 |
+
$result->url = $redirect;
|
805 |
+
|
806 |
+
$this->getResponse()->setBody(json_encode($result));
|
807 |
+
}
|
808 |
+
} else {
|
809 |
+
$result = new stdClass();
|
810 |
+
$redirect = Mage::getUrl('onestepcheckout/index/index');
|
811 |
+
// Header('Location: ' . $redirect);
|
812 |
+
// exit();
|
813 |
+
$result->url = $redirect;
|
814 |
+
$this->getResponse()->setBody(json_encode($result));
|
815 |
+
}
|
816 |
+
}
|
817 |
+
}
|
818 |
+
|
819 |
+
protected function _getCustomerSession() {
|
820 |
+
return Mage::getSingleton('customer/session');
|
821 |
+
}
|
822 |
+
|
823 |
+
/*
|
824 |
+
* Reload shipping method html
|
825 |
+
*/
|
826 |
+
|
827 |
+
protected function _getShippingMethodsHtml() {
|
828 |
+
//$this->_cleanLayoutCache();
|
829 |
+
$layout = $this->getLayout();
|
830 |
+
$update = $layout->getUpdate();
|
831 |
+
$update->load('onestepcheckout_onestepcheckout_shippingmethod');
|
832 |
+
$layout->generateXml();
|
833 |
+
$layout->generateBlocks();
|
834 |
+
$output = $layout->getOutput();
|
835 |
+
return $output;
|
836 |
+
}
|
837 |
+
|
838 |
+
/*
|
839 |
+
* Reload payment method html
|
840 |
+
*/
|
841 |
+
|
842 |
+
public function _getPaymentMethodsHtml() {
|
843 |
+
//$this->_cleanLayoutCache();
|
844 |
+
$layout = $this->getLayout();
|
845 |
+
$update = $layout->getUpdate();
|
846 |
+
$update->load('onestepcheckout_onestepcheckout_paymentmethod');
|
847 |
+
$layout->generateXml();
|
848 |
+
$layout->generateBlocks();
|
849 |
+
$output = $layout->getOutput();
|
850 |
+
return $output;
|
851 |
+
}
|
852 |
+
|
853 |
+
public function _getReviewTotalHtml() {
|
854 |
+
//$this->_cleanLayoutCache();
|
855 |
+
$layout = $this->getLayout();
|
856 |
+
$update = $layout->getUpdate();
|
857 |
+
$update->load('onestepcheckout_onestepcheckout_review');
|
858 |
+
$layout->unsetBlock('shippingmethod');
|
859 |
+
$layout->generateXml();
|
860 |
+
$layout->generateBlocks();
|
861 |
+
$output = $layout->getOutput();
|
862 |
+
return $output;
|
863 |
+
}
|
864 |
+
|
865 |
+
protected function _isLoggedIn() {
|
866 |
+
return $this->_getCustomerSession()->isLoggedIn();
|
867 |
+
}
|
868 |
+
|
869 |
+
public function isVirtual() {
|
870 |
+
return $this->getOnepage()->getQuote()->isVirtual();
|
871 |
+
}
|
872 |
+
|
873 |
+
/*
|
874 |
+
* this function is to pass the validation
|
875 |
+
* Only available for Magento 1.4.x
|
876 |
+
*/
|
877 |
+
|
878 |
+
public function setIgnoreValidation() {
|
879 |
+
$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);
|
880 |
+
$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);
|
881 |
+
}
|
882 |
+
|
883 |
+
protected function _cleanLayoutCache() {
|
884 |
+
Mage::app()->cleanCache(LAYOUT_GENERAL_CACHE_TAG);
|
885 |
+
}
|
886 |
+
|
887 |
+
public function enableCustomerFields() {
|
888 |
+
$helper = Mage::helper('onestepcheckout');
|
889 |
+
$fieldValue = $helper->getFieldValue();
|
890 |
+
$prefix = 0;
|
891 |
+
$suffix = 0;
|
892 |
+
$middlename = 0;
|
893 |
+
$birthday = 0;
|
894 |
+
$gender = 0;
|
895 |
+
$taxvat = 0;
|
896 |
+
$fields = $helper->getFieldEnables();
|
897 |
+
for ($i = 0; $i < 20; $i++) {
|
898 |
+
if ($fields[$i]['value'] == 'prefix')
|
899 |
+
$prefix = 1;
|
900 |
+
if ($fields[$i]['value'] == 'suffix')
|
901 |
+
$suffix = 1;
|
902 |
+
if ($fields[$i]['value'] == 'middlename')
|
903 |
+
$middlename = 1;
|
904 |
+
if ($fields[$i]['value'] == 'birthday')
|
905 |
+
$birthday = 1;
|
906 |
+
if ($fields[$i]['value'] == 'gender')
|
907 |
+
$gender = 1;
|
908 |
+
if ($fields[$i]['value'] == 'taxvat')
|
909 |
+
$taxvat = 1;
|
910 |
+
}
|
911 |
+
|
912 |
+
try {
|
913 |
+
if ($prefix == 1) {
|
914 |
+
if ($helper->getFieldRequire('prefix')) {
|
915 |
+
Mage::getConfig()->saveConfig('customer/address/prefix_show', 'req');
|
916 |
+
$this->updateAttribute('prefix', 'reg');
|
917 |
+
} else {
|
918 |
+
Mage::getConfig()->saveConfig('customer/address/prefix_show', 'opt');
|
919 |
+
$this->updateAttribute('prefix', 'opt');
|
920 |
+
}
|
921 |
+
}
|
922 |
+
if ($suffix == 1) {
|
923 |
+
if ($helper->getFieldRequire('suffix')) {
|
924 |
+
Mage::getConfig()->saveConfig('customer/address/suffix_show', 'req');
|
925 |
+
$this->updateAttribute('suffix', 'req');
|
926 |
+
} else {
|
927 |
+
Mage::getConfig()->saveConfig('customer/address/suffix_show', 'opt');
|
928 |
+
$this->updateAttribute('suffix', 'opt');
|
929 |
+
}
|
930 |
+
}
|
931 |
+
if ($middlename == 1) {
|
932 |
+
Mage::getConfig()->saveConfig('customer/address/middlename_show', '1');
|
933 |
+
$this->updateAttribute('middlename', '1');
|
934 |
+
}
|
935 |
+
if ($birthday == 1) {
|
936 |
+
if ($helper->getFieldRequire('birthday')) {
|
937 |
+
Mage::getConfig()->saveConfig('customer/address/dob_show', 'req');
|
938 |
+
$this->updateAttribute('dob', 'req');
|
939 |
+
} else {
|
940 |
+
Mage::getConfig()->saveConfig('customer/address/dob_show', 'opt');
|
941 |
+
$this->updateAttribute('dob', 'opt');
|
942 |
+
}
|
943 |
+
}
|
944 |
+
if ($gender == 1) {
|
945 |
+
if ($helper->getFieldRequire('gender')) {
|
946 |
+
Mage::getConfig()->saveConfig('customer/address/gender_show', 'req');
|
947 |
+
$this->updateAttribute('gender', 'req');
|
948 |
+
} else {
|
949 |
+
Mage::getConfig()->saveConfig('customer/address/gender_show', 'opt');
|
950 |
+
$this->updateAttribute('gender', 'opt');
|
951 |
+
}
|
952 |
+
}
|
953 |
+
if ($taxvat == 1) {
|
954 |
+
if ($helper->getFieldRequire('taxvat')) {
|
955 |
+
Mage::getConfig()->saveConfig('customer/address/taxvat_show', 'req');
|
956 |
+
$this->updateAttribute('taxvat', 'req');
|
957 |
+
} else {
|
958 |
+
Mage::getConfig()->saveConfig('customer/address/taxvat_show', 'opt');
|
959 |
+
$this->updateAttribute('taxvat', 'opt');
|
960 |
+
}
|
961 |
+
}
|
962 |
+
} catch (Exception $e) {
|
963 |
+
|
964 |
+
}
|
965 |
+
}
|
966 |
+
|
967 |
+
public function updateAttribute($attribute, $option) {
|
968 |
+
$attributeObject = Mage::getSingleton('eav/config')->getAttribute('customer', $attribute);
|
969 |
+
$valueConfig = array(
|
970 |
+
'' => array('is_required' => 0, 'is_visible' => 0),
|
971 |
+
'opt' => array('is_required' => 0, 'is_visible' => 1),
|
972 |
+
'1' => array('is_required' => 0, 'is_visible' => 1),
|
973 |
+
'req' => array('is_required' => 1, 'is_visible' => 1),
|
974 |
+
);
|
975 |
+
$data = $valueConfig[$option];
|
976 |
+
$attributeObject->setData('is_required', $data['is_required']);
|
977 |
+
$attributeObject->setData('is_visible', $data['is_visible']);
|
978 |
+
$attributeObject->save();
|
979 |
+
}
|
980 |
+
|
981 |
+
public function getreionidAction(){
|
982 |
+
$data = $this->getRequest()->getPost();
|
983 |
+
$resion = Mage::getModel('directory/region')->getCollection()
|
984 |
+
->addFieldToFilter('country_id',$data['country'])
|
985 |
+
->addFieldToFilter('code',$data['region_id'])
|
986 |
+
->getFirstItem();
|
987 |
+
$result = array();
|
988 |
+
$result['id'] = $resion->getId();
|
989 |
+
|
990 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
991 |
+
}
|
992 |
+
|
993 |
+
protected function _getCart()
|
994 |
+
{
|
995 |
+
return Mage::getSingleton('checkout/cart');
|
996 |
+
}
|
997 |
+
|
998 |
+
public function deleteproductAction(){
|
999 |
+
$id = (int)$this->getRequest()->getParam('id');
|
1000 |
+
$result = array();
|
1001 |
+
$result['success'] = false;
|
1002 |
+
if ($id) {
|
1003 |
+
try {
|
1004 |
+
$this->_getCart()->removeItem($id)
|
1005 |
+
->save();
|
1006 |
+
$result['success'] = true;
|
1007 |
+
if(!$this->_getCart()->getQuote()->getItemsCount()){
|
1008 |
+
$result['url'] = Mage::getUrl('checkout/cart', array('_secure' => true));
|
1009 |
+
}
|
1010 |
+
} catch (Exception $e) {
|
1011 |
+
$result['error'] = Mage::helper('onestepcheckout')->__('Cannot remove the item.');
|
1012 |
+
Mage::logException($e);
|
1013 |
+
}
|
1014 |
+
}
|
1015 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
public function minus_productAction(){
|
1019 |
+
$id = (int)$this->getRequest()->getParam('id');
|
1020 |
+
$qty = (int)$this->getRequest()->getParam('qty');
|
1021 |
+
|
1022 |
+
$result = array();
|
1023 |
+
$cartData = array($id => array('qty' => $qty-1));
|
1024 |
+
|
1025 |
+
try {
|
1026 |
+
|
1027 |
+
|
1028 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
1029 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
1030 |
+
);
|
1031 |
+
foreach ($cartData as $index => $data) {
|
1032 |
+
if (isset($data['qty'])) {
|
1033 |
+
$cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
$cart = $this->_getCart();
|
1037 |
+
if (! $cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
|
1038 |
+
$cart->getQuote()->setCustomerId(null);
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
$cartData = $cart->suggestItemsQty($cartData);
|
1042 |
+
$cart->updateItems($cartData)
|
1043 |
+
->save();
|
1044 |
+
|
1045 |
+
$result['qty'] = $cartData[$id]['qty'];
|
1046 |
+
if(!$this->_getCart()->getQuote()->getItemsCount()){
|
1047 |
+
$result['url'] = Mage::getUrl('checkout/cart', array('_secure' => true));
|
1048 |
+
}
|
1049 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
1050 |
+
|
1051 |
+
} catch (Mage_Core_Exception $e) {
|
1052 |
+
$result['error'] = Mage::helper('core')->escapeHtml($e->getMessage());
|
1053 |
+
} catch (Exception $e) {
|
1054 |
+
$result['error'] = $this->__('Cannot update shopping cart.');
|
1055 |
+
Mage::logException($e);
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
public function add_productAction(){
|
1061 |
+
$id = (int)$this->getRequest()->getParam('id');
|
1062 |
+
$qty = (int)$this->getRequest()->getParam('qty');
|
1063 |
+
|
1064 |
+
$result = array();
|
1065 |
+
$cartData = array($id => array('qty' => $qty+1));
|
1066 |
+
|
1067 |
+
try {
|
1068 |
+
|
1069 |
+
|
1070 |
+
$filter = new Zend_Filter_LocalizedToNormalized(
|
1071 |
+
array('locale' => Mage::app()->getLocale()->getLocaleCode())
|
1072 |
+
);
|
1073 |
+
foreach ($cartData as $index => $data) {
|
1074 |
+
if (isset($data['qty'])) {
|
1075 |
+
$cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
$cart = $this->_getCart();
|
1079 |
+
if (! $cart->getCustomerSession()->getCustomer()->getId() && $cart->getQuote()->getCustomerId()) {
|
1080 |
+
$cart->getQuote()->setCustomerId(null);
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
$cartData = $cart->suggestItemsQty($cartData);
|
1084 |
+
$cart->updateItems($cartData)
|
1085 |
+
->save();
|
1086 |
+
$message = $cart->getQuote()->getMessages();
|
1087 |
+
if($message)
|
1088 |
+
{
|
1089 |
+
$result['error'] = $message['qty']->getCode();
|
1090 |
+
$cartData = array($id => array('qty' => $qty));
|
1091 |
+
$cartData = $cart->suggestItemsQty($cartData);
|
1092 |
+
$cart->updateItems($cartData)
|
1093 |
+
->save();
|
1094 |
+
}
|
1095 |
+
$result['qty'] = $cartData[$id]['qty'];
|
1096 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
1097 |
+
|
1098 |
+
} catch (Mage_Core_Exception $e) {
|
1099 |
+
$result['error'] = Mage::helper('core')->escapeHtml($e->getMessage());
|
1100 |
+
} catch (Exception $e) {
|
1101 |
+
$result['error'] = $this->__('Cannot update shopping cart.');
|
1102 |
+
Mage::logException($e);
|
1103 |
+
}
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
}
|
app/code/community/Abserve/Onestepcheckout/controllers/PaymentController.php
ADDED
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
require_once 'Ebizmarts/SagePaySuite/controllers/PaymentController.php';
|
12 |
+
class Abserve_Onestepcheckout_PaymentController extends Ebizmarts_SagePaySuite_PaymentController {
|
13 |
+
|
14 |
+
private function _emailIsRegistered($email_address) {
|
15 |
+
$model = Mage::getModel('customer/customer');
|
16 |
+
$model->setWebsiteId(Mage::app()->getStore()->getWebsiteId())->loadByEmail($email_address);
|
17 |
+
if ($model->getId()) {
|
18 |
+
return true;
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
return false;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
private function _MAGESTORESaveBilling()
|
26 |
+
{
|
27 |
+
$post = $this->getRequest()->getPost();
|
28 |
+
if (!$post) return;
|
29 |
+
$result = new stdClass();
|
30 |
+
$error = false;
|
31 |
+
$helper = Mage::helper('onestepcheckout');
|
32 |
+
|
33 |
+
$billing_data = $this->getRequest()->getPost('billing', array());
|
34 |
+
$shipping_data = $this->getRequest()->getPost('shipping', array());
|
35 |
+
|
36 |
+
//set checkout method
|
37 |
+
$checkoutMethod = '';
|
38 |
+
if (!Mage::helper('customer')->isLoggedIn()) {
|
39 |
+
$checkoutMethod = 'guest';
|
40 |
+
if ($helper->enableRegistration() || !$helper->allowGuestCheckout()) {
|
41 |
+
$is_create_account = $this->getRequest()->getPost('create_account_checkbox');
|
42 |
+
$email_address = $billing_data['email'];
|
43 |
+
if ($is_create_account || !$helper->allowGuestCheckout()) {
|
44 |
+
if ($this->_emailIsRegistered($email_address)) {
|
45 |
+
$error = true;
|
46 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Email is already registered.'));
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
if (!$billing_data['customer_password'] || $billing_data['customer_password'] == '') {
|
50 |
+
$error = true;
|
51 |
+
}
|
52 |
+
else if (!$billing_data['confirm_password'] || $billing_data['confirm_password'] == '') {
|
53 |
+
$error = true;
|
54 |
+
}
|
55 |
+
else if ($billing_data['confirm_password'] !== $billing_data['customer_password']) {
|
56 |
+
$error = true;
|
57 |
+
}
|
58 |
+
if ($error) {
|
59 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('onestepcheckout')->__('Please correct your password.'));
|
60 |
+
$this->_redirect('*/*/index');
|
61 |
+
}
|
62 |
+
else {
|
63 |
+
$checkoutMethod = 'register';
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
if ($checkoutMethod != '') $this->getOnepage()->saveCheckoutMethod($checkoutMethod);
|
70 |
+
if($checkoutMethod == 'register'){
|
71 |
+
$password = $billing_data['customer_password'];
|
72 |
+
$this->getOnepage()->getQuote()->getCustomer()->setData('password', $password);
|
73 |
+
$this->getOnepage()->getQuote()->setData('customer_email', $billing_data['email']);
|
74 |
+
$this->getOnepage()->getQuote()->setData('customer_firstname', $billing_data['firstname']);
|
75 |
+
$this->getOnepage()->getQuote()->setData('customer_lastname', $billing_data['lastname']);
|
76 |
+
$this->getOnepage()->getQuote()->setData('password_hash', Mage::getModel('customer/customer')->encryptPassword($password));
|
77 |
+
}
|
78 |
+
//to ignore validation for disabled fields
|
79 |
+
$this->setIgnoreValidation();
|
80 |
+
|
81 |
+
//resave billing address to make sure there is no error if customer change something in billing section before finishing order
|
82 |
+
$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
|
83 |
+
$result = $this->getOnepage()->saveBilling($billing_data, $customerAddressId);
|
84 |
+
if(isset($result['error'])) {
|
85 |
+
$error = true;
|
86 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
87 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
88 |
+
else
|
89 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
90 |
+
}
|
91 |
+
|
92 |
+
//re-save shipping address
|
93 |
+
$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);
|
94 |
+
if($helper->isShowShippingAddress()) {
|
95 |
+
if(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1') {
|
96 |
+
$result = $this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);
|
97 |
+
if(isset($result['error'])) {
|
98 |
+
$error = true;
|
99 |
+
if (is_array($result['message']) && isset($result['message'][0]))
|
100 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
101 |
+
else
|
102 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
else {
|
106 |
+
$result['allow_sections'] = array('shipping');
|
107 |
+
$result['duplicateBillingInfo'] = 'true';
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
//re-save shipping method
|
112 |
+
$shipping_method = $this->getRequest()->getPost('shipping_method', '');
|
113 |
+
if(!$this->getOnepage()->getQuote()->isVirtual()) {
|
114 |
+
$result = $this->getOnepage()->saveShippingMethod($shipping_method);
|
115 |
+
if(isset($result['error'])) {
|
116 |
+
$error = true;
|
117 |
+
if (is_array($result['message']) && isset($result['message'][0])) {
|
118 |
+
Mage::getSingleton('checkout/session')->addError($result['message'][0]);
|
119 |
+
}
|
120 |
+
else {
|
121 |
+
Mage::getSingleton('checkout/session')->addError($result['message']);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
else {
|
125 |
+
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$this->getOnepage()->getQuote()));
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
//save payment method
|
130 |
+
try {
|
131 |
+
$result = array();
|
132 |
+
$payment = $this->getRequest()->getPost('payment', array());
|
133 |
+
$result = $helper->savePaymentMethod($payment);
|
134 |
+
if($payment){
|
135 |
+
$this->getOnepage()->getQuote()->getPayment()->importData($payment);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
catch (Mage_Payment_Exception $e) {
|
139 |
+
if ($e->getFields()) {
|
140 |
+
$result['fields'] = $e->getFields();
|
141 |
+
}
|
142 |
+
$result['error'] = $e->getMessage();
|
143 |
+
} catch (Mage_Core_Exception $e) {
|
144 |
+
$result['error'] = $e->getMessage();
|
145 |
+
} catch (Exception $e) {
|
146 |
+
Mage::logException($e);
|
147 |
+
$result['error'] = $this->__('Unable to set Payment Method.');
|
148 |
+
}
|
149 |
+
|
150 |
+
if (isset($result['error'])) {
|
151 |
+
$error = true;
|
152 |
+
Mage::getSingleton('checkout/session')->addError($result['error']);
|
153 |
+
}
|
154 |
+
|
155 |
+
//only continue to process order if there is no error
|
156 |
+
if (!$error) {
|
157 |
+
//newsletter subscribe
|
158 |
+
if ($helper->isShowNewsletter()) {
|
159 |
+
$news_billing = $this->getRequest()->getPost('billing');
|
160 |
+
// $is_subscriber = $this->getRequest()->getPost('newsletter_subscriber_checkbox', false);
|
161 |
+
$is_subscriber = $news_billing['newsletter_subscriber_checkbox'];
|
162 |
+
if ($is_subscriber) {
|
163 |
+
$subscribe_email = '';
|
164 |
+
//pull subscriber email from billing data
|
165 |
+
if (isset($billing_data['email']) && $billing_data['email'] != '') {
|
166 |
+
$subscribe_email = $billing_data['email'];
|
167 |
+
}
|
168 |
+
else if (Mage::helper('customer')->isLoggedIn()) {
|
169 |
+
$subscribe_email = Mage::helper('customer')->getCustomer()->getEmail();
|
170 |
+
}
|
171 |
+
//check if email is already subscribed
|
172 |
+
$subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($subscribe_email);
|
173 |
+
if ($subscriberModel->getId() === NULL) {
|
174 |
+
Mage::getModel('newsletter/subscriber')->subscribe($subscribe_email);
|
175 |
+
}else if($subscriberModel->getData('subscriber_status') !=1 ){
|
176 |
+
$subscriberModel->setData('subscriber_status', 1);
|
177 |
+
try{
|
178 |
+
$subscriberModel->save();
|
179 |
+
}catch(Exception $e){
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
//Save OSC Comment
|
185 |
+
$session = Mage::getSingleton('checkout/session');
|
186 |
+
if ($helper->enableOrderComment()) {
|
187 |
+
$comment = $billing_data['onestepcheckout_comment'];
|
188 |
+
|
189 |
+
$comment = trim($comment);
|
190 |
+
if ($comment != '') {
|
191 |
+
$session->setData('customer_comment', $comment);
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
//}
|
196 |
+
//Save OSC Survey
|
197 |
+
if($helper->enableSurvey()){
|
198 |
+
$surveyQuestion = $helper->getSurveyQuestion();
|
199 |
+
$surveyValues = unserialize($helper->getSurveyValues());
|
200 |
+
$surveyValue = $billing_data['onestepcheckout-survey'];
|
201 |
+
$surveyFreeText = $billing_data['onestepcheckout-survey-freetext'];
|
202 |
+
$surveyAnswer='';
|
203 |
+
if(!empty($surveyValue)){
|
204 |
+
if($surveyValue != 'freetext'){
|
205 |
+
$surveyAnswer = $surveyValues[$surveyValue]['value'];
|
206 |
+
}
|
207 |
+
else{
|
208 |
+
$surveyAnswer = $surveyFreeText;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
if($surveyQuestion)
|
212 |
+
$session->setData('survey_question', $surveyQuestion);
|
213 |
+
if($surveyAnswer)
|
214 |
+
$session->setData('survey_answer', $surveyAnswer);
|
215 |
+
}
|
216 |
+
}else {
|
217 |
+
}
|
218 |
+
|
219 |
+
}
|
220 |
+
|
221 |
+
public function onepageSaveOrderAction()
|
222 |
+
{
|
223 |
+
if ($this->_expireAjax()) {
|
224 |
+
return;
|
225 |
+
}
|
226 |
+
|
227 |
+
$paymentMethod = $this->getOnepage()->getQuote()->getPayment()->getMethod();
|
228 |
+
|
229 |
+
if((FALSE === strstr(parse_url($this->_getRefererUrl(), PHP_URL_PATH), 'onestepcheckout')) && is_null($this->getRequest()->getPost('billing'))){ // Not OSC, OSC validates T&C with JS and has it own T&C
|
230 |
+
# Validate checkout Terms and Conditions
|
231 |
+
$result = array();
|
232 |
+
if ($requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds()) {
|
233 |
+
$postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
|
234 |
+
if ($diff = array_diff($requiredAgreements, $postedAgreements)) {
|
235 |
+
$result['success'] = false;
|
236 |
+
$result['response_status'] = 'ERROR';
|
237 |
+
$result['response_status_detail'] = $this->__('Please agree to all the terms and conditions before placing the order.');
|
238 |
+
$this->getResponse()->setBody(Zend_Json::encode($result));
|
239 |
+
return;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
# Validate checkout Terms and Conditions
|
243 |
+
}else{
|
244 |
+
|
245 |
+
/** * OSC */
|
246 |
+
if(FALSE !== Mage::getConfig()->getNode('modules/Idev_OneStepCheckout')){
|
247 |
+
$this->_OSCSaveBilling();
|
248 |
+
}elseif(FALSE !== Mage::getConfig()->getNode('modules/Abserve_Onestepcheckout')){
|
249 |
+
$this->_MAGESTORESaveBilling();
|
250 |
+
}
|
251 |
+
/*** OSC */
|
252 |
+
}
|
253 |
+
$paymentData = $this->getRequest()->getPost('payment', array());
|
254 |
+
if ($paymentData) {
|
255 |
+
//Sanitize payment data
|
256 |
+
array_walk($paymentData, array($this, "sanitize_string"));
|
257 |
+
$this->getOnepage()->getQuote()->getPayment()->importData($paymentData);
|
258 |
+
}
|
259 |
+
|
260 |
+
if($dataM = $this->getRequest()->getPost('shipping_method', '')){
|
261 |
+
$this->getOnepage()->saveShippingMethod($this->sanitize_string($dataM));
|
262 |
+
}
|
263 |
+
|
264 |
+
if($paymentMethod == 'sagepayserver'){
|
265 |
+
$this->_forward('saveOrder', 'serverPayment', 'sgps', $this->getRequest()->getParams());
|
266 |
+
return;
|
267 |
+
}else if($paymentMethod == 'sagepaydirectpro'){
|
268 |
+
$this->_forward('saveOrder', 'directPayment', 'sgps', $this->getRequest()->getParams());
|
269 |
+
return;
|
270 |
+
}else if($paymentMethod == 'sagepayform'){
|
271 |
+
$this->_forward('saveOrder', 'formPayment', 'sgps', $this->getRequest()->getParams());
|
272 |
+
return;
|
273 |
+
}else{
|
274 |
+
$this->_forward('saveOrder', 'onepage', 'checkout', $this->getRequest()->getParams());
|
275 |
+
return;
|
276 |
+
}
|
277 |
+
|
278 |
+
}
|
279 |
+
|
280 |
+
public function setIgnoreValidation() {
|
281 |
+
$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);
|
282 |
+
$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);
|
283 |
+
}
|
284 |
+
}
|
app/code/community/Abserve/Onestepcheckout/etc/adminhtml.xml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<menu>
|
13 |
+
<settings module="settings">
|
14 |
+
<children>
|
15 |
+
<onestepcheckout module="onestepcheckout">
|
16 |
+
<title>Onestepcheckout</title>
|
17 |
+
<sort_order>4</sort_order>
|
18 |
+
<action>adminhtml/system_config/edit/section/onestepcheckout</action>
|
19 |
+
</onestepcheckout>
|
20 |
+
</children>
|
21 |
+
</settings>
|
22 |
+
</menu>
|
23 |
+
<acl>
|
24 |
+
<resources>
|
25 |
+
<all>
|
26 |
+
<title>Allow Everything</title>
|
27 |
+
</all>
|
28 |
+
<admin>
|
29 |
+
<children>
|
30 |
+
<system>
|
31 |
+
<children>
|
32 |
+
<config>
|
33 |
+
<children>
|
34 |
+
<onestepcheckout translate="title" >
|
35 |
+
<title>Abserve</title>
|
36 |
+
<sort_order>50</sort_order>
|
37 |
+
</onestepcheckout>
|
38 |
+
</children>
|
39 |
+
</config>
|
40 |
+
</children>
|
41 |
+
</system>
|
42 |
+
<onestepcheckout module="onestepcheckout" translate="title">
|
43 |
+
<title>Onestepcheckout</title>
|
44 |
+
<sort_order>71</sort_order>
|
45 |
+
<children>
|
46 |
+
<!-- <country module="onestepcheckout" translate="title">
|
47 |
+
<title>Update GeoIP Database</title>
|
48 |
+
<sort_order>0</sort_order>
|
49 |
+
<action>onestepcheckoutadmin/adminhtml_geoip</action>
|
50 |
+
</country>
|
51 |
+
<geoip module="onestepcheckout" translate="title">
|
52 |
+
<title>Update Country Postcode Database</title>
|
53 |
+
<sort_order>10</sort_order>
|
54 |
+
<action>onestepcheckoutadmin/adminhtml_country</action>
|
55 |
+
</geoip> -->
|
56 |
+
<settings module="onestepcheckout" translate="title">
|
57 |
+
<title>Settings</title>
|
58 |
+
<sort_order>1000</sort_order>
|
59 |
+
</settings>
|
60 |
+
</children>
|
61 |
+
</onestepcheckout>
|
62 |
+
</children>
|
63 |
+
</admin>
|
64 |
+
</resources>
|
65 |
+
</acl>
|
66 |
+
<translate>
|
67 |
+
<modules>
|
68 |
+
<Abserve_Onestepcheckout>
|
69 |
+
<files>
|
70 |
+
<default>Abserve_Onestepcheckout.csv</default>
|
71 |
+
</files>
|
72 |
+
</Abserve_Onestepcheckout>
|
73 |
+
</modules>
|
74 |
+
</translate>
|
75 |
+
</config>
|
app/code/community/Abserve/Onestepcheckout/etc/config.xml
ADDED
@@ -0,0 +1,452 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_Onestepcheckout>
|
14 |
+
<version>3.1.0</version>
|
15 |
+
</Abserve_Onestepcheckout>
|
16 |
+
</modules>
|
17 |
+
<frontend>
|
18 |
+
<secure_url>
|
19 |
+
<onestepcheckout>/onestepcheckout/</onestepcheckout>
|
20 |
+
</secure_url>
|
21 |
+
<routers>
|
22 |
+
<onestepcheckout>
|
23 |
+
<use>standard</use>
|
24 |
+
<args>
|
25 |
+
<module>Abserve_Onestepcheckout</module>
|
26 |
+
<frontName>onestepcheckout</frontName>
|
27 |
+
</args>
|
28 |
+
</onestepcheckout>
|
29 |
+
</routers>
|
30 |
+
<translate>
|
31 |
+
<modules>
|
32 |
+
<Abserve_Onestepcheckout>
|
33 |
+
<files>
|
34 |
+
<default>Abserve_Onestepcheckout.csv</default>
|
35 |
+
</files>
|
36 |
+
</Abserve_Onestepcheckout>
|
37 |
+
</modules>
|
38 |
+
</translate>
|
39 |
+
<layout>
|
40 |
+
<updates>
|
41 |
+
<onestepcheckout>
|
42 |
+
<file>onestepcheckout.xml</file>
|
43 |
+
</onestepcheckout>
|
44 |
+
</updates>
|
45 |
+
</layout>
|
46 |
+
<events>
|
47 |
+
<sales_order_place_after>
|
48 |
+
<observers>
|
49 |
+
<abserve_onestepcheckout_observer>
|
50 |
+
<type>singleton</type>
|
51 |
+
<class>onestepcheckout/observer</class>
|
52 |
+
<method>orderPlaceAfter</method>
|
53 |
+
</abserve_onestepcheckout_observer>
|
54 |
+
</observers>
|
55 |
+
</sales_order_place_after>
|
56 |
+
<paypal_prepare_line_items>
|
57 |
+
<observers>
|
58 |
+
<abserve_onstepcheckout_paypal_prepare_line_items>
|
59 |
+
<type>singleton</type>
|
60 |
+
<class>onestepcheckout/giftwrap</class>
|
61 |
+
<method>paypal_prepare_line_items</method>
|
62 |
+
</abserve_onstepcheckout_paypal_prepare_line_items>
|
63 |
+
</observers>
|
64 |
+
</paypal_prepare_line_items>
|
65 |
+
</events>
|
66 |
+
</frontend>
|
67 |
+
<admin>
|
68 |
+
<routers>
|
69 |
+
<onestepcheckoutadmin>
|
70 |
+
<use>admin</use>
|
71 |
+
<args>
|
72 |
+
<module>Abserve_Onestepcheckout</module>
|
73 |
+
<frontName>onestepcheckoutadmin</frontName>
|
74 |
+
</args>
|
75 |
+
</onestepcheckoutadmin>
|
76 |
+
</routers>
|
77 |
+
</admin>
|
78 |
+
<adminhtml>
|
79 |
+
<layout>
|
80 |
+
<updates>
|
81 |
+
<onestepcheckout>
|
82 |
+
<file>onestepcheckout.xml</file>
|
83 |
+
</onestepcheckout>
|
84 |
+
</updates>
|
85 |
+
</layout>
|
86 |
+
<events>
|
87 |
+
<controller_action_predispatch_adminhtml>
|
88 |
+
<observers>
|
89 |
+
<abserve_onestepcheckout_observer>
|
90 |
+
<type>singleton</type>
|
91 |
+
<class>onestepcheckout/observer</class>
|
92 |
+
<method>controller_action_predispatch_adminhtml</method>
|
93 |
+
</abserve_onestepcheckout_observer>
|
94 |
+
</observers>
|
95 |
+
</controller_action_predispatch_adminhtml>
|
96 |
+
<admin_system_config_changed_section_onestepcheckout>
|
97 |
+
<observers>
|
98 |
+
<onestepcheckout>
|
99 |
+
<type>singleton</type>
|
100 |
+
<class>onestepcheckout/observer</class>
|
101 |
+
<method>changeFieldPosition</method>
|
102 |
+
</onestepcheckout>
|
103 |
+
</observers>
|
104 |
+
</admin_system_config_changed_section_onestepcheckout>
|
105 |
+
</events>
|
106 |
+
<blocks>
|
107 |
+
<adminhtml>
|
108 |
+
<rewrite>
|
109 |
+
<system_config_edit>Abserve_Onestepcheckout_Block_Adminhtml_Config_Edit</system_config_edit>
|
110 |
+
</rewrite>
|
111 |
+
</adminhtml>
|
112 |
+
</blocks>
|
113 |
+
</adminhtml>
|
114 |
+
<global>
|
115 |
+
<routers>
|
116 |
+
<sagepaysuite>
|
117 |
+
<rewrite>
|
118 |
+
<payment>
|
119 |
+
<to>onestepcheckout/payment</to>
|
120 |
+
<override_actions>true</override_actions>
|
121 |
+
<actions>
|
122 |
+
<onepageSaveOrder>
|
123 |
+
<to>onestepcheckout/payment/onepageSaveOrder</to>
|
124 |
+
</onepageSaveOrder>
|
125 |
+
</actions>
|
126 |
+
</payment>
|
127 |
+
</rewrite>
|
128 |
+
</sagepaysuite>
|
129 |
+
</routers>
|
130 |
+
<models>
|
131 |
+
<onestepcheckout>
|
132 |
+
<class>Abserve_Onestepcheckout_Model</class>
|
133 |
+
<resourceModel>onestepcheckout_mysql4</resourceModel>
|
134 |
+
</onestepcheckout>
|
135 |
+
<onestepcheckout_mysql4>
|
136 |
+
<class>Abserve_Onestepcheckout_Model_Mysql4</class>
|
137 |
+
<entities>
|
138 |
+
<onestepcheckout>
|
139 |
+
<table>onestepcheckout</table>
|
140 |
+
</onestepcheckout>
|
141 |
+
<config>
|
142 |
+
<table>onestepcheckout_config_data</table>
|
143 |
+
</config>
|
144 |
+
<survey>
|
145 |
+
<table>onestepcheckout_survey</table>
|
146 |
+
</survey>
|
147 |
+
<delivery>
|
148 |
+
<table>onestepcheckout_delivery</table>
|
149 |
+
</delivery>
|
150 |
+
<geoip>
|
151 |
+
<table>geoip</table>
|
152 |
+
</geoip>
|
153 |
+
<country>
|
154 |
+
<table>geoip_country</table>
|
155 |
+
</country>
|
156 |
+
<countrylist>
|
157 |
+
<table>geoip_countrylist</table>
|
158 |
+
</countrylist>
|
159 |
+
</entities>
|
160 |
+
</onestepcheckout_mysql4>
|
161 |
+
<customer>
|
162 |
+
<rewrite>
|
163 |
+
<form>Abserve_Onestepcheckout_Model_Customer_Form</form>
|
164 |
+
<customer>Abserve_Onestepcheckout_Model_Customer_Customer</customer>
|
165 |
+
</rewrite>
|
166 |
+
</customer>
|
167 |
+
</models>
|
168 |
+
<resources>
|
169 |
+
<onestepcheckout_setup>
|
170 |
+
<setup>
|
171 |
+
<module>Abserve_Onestepcheckout</module>
|
172 |
+
</setup>
|
173 |
+
<connection>
|
174 |
+
<use>core_setup</use>
|
175 |
+
</connection>
|
176 |
+
</onestepcheckout_setup>
|
177 |
+
<onestepcheckout_write>
|
178 |
+
<connection>
|
179 |
+
<use>core_write</use>
|
180 |
+
</connection>
|
181 |
+
</onestepcheckout_write>
|
182 |
+
<onestepcheckout_read>
|
183 |
+
<connection>
|
184 |
+
<use>core_read</use>
|
185 |
+
</connection>
|
186 |
+
</onestepcheckout_read>
|
187 |
+
</resources>
|
188 |
+
<blocks>
|
189 |
+
<onestepcheckout>
|
190 |
+
<class>Abserve_Onestepcheckout_Block</class>
|
191 |
+
</onestepcheckout>
|
192 |
+
<adminhtml>
|
193 |
+
<rewrite>
|
194 |
+
<system_config_edit>Abserve_Onestepcheckout_Block_Adminhtml_Config_Edit</system_config_edit>
|
195 |
+
</rewrite>
|
196 |
+
</adminhtml>
|
197 |
+
<checkout>
|
198 |
+
<rewrite>
|
199 |
+
<onepage_link>Abserve_Onestepcheckout_Block_Onepage_Link</onepage_link>
|
200 |
+
<links>Abserve_Onestepcheckout_Block_Checkout_Links</links>
|
201 |
+
</rewrite>
|
202 |
+
</checkout>
|
203 |
+
</blocks>
|
204 |
+
<helpers>
|
205 |
+
<onestepcheckout>
|
206 |
+
<class>Abserve_Onestepcheckout_Helper</class>
|
207 |
+
</onestepcheckout>
|
208 |
+
<checkout>
|
209 |
+
<rewrite>
|
210 |
+
<url>Abserve_Onestepcheckout_Helper_Rewrite_Checkout_Url</url>
|
211 |
+
</rewrite>
|
212 |
+
</checkout>
|
213 |
+
</helpers>
|
214 |
+
<events>
|
215 |
+
<controller_action_predispatch_checkout_onepage_index>
|
216 |
+
<observers>
|
217 |
+
<abserve_onestepcheckout_observer>
|
218 |
+
<type>singleton</type>
|
219 |
+
<class>onestepcheckout/observer</class>
|
220 |
+
<method>initController</method>
|
221 |
+
</abserve_onestepcheckout_observer>
|
222 |
+
</observers>
|
223 |
+
</controller_action_predispatch_checkout_onepage_index>
|
224 |
+
<checkout_cart_add_product_complete>
|
225 |
+
<observers>
|
226 |
+
<checkout_cart_index>
|
227 |
+
<type>singleton</type>
|
228 |
+
<class>onestepcheckout/observer</class>
|
229 |
+
<method>initCartController</method>
|
230 |
+
</checkout_cart_index>
|
231 |
+
</observers>
|
232 |
+
</checkout_cart_add_product_complete>
|
233 |
+
<controller_action_predispatch_checkout_cart_index>
|
234 |
+
<observers>
|
235 |
+
<abserve_onestepcheckout_observer>
|
236 |
+
<type>singleton</type>
|
237 |
+
<class>onestepcheckout/observer</class>
|
238 |
+
<method>controllerActionPredispatchCheckoutCartIndex</method>
|
239 |
+
</abserve_onestepcheckout_observer>
|
240 |
+
</observers>
|
241 |
+
</controller_action_predispatch_checkout_cart_index>
|
242 |
+
<controller_action_predispatch_icepay_processing_result>
|
243 |
+
<observers>
|
244 |
+
<abserve_onestepcheckout_observer>
|
245 |
+
<type>singleton</type>
|
246 |
+
<class>onestepcheckout/observer</class>
|
247 |
+
<method>controllerActionPredispatchIcepayProcessingResult</method>
|
248 |
+
</abserve_onestepcheckout_observer>
|
249 |
+
</observers>
|
250 |
+
</controller_action_predispatch_icepay_processing_result>
|
251 |
+
<controller_action_predispatch_wirecard_checkout_page_processing_checkresponse>
|
252 |
+
<observers>
|
253 |
+
<abserve_onestepcheckout_observer>
|
254 |
+
<type>singleton</type>
|
255 |
+
<class>onestepcheckout/observer</class>
|
256 |
+
<method>controllerActionPredispatchWirecardCheckoutPageProcessingCheckresponse</method>
|
257 |
+
</abserve_onestepcheckout_observer>
|
258 |
+
</observers>
|
259 |
+
</controller_action_predispatch_wirecard_checkout_page_processing_checkresponse>
|
260 |
+
<controller_action_predispatch_onestepcheckout_index_index>
|
261 |
+
<observers>
|
262 |
+
<abserve_onestepcheckout_observer>
|
263 |
+
<type>singleton</type>
|
264 |
+
<class>onestepcheckout/observer</class>
|
265 |
+
<method>controllerActionPredispatchOnestepcheckoutIndex</method>
|
266 |
+
</abserve_onestepcheckout_observer>
|
267 |
+
</observers>
|
268 |
+
</controller_action_predispatch_onestepcheckout_index_index>
|
269 |
+
<checkout_type_onepage_save_order>
|
270 |
+
<observers>
|
271 |
+
<abserve_onestepcheckout_observer>
|
272 |
+
<type>model</type>
|
273 |
+
<class>Abserve_Onestepcheckout_Helper_Data</class>
|
274 |
+
<method>saveOrderComment</method>
|
275 |
+
</abserve_onestepcheckout_observer>
|
276 |
+
</observers>
|
277 |
+
</checkout_type_onepage_save_order>
|
278 |
+
<checkout_type_onepage_save_order_after>
|
279 |
+
<observers>
|
280 |
+
<abserve_onestepcheckout_observer>
|
281 |
+
<type>singleton</type>
|
282 |
+
<class>onestepcheckout/observer</class>
|
283 |
+
<method>notifyAdmin</method>
|
284 |
+
</abserve_onestepcheckout_observer>
|
285 |
+
</observers>
|
286 |
+
</checkout_type_onepage_save_order_after>
|
287 |
+
</events>
|
288 |
+
<template>
|
289 |
+
<email>
|
290 |
+
<onestepcheckout_order_notification_template translate="label" module="onestepcheckout">
|
291 |
+
<label>New Order Notification</label>
|
292 |
+
<file>sales/new_order_notification.html</file>
|
293 |
+
<type>html</type>
|
294 |
+
</onestepcheckout_order_notification_template>
|
295 |
+
</email>
|
296 |
+
</template>
|
297 |
+
<sales>
|
298 |
+
<quote>
|
299 |
+
<totals>
|
300 |
+
<giftwrap>
|
301 |
+
<class>onestepcheckout/sales_quote_address_total_giftwrap</class>
|
302 |
+
<after>wee,discount,tax,tax_subtotal,grand_total</after>
|
303 |
+
</giftwrap>
|
304 |
+
</totals>
|
305 |
+
</quote>
|
306 |
+
<order_invoice>
|
307 |
+
<totals>
|
308 |
+
<giftwrap>
|
309 |
+
<class>onestepcheckout/sales_order_invoice_total_giftwrap</class>
|
310 |
+
</giftwrap>
|
311 |
+
</totals>
|
312 |
+
</order_invoice>
|
313 |
+
<order_creditmemo>
|
314 |
+
<totals>
|
315 |
+
<giftwrap>
|
316 |
+
<class>onestepcheckout/sales_order_creditmemo_total_giftwrap</class>
|
317 |
+
</giftwrap>
|
318 |
+
</totals>
|
319 |
+
</order_creditmemo>
|
320 |
+
</sales>
|
321 |
+
<fieldsets>
|
322 |
+
<sales_convert_quote_address>
|
323 |
+
<onestepcheckout_giftwrap_amount>
|
324 |
+
<to_order>*</to_order>
|
325 |
+
</onestepcheckout_giftwrap_amount>
|
326 |
+
</sales_convert_quote_address>
|
327 |
+
<sales_convert_quote_address>
|
328 |
+
<onestepcheckout_order_comment>
|
329 |
+
<to_order>*</to_order>
|
330 |
+
</onestepcheckout_order_comment>
|
331 |
+
</sales_convert_quote_address>
|
332 |
+
</fieldsets>
|
333 |
+
<pdf>
|
334 |
+
<totals>
|
335 |
+
<giftwrap translate="title">
|
336 |
+
<title>Giftwrap</title>
|
337 |
+
<source_field>giftwrap_amount</source_field>
|
338 |
+
<model>onestepcheckout/order_pdf_amount</model>
|
339 |
+
<font_size>7</font_size>
|
340 |
+
<display_zero>0</display_zero>
|
341 |
+
<sort_order>450</sort_order>
|
342 |
+
</giftwrap>
|
343 |
+
</totals>
|
344 |
+
</pdf>
|
345 |
+
</global>
|
346 |
+
<default>
|
347 |
+
<onestepcheckout>
|
348 |
+
<general>
|
349 |
+
<active>1</active>
|
350 |
+
<show_shipping_address>1</show_shipping_address>
|
351 |
+
<country_id>US</country_id>
|
352 |
+
<postcode>90034</postcode>
|
353 |
+
<region_id>12</region_id>
|
354 |
+
<use_for_disabled_fields>1</use_for_disabled_fields>
|
355 |
+
<checkout_title>One step checkout</checkout_title>
|
356 |
+
<checkout_description>Please fill in the fields below and click Place order to complete your purchase!</checkout_description>
|
357 |
+
<page_layout>3columns</page_layout>
|
358 |
+
</general>
|
359 |
+
<field_management>
|
360 |
+
<show_city>1</show_city>
|
361 |
+
<show_zipcode>1</show_zipcode>
|
362 |
+
<show_company>0</show_company>
|
363 |
+
<show_fax>0</show_fax>
|
364 |
+
<show_telephone>1</show_telephone>
|
365 |
+
<show_region>1</show_region>
|
366 |
+
<show_comment>0</show_comment>
|
367 |
+
<show_newsletter>0</show_newsletter>
|
368 |
+
<show_discount>0</show_discount>
|
369 |
+
<redirect_to_checkout>0</redirect_to_checkout>
|
370 |
+
<suggest_address>0</suggest_address>
|
371 |
+
<enable_giftmessage>0</enable_giftmessage>
|
372 |
+
</field_management>
|
373 |
+
<field_position_management>
|
374 |
+
<position>test</position>
|
375 |
+
<row_0>firstname</row_0>
|
376 |
+
<row_1>lastname</row_1>
|
377 |
+
<row_2>email</row_2>
|
378 |
+
<row_3>telephone</row_3>
|
379 |
+
<row_4>street</row_4>
|
380 |
+
<row_5>0</row_5>
|
381 |
+
<row_6>country</row_6>
|
382 |
+
<row_7>0</row_7>
|
383 |
+
<row_8>city</row_8>
|
384 |
+
<row_9>0</row_9>
|
385 |
+
<row_10>postcode</row_10>
|
386 |
+
<row_11>region</row_11>
|
387 |
+
<row_12>company</row_12>
|
388 |
+
<row_13>fax</row_13>
|
389 |
+
<row_14>0</row_14>
|
390 |
+
</field_position_management>
|
391 |
+
<field_require_management>
|
392 |
+
<firstname>1</firstname>
|
393 |
+
<lastname>1</lastname>
|
394 |
+
<email>1</email>
|
395 |
+
<company>0</company>
|
396 |
+
<street>1</street>
|
397 |
+
<country>1</country>
|
398 |
+
<region>0</region>
|
399 |
+
<city>1</city>
|
400 |
+
<postcode>1</postcode>
|
401 |
+
<telephone>1</telephone>
|
402 |
+
<fax>0</fax>
|
403 |
+
</field_require_management>
|
404 |
+
<checkout_mode>
|
405 |
+
<show_login_link>1</show_login_link>
|
406 |
+
<enable_registration>1</enable_registration>
|
407 |
+
<allow_guest>1</allow_guest>
|
408 |
+
<login_link_title>Already have an account? Click here to login</login_link_title>
|
409 |
+
</checkout_mode>
|
410 |
+
<ajax_update>
|
411 |
+
<enable_ajax>1</enable_ajax>
|
412 |
+
<ajax_fields>country,postcode,state/region,city</ajax_fields>
|
413 |
+
<update_payment>1</update_payment>
|
414 |
+
<reload_payment>1</reload_payment>
|
415 |
+
|
416 |
+
<address_shipping>1</address_shipping>
|
417 |
+
<address_payment>0</address_payment>
|
418 |
+
<address_review>1</address_review>
|
419 |
+
|
420 |
+
<shipping_payment>0</shipping_payment>
|
421 |
+
<shipping_review>1</shipping_review>
|
422 |
+
|
423 |
+
<payment_review>0</payment_review>
|
424 |
+
</ajax_update>
|
425 |
+
<terms_conditions>
|
426 |
+
<enable_terms>0</enable_terms>
|
427 |
+
<term_width>400</term_width>
|
428 |
+
<term_height>250</term_height>
|
429 |
+
</terms_conditions>
|
430 |
+
<order_notification>
|
431 |
+
<enable_notification>0</enable_notification>
|
432 |
+
<template>onestepcheckout_order_notification_template</template>
|
433 |
+
</order_notification>
|
434 |
+
<geoip>
|
435 |
+
<enable>0</enable>
|
436 |
+
<!-- <postcode_characters>3</postcode_characters>
|
437 |
+
<city_characters>3</city_characters>
|
438 |
+
<rows>100</rows> -->
|
439 |
+
</geoip>
|
440 |
+
</onestepcheckout>
|
441 |
+
</default>
|
442 |
+
<!-- <websites>
|
443 |
+
<admin>
|
444 |
+
<dev>
|
445 |
+
<debug>
|
446 |
+
<template_hints>1</template_hints>
|
447 |
+
<template_hints_blocks>1</template_hints_blocks>
|
448 |
+
</debug>
|
449 |
+
</dev>
|
450 |
+
</admin>
|
451 |
+
</websites> -->
|
452 |
+
</config>
|
app/code/community/Abserve/Onestepcheckout/etc/system.xml
ADDED
@@ -0,0 +1,957 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<tabs>
|
13 |
+
<abserve translate="label">
|
14 |
+
<label>Abserve Extension</label>
|
15 |
+
<sort_order>400</sort_order>
|
16 |
+
</abserve>
|
17 |
+
</tabs>
|
18 |
+
<sections>
|
19 |
+
<onestepcheckout translate="label" module="onestepcheckout">
|
20 |
+
<class>separator-top</class>
|
21 |
+
<label>One Step Checkout</label>
|
22 |
+
<tab>settings</tab>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>300</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<groups>
|
29 |
+
<general translate="label">
|
30 |
+
<label>General Configuration</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<fields>
|
37 |
+
<general_configuration_separator translate="label comment">
|
38 |
+
<label>General</label>
|
39 |
+
<frontend_type>label</frontend_type>
|
40 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
41 |
+
<margin_top>10px</margin_top>
|
42 |
+
<sort_order>10</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<comment></comment>
|
47 |
+
</general_configuration_separator>
|
48 |
+
<active translate="label">
|
49 |
+
<label>Enable One Step Checkout</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
52 |
+
<sort_order>20</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
</active>
|
57 |
+
<show_shipping_address translate="label">
|
58 |
+
<label>Enable shipping to different address</label>
|
59 |
+
<frontend_type>select</frontend_type>
|
60 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
61 |
+
<sort_order>30</sort_order>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>1</show_in_store>
|
65 |
+
<comment><![CDATA[For Customers that have shipping address different from billing address]]>
|
66 |
+
</comment>
|
67 |
+
</show_shipping_address>
|
68 |
+
<delivery_time_date translate="label">
|
69 |
+
<label>Enable Delivery time and date</label>
|
70 |
+
<frontend_type>select</frontend_type>
|
71 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
72 |
+
<sort_order>31</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
</delivery_time_date>
|
77 |
+
<redirect_to_checkout translate="label">
|
78 |
+
<label>Redirect to checkout automatically after adding product to cart</label>
|
79 |
+
<frontend_type>select</frontend_type>
|
80 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
81 |
+
<sort_order>32</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>1</show_in_store>
|
85 |
+
</redirect_to_checkout>
|
86 |
+
<suggest_address translate="label">
|
87 |
+
<label>Enable suggesting address by Google</label>
|
88 |
+
<frontend_type>select</frontend_type>
|
89 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
90 |
+
<sort_order>33</sort_order>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>1</show_in_store>
|
94 |
+
</suggest_address>
|
95 |
+
<!--<reload_shipping translate="label">
|
96 |
+
<label>Reload Shipping Method when address change</label>
|
97 |
+
<frontend_type>select</frontend_type>
|
98 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
99 |
+
<sort_order>3</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
+
</reload_shipping>-->
|
104 |
+
<defaultinfo_configuration_separator translate="label comment">
|
105 |
+
<label>Default Information</label>
|
106 |
+
<frontend_type>label</frontend_type>
|
107 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
108 |
+
<margin_top>10px</margin_top>
|
109 |
+
<sort_order>40</sort_order>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>1</show_in_store>
|
113 |
+
<comment></comment>
|
114 |
+
</defaultinfo_configuration_separator>
|
115 |
+
<default_payment translate="label">
|
116 |
+
<label>Default Payment Method</label>
|
117 |
+
<frontend_type>select</frontend_type>
|
118 |
+
<source_model>onestepcheckout/source_payment</source_model>
|
119 |
+
<sort_order>50</sort_order>
|
120 |
+
<show_in_default>1</show_in_default>
|
121 |
+
<show_in_website>1</show_in_website>
|
122 |
+
<show_in_store>1</show_in_store>
|
123 |
+
</default_payment>
|
124 |
+
<default_shipping translate="label">
|
125 |
+
<label>Default Shipping Method</label>
|
126 |
+
<frontend_type>select</frontend_type>
|
127 |
+
<source_model>onestepcheckout/source_shipping</source_model>
|
128 |
+
<sort_order>60</sort_order>
|
129 |
+
<show_in_default>1</show_in_default>
|
130 |
+
<show_in_website>1</show_in_website>
|
131 |
+
<show_in_store>1</show_in_store>
|
132 |
+
</default_shipping>
|
133 |
+
<country_id translate="label">
|
134 |
+
<label>Default country</label>
|
135 |
+
<frontend_type>select</frontend_type>
|
136 |
+
<frontend_class>countries</frontend_class>
|
137 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
138 |
+
<sort_order>70</sort_order>
|
139 |
+
<show_in_default>1</show_in_default>
|
140 |
+
<show_in_website>1</show_in_website>
|
141 |
+
<show_in_store>1</show_in_store>
|
142 |
+
</country_id>
|
143 |
+
<region_id translate="label">
|
144 |
+
<label>Default region/state</label>
|
145 |
+
<frontend_type>text</frontend_type>
|
146 |
+
<sort_order>80</sort_order>
|
147 |
+
<show_in_default>1</show_in_default>
|
148 |
+
<show_in_website>1</show_in_website>
|
149 |
+
<show_in_store>1</show_in_store>
|
150 |
+
</region_id>
|
151 |
+
<postcode translate="label">
|
152 |
+
<label>Default zip/postal code</label>
|
153 |
+
<frontend_type>text</frontend_type>
|
154 |
+
<sort_order>90</sort_order>
|
155 |
+
<show_in_default>1</show_in_default>
|
156 |
+
<show_in_website>1</show_in_website>
|
157 |
+
<show_in_store>1</show_in_store>
|
158 |
+
</postcode>
|
159 |
+
<city translate="label">
|
160 |
+
<label>Default city</label>
|
161 |
+
<frontend_type>text</frontend_type>
|
162 |
+
<sort_order>100</sort_order>
|
163 |
+
<show_in_default>1</show_in_default>
|
164 |
+
<show_in_website>1</show_in_website>
|
165 |
+
<show_in_store>1</show_in_store>
|
166 |
+
</city>
|
167 |
+
<!-- <use_for_disabled_fields translate="label comment">
|
168 |
+
<label>Using default data for disabled fields</label>
|
169 |
+
<comment><![CDATA[Using default country, postcode, state, city for disabled fields]]></comment>
|
170 |
+
<frontend_type>select</frontend_type>
|
171 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
172 |
+
<sort_order>10</sort_order>
|
173 |
+
<show_in_default>1</show_in_default>
|
174 |
+
<show_in_website>1</show_in_website>
|
175 |
+
<show_in_store>1</show_in_store>
|
176 |
+
</use_for_disabled_fields> -->
|
177 |
+
|
178 |
+
<displayedfields_configuration_separator translate="label comment">
|
179 |
+
<label>Displayed Fields</label>
|
180 |
+
<frontend_type>label</frontend_type>
|
181 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
182 |
+
<margin_top>10px</margin_top>
|
183 |
+
<sort_order>110</sort_order>
|
184 |
+
<show_in_default>1</show_in_default>
|
185 |
+
<show_in_website>1</show_in_website>
|
186 |
+
<show_in_store>1</show_in_store>
|
187 |
+
<comment></comment>
|
188 |
+
</displayedfields_configuration_separator>
|
189 |
+
<checkout_title translate="label">
|
190 |
+
<label>Checkout title</label>
|
191 |
+
<frontend_type>text</frontend_type>
|
192 |
+
<sort_order>120</sort_order>
|
193 |
+
<show_in_default>1</show_in_default>
|
194 |
+
<show_in_website>1</show_in_website>
|
195 |
+
<show_in_store>1</show_in_store>
|
196 |
+
</checkout_title>
|
197 |
+
<checkout_description translate="label">
|
198 |
+
<label>Checkout description</label>
|
199 |
+
<frontend_type>textarea</frontend_type>
|
200 |
+
<sort_order>130</sort_order>
|
201 |
+
<show_in_default>1</show_in_default>
|
202 |
+
<show_in_website>1</show_in_website>
|
203 |
+
<show_in_store>1</show_in_store>
|
204 |
+
</checkout_description>
|
205 |
+
<hide_shipping_method transalte="label">
|
206 |
+
<label>Hide section Shipping Method if only one method is applicable</label>
|
207 |
+
<frontend_type>select</frontend_type>
|
208 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
209 |
+
<sort_order>140</sort_order>
|
210 |
+
<show_in_default>1</show_in_default>
|
211 |
+
<show_in_website>1</show_in_website>
|
212 |
+
<show_in_store>1</show_in_store>
|
213 |
+
</hide_shipping_method>
|
214 |
+
<show_comment translate="label">
|
215 |
+
<label>Enable adding comment to order</label>
|
216 |
+
<frontend_type>select</frontend_type>
|
217 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
218 |
+
<sort_order>150</sort_order>
|
219 |
+
<show_in_default>1</show_in_default>
|
220 |
+
<show_in_website>1</show_in_website>
|
221 |
+
<show_in_store>1</show_in_store>
|
222 |
+
</show_comment>
|
223 |
+
<show_newsletter translate="label">
|
224 |
+
<label>Show Newsletter checkbox</label>
|
225 |
+
<frontend_type>select</frontend_type>
|
226 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
227 |
+
<sort_order>160</sort_order>
|
228 |
+
<show_in_default>1</show_in_default>
|
229 |
+
<show_in_website>1</show_in_website>
|
230 |
+
<show_in_store>1</show_in_store>
|
231 |
+
</show_newsletter>
|
232 |
+
<newsletter_default_checked translate="label">
|
233 |
+
<label>Newsletter checkbox checked by default</label>
|
234 |
+
<frontend_type>select</frontend_type>
|
235 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
236 |
+
<sort_order>170</sort_order>
|
237 |
+
<show_in_default>1</show_in_default>
|
238 |
+
<show_in_website>1</show_in_website>
|
239 |
+
<show_in_store>1</show_in_store>
|
240 |
+
</newsletter_default_checked>
|
241 |
+
<show_discount translate="label">
|
242 |
+
<label>Show Discount Code section</label>
|
243 |
+
<frontend_type>select</frontend_type>
|
244 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
245 |
+
<sort_order>180</sort_order>
|
246 |
+
<show_in_default>1</show_in_default>
|
247 |
+
<show_in_website>1</show_in_website>
|
248 |
+
<show_in_store>1</show_in_store>
|
249 |
+
</show_discount>
|
250 |
+
<layout_configuration_separator translate="label comment">
|
251 |
+
<label>Layout</label>
|
252 |
+
<frontend_type>label</frontend_type>
|
253 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
254 |
+
<margin_top>10px</margin_top>
|
255 |
+
<sort_order>190</sort_order>
|
256 |
+
<show_in_default>1</show_in_default>
|
257 |
+
<show_in_website>1</show_in_website>
|
258 |
+
<show_in_store>1</show_in_store>
|
259 |
+
<comment></comment>
|
260 |
+
</layout_configuration_separator>
|
261 |
+
<page_layout translate="label">
|
262 |
+
<label>Checkout page layout</label>
|
263 |
+
<frontend_type>select</frontend_type>
|
264 |
+
<source_model>onestepcheckout/source_layout</source_model>
|
265 |
+
<sort_order>200</sort_order>
|
266 |
+
<show_in_default>1</show_in_default>
|
267 |
+
<show_in_website>1</show_in_website>
|
268 |
+
<show_in_store>1</show_in_store>
|
269 |
+
</page_layout>
|
270 |
+
</fields>
|
271 |
+
</general>
|
272 |
+
<field_position_management translate="label">
|
273 |
+
<label>Field Position Management</label>
|
274 |
+
<frontend_type>text</frontend_type>
|
275 |
+
<sort_order>2</sort_order>
|
276 |
+
<show_in_default>1</show_in_default>
|
277 |
+
<show_in_website>1</show_in_website>
|
278 |
+
<show_in_store>1</show_in_store>
|
279 |
+
<fields>
|
280 |
+
<position translate="label">
|
281 |
+
<label>Field Position Management</label>
|
282 |
+
<frontend_type>text</frontend_type>
|
283 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_field_position</frontend_model>
|
284 |
+
<sort_order>1</sort_order>
|
285 |
+
<show_in_default>1</show_in_default>
|
286 |
+
<show_in_website>1</show_in_website>
|
287 |
+
<show_in_store>1</show_in_store>
|
288 |
+
<comment></comment>
|
289 |
+
</position>
|
290 |
+
</fields>
|
291 |
+
</field_position_management>
|
292 |
+
<field_require_management translate="label">
|
293 |
+
<label>Required Field Management</label>
|
294 |
+
<frontend_type>text</frontend_type>
|
295 |
+
<sort_order>3</sort_order>
|
296 |
+
<show_in_default>1</show_in_default>
|
297 |
+
<show_in_website>1</show_in_website>
|
298 |
+
<show_in_store>1</show_in_store>
|
299 |
+
<fields>
|
300 |
+
<company translate="label">
|
301 |
+
<label>Company</label>
|
302 |
+
<frontend_type>select</frontend_type>
|
303 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
304 |
+
<sort_order>4</sort_order>
|
305 |
+
<show_in_default>1</show_in_default>
|
306 |
+
<show_in_website>1</show_in_website>
|
307 |
+
<show_in_store>1</show_in_store>
|
308 |
+
</company>
|
309 |
+
<street translate="label">
|
310 |
+
<label>Address</label>
|
311 |
+
<frontend_type>select</frontend_type>
|
312 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
313 |
+
<sort_order>5</sort_order>
|
314 |
+
<show_in_default>1</show_in_default>
|
315 |
+
<show_in_website>1</show_in_website>
|
316 |
+
<show_in_store>1</show_in_store>
|
317 |
+
</street>
|
318 |
+
<country translate="label">
|
319 |
+
<label>Country</label>
|
320 |
+
<frontend_type>select</frontend_type>
|
321 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
322 |
+
<sort_order>6</sort_order>
|
323 |
+
<show_in_default>1</show_in_default>
|
324 |
+
<show_in_website>1</show_in_website>
|
325 |
+
<show_in_store>1</show_in_store>
|
326 |
+
</country>
|
327 |
+
<region translate="label">
|
328 |
+
<label>State/Province</label>
|
329 |
+
<frontend_type>select</frontend_type>
|
330 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
331 |
+
<sort_order>7</sort_order>
|
332 |
+
<show_in_default>1</show_in_default>
|
333 |
+
<show_in_website>1</show_in_website>
|
334 |
+
<show_in_store>1</show_in_store>
|
335 |
+
</region>
|
336 |
+
<city translate="label">
|
337 |
+
<label>City</label>
|
338 |
+
<frontend_type>select</frontend_type>
|
339 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
340 |
+
<sort_order>8</sort_order>
|
341 |
+
<show_in_default>1</show_in_default>
|
342 |
+
<show_in_website>1</show_in_website>
|
343 |
+
<show_in_store>1</show_in_store>
|
344 |
+
</city>
|
345 |
+
<postcode translate="label">
|
346 |
+
<label>Zip/Postal Code</label>
|
347 |
+
<frontend_type>select</frontend_type>
|
348 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
349 |
+
<sort_order>9</sort_order>
|
350 |
+
<show_in_default>1</show_in_default>
|
351 |
+
<show_in_website>1</show_in_website>
|
352 |
+
<show_in_store>1</show_in_store>
|
353 |
+
</postcode>
|
354 |
+
<telephone translate="label">
|
355 |
+
<label>Telephone</label>
|
356 |
+
<frontend_type>select</frontend_type>
|
357 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
358 |
+
<sort_order>10</sort_order>
|
359 |
+
<show_in_default>1</show_in_default>
|
360 |
+
<show_in_website>1</show_in_website>
|
361 |
+
<show_in_store>1</show_in_store>
|
362 |
+
</telephone>
|
363 |
+
<fax translate="label">
|
364 |
+
<label>Fax</label>
|
365 |
+
<frontend_type>select</frontend_type>
|
366 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
367 |
+
<sort_order>11</sort_order>
|
368 |
+
<show_in_default>1</show_in_default>
|
369 |
+
<show_in_website>1</show_in_website>
|
370 |
+
<show_in_store>1</show_in_store>
|
371 |
+
</fax>
|
372 |
+
<prefix translate="label">
|
373 |
+
<label>Prefix Name</label>
|
374 |
+
<frontend_type>select</frontend_type>
|
375 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
376 |
+
<sort_order>12</sort_order>
|
377 |
+
<show_in_default>1</show_in_default>
|
378 |
+
<show_in_website>1</show_in_website>
|
379 |
+
<show_in_store>1</show_in_store>
|
380 |
+
</prefix>
|
381 |
+
<middlename translate="label">
|
382 |
+
<label>Middle Name</label>
|
383 |
+
<frontend_type>select</frontend_type>
|
384 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
385 |
+
<sort_order>13</sort_order>
|
386 |
+
<show_in_default>1</show_in_default>
|
387 |
+
<show_in_website>1</show_in_website>
|
388 |
+
<show_in_store>1</show_in_store>
|
389 |
+
</middlename>
|
390 |
+
<suffix translate="label">
|
391 |
+
<label>Suffix Name</label>
|
392 |
+
<frontend_type>select</frontend_type>
|
393 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
394 |
+
<sort_order>14</sort_order>
|
395 |
+
<show_in_default>1</show_in_default>
|
396 |
+
<show_in_website>1</show_in_website>
|
397 |
+
<show_in_store>1</show_in_store>
|
398 |
+
</suffix>
|
399 |
+
<birthday translate="label">
|
400 |
+
<label>Date of Birth</label>
|
401 |
+
<frontend_type>select</frontend_type>
|
402 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
403 |
+
<sort_order>15</sort_order>
|
404 |
+
<show_in_default>1</show_in_default>
|
405 |
+
<show_in_website>1</show_in_website>
|
406 |
+
<show_in_store>1</show_in_store>
|
407 |
+
</birthday>
|
408 |
+
<gender translate="label">
|
409 |
+
<label>Gender</label>
|
410 |
+
<frontend_type>select</frontend_type>
|
411 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
412 |
+
<sort_order>16</sort_order>
|
413 |
+
<show_in_default>1</show_in_default>
|
414 |
+
<show_in_website>1</show_in_website>
|
415 |
+
<show_in_store>1</show_in_store>
|
416 |
+
</gender>
|
417 |
+
<taxvat translate="label">
|
418 |
+
<label>Tax/VAT number</label>
|
419 |
+
<frontend_type>select</frontend_type>
|
420 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
421 |
+
<sort_order>17</sort_order>
|
422 |
+
<show_in_default>1</show_in_default>
|
423 |
+
<show_in_website>1</show_in_website>
|
424 |
+
<show_in_store>1</show_in_store>
|
425 |
+
</taxvat>
|
426 |
+
</fields>
|
427 |
+
</field_require_management>
|
428 |
+
|
429 |
+
<checkout_mode translate="label">
|
430 |
+
<label>Checkout Mode</label>
|
431 |
+
<frontend_type>text</frontend_type>
|
432 |
+
<sort_order>4</sort_order>
|
433 |
+
<show_in_default>1</show_in_default>
|
434 |
+
<show_in_website>1</show_in_website>
|
435 |
+
<show_in_store>1</show_in_store>
|
436 |
+
<fields>
|
437 |
+
<show_login_link translate="label">
|
438 |
+
<label>Show Login Link</label>
|
439 |
+
<frontend_type>select</frontend_type>
|
440 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
441 |
+
<sort_order>1</sort_order>
|
442 |
+
<show_in_default>1</show_in_default>
|
443 |
+
<show_in_website>1</show_in_website>
|
444 |
+
<show_in_store>1</show_in_store>
|
445 |
+
</show_login_link>
|
446 |
+
<enable_registration translate="label">
|
447 |
+
<label>Enable Registration</label>
|
448 |
+
<frontend_type>select</frontend_type>
|
449 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
450 |
+
<sort_order>2</sort_order>
|
451 |
+
<show_in_default>1</show_in_default>
|
452 |
+
<show_in_website>1</show_in_website>
|
453 |
+
<show_in_store>1</show_in_store>
|
454 |
+
</enable_registration>
|
455 |
+
<allow_guest translate="label comment">
|
456 |
+
<label>Allow Guest Checkout</label>
|
457 |
+
<comment><![CDATA[if set to No, registration is required]]>
|
458 |
+
</comment>
|
459 |
+
<frontend_type>select</frontend_type>
|
460 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
461 |
+
<sort_order>3</sort_order>
|
462 |
+
<show_in_default>1</show_in_default>
|
463 |
+
<show_in_website>1</show_in_website>
|
464 |
+
<show_in_store>1</show_in_store>
|
465 |
+
</allow_guest>
|
466 |
+
<login_link_title translate="label comment">
|
467 |
+
<label>Login Message</label>
|
468 |
+
<frontend_type>textarea</frontend_type>
|
469 |
+
<sort_order>4</sort_order>
|
470 |
+
<show_in_default>1</show_in_default>
|
471 |
+
<show_in_website>1</show_in_website>
|
472 |
+
<show_in_store>1</show_in_store>
|
473 |
+
</login_link_title>
|
474 |
+
</fields>
|
475 |
+
</checkout_mode>
|
476 |
+
<ajax_update translate="label">
|
477 |
+
<label>Auto update Sections</label>
|
478 |
+
<frontend_type>text</frontend_type>
|
479 |
+
<sort_order>4</sort_order>
|
480 |
+
<show_in_default>1</show_in_default>
|
481 |
+
<show_in_website>1</show_in_website>
|
482 |
+
<show_in_store>1</show_in_store>
|
483 |
+
<fields>
|
484 |
+
|
485 |
+
<address_configuration_separator translate="label comment">
|
486 |
+
<label>Sections updated when changing in Address</label>
|
487 |
+
<frontend_type>label</frontend_type>
|
488 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
489 |
+
<margin_top>10px</margin_top>
|
490 |
+
<sort_order>10</sort_order>
|
491 |
+
<show_in_default>1</show_in_default>
|
492 |
+
<show_in_website>1</show_in_website>
|
493 |
+
<show_in_store>1</show_in_store>
|
494 |
+
<comment></comment>
|
495 |
+
</address_configuration_separator>
|
496 |
+
<enable_ajax translate="label">
|
497 |
+
<label>Auto update Sections following changes in Address</label>
|
498 |
+
<frontend_type>select</frontend_type>
|
499 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
500 |
+
<sort_order>11</sort_order>
|
501 |
+
<show_in_default>1</show_in_default>
|
502 |
+
<show_in_website>1</show_in_website>
|
503 |
+
<show_in_store>1</show_in_store>
|
504 |
+
<comment><![CDATA[Auto save address and update Sections]]>
|
505 |
+
</comment>
|
506 |
+
</enable_ajax>
|
507 |
+
<ajax_fields translate="label">
|
508 |
+
<label>Address fields triggered updating Sections</label>
|
509 |
+
<frontend_type>multiselect</frontend_type>
|
510 |
+
<source_model>onestepcheckout/source_ajaxbilling</source_model>
|
511 |
+
<sort_order>12</sort_order>
|
512 |
+
<show_in_default>1</show_in_default>
|
513 |
+
<show_in_website>1</show_in_website>
|
514 |
+
<show_in_store>1</show_in_store>
|
515 |
+
</ajax_fields>
|
516 |
+
<reload_payment translate="label">
|
517 |
+
<label>Reload Sections</label>
|
518 |
+
<frontend_type>select</frontend_type>
|
519 |
+
<source_model>onestepcheckout/source_reloadpayment</source_model>
|
520 |
+
<sort_order>13</sort_order>
|
521 |
+
<show_in_default>1</show_in_default>
|
522 |
+
<show_in_website>1</show_in_website>
|
523 |
+
<show_in_store>1</show_in_store>
|
524 |
+
</reload_payment>
|
525 |
+
<address_shipping translate="label">
|
526 |
+
<label>Update Shipping Method</label>
|
527 |
+
<frontend_type>select</frontend_type>
|
528 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
529 |
+
<sort_order>20</sort_order>
|
530 |
+
<show_in_default>1</show_in_default>
|
531 |
+
<show_in_website>1</show_in_website>
|
532 |
+
<show_in_store>1</show_in_store>
|
533 |
+
<comment></comment>
|
534 |
+
</address_shipping>
|
535 |
+
<address_payment translate="label">
|
536 |
+
<label>Update Payment Method</label>
|
537 |
+
<frontend_type>select</frontend_type>
|
538 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
539 |
+
<sort_order>30</sort_order>
|
540 |
+
<show_in_default>1</show_in_default>
|
541 |
+
<show_in_website>1</show_in_website>
|
542 |
+
<show_in_store>1</show_in_store>
|
543 |
+
<comment></comment>
|
544 |
+
</address_payment>
|
545 |
+
<address_review translate="label">
|
546 |
+
<label>Update Order Review</label>
|
547 |
+
<frontend_type>select</frontend_type>
|
548 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
549 |
+
<sort_order>40</sort_order>
|
550 |
+
<show_in_default>1</show_in_default>
|
551 |
+
<show_in_website>1</show_in_website>
|
552 |
+
<show_in_store>1</show_in_store>
|
553 |
+
<comment></comment>
|
554 |
+
</address_review>
|
555 |
+
|
556 |
+
|
557 |
+
<shipping_configuration_separator translate="label comment">
|
558 |
+
<label>Sections updated when changing in Shipping Method</label>
|
559 |
+
<frontend_type>label</frontend_type>
|
560 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
561 |
+
<margin_top>10px</margin_top>
|
562 |
+
<sort_order>60</sort_order>
|
563 |
+
<show_in_default>1</show_in_default>
|
564 |
+
<show_in_website>1</show_in_website>
|
565 |
+
<show_in_store>1</show_in_store>
|
566 |
+
<comment></comment>
|
567 |
+
</shipping_configuration_separator>
|
568 |
+
<shipping_payment translate="label">
|
569 |
+
<label>Update Payment Method</label>
|
570 |
+
<frontend_type>select</frontend_type>
|
571 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
572 |
+
<sort_order>70</sort_order>
|
573 |
+
<show_in_default>1</show_in_default>
|
574 |
+
<show_in_website>1</show_in_website>
|
575 |
+
<show_in_store>1</show_in_store>
|
576 |
+
<comment></comment>
|
577 |
+
</shipping_payment>
|
578 |
+
<shipping_review translate="label">
|
579 |
+
<label>Update Order Review</label>
|
580 |
+
<frontend_type>select</frontend_type>
|
581 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
582 |
+
<sort_order>80</sort_order>
|
583 |
+
<show_in_default>1</show_in_default>
|
584 |
+
<show_in_website>1</show_in_website>
|
585 |
+
<show_in_store>1</show_in_store>
|
586 |
+
<comment></comment>
|
587 |
+
</shipping_review>
|
588 |
+
|
589 |
+
<payment_configuration_separator translate="label comment">
|
590 |
+
<label>Sections updated when changing in Payment Method</label>
|
591 |
+
<frontend_type>label</frontend_type>
|
592 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_form_field_separator</frontend_model>
|
593 |
+
<margin_top>10px</margin_top>
|
594 |
+
<sort_order>110</sort_order>
|
595 |
+
<show_in_default>1</show_in_default>
|
596 |
+
<show_in_website>1</show_in_website>
|
597 |
+
<show_in_store>1</show_in_store>
|
598 |
+
<comment></comment>
|
599 |
+
</payment_configuration_separator>
|
600 |
+
<payment_review translate="label">
|
601 |
+
<label>Update Order Review</label>
|
602 |
+
<frontend_type>select</frontend_type>
|
603 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
604 |
+
<sort_order>120</sort_order>
|
605 |
+
<show_in_default>1</show_in_default>
|
606 |
+
<show_in_website>1</show_in_website>
|
607 |
+
<show_in_store>1</show_in_store>
|
608 |
+
<comment></comment>
|
609 |
+
</payment_review>
|
610 |
+
<!-- <update_payment translate="label">
|
611 |
+
<label>Enable updating payment method</label>
|
612 |
+
<frontend_type>select</frontend_type>
|
613 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
614 |
+
<sort_order>4</sort_order>
|
615 |
+
<show_in_default>1</show_in_default>
|
616 |
+
<show_in_website>1</show_in_website>
|
617 |
+
<show_in_store>1</show_in_store>
|
618 |
+
</update_payment>-->
|
619 |
+
</fields>
|
620 |
+
</ajax_update>
|
621 |
+
<terms_conditions translate="label">
|
622 |
+
<label>Terms and Conditions</label>
|
623 |
+
<frontend_type>text</frontend_type>
|
624 |
+
<sort_order>6</sort_order>
|
625 |
+
<show_in_default>1</show_in_default>
|
626 |
+
<show_in_website>1</show_in_website>
|
627 |
+
<show_in_store>1</show_in_store>
|
628 |
+
<fields>
|
629 |
+
<enable_terms translate="label">
|
630 |
+
<label>Show Terms and Conditions</label>
|
631 |
+
<frontend_type>select</frontend_type>
|
632 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
633 |
+
<sort_order>10</sort_order>
|
634 |
+
<show_in_default>1</show_in_default>
|
635 |
+
<show_in_website>1</show_in_website>
|
636 |
+
<show_in_store>1</show_in_store>
|
637 |
+
</enable_terms>
|
638 |
+
<term_title translate="label">
|
639 |
+
<label>Terms and Conditions Title</label>
|
640 |
+
<frontend_type>text</frontend_type>
|
641 |
+
<sort_order>20</sort_order>
|
642 |
+
<show_in_default>1</show_in_default>
|
643 |
+
<show_in_website>1</show_in_website>
|
644 |
+
<show_in_store>1</show_in_store>
|
645 |
+
</term_title>
|
646 |
+
<term_html translate="label">
|
647 |
+
<label>Terms and Conditions Content (HTML)</label>
|
648 |
+
<frontend_type>textarea</frontend_type>
|
649 |
+
<sort_order>30</sort_order>
|
650 |
+
<show_in_default>1</show_in_default>
|
651 |
+
<show_in_website>1</show_in_website>
|
652 |
+
<show_in_store>1</show_in_store>
|
653 |
+
</term_html>
|
654 |
+
<enable_custom_size translate="label">
|
655 |
+
<label>Enable custom size</label>
|
656 |
+
<frontend_type>select</frontend_type>
|
657 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
658 |
+
<comment><![CDATA[If enabled, allow adjusting the Terms and Conditions popup size.]]>
|
659 |
+
</comment>
|
660 |
+
<sort_order>35</sort_order>
|
661 |
+
<show_in_default>1</show_in_default>
|
662 |
+
<show_in_website>1</show_in_website>
|
663 |
+
<show_in_store>1</show_in_store>
|
664 |
+
</enable_custom_size>
|
665 |
+
<term_width translate="label comment">
|
666 |
+
<label>Width</label>
|
667 |
+
<comment><![CDATA[Width(px) of Terms and and Conditions popup]]>
|
668 |
+
</comment>
|
669 |
+
<frontend_type>text</frontend_type>
|
670 |
+
<sort_order>50</sort_order>
|
671 |
+
<show_in_default>1</show_in_default>
|
672 |
+
<show_in_website>1</show_in_website>
|
673 |
+
<show_in_store>1</show_in_store>
|
674 |
+
<depends>
|
675 |
+
<enable_custom_size>1</enable_custom_size>
|
676 |
+
</depends>
|
677 |
+
</term_width>
|
678 |
+
<term_height translate="label comment">
|
679 |
+
<label>Height</label>
|
680 |
+
<comment><![CDATA[Height(px) of Terms and and Conditions popup]]>
|
681 |
+
</comment>
|
682 |
+
<frontend_type>text</frontend_type>
|
683 |
+
<sort_order>70</sort_order>
|
684 |
+
<show_in_default>1</show_in_default>
|
685 |
+
<show_in_website>1</show_in_website>
|
686 |
+
<show_in_store>1</show_in_store>
|
687 |
+
<depends>
|
688 |
+
<enable_custom_size>1</enable_custom_size>
|
689 |
+
</depends>
|
690 |
+
</term_height>
|
691 |
+
</fields>
|
692 |
+
</terms_conditions>
|
693 |
+
<order_notification translate="label">
|
694 |
+
<label>Admin Order Notification</label>
|
695 |
+
<frontend_type>text</frontend_type>
|
696 |
+
<sort_order>8</sort_order>
|
697 |
+
<show_in_default>1</show_in_default>
|
698 |
+
<show_in_website>1</show_in_website>
|
699 |
+
<show_in_store>1</show_in_store>
|
700 |
+
<fields>
|
701 |
+
<enable_notification translate="label">
|
702 |
+
<label>Enable email notification</label>
|
703 |
+
<frontend_type>select</frontend_type>
|
704 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
705 |
+
<sort_order>10</sort_order>
|
706 |
+
<show_in_default>1</show_in_default>
|
707 |
+
<show_in_website>1</show_in_website>
|
708 |
+
<show_in_store>1</show_in_store>
|
709 |
+
</enable_notification>
|
710 |
+
<template translate="label">
|
711 |
+
<label>Notification email template</label>
|
712 |
+
<frontend_type>select</frontend_type>
|
713 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
714 |
+
<sort_order>20</sort_order>
|
715 |
+
<show_in_default>1</show_in_default>
|
716 |
+
<show_in_website>1</show_in_website>
|
717 |
+
<show_in_store>1</show_in_store>
|
718 |
+
</template>
|
719 |
+
<notification_email translate="label comment">
|
720 |
+
<label>Email(s) received notification</label>
|
721 |
+
<comment><![CDATA[Separated by ',']]>
|
722 |
+
</comment>
|
723 |
+
<frontend_type>textarea</frontend_type>
|
724 |
+
<sort_order>30</sort_order>
|
725 |
+
<show_in_default>1</show_in_default>
|
726 |
+
<show_in_website>1</show_in_website>
|
727 |
+
<show_in_store>1</show_in_store>
|
728 |
+
</notification_email>
|
729 |
+
</fields>
|
730 |
+
</order_notification>
|
731 |
+
<giftwrap translate="label comment">
|
732 |
+
<label>Gift Wrap Configuration</label>
|
733 |
+
<frontend_type>text</frontend_type>
|
734 |
+
<sort_order>10</sort_order>
|
735 |
+
<show_in_default>1</show_in_default>
|
736 |
+
<show_in_website>1</show_in_website>
|
737 |
+
<show_in_store>1</show_in_store>
|
738 |
+
<fields>
|
739 |
+
<enable_giftwrap translate="label">
|
740 |
+
<label>Enable gift wrap</label>
|
741 |
+
<frontend_type>select</frontend_type>
|
742 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
743 |
+
<sort_order>14</sort_order>
|
744 |
+
<show_in_default>1</show_in_default>
|
745 |
+
<show_in_website>1</show_in_website>
|
746 |
+
<show_in_store>1</show_in_store>
|
747 |
+
</enable_giftwrap>
|
748 |
+
<giftwrap_type translate="label">
|
749 |
+
<label>Gift wrap type</label>
|
750 |
+
<frontend_type>select</frontend_type>
|
751 |
+
<source_model>onestepcheckout/giftwrap</source_model>
|
752 |
+
<comment><![CDATA[To calculate gift wrap fee based on item or order.]]>
|
753 |
+
</comment>
|
754 |
+
<sort_order>15</sort_order>
|
755 |
+
<show_in_default>1</show_in_default>
|
756 |
+
<show_in_website>1</show_in_website>
|
757 |
+
<show_in_store>1</show_in_store>
|
758 |
+
<depends>
|
759 |
+
<enable_giftwrap>1</enable_giftwrap>
|
760 |
+
</depends>
|
761 |
+
</giftwrap_type>
|
762 |
+
<giftwrap_amount translate="label">
|
763 |
+
<label>Gift wrap fee</label>
|
764 |
+
<frontend_type>text</frontend_type>
|
765 |
+
<sort_order>16</sort_order>
|
766 |
+
<show_in_default>1</show_in_default>
|
767 |
+
<show_in_website>1</show_in_website>
|
768 |
+
<show_in_store>1</show_in_store>
|
769 |
+
<depends>
|
770 |
+
<enable_giftwrap>1</enable_giftwrap>
|
771 |
+
</depends>
|
772 |
+
<comment><![CDATA[Enter the amount of gift wrap fee.]]>
|
773 |
+
</comment>
|
774 |
+
</giftwrap_amount>
|
775 |
+
</fields>
|
776 |
+
</giftwrap>
|
777 |
+
<giftmessage translate="label comment">
|
778 |
+
<label>Gift Message Configuration</label>
|
779 |
+
<frontend_type>text</frontend_type>
|
780 |
+
<sort_order>15</sort_order>
|
781 |
+
<show_in_default>1</show_in_default>
|
782 |
+
<show_in_website>1</show_in_website>
|
783 |
+
<show_in_store>1</show_in_store>
|
784 |
+
<fields>
|
785 |
+
<enable_giftmessage translate="label">
|
786 |
+
<label>Enable gift message</label>
|
787 |
+
<frontend_type>select</frontend_type>
|
788 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
789 |
+
<sort_order>13</sort_order>
|
790 |
+
<show_in_default>1</show_in_default>
|
791 |
+
<show_in_website>1</show_in_website>
|
792 |
+
<show_in_store>1</show_in_store>
|
793 |
+
</enable_giftmessage>
|
794 |
+
</fields>
|
795 |
+
</giftmessage>
|
796 |
+
<survey translate="label comment">
|
797 |
+
<label>Survey Configuration</label>
|
798 |
+
<frontend_type>text</frontend_type>
|
799 |
+
<sort_order>20</sort_order>
|
800 |
+
<show_in_default>1</show_in_default>
|
801 |
+
<show_in_website>1</show_in_website>
|
802 |
+
<show_in_store>1</show_in_store>
|
803 |
+
<fields>
|
804 |
+
<enable_survey translate="label">
|
805 |
+
<label>Enable survey</label>
|
806 |
+
<frontend_type>select</frontend_type>
|
807 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
808 |
+
<sort_order>1</sort_order>
|
809 |
+
<show_in_default>1</show_in_default>
|
810 |
+
<show_in_website>1</show_in_website>
|
811 |
+
<show_in_store>1</show_in_store>
|
812 |
+
</enable_survey>
|
813 |
+
<survey_question translate="label">
|
814 |
+
<label>Survey question</label>
|
815 |
+
<frontend_type>text</frontend_type>
|
816 |
+
<sort_order>5</sort_order>
|
817 |
+
<show_in_default>1</show_in_default>
|
818 |
+
<show_in_website>1</show_in_website>
|
819 |
+
<show_in_store>1</show_in_store>
|
820 |
+
</survey_question>
|
821 |
+
<enable_survey_freetext translate="label">
|
822 |
+
<label>Enable "Other" value</label>
|
823 |
+
<comment>If enabled, users can type free text and "Other" label will be added to dropdown</comment>
|
824 |
+
<frontend_type>select</frontend_type>
|
825 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
826 |
+
<sort_order>10</sort_order>
|
827 |
+
<show_in_default>1</show_in_default>
|
828 |
+
<show_in_website>1</show_in_website>
|
829 |
+
<show_in_store>1</show_in_store>
|
830 |
+
</enable_survey_freetext>
|
831 |
+
<survey_values>
|
832 |
+
<label>Values</label>
|
833 |
+
<frontend_model>onestepcheckout/system_config_form_field_survey</frontend_model>
|
834 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
835 |
+
<sort_order>15</sort_order>
|
836 |
+
<show_in_default>1</show_in_default>
|
837 |
+
<show_in_website>1</show_in_website>
|
838 |
+
<show_in_store>1</show_in_store>
|
839 |
+
<comment>Values entered here will appear as labels in feedback dropdown on checkout page</comment>
|
840 |
+
</survey_values>
|
841 |
+
</fields>
|
842 |
+
</survey>
|
843 |
+
<!-- <geoip transalte="label">
|
844 |
+
<label>GeoIP Management</label>
|
845 |
+
<frontend_type>text</frontend_type>
|
846 |
+
<sort_order>23</sort_order>
|
847 |
+
<show_in_default>1</show_in_default>
|
848 |
+
<show_in_website>1</show_in_website>
|
849 |
+
<show_in_store>0</show_in_store>
|
850 |
+
<fields>
|
851 |
+
<enable translate="label">
|
852 |
+
<label>Enable GeoIP</label>
|
853 |
+
<frontend_type>select</frontend_type>
|
854 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
855 |
+
<sort_order>1</sort_order>
|
856 |
+
<show_in_default>1</show_in_default>
|
857 |
+
<show_in_website>1</show_in_website>
|
858 |
+
<show_in_store>0</show_in_store>
|
859 |
+
</enable>
|
860 |
+
<detect_by_ip translate="label">
|
861 |
+
<label>Detect country by IP</label>
|
862 |
+
<frontend_type>select</frontend_type>
|
863 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
864 |
+
<sort_order>5</sort_order>
|
865 |
+
<show_in_default>1</show_in_default>
|
866 |
+
<show_in_website>1</show_in_website>
|
867 |
+
<show_in_store>0</show_in_store>
|
868 |
+
</detect_by_ip>
|
869 |
+
<detect_by_postcode translate="label">
|
870 |
+
<label>Detect address by postcode</label>
|
871 |
+
<frontend_type>select</frontend_type>
|
872 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
873 |
+
<sort_order>10</sort_order>
|
874 |
+
<show_in_default>1</show_in_default>
|
875 |
+
<show_in_website>1</show_in_website>
|
876 |
+
<show_in_store>0</show_in_store>
|
877 |
+
</detect_by_postcode>
|
878 |
+
<postcode_characters translate="label">
|
879 |
+
<label>Number of characters to start detecting postcode</label>
|
880 |
+
<frontend_type>text</frontend_type>
|
881 |
+
<sort_order>15</sort_order>
|
882 |
+
<show_in_default>1</show_in_default>
|
883 |
+
<show_in_website>1</show_in_website>
|
884 |
+
<show_in_store>0</show_in_store>
|
885 |
+
</postcode_characters>
|
886 |
+
<detect_by_city translate="label">
|
887 |
+
<label>Detect address by city</label>
|
888 |
+
<frontend_type>select</frontend_type>
|
889 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
890 |
+
<sort_order>20</sort_order>
|
891 |
+
<show_in_default>1</show_in_default>
|
892 |
+
<show_in_website>1</show_in_website>
|
893 |
+
<show_in_store>0</show_in_store>
|
894 |
+
</detect_by_city>
|
895 |
+
<city_characters translate="label">
|
896 |
+
<label>Number of characters to start detecting city</label>
|
897 |
+
<frontend_type>text</frontend_type>
|
898 |
+
<sort_order>25</sort_order>
|
899 |
+
<show_in_default>1</show_in_default>
|
900 |
+
<show_in_website>1</show_in_website>
|
901 |
+
<show_in_store>0</show_in_store>
|
902 |
+
</city_characters>
|
903 |
+
<rows translate="label">
|
904 |
+
<label>Number of rows updated each time</label>
|
905 |
+
<frontend_type>text</frontend_type>
|
906 |
+
<sort_order>30</sort_order>
|
907 |
+
<show_in_default>1</show_in_default>
|
908 |
+
<show_in_website>1</show_in_website>
|
909 |
+
<show_in_store>0</show_in_store>
|
910 |
+
<comment><![CDATA[During the process of updating GeoIP Database.]]>
|
911 |
+
</comment>
|
912 |
+
</rows>
|
913 |
+
</fields>
|
914 |
+
</geoip> -->
|
915 |
+
<!-- <mobile transalte="label">
|
916 |
+
<label>Mobile Version Management</label>
|
917 |
+
<frontend_type>text</frontend_type>
|
918 |
+
<sort_order>25</sort_order>
|
919 |
+
<show_in_default>1</show_in_default>
|
920 |
+
<show_in_website>1</show_in_website>
|
921 |
+
<show_in_store>1</show_in_store>
|
922 |
+
<fields>
|
923 |
+
<enable translate="label">
|
924 |
+
<label>Enable Mobile Version</label>
|
925 |
+
<frontend_type>select</frontend_type>
|
926 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
927 |
+
<sort_order>1</sort_order>
|
928 |
+
<show_in_default>1</show_in_default>
|
929 |
+
<show_in_website>1</show_in_website>
|
930 |
+
<show_in_store>0</show_in_store>
|
931 |
+
</enable>
|
932 |
+
</fields>
|
933 |
+
</mobile> -->
|
934 |
+
<style_management translate="label">
|
935 |
+
<label>Style Management</label>
|
936 |
+
<frontend_type>text</frontend_type>
|
937 |
+
<sort_order>30</sort_order>
|
938 |
+
<show_in_default>1</show_in_default>
|
939 |
+
<show_in_website>1</show_in_website>
|
940 |
+
<show_in_store>1</show_in_store>
|
941 |
+
<fields>
|
942 |
+
<style translate="label">
|
943 |
+
<label>Style Management</label>
|
944 |
+
<frontend_type>text</frontend_type>
|
945 |
+
<frontend_model>onestepcheckout/adminhtml_system_config_field_style</frontend_model>
|
946 |
+
<sort_order>1</sort_order>
|
947 |
+
<show_in_default>1</show_in_default>
|
948 |
+
<show_in_website>1</show_in_website>
|
949 |
+
<show_in_store>1</show_in_store>
|
950 |
+
<comment></comment>
|
951 |
+
</style>
|
952 |
+
</fields>
|
953 |
+
</style_management>
|
954 |
+
</groups>
|
955 |
+
</onestepcheckout>
|
956 |
+
</sections>
|
957 |
+
</config>
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.0.1-1.1.0.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
//create order comment
|
6 |
+
$entity_type = Mage::getSingleton("eav/entity_type")->loadByCode("order");
|
7 |
+
$entity_type_id = $entity_type->getId();
|
8 |
+
$collection = Mage::getModel("eav/entity_attribute")
|
9 |
+
->getCollection()
|
10 |
+
->addFieldToFilter("entity_type_id",$entity_type_id)
|
11 |
+
->addFieldToFilter("attribute_code","onestepcheckout_order_comment");
|
12 |
+
|
13 |
+
if(!count($collection)) {
|
14 |
+
$attribute = Mage::getModel("eav/entity_attribute");
|
15 |
+
$data = array();
|
16 |
+
$data['id'] = null;
|
17 |
+
$data['entity_type_id'] = $entity_type_id;
|
18 |
+
$data['attribute_code'] = "onestepcheckout_order_comment";
|
19 |
+
$data['backend_type'] = "text";
|
20 |
+
$data['frontend_input'] = "textarea";
|
21 |
+
$data['frontend_label'] = 'Order Comment';
|
22 |
+
$data['is_global'] = "1";
|
23 |
+
$data['is_visible'] = "1";
|
24 |
+
$data['is_required'] = "0";
|
25 |
+
$data['is_user_defined'] = "0";
|
26 |
+
$attribute->setData($data);
|
27 |
+
$attribute->save();
|
28 |
+
}
|
29 |
+
|
30 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.0-1.1.1.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->run("
|
6 |
+
ALTER TABLE {$this->getTable('sales_flat_order')} ADD `onestepcheckout_order_comment` text NULL
|
7 |
+
");
|
8 |
+
|
9 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.1-1.1.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.5-1.1.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.6-1.1.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.7-1.1.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.8-1.1.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.1.9-1.2.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.2.2-1.2.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-1.2.3-2.0.0.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->run("
|
6 |
+
ALTER TABLE {$this->getTable('sales_flat_order')}
|
7 |
+
ADD `onestepcheckout_giftwrap_amount` DECIMAL( 12, 4 );
|
8 |
+
|
9 |
+
CREATE TABLE {$this->getTable('onestepcheckout_survey')}(
|
10 |
+
`survey_id` int(11) unsigned NOT NULL auto_increment,
|
11 |
+
`question` varchar(255) default '',
|
12 |
+
`answer` varchar(255) default '',
|
13 |
+
`order_id` int(10) unsigned NOT NULL,
|
14 |
+
PRIMARY KEY (`survey_id`)
|
15 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16 |
+
");
|
17 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.0-2.0.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.1-2.0.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
|
5 |
+
$installer->endSetup();
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.2-3.0.0.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Abserve
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Abserve.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.abserve.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Abserve
|
18 |
+
* @package Abserve_Geoip
|
19 |
+
* @copyright Copyright (c) 2012 Abserve (http://www.abserve.com/)
|
20 |
+
* @license http://www.abserve.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
/** @var $installer Mage_Core_Model_Resource_Setup */
|
23 |
+
$installer = $this;
|
24 |
+
|
25 |
+
$installer->startSetup();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* create geoip table
|
29 |
+
*/
|
30 |
+
$installer->run("
|
31 |
+
DROP TABLE IF EXISTS {$this->getTable('onestepcheckout_config_data')};
|
32 |
+
CREATE TABLE {$this->getTable('onestepcheckout_config_data')} (
|
33 |
+
`config_id` int(11) unsigned NOT NULL auto_increment,
|
34 |
+
`scope` varchar(8) default '',
|
35 |
+
`scope_id` int(11) NOT NULL default '0',
|
36 |
+
`path` varchar(255) default '',
|
37 |
+
`value` text default '' ,
|
38 |
+
PRIMARY KEY (`config_id`)
|
39 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
40 |
+
");
|
41 |
+
$installer->endSetup();
|
42 |
+
|
app/code/community/Abserve/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-3.0.0-3.1.0.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Abserve
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Abserve.com license that is
|
9 |
+
* available through the world-wide-web at this URL:
|
10 |
+
* http://www.abserve.com/license-agreement.html
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this extension to newer
|
15 |
+
* version in the future.
|
16 |
+
*
|
17 |
+
* @category Abserve
|
18 |
+
* @package Abserve_Geoip
|
19 |
+
* @copyright Copyright (c) 2012 Abserve (http://www.abserve.com/)
|
20 |
+
* @license http://www.abserve.com/license-agreement.html
|
21 |
+
*/
|
22 |
+
/** @var $installer Mage_Core_Model_Resource_Setup */
|
23 |
+
$installer = $this;
|
24 |
+
|
25 |
+
$installer->startSetup();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* create geoip table
|
29 |
+
*/
|
30 |
+
$installer->run("
|
31 |
+
DROP TABLE IF EXISTS {$this->getTable('onestepcheckout_delivery')};
|
32 |
+
CREATE TABLE {$this->getTable('onestepcheckout_delivery')} (
|
33 |
+
`delivery_id` int(11) unsigned NOT NULL auto_increment,
|
34 |
+
`delivery_time_date` varchar(16) default '',
|
35 |
+
`order_id` int(11) NOT NULL default '0',
|
36 |
+
PRIMARY KEY (`delivery_id`)
|
37 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
+
");
|
39 |
+
$installer->endSetup();
|
40 |
+
|
app/code/community/Abserve/PaypalBNCode/Helper/Data.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_PaypalBNCode_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
+
{
|
13 |
+
|
14 |
+
}
|
app/code/community/Abserve/PaypalBNCode/Model/Config.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_PaypalBNCode_Model_Config extends Mage_Paypal_Model_Config
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* BN code getter
|
15 |
+
* override method
|
16 |
+
*
|
17 |
+
* @param string $countryCode ISO 3166-1
|
18 |
+
*/
|
19 |
+
public function getBuildNotationCode($countryCode = null)
|
20 |
+
{
|
21 |
+
if($this->isMageEnterprise()){
|
22 |
+
$newBnCode = 'Abserve_SI_MagentoEE';
|
23 |
+
} else {
|
24 |
+
$newBnCode = 'Abserve_SI_MagentoCE';
|
25 |
+
}
|
26 |
+
|
27 |
+
$bnCode = parent::getBuildNotationCode($countryCode);
|
28 |
+
|
29 |
+
if(class_exists("Abserve_Onestepcheckout_Helper_Data") && Mage::getStoreConfig('onestepcheckout/general/active')){
|
30 |
+
return $newBnCode;
|
31 |
+
} else {
|
32 |
+
return $bnCode;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
public function isMageEnterprise() {
|
37 |
+
return Mage::getConfig ()->getModuleConfig ( 'Enterprise_Enterprise' )
|
38 |
+
&& Mage::getConfig ()->getModuleConfig ( 'Enterprise_AdminGws' )
|
39 |
+
&& Mage::getConfig ()->getModuleConfig ( 'Enterprise_Checkout' )
|
40 |
+
&& Mage::getConfig ()->getModuleConfig ( 'Enterprise_Customer' );
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
app/code/community/Abserve/PaypalBNCode/etc/config.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<modules>
|
13 |
+
<Abserve_PaypalBNCode>
|
14 |
+
<version>0.1.0</version>
|
15 |
+
</Abserve_PaypalBNCode>
|
16 |
+
</modules>
|
17 |
+
<global>
|
18 |
+
<models>
|
19 |
+
<paypalbncode>
|
20 |
+
<class>Abserve_PaypalBNCode_Model</class>
|
21 |
+
</paypalbncode>
|
22 |
+
<paypal>
|
23 |
+
<rewrite>
|
24 |
+
<config>Abserve_PaypalBNCode_Model_Config</config>
|
25 |
+
</rewrite>
|
26 |
+
</paypal>
|
27 |
+
</models>
|
28 |
+
<helpers>
|
29 |
+
<paypalbncode>
|
30 |
+
<class>Abserve_PaypalBNCode_Helper</class>
|
31 |
+
</paypalbncode>
|
32 |
+
</helpers>
|
33 |
+
</global>
|
34 |
+
</config>
|
app/code/community/Abserve/Settings/Block/Settings.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Abserve_Settings_Block_Settings extends Mage_Core_Block_Template{
|
3 |
+
|
4 |
+
}
|
app/code/community/Abserve/Settings/Helper/Data.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @category Abserve
|
4 |
+
* @package Abserve_Module
|
5 |
+
* @author Abserve Developer
|
6 |
+
* @license http://abservetech.com/license-agreement/
|
7 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<?php
|
11 |
+
class Abserve_Settings_Helper_Data extends Mage_Core_Helper_Data
|
12 |
+
{
|
13 |
+
|
14 |
+
}
|
app/code/community/Abserve/Settings/controllers/IndexController.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Abserve_Settings_IndexController extends Mage_Core_Controller_Front_Action{
|
3 |
+
|
4 |
+
public function IndexAction(){
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->renderLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function BannerAction(){
|
10 |
+
$this->loadLayout();
|
11 |
+
$this->renderLayout();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function BrandAction(){
|
15 |
+
$this->loadLayout();
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function AdAction(){
|
20 |
+
$this->loadLayout();
|
21 |
+
$this->renderLayout();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function NewproductAction(){
|
25 |
+
$this->loadLayout();
|
26 |
+
$this->renderLayout();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function CategoryAction(){
|
30 |
+
$this->loadLayout();
|
31 |
+
$this->renderLayout();
|
32 |
+
}
|
33 |
+
|
34 |
+
public function DeliveryAction(){
|
35 |
+
$this->loadLayout();
|
36 |
+
$this->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function CategoryhomeAction(){
|
40 |
+
$this->loadLayout();
|
41 |
+
$this->renderLayout();
|
42 |
+
}
|
43 |
+
|
44 |
+
public function GetproductbyidAction(){
|
45 |
+
$product_id = 18;
|
46 |
+
$_product = Mage::getModel('catalog/product')->load($product_id);
|
47 |
+
echo $_product->getPrice();
|
48 |
+
}
|
49 |
+
|
50 |
+
public function BlogAction(){
|
51 |
+
$this->loadLayout();
|
52 |
+
$this->renderLayout();
|
53 |
+
}
|
54 |
+
}
|
app/code/community/Abserve/Settings/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<settings>
|
12 |
+
<title> Settings </title> <!-- Used in resources tree -->
|
13 |
+
</settings>
|
14 |
+
</children>
|
15 |
+
</config>
|
16 |
+
</children>
|
17 |
+
</system>
|
18 |
+
</children>
|
19 |
+
</admin>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/community/Abserve/Settings/etc/config.xml
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Abserve_Settings>
|
5 |
+
<version>1.2.3</version>
|
6 |
+
</Abserve_Settings>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<settings>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Abserve_Settings</module>
|
14 |
+
<frontName>settings</frontName>
|
15 |
+
</args>
|
16 |
+
</settings>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<settings>
|
21 |
+
<file>settings.xml</file>
|
22 |
+
</settings>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<admin>
|
27 |
+
<routers>
|
28 |
+
<settings>
|
29 |
+
<use>admin</use>
|
30 |
+
<args>
|
31 |
+
<module>Abserve_Settings</module>
|
32 |
+
<frontName>footer</frontName>
|
33 |
+
</args>
|
34 |
+
</settings>
|
35 |
+
</routers>
|
36 |
+
</admin>
|
37 |
+
<global>
|
38 |
+
<helpers>
|
39 |
+
<settings>
|
40 |
+
<class>Abserve_Settings_Helper</class>
|
41 |
+
</settings>
|
42 |
+
</helpers>
|
43 |
+
<blocks>
|
44 |
+
<settings>
|
45 |
+
<class>Abserve_Settings_Block</class>
|
46 |
+
</settings>
|
47 |
+
</blocks>
|
48 |
+
</global>
|
49 |
+
<default>
|
50 |
+
<settings>
|
51 |
+
<general>
|
52 |
+
</general>
|
53 |
+
</settings>
|
54 |
+
</default>
|
55 |
+
<adminhtml>
|
56 |
+
<menu>
|
57 |
+
<settings module="settings">
|
58 |
+
<title>Shoestore</title>
|
59 |
+
<sort_order>100</sort_order>
|
60 |
+
<children>
|
61 |
+
<ajaxcart module="ajaxcart">
|
62 |
+
<title> Shoestore Configuration </title>
|
63 |
+
<sort_order>1</sort_order>
|
64 |
+
<action>adminhtml/system_config/edit/section/settings</action>
|
65 |
+
</ajaxcart>
|
66 |
+
</children>
|
67 |
+
</settings>
|
68 |
+
</menu>
|
69 |
+
</adminhtml>
|
70 |
+
</config>
|
app/code/community/Abserve/Settings/etc/system.xml
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<settings translate="label" module="settings">
|
5 |
+
<label> Shoestore </label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
<class>settings</class>
|
8 |
+
</settings>
|
9 |
+
</tabs>
|
10 |
+
<sections>
|
11 |
+
<settings translate="label" module="settings">
|
12 |
+
|
13 |
+
<class>separator-top</class>
|
14 |
+
<label>Shoestore Configuration</label>
|
15 |
+
<tab>settings</tab> <!-- the important one -->
|
16 |
+
<sort_order>10</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
|
21 |
+
<groups>
|
22 |
+
|
23 |
+
<general translate="label">
|
24 |
+
|
25 |
+
<label>General Details </label>
|
26 |
+
<frontend_type>text</frontend_type>
|
27 |
+
<sort_order>0</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>1</show_in_store>
|
31 |
+
|
32 |
+
<fields>
|
33 |
+
<copyrights translate="label">
|
34 |
+
<label> Copyrights </label>
|
35 |
+
<frontend_type>text</frontend_type>
|
36 |
+
<sort_order>0</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
</copyrights>
|
41 |
+
|
42 |
+
|
43 |
+
<skype translate="label">
|
44 |
+
<label> Skype Number </label>
|
45 |
+
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>0</sort_order>
|
47 |
+
<show_in_default>1</show_in_default>
|
48 |
+
<show_in_website>1</show_in_website>
|
49 |
+
<show_in_store>1</show_in_store>
|
50 |
+
</skype>
|
51 |
+
|
52 |
+
<facebook translate="label">
|
53 |
+
<label> Facebook Id </label>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<sort_order>0</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
</facebook>
|
60 |
+
|
61 |
+
<twitter translate="label">
|
62 |
+
<label> Twitter Id </label>
|
63 |
+
<frontend_type>text</frontend_type>
|
64 |
+
<sort_order>0</sort_order>
|
65 |
+
<show_in_default>1</show_in_default>
|
66 |
+
<show_in_website>1</show_in_website>
|
67 |
+
<show_in_store>1</show_in_store>
|
68 |
+
</twitter>
|
69 |
+
|
70 |
+
<linkedin translate="label">
|
71 |
+
<label> LinkedIn Id </label>
|
72 |
+
<frontend_type>text</frontend_type>
|
73 |
+
<sort_order>0</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
</linkedin>
|
78 |
+
|
79 |
+
<gplus translate="label">
|
80 |
+
<label> Google Plus Id </label>
|
81 |
+
<frontend_type>text</frontend_type>
|
82 |
+
<sort_order>0</sort_order>
|
83 |
+
<show_in_default>1</show_in_default>
|
84 |
+
<show_in_website>1</show_in_website>
|
85 |
+
<show_in_store>1</show_in_store>
|
86 |
+
</gplus>
|
87 |
+
|
88 |
+
<!-- <staus translate="label">
|
89 |
+
<label> Status </label>
|
90 |
+
<frontend_type>select</frontend_type>
|
91 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
92 |
+
<sort_order>0</sort_order>
|
93 |
+
<show_in_default>1</show_in_default>
|
94 |
+
<show_in_website>1</show_in_website>
|
95 |
+
<show_in_store>1</show_in_store>
|
96 |
+
</staus> -->
|
97 |
+
</fields>
|
98 |
+
|
99 |
+
</general>
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
+
<contactus translate="label">
|
104 |
+
<label> Contactus </label>
|
105 |
+
<frontend_type>text</frontend_type>
|
106 |
+
<sort_order>0</sort_order>
|
107 |
+
<show_in_default>1</show_in_default>
|
108 |
+
<show_in_website>1</show_in_website>
|
109 |
+
<show_in_store>1</show_in_store>
|
110 |
+
|
111 |
+
<fields>
|
112 |
+
|
113 |
+
<address translate="label">
|
114 |
+
<label> Address Location </label>
|
115 |
+
<frontend_type>text</frontend_type>
|
116 |
+
<sort_order>0</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
</address>
|
121 |
+
|
122 |
+
<mobileno translate="label">
|
123 |
+
<label> Mobile No </label>
|
124 |
+
<frontend_type>text</frontend_type>
|
125 |
+
<sort_order>0</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>1</show_in_store>
|
129 |
+
</mobileno>
|
130 |
+
|
131 |
+
<telephoneno translate="label">
|
132 |
+
<label> Telephone No </label>
|
133 |
+
<frontend_type>text</frontend_type>
|
134 |
+
<sort_order>0</sort_order>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>1</show_in_website>
|
137 |
+
<show_in_store>1</show_in_store>
|
138 |
+
</telephoneno>
|
139 |
+
|
140 |
+
<contactmail translate="label">
|
141 |
+
<label> Contact Email </label>
|
142 |
+
<frontend_type>text</frontend_type>
|
143 |
+
<sort_order>0</sort_order>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>1</show_in_website>
|
146 |
+
<show_in_store>1</show_in_store>
|
147 |
+
</contactmail>
|
148 |
+
|
149 |
+
</fields>
|
150 |
+
</contactus>
|
151 |
+
|
152 |
+
|
153 |
+
|
154 |
+
|
155 |
+
|
156 |
+
|
157 |
+
<helpline translate="label">
|
158 |
+
<label> Helpline </label>
|
159 |
+
<frontend_type>text</frontend_type>
|
160 |
+
<sort_order>0</sort_order>
|
161 |
+
<show_in_default>1</show_in_default>
|
162 |
+
<show_in_website>1</show_in_website>
|
163 |
+
<show_in_store>1</show_in_store>
|
164 |
+
|
165 |
+
<fields>
|
166 |
+
|
167 |
+
<helplineno translate="label">
|
168 |
+
<label> Help Line </label>
|
169 |
+
<frontend_type>text</frontend_type>
|
170 |
+
<sort_order>0</sort_order>
|
171 |
+
<show_in_default>1</show_in_default>
|
172 |
+
<show_in_website>1</show_in_website>
|
173 |
+
<show_in_store>1</show_in_store>
|
174 |
+
</helplineno>
|
175 |
+
|
176 |
+
<helplineemail translate="label">
|
177 |
+
<label> Help Line Email </label>
|
178 |
+
<frontend_type>text</frontend_type>
|
179 |
+
<sort_order>0</sort_order>
|
180 |
+
<show_in_default>1</show_in_default>
|
181 |
+
<show_in_website>1</show_in_website>
|
182 |
+
<show_in_store>1</show_in_store>
|
183 |
+
</helplineemail>
|
184 |
+
|
185 |
+
</fields>
|
186 |
+
</helpline>
|
187 |
+
</groups>
|
188 |
+
|
189 |
+
</settings>
|
190 |
+
</sections>
|
191 |
+
</config>
|
app/code/community/Abserve/license_certificates/Abserve_Onestepcheckout.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<config>
|
12 |
+
<Abserve_Onestepcheckout>
|
13 |
+
<name>One Step Checkout - Goodbye checkout complexity</name>
|
14 |
+
<type>commercial</type>
|
15 |
+
<activation_date>Apr 17, 2015</activation_date>
|
16 |
+
<expiration_date/>
|
17 |
+
<order_number>100053220</order_number>
|
18 |
+
</Abserve_Onestepcheckout>
|
19 |
+
</config>
|
app/design/adminhtml/default/default/layout/magenotification.xml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addJs"><script>tinybox/tinybox.js</script></action>
|
6 |
+
<action method="addCss"><stylesheet>css/tinybox/style.css</stylesheet></action>
|
7 |
+
<action method="addCss"><stylesheet>css/abserve/magenotification.css</stylesheet></action>
|
8 |
+
</reference>
|
9 |
+
</default>
|
10 |
+
<magenotification_adminhtml_feedback_index>
|
11 |
+
<reference name="content">
|
12 |
+
<block type="magenotification/adminhtml_feedback" name="extension_feedback" />
|
13 |
+
</reference>
|
14 |
+
</magenotification_adminhtml_feedback_index>
|
15 |
+
|
16 |
+
</layout>
|
app/design/adminhtml/default/default/layout/onestepcheckout.xml
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<!-- <adminhtml_sales_order_view>
|
4 |
+
<update handle="order_tab_info" />
|
5 |
+
<reference name="order_tab_info">
|
6 |
+
<action method="setTemplate"><template>onestepcheckout/info.phtml</template></action>
|
7 |
+
</reference>
|
8 |
+
</adminhtml_sales_order_view> -->
|
9 |
+
|
10 |
+
<!-- Order -->
|
11 |
+
<adminhtml_sales_order_view>
|
12 |
+
<reference name="order_totals">
|
13 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
14 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckoutdiscount" />
|
15 |
+
</reference>
|
16 |
+
<reference name="order_item_extra_info">
|
17 |
+
<block type="onestepcheckout/adminhtml_sales_order_view_tab_survey"
|
18 |
+
as="onestepcheckout_order" />
|
19 |
+
<block type="onestepcheckout/adminhtml_sales_order_view_tab_delivery"
|
20 |
+
as="onestepcheckout_order" />
|
21 |
+
</reference>
|
22 |
+
</adminhtml_sales_order_view>
|
23 |
+
<adminhtml_sales_order_invoice_new>
|
24 |
+
<reference name="invoice_totals">
|
25 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
26 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckoutdiscount" />
|
27 |
+
</reference>
|
28 |
+
<!-- <reference name="order_item_extra_info">
|
29 |
+
<block type="onestepcheckout/adminhtml_sales_order_view_tab_survey"
|
30 |
+
as="onestepcheckout_invoice" />
|
31 |
+
</reference> -->
|
32 |
+
</adminhtml_sales_order_invoice_new>
|
33 |
+
<adminhtml_sales_order_invoice_view>
|
34 |
+
<reference name="invoice_totals">
|
35 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
36 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckoutdiscount" />
|
37 |
+
</reference>
|
38 |
+
</adminhtml_sales_order_invoice_view>
|
39 |
+
<adminhtml_sales_order_creditmemo_new>
|
40 |
+
<reference name="creditmemo_totals">
|
41 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
42 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckoutdiscount" />
|
43 |
+
</reference>
|
44 |
+
</adminhtml_sales_order_creditmemo_new>
|
45 |
+
<adminhtml_sales_order_creditmemo_view>
|
46 |
+
<reference name="creditmemo_totals">
|
47 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
48 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckoutdiscount" />
|
49 |
+
</reference>
|
50 |
+
</adminhtml_sales_order_creditmemo_view>
|
51 |
+
|
52 |
+
<!-- Geoip -->
|
53 |
+
<onestepcheckoutadmin_adminhtml_geoip_showgeoip>
|
54 |
+
<reference name="content">
|
55 |
+
<block type="onestepcheckout/adminhtml_geoip" template="onestepcheckout/geoip.phtml" name="geoip" />
|
56 |
+
</reference>
|
57 |
+
</onestepcheckoutadmin_adminhtml_geoip_showgeoip>
|
58 |
+
<onestepcheckoutadmin_adminhtml_country_showcountryip>
|
59 |
+
<reference name="content">
|
60 |
+
<block type="onestepcheckout/adminhtml_country" template="onestepcheckout/country.phtml" name="country" />
|
61 |
+
</reference>
|
62 |
+
</onestepcheckoutadmin_adminhtml_country_showcountryip>
|
63 |
+
<onestepcheckoutadmin_adminhtml_geoip_index>
|
64 |
+
<reference name="head">
|
65 |
+
<action method="addJs"><script>abserve/adminhtml/onestepcheckout/geoip.js</script></action>
|
66 |
+
</reference>
|
67 |
+
<reference name="head">
|
68 |
+
<action method="addCss"><stylesheet>css/abserve/onestepcheckout.css</stylesheet></action>
|
69 |
+
</reference>
|
70 |
+
<reference name="content">
|
71 |
+
<block type="onestepcheckout/adminhtml_geoipgrid" name="geoipgrid" />
|
72 |
+
</reference>
|
73 |
+
</onestepcheckoutadmin_adminhtml_geoip_index>
|
74 |
+
<onestepcheckoutadmin_adminhtml_country_index>
|
75 |
+
<reference name="head">
|
76 |
+
<action method="addJs"><script>abserve/adminhtml/onestepcheckout/geoip.js</script></action>
|
77 |
+
</reference>
|
78 |
+
<reference name="head">
|
79 |
+
<action method="addCss"><stylesheet>css/abserve/onestepcheckout.css</stylesheet></action>
|
80 |
+
</reference>
|
81 |
+
<reference name="content">
|
82 |
+
<block type="onestepcheckout/adminhtml_countrygrid" name="countrygrid" />
|
83 |
+
</reference>
|
84 |
+
</onestepcheckoutadmin_adminhtml_country_index>
|
85 |
+
<adminhtml_system_config_edit>
|
86 |
+
<reference name="head">
|
87 |
+
<action method="addJs">
|
88 |
+
<script>abserve/onestepcheckout/colorpicker/prototype_colorpicker.js</script>
|
89 |
+
</action>
|
90 |
+
<action method="addJs">
|
91 |
+
<script>abserve/onestepcheckout/colorpicker/config.js</script>
|
92 |
+
</action>
|
93 |
+
<action method="addCss">
|
94 |
+
<stylesheet>css/abserve/onestepcheckout/prototype_colorpicker.css</stylesheet>
|
95 |
+
</action>
|
96 |
+
</reference>
|
97 |
+
</adminhtml_system_config_edit>
|
98 |
+
</layout>
|
app/design/adminhtml/default/default/template/magenotification/feedback/files.phtml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
?>
|
4 |
+
<div id="feedback_files">
|
5 |
+
<input type="file" class="input-file" value="" name="file0" id="file0" >
|
6 |
+
<button onclick="magenotificationAddMoreFile();" class="scalable add" type="button">
|
7 |
+
<span><?php echo $this->__('Add More')?></span>
|
8 |
+
</button>
|
9 |
+
</div>
|
10 |
+
<script type="text/javascript">
|
11 |
+
var currentfile = 0;
|
12 |
+
function magenotificationAddMoreFile(){
|
13 |
+
currentfile++;
|
14 |
+
var inputFile = '<br/><input type="file" class="input-file" value="" name="file'+currentfile+'" id="file'+currentfile+'">';
|
15 |
+
$('feedback_files').insert(inputFile);
|
16 |
+
}
|
17 |
+
</script>
|
app/design/adminhtml/default/default/template/magenotification/feedback/history.phtml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $messages = $this->getMessages() ?>
|
2 |
+
<?php if(count($messages)): ?>
|
3 |
+
<?php foreach($messages as $message): ?>
|
4 |
+
<?php if((int)$message->getIsCustomer() == 1): ?>
|
5 |
+
<br/>
|
6 |
+
<?php if((int)$message->getIsSent() == 1): ?>
|
7 |
+
<span class="grid-severity-notice" style="width: 150px;">
|
8 |
+
<span><?php echo $this->__('Sent to').' '.Abserve_Magenotification_Model_Keygen::SERVER_NAME?></span>
|
9 |
+
</span>
|
10 |
+
<?php else: ?>
|
11 |
+
<table><tr><td width="170">
|
12 |
+
<span class="grid-severity-critical" style="width: 150px;"><span><?php echo $this->__('Not Sent')?></span></span>
|
13 |
+
</td><td>
|
14 |
+
<a href='<?php echo $this->getUrl('magenotification/adminhtml_feedback/resendmessage',array('id'=>$message->getId(),'feedback_id'=>$this->getFeedback()->getId(),'_secure'=>true)) ?>' >
|
15 |
+
<?php echo $this->__('Resend')?>
|
16 |
+
</a>
|
17 |
+
</td></tr></table>
|
18 |
+
<?php endif; ?>
|
19 |
+
<?php endif; ?>
|
20 |
+
<?php echo $this->getMessageTitle($message) ?>
|
21 |
+
<br/>
|
22 |
+
<pre><?php echo $message->getMessage() ?></pre>
|
23 |
+
<br/>
|
24 |
+
<?php if($attachedfiles = $message->getAttachedFile()): ?>
|
25 |
+
<b><?php echo $this->__('Attached Files')?></b>
|
26 |
+
<?php echo $attachedfiles ?>
|
27 |
+
<?php endif; ?>
|
28 |
+
<br/>
|
29 |
+
<hr style="border: 1px dashed rgb(204, 204, 204);"/>
|
30 |
+
<?php endforeach; ?>
|
31 |
+
<?php endif; ?>
|
app/design/adminhtml/default/default/template/magenotification/license/licenseinfo.phtml
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* License Info Template
|
4 |
+
* @see Abserve_Magenotification_Block_Config_Licenseinfo
|
5 |
+
*/
|
6 |
+
?>
|
7 |
+
<strong><label for="<?php echo $this->getExtensionName() ?>_license_info"><?php echo $this->__('License Serial') ?>:</label></strong>
|
8 |
+
<?php if ($this->getLicenseSerial()): ?>
|
9 |
+
<?php echo $this->getLicenseSerial() ?>
|
10 |
+
<br/>
|
11 |
+
<?php else: ?>
|
12 |
+
<?php $_serial = $this->getConfigLicenseSerial() ?>
|
13 |
+
<a href="#" onclick="return <?php echo $this->getExtensionName() ?>ChangeLicense(this);" style="text-decoration: none;<?php if (!$_serial): ?> display: none;<?php endif ?>">
|
14 |
+
<?php echo $_serial ?>
|
15 |
+
<br/>
|
16 |
+
</a>
|
17 |
+
<span id="<?php echo $this->getExtensionName() ?>_license_input"<?php if ($_serial): ?> style="display: none;"<?php endif ?>>
|
18 |
+
<input id="<?php echo $this->getExtensionName() ?>_license_info" name="groups[extension_serials][fields][<?php echo $this->getExtensionName() ?>][value]" value="<?php echo $_serial ?>" style="width: 154px;" type="text" class="input-text" />
|
19 |
+
<p class="note" style="margin-left: 86px;">
|
20 |
+
<?php echo $this->__('get license serial from') ?>
|
21 |
+
<a href="https://www.abserve.com/licensemanager/license/certificates" title="<?php echo $this->__('get license serial') ?>" target="_blank"><?php echo $this->__('here') ?></a>
|
22 |
+
</p>
|
23 |
+
</span>
|
24 |
+
<script type="text/javascript">
|
25 |
+
function <?php echo $this->getExtensionName() ?>ChangeLicense(el) {
|
26 |
+
el.hide();
|
27 |
+
$('<?php echo $this->getExtensionName() ?>_license_input').show();
|
28 |
+
return false;
|
29 |
+
}
|
30 |
+
</script>
|
31 |
+
<?php endif ?>
|
32 |
+
|
33 |
+
<strong><?php echo $this->__('License Type') ?>:</strong>
|
34 |
+
<?php
|
35 |
+
switch ($this->getLicenseType()) {
|
36 |
+
case Abserve_Magenotification_Model_Config::COMMERCIAL_LICENSE:
|
37 |
+
echo $this->__('commercial for one Magento Installation');
|
38 |
+
break;
|
39 |
+
case Abserve_Magenotification_Model_Config::TRIAL_LICENSE:
|
40 |
+
echo $this->__('Trial for one Magento Installation');
|
41 |
+
break;
|
42 |
+
case Abserve_Magenotification_Model_Config::FREE_LICENSE:
|
43 |
+
echo $this->__('Free License');
|
44 |
+
break;
|
45 |
+
default :
|
46 |
+
echo $this->__('N/A');
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
|
50 |
+
<br/>
|
51 |
+
<strong><?php echo $this->__('Activation Date') ?>:</strong>
|
52 |
+
<?php if ($this->getActivationDate()): ?>
|
53 |
+
<?php echo $this->formatDate($this->getActivationDate(), 'medium', false) ?>
|
54 |
+
<?php else: ?>
|
55 |
+
<?php echo $this->__('N/A') ?>
|
56 |
+
<?php endif ?>
|
57 |
+
|
58 |
+
<br/>
|
59 |
+
<strong><?php echo $this->__('Expiration Date') ?>:</strong>
|
60 |
+
<?php if ($this->getExpirationDate()): ?>
|
61 |
+
<?php echo $this->formatDate($this->getExpirationDate(), 'medium', false) ?>
|
62 |
+
<?php else: ?>
|
63 |
+
<?php echo $this->__('N/A') ?>
|
64 |
+
<?php endif ?>
|
65 |
+
|
66 |
+
<br/>
|
67 |
+
<?php echo $this->__('Check license information') ?>
|
68 |
+
<a href="https://www.abserve.com/licensemanager/license/check" title="<?php echo $this->__('check license information') ?>" target="_blank"><?php echo $this->__('here') ?></a>
|
app/design/adminhtml/default/default/template/magenotification/license/purchaseform.phtml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
?>
|
4 |
+
|
5 |
+
<button style="margin-top:5px;" onclick="location.href='<?php echo $this->getPurchaseUrl() ?>'" class="scalable add" type="button" >
|
6 |
+
<span><?php echo $this->__('Purchase now')?></span>
|
7 |
+
</button><br/><br/>
|
app/design/adminhtml/default/default/template/magenotification/license/updateform.phtml
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
?>
|
4 |
+
<table width="300">
|
5 |
+
<tr>
|
6 |
+
<td colspan="2">
|
7 |
+
<?php echo $this->__('Upgrade License to')?><br/>
|
8 |
+
<select style="margin:5px 0 5px 0;"class="input-text" name="<?php echo $this->getExtensionName() ?>_licensetype" id="<?php echo $this->getExtensionName() ?>_licensetype">
|
9 |
+
<?php foreach($this->getLicenseTypeOption() as $key=>$label): ?>
|
10 |
+
<option value="<?php echo $key?>"><?php echo $label?></option>
|
11 |
+
<?php endforeach; ?>
|
12 |
+
</select>
|
13 |
+
</td>
|
14 |
+
</tr>
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<button style="" onclick="updateLicenseViewPrice('<?php echo $this->getLicensekey() ?>','<?php echo $this->getExtensionName() ?>_licensetype')" class="scalable" type="button" >
|
18 |
+
<span><?php echo $this->__('View Price')?></span>
|
19 |
+
</button>
|
20 |
+
</td>
|
21 |
+
<td>
|
22 |
+
<button style="" onclick="updateLicensePurchase('<?php echo $this->getLicensekey() ?>','<?php echo $this->getExtensionName() ?>_licensetype')" class="scalable add" type="button" >
|
23 |
+
<span><?php echo $this->__('Upgrade Now')?></span>
|
24 |
+
</button>
|
25 |
+
</td>
|
26 |
+
</tr>
|
27 |
+
</table><br/>
|
28 |
+
|
29 |
+
<script type="text/javascript">
|
30 |
+
function updateLicenseViewPrice(licensekey,licensetype_selector){
|
31 |
+
var licensetype = $(licensetype_selector).value;
|
32 |
+
var url = '<?php echo $this->getViewPriceUrl()?>'+'licensekey/'+licensekey+'/licensetype/'+licensetype;
|
33 |
+
TINY.box.show(url, 1, 300, 100, 1);
|
34 |
+
}
|
35 |
+
|
36 |
+
function updateLicensePurchase(licensekey,licensetype_selector){
|
37 |
+
var licensetype = $(licensetype_selector).value;
|
38 |
+
var url = '<?php echo $this->getUpdateUrl()?>'+'licensekey/'+licensekey+'/licensetype/'+licensetype;
|
39 |
+
location.href=url;
|
40 |
+
}
|
41 |
+
</script>
|
app/design/adminhtml/default/default/template/onestepcheckout/country.phtml
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //Zend_Debug::dump($this->checkDataImport());?>
|
2 |
+
<style>
|
3 |
+
body{
|
4 |
+
color: #000;
|
5 |
+
font-size: 15px;
|
6 |
+
}
|
7 |
+
#first{
|
8 |
+
width:75%;
|
9 |
+
}
|
10 |
+
table{
|
11 |
+
width:100%;
|
12 |
+
}
|
13 |
+
td{
|
14 |
+
width: 25%;
|
15 |
+
}
|
16 |
+
.log-import{
|
17 |
+
background: #DDDDFF;
|
18 |
+
color: #fff;
|
19 |
+
}
|
20 |
+
ul {
|
21 |
+
list-style-type: none;
|
22 |
+
margin: 0;
|
23 |
+
padding: 0;
|
24 |
+
}
|
25 |
+
li {
|
26 |
+
border: 1px solid #CCCCCC;
|
27 |
+
font: 12px sans-serif;
|
28 |
+
margin: 2px;
|
29 |
+
padding: 2px;
|
30 |
+
}
|
31 |
+
img {
|
32 |
+
margin-right: 5px;
|
33 |
+
}
|
34 |
+
.log-failed{
|
35 |
+
background-color:#FDD;
|
36 |
+
}
|
37 |
+
.log-success{
|
38 |
+
background-color:#DDF;
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
<?php
|
42 |
+
$url = trim($this->actionImport(), '/');
|
43 |
+
?>
|
44 |
+
<script type="text/javascript">
|
45 |
+
var ilog = 0;
|
46 |
+
var log = new Array();
|
47 |
+
var conti = true;
|
48 |
+
var resumeImport = function(el){
|
49 |
+
var label = {
|
50 |
+
pause: '<?php echo $this->__('Pause') ?>',
|
51 |
+
resume: '<?php echo $this->__('Resume') ?>'
|
52 |
+
};
|
53 |
+
if(conti){
|
54 |
+
conti = false;
|
55 |
+
el.innerHTML = label.resume;
|
56 |
+
} else {
|
57 |
+
conti=true;
|
58 |
+
el.innerHTML = label.pause;
|
59 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLink() ?>');
|
60 |
+
importData(conti);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
var processResult=function(text){
|
64 |
+
if(text!=""){
|
65 |
+
var re=new Array();
|
66 |
+
re=text.split('-');
|
67 |
+
return re;
|
68 |
+
}
|
69 |
+
return null;
|
70 |
+
}
|
71 |
+
var addImage=function(id){
|
72 |
+
var path='<?php echo $this->getImageLink() ?>';
|
73 |
+
$(id).innerHTML+="<span id='ajax-import'><img id='image-import' src='"+path+"' /></span>";
|
74 |
+
}
|
75 |
+
|
76 |
+
var total = 0;
|
77 |
+
var importData=function(con){
|
78 |
+
if(con){
|
79 |
+
var importGeoip=new Ajax.Request(
|
80 |
+
'<?php echo $url ?>',
|
81 |
+
{
|
82 |
+
method:'post',
|
83 |
+
onComplete:function(xhr){
|
84 |
+
if(xhr.responseText){
|
85 |
+
var res=processResult(xhr.responseText);
|
86 |
+
if(res[1]!='complete'){
|
87 |
+
total = total + res[1]/1;
|
88 |
+
if(total > 0){
|
89 |
+
$('data-importing').innerHTML=" "+total+" "+res[0];
|
90 |
+
$('status-import').innerHTML='<?php echo $this->__('Processed ') ?>';
|
91 |
+
$('image-import').setAttribute('src', '<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>');
|
92 |
+
}
|
93 |
+
// else{
|
94 |
+
// $('data-importing').innerHTML='';
|
95 |
+
// $('status-import').innerHTML='';
|
96 |
+
// $('image-import').setAttribute('text', '');
|
97 |
+
// }
|
98 |
+
// alert('total');
|
99 |
+
}else{
|
100 |
+
$('status-import').innerHTML='<?php echo $this->__('Complete updating!') ?>';
|
101 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
102 |
+
$('data-importing').innerHTML='';
|
103 |
+
$('pause_button').hide();
|
104 |
+
conti=false;
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
if(res[0]){
|
108 |
+
if(res[2]=='failed'){
|
109 |
+
log[ilog]="<li class='log-failed'><img class='v-middle' src='<?php echo $this->getSkinUrl('images/error_msg_icon.gif') ?>'>"+total+" "+res[0]+"</li>";
|
110 |
+
}else{
|
111 |
+
if(total > 0){
|
112 |
+
log[ilog]="<li class='log-success'><img class='v-middle' src='<?php echo $this->getSkinUrl('images/fam_bullet_success.gif') ?>'>"+total+" "+res[0]+"</li>";
|
113 |
+
}else{
|
114 |
+
log[ilog]='';
|
115 |
+
}
|
116 |
+
}
|
117 |
+
ilog++;
|
118 |
+
}
|
119 |
+
|
120 |
+
var temp="";
|
121 |
+
var k=log.length-1;
|
122 |
+
var t=1;
|
123 |
+
while(t<=5&&k>=0){
|
124 |
+
temp+=log[k];
|
125 |
+
k--;
|
126 |
+
t++;
|
127 |
+
}
|
128 |
+
$('body_import').innerHTML=temp;
|
129 |
+
}
|
130 |
+
if(conti){
|
131 |
+
importData(con);
|
132 |
+
}else{
|
133 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
134 |
+
$('status-import').innerHTML='<?php echo $this->__('Paused ') ?>';
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
)
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
var index=1;
|
143 |
+
var a=setInterval(showRow, 1000);
|
144 |
+
function showRow(){
|
145 |
+
var row=$('row-'+index);
|
146 |
+
if(row)
|
147 |
+
row.style.display='block';
|
148 |
+
index++;
|
149 |
+
if(index>4){
|
150 |
+
clearInterval(a) ;
|
151 |
+
<?php if (!$this->checkDataImport()): ?>
|
152 |
+
conti=false;
|
153 |
+
$('status-import').innerHTML='<?php echo $this->__("No data to update!") ?>';
|
154 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
155 |
+
<?php endif; ?>
|
156 |
+
importData(conti);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
</script>
|
161 |
+
<body id="body">
|
162 |
+
<ul>
|
163 |
+
<li style="height:25px;">
|
164 |
+
<button id="pause_button" type="buton" style="float:right;width: 100px;height: 25px;" onclick="resumeImport(this)"><?php echo $this->__('Pause') ?></button>
|
165 |
+
</li>
|
166 |
+
<li id="row-1" style="display:none;">
|
167 |
+
<img style="margin-right:5px" class="v-middle" src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif') ?>" /><?php echo $this->__('Updating data to GeoIP system, please wait...') ?>
|
168 |
+
</li>
|
169 |
+
<li id="row-2" style="background-color:#FFD;display:none;">
|
170 |
+
<img style="margin-right:5px" class="v-middle" src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif') ?>"><?php echo $this->__('Please note: Do not close this window until data is fully updated!') ?>
|
171 |
+
</li>
|
172 |
+
<li id="row-3" style="background-color:#DDF;display:none; ">
|
173 |
+
<img class="v-middle" src="<?php echo $this->getSkinUrl('images/fam_bullet_success.gif') ?>"><?php echo $this->__('Start checking data') ?>
|
174 |
+
</li>
|
175 |
+
<li id="row-4" style="background-color: #FFD;display:none;">
|
176 |
+
<img style="margin-right:5px" id="image-import" class="v-middle" src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>" id="updatedRows_img">
|
177 |
+
<span class="text" id="updatedRows_status">
|
178 |
+
<span id="status-import"></span> <strong id="data-importing"></strong>
|
179 |
+
</span>
|
180 |
+
</li>
|
181 |
+
</ul>
|
182 |
+
<ul id="body_import"></ul>
|
183 |
+
</body>
|
app/design/adminhtml/default/default/template/onestepcheckout/geoip.phtml
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //Zend_Debug::dump($this->checkDataImport());?>
|
2 |
+
<style>
|
3 |
+
body{
|
4 |
+
color: #000;
|
5 |
+
font-size: 15px;
|
6 |
+
}
|
7 |
+
#first{
|
8 |
+
width:75%;
|
9 |
+
}
|
10 |
+
table{
|
11 |
+
width:100%;
|
12 |
+
}
|
13 |
+
td{
|
14 |
+
width: 25%;
|
15 |
+
}
|
16 |
+
.log-import{
|
17 |
+
background: #DDDDFF;
|
18 |
+
color: #fff;
|
19 |
+
}
|
20 |
+
ul {
|
21 |
+
list-style-type: none;
|
22 |
+
margin: 0;
|
23 |
+
padding: 0;
|
24 |
+
}
|
25 |
+
li {
|
26 |
+
border: 1px solid #CCCCCC;
|
27 |
+
font: 12px sans-serif;
|
28 |
+
margin: 2px;
|
29 |
+
padding: 2px;
|
30 |
+
}
|
31 |
+
img {
|
32 |
+
margin-right: 5px;
|
33 |
+
}
|
34 |
+
.log-failed{
|
35 |
+
background-color:#FDD;
|
36 |
+
}
|
37 |
+
.log-success{
|
38 |
+
background-color:#DDF;
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
<?php
|
42 |
+
$url = trim($this->actionImport(), '/');
|
43 |
+
?>
|
44 |
+
<script type="text/javascript">
|
45 |
+
var ilog = 0;
|
46 |
+
var log = new Array();
|
47 |
+
var conti = true;
|
48 |
+
var resumeImport = function(el){
|
49 |
+
var label = {
|
50 |
+
pause: '<?php echo $this->__('Pause') ?>',
|
51 |
+
resume: '<?php echo $this->__('Resume') ?>'
|
52 |
+
};
|
53 |
+
if(conti){
|
54 |
+
conti = false;
|
55 |
+
el.innerHTML = label.resume;
|
56 |
+
} else {
|
57 |
+
conti=true;
|
58 |
+
el.innerHTML = label.pause;
|
59 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLink() ?>');
|
60 |
+
importData(conti);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
var processResult=function(text){
|
64 |
+
if(text!=""){
|
65 |
+
var re=new Array();
|
66 |
+
re=text.split('-');
|
67 |
+
return re;
|
68 |
+
}
|
69 |
+
return null;
|
70 |
+
}
|
71 |
+
var addImage=function(id){
|
72 |
+
var path='<?php echo $this->getImageLink() ?>';
|
73 |
+
$(id).innerHTML+="<span id='ajax-import'><img id='image-import' src='"+path+"' /></span>";
|
74 |
+
}
|
75 |
+
|
76 |
+
var total = 0;
|
77 |
+
var importData=function(con){
|
78 |
+
if(con){
|
79 |
+
var importGeoip=new Ajax.Request(
|
80 |
+
'<?php echo $url ?>',
|
81 |
+
{
|
82 |
+
method:'post',
|
83 |
+
onComplete:function(xhr){
|
84 |
+
if(xhr.responseText){
|
85 |
+
var res=processResult(xhr.responseText);
|
86 |
+
if(res[1]!='complete'){
|
87 |
+
total = total + res[1]/1;
|
88 |
+
$('data-importing').innerHTML=" "+total+" "+res[0];
|
89 |
+
$('status-import').innerHTML='<?php echo $this->__('Processed ') ?>';
|
90 |
+
$('image-import').setAttribute('src', '<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>');
|
91 |
+
}else{
|
92 |
+
$('status-import').innerHTML='<?php echo $this->__('Complete updating!') ?>';
|
93 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
94 |
+
$('data-importing').innerHTML='';
|
95 |
+
$('pause_button').hide();
|
96 |
+
conti=false;
|
97 |
+
return;
|
98 |
+
}
|
99 |
+
if(res[0]){
|
100 |
+
if(res[2]=='failed'){
|
101 |
+
log[ilog]="<li class='log-failed'><img class='v-middle' src='<?php echo $this->getSkinUrl('images/error_msg_icon.gif') ?>'>"+total+" "+res[0]+"</li>";
|
102 |
+
}else{
|
103 |
+
log[ilog]="<li class='log-success'><img class='v-middle' src='<?php echo $this->getSkinUrl('images/fam_bullet_success.gif') ?>'>"+total+" "+res[0]+"</li>";
|
104 |
+
}
|
105 |
+
ilog++;
|
106 |
+
}
|
107 |
+
|
108 |
+
var temp="";
|
109 |
+
var k=log.length-1;
|
110 |
+
var t=1;
|
111 |
+
while(t<=5&&k>=0){
|
112 |
+
temp+=log[k];
|
113 |
+
k--;
|
114 |
+
t++;
|
115 |
+
}
|
116 |
+
$('body_import').innerHTML=temp;
|
117 |
+
}
|
118 |
+
if(conti){
|
119 |
+
importData(con);
|
120 |
+
}else{
|
121 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
122 |
+
$('status-import').innerHTML='<?php echo $this->__('Paused ') ?>';
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
)
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
var index=1;
|
131 |
+
var a=setInterval(showRow, 1000);
|
132 |
+
function showRow(){
|
133 |
+
var row=$('row-'+index);
|
134 |
+
if(row)
|
135 |
+
row.style.display='block';
|
136 |
+
index++;
|
137 |
+
if(index>4){
|
138 |
+
clearInterval(a) ;
|
139 |
+
<?php if (!$this->checkDataImport()): ?>
|
140 |
+
conti=false;
|
141 |
+
$('status-import').innerHTML='<?php echo $this->__("No data to update!") ?>';
|
142 |
+
$('image-import').setAttribute('src', '<?php echo $this->getImageLinkStop() ?>');
|
143 |
+
<?php endif; ?>
|
144 |
+
importData(conti);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
</script>
|
149 |
+
<body id="body">
|
150 |
+
<ul>
|
151 |
+
<li style="height:25px;">
|
152 |
+
<button id="pause_button" type="buton" style="float:right;width: 100px;height: 25px;" onclick="resumeImport(this)"><?php echo $this->__('Pause') ?></button>
|
153 |
+
</li>
|
154 |
+
<li id="row-1" style="display:none;">
|
155 |
+
<img style="margin-right:5px" class="v-middle" src="<?php echo $this->getSkinUrl('images/note_msg_icon.gif') ?>" /><?php echo $this->__('Updating data to GeoIP system, please wait...') ?>
|
156 |
+
</li>
|
157 |
+
<li id="row-2" style="background-color:#FFD;display:none;">
|
158 |
+
<img style="margin-right:5px" class="v-middle" src="<?php echo $this->getSkinUrl('images/fam_bullet_error.gif') ?>"><?php echo $this->__('Please note: Do not close this window until data is fully updated!') ?>
|
159 |
+
</li>
|
160 |
+
<li id="row-3" style="background-color:#DDF;display:none; ">
|
161 |
+
<img class="v-middle" src="<?php echo $this->getSkinUrl('images/fam_bullet_success.gif') ?>"><?php echo $this->__('Start checking data') ?>
|
162 |
+
</li>
|
163 |
+
<li id="row-4" style="background-color: #FFD;display:none;">
|
164 |
+
<img style="margin-right:5px" id="image-import" class="v-middle" src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>" id="updatedRows_img">
|
165 |
+
<span class="text" id="updatedRows_status">
|
166 |
+
<span id="status-import"></span> <strong id="data-importing"></strong>
|
167 |
+
</span>
|
168 |
+
</li>
|
169 |
+
</ul>
|
170 |
+
<ul id="body_import"></ul>
|
171 |
+
</body>
|
app/design/adminhtml/default/default/template/onestepcheckout/geoipgrid.phtml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$user_guide = Mage::helper('onestepcheckout')->__('
|
3 |
+
GeoIP is used to auto detect country of Purchaser by their IP address. Follow these steps to update GeoIP:<br/>
|
4 |
+
1. Click "Upload new GeoIP Database version" and upload the file we provide. Please note that a version was already uploaded when you first install the extension.<br/>
|
5 |
+
2. Come back to this page, in the section below, "Latest version available" will display the version you just upload.<br/>
|
6 |
+
3. Click "Update to Latest version" and the system will update database for you.
|
7 |
+
');
|
8 |
+
?>
|
9 |
+
<?php $geoip = $this->getGeoip();?>
|
10 |
+
<div class="entry-edit">
|
11 |
+
<div class="entry-edit-head">
|
12 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('onestepcheckout')->__('Instructions')?></h4>
|
13 |
+
<div class="form-buttons"></div>
|
14 |
+
</div>
|
15 |
+
<div id="import_form" class="fieldset ">
|
16 |
+
<div class="hor-scroll">
|
17 |
+
<?php echo $user_guide?>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
<div class="entry-edit">
|
22 |
+
<div class="entry-edit-head">
|
23 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('onestepcheckout')->__('Database information')?></h4>
|
24 |
+
<div class="form-buttons"></div>
|
25 |
+
</div>
|
26 |
+
<div id="import_form" class="fieldset ">
|
27 |
+
<div class="hor-scroll">
|
28 |
+
<table cellspacing="0" class="form-list">
|
29 |
+
<tbody>
|
30 |
+
<tr>
|
31 |
+
<td class="label"><label for="csv_geoip"><strong><?php echo Mage::helper('onestepcheckout')->__('Records Updated')?>:</strong><span class="required"></span></label></td>
|
32 |
+
<td class="value">
|
33 |
+
<?php echo $geoip->getCurrentRecords();?>
|
34 |
+
</td>
|
35 |
+
</tr>
|
36 |
+
<tr>
|
37 |
+
<td class="label"><label for="csv_geoip"><strong><?php echo Mage::helper('onestepcheckout')->__('Records Total')?>:</strong><span class="required"></span></label></td>
|
38 |
+
<td class="value">
|
39 |
+
<?php echo $geoip->getTotalRecords();?>
|
40 |
+
</td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td class="label"><label for="csv_geoip"><strong><?php echo Mage::helper('onestepcheckout')->__('You are using version')?>:</strong><span class="required"></span></label></td>
|
44 |
+
<td class="value">
|
45 |
+
<?php echo $geoip->getCurrentVersion();?>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
<tr>
|
49 |
+
<td class="label"><label for="csv_geoip"><strong><?php echo Mage::helper('onestepcheckout')->__('Latest version available')?>:</strong><span class="required"></span></label></td>
|
50 |
+
<td class="value">
|
51 |
+
<?php echo $geoip->getLastVersion();?>
|
52 |
+
</td>
|
53 |
+
</tr>
|
54 |
+
<tr>
|
55 |
+
<td class="label"><label for="csv_geoip"><strong><?php echo Mage::helper('onestepcheckout')->__('Status')?>:</strong><span class="required"></span></label></td>
|
56 |
+
<td class="value">
|
57 |
+
<span class="<?php if($geoip->getStatus()) echo 'grid-severity-notice'; else echo 'grid-severity-major'?>">
|
58 |
+
<span><?php echo Mage::getModel('onestepcheckout/countrylist')->getStatusLabel($geoip->getStatus());?> </span>
|
59 |
+
</span>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
<br/>
|
63 |
+
<tr>
|
64 |
+
<td class="label"><label for="csv_geoip"><span class="required"></span></label></td>
|
65 |
+
<td class="value">
|
66 |
+
<button onclick="importGeoIp('<?php echo $this->linkUpdateGeoip()?>')" type="button"><?php echo Mage::helper('onestepcheckout')->__('Update to latest version')?></button>
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
</tbody>
|
70 |
+
</table>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
|
app/design/adminhtml/default/default/template/onestepcheckout/info.phtml
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_order = $this->getOrder() ?>
|
28 |
+
<div>
|
29 |
+
<div id="order-messages">
|
30 |
+
<?php echo $this->getChildHtml('order_messages') ?>
|
31 |
+
</div>
|
32 |
+
<?php echo $this->getChildHtml('order_info') ?>
|
33 |
+
<input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
|
34 |
+
<?php if ($_order->getIsVirtual()): ?>
|
35 |
+
<div class="box-right">
|
36 |
+
<?php else: ?>
|
37 |
+
<div class="box-left">
|
38 |
+
<?php endif; ?>
|
39 |
+
<!--Payment Method-->
|
40 |
+
<div class="entry-edit">
|
41 |
+
<div class="entry-edit-head">
|
42 |
+
<h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
|
43 |
+
</div>
|
44 |
+
<fieldset>
|
45 |
+
<?php echo $this->getPaymentHtml() ?>
|
46 |
+
<div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
|
47 |
+
</fieldset>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
<?php if (!$_order->getIsVirtual()): ?>
|
51 |
+
<div class="box-right">
|
52 |
+
<!--Shipping Method-->
|
53 |
+
<div class="entry-edit">
|
54 |
+
<div class="entry-edit-head">
|
55 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping & Handling Information') ?></h4>
|
56 |
+
</div>
|
57 |
+
<fieldset>
|
58 |
+
<?php if ($_order->getTracksCollection()->count()) : ?>
|
59 |
+
<a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
|
60 |
+
<br/>
|
61 |
+
<?php endif; ?>
|
62 |
+
<?php if ($_order->getShippingDescription()): ?>
|
63 |
+
<strong><?php echo $_order->getShippingDescription() ?></strong>
|
64 |
+
|
65 |
+
<?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
|
66 |
+
<?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
|
67 |
+
<?php else: ?>
|
68 |
+
<?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
|
69 |
+
<?php endif; ?>
|
70 |
+
<?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
|
71 |
+
|
72 |
+
<?php echo $_excl; ?>
|
73 |
+
<?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
|
74 |
+
(<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
|
75 |
+
<?php endif; ?>
|
76 |
+
<?php else: ?>
|
77 |
+
<?php echo $this->helper('sales')->__('No shipping information available'); ?>
|
78 |
+
<?php endif; ?>
|
79 |
+
</fieldset>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
<?php endif; ?>
|
83 |
+
<div class="clear"></div>
|
84 |
+
|
85 |
+
<!-- Survey -->
|
86 |
+
<?php
|
87 |
+
$orderId=Mage::app()->getRequest()->getParam('order_id');
|
88 |
+
$survey = Mage::getModel('onestepcheckout/survey')->load($orderId, 'order_id');
|
89 |
+
?>
|
90 |
+
<?php if($survey->getId()):?>
|
91 |
+
<div class="box-left">
|
92 |
+
<div class="entry-edit">
|
93 |
+
<div class="entry-edit-head">
|
94 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Survey Information') ?></h4>
|
95 |
+
</div>
|
96 |
+
<fieldset>
|
97 |
+
<div class="grid">
|
98 |
+
<div class="hor-scroll">
|
99 |
+
<table cellspacing="0" class="data">
|
100 |
+
<tbody>
|
101 |
+
<tr class="odd">
|
102 |
+
<td class="a-left" style="width:25%;border-right:none !important;font-weight:bold" ><?php echo Mage::helper('onestepcheckout')->__('Survey Question :') ?></td>
|
103 |
+
<td class="a-left">
|
104 |
+
<?php echo $survey->getQuestion();?>
|
105 |
+
</td>
|
106 |
+
</tr>
|
107 |
+
<tr class="even">
|
108 |
+
<td class="a-left" style="width:25%;border-right:none !important;font-weight:bold"><?php echo Mage::helper('onestepcheckout')->__('Answer: ') ?></td>
|
109 |
+
<td class="a-left">
|
110 |
+
<?php echo $survey->getAnswer();?>
|
111 |
+
</td>
|
112 |
+
</tr>
|
113 |
+
</tbody>
|
114 |
+
</table>
|
115 |
+
|
116 |
+
</div>
|
117 |
+
</div>
|
118 |
+
</fieldset>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
<?php endif;?>
|
122 |
+
|
123 |
+
<!-- begin of customer comment -->
|
124 |
+
<?php if($_order->getOnestepcheckoutOrderComment()):?>
|
125 |
+
<div class="box-right">
|
126 |
+
<div class="entry-edit">
|
127 |
+
<div class="entry-edit-head">
|
128 |
+
<h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Customer Comment') ?></h4>
|
129 |
+
</div>
|
130 |
+
<fieldset>
|
131 |
+
<?php echo $_order->getOnestepcheckoutOrderComment();?>
|
132 |
+
</fieldset>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
<!-- end of customer comment -->
|
136 |
+
<?php endif;?>
|
137 |
+
<div class="clear"></div>
|
138 |
+
<?php echo $this->getGiftmessageHtml() ?>
|
139 |
+
|
140 |
+
<div class="clear"></div>
|
141 |
+
<div class="entry-edit">
|
142 |
+
<div class="entry-edit-head">
|
143 |
+
<h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
<?php echo $this->getItemsHtml() ?>
|
147 |
+
<div class="clear"></div>
|
148 |
+
|
149 |
+
<div class="box-left">
|
150 |
+
<div class="entry-edit">
|
151 |
+
<div class="entry-edit-head">
|
152 |
+
<h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
|
153 |
+
</div>
|
154 |
+
<fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
<div class="box-right entry-edit">
|
158 |
+
<div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
|
159 |
+
<div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
|
160 |
+
</div>
|
161 |
+
<div class="clear"></div>
|
162 |
+
</div>
|
app/design/adminhtml/default/default/template/onestepcheckout/sales/order/view/tab/delivery.phtml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$orderId=Mage::app()->getRequest()->getParam('order_id');
|
3 |
+
$delivery = Mage::getModel('onestepcheckout/delivery')->load($orderId, 'order_id');
|
4 |
+
?>
|
5 |
+
<?php if($this->getLastItem()) {?>
|
6 |
+
</table>
|
7 |
+
|
8 |
+
<?php if($delivery->getId()):?>
|
9 |
+
<div class="entry-edit">
|
10 |
+
<fieldset>
|
11 |
+
<div class="delivery">
|
12 |
+
<div class="entry-edit-head">
|
13 |
+
<h4 class="icon-head head-account">
|
14 |
+
<?php echo Mage::helper('onestepcheckout')->__('Time of Delivery') ?>
|
15 |
+
</h4>
|
16 |
+
</div>
|
17 |
+
</div>
|
18 |
+
<div class="grid">
|
19 |
+
<div class="hor-scroll">
|
20 |
+
<table cellspacing="0" class="data">
|
21 |
+
<tbody>
|
22 |
+
<tr class="odd">
|
23 |
+
|
24 |
+
<td class="a-left" style="height:35px;line-height:35px;font-weight:bold;padding-left:10px;">
|
25 |
+
<?php echo $delivery->getDeliveryTimeDate();?>
|
26 |
+
</td>
|
27 |
+
</tr>
|
28 |
+
|
29 |
+
</tbody>
|
30 |
+
</table>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
</fieldset>
|
34 |
+
</div>
|
35 |
+
<?php endif;?>
|
36 |
+
<?php } ?>
|
app/design/adminhtml/default/default/template/onestepcheckout/sales/order/view/tab/survey.phtml
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<?php
|
3 |
+
$orderId=Mage::app()->getRequest()->getParam('order_id');
|
4 |
+
$survey = Mage::getModel('onestepcheckout/survey')->load($orderId, 'order_id');
|
5 |
+
$comment = Mage::getModel('sales/order')->load($orderId)->getOnestepcheckoutOrderComment();
|
6 |
+
//echo 'LAN';
|
7 |
+
?>
|
8 |
+
<?php if($this->getLastItem()) {?>
|
9 |
+
</table>
|
10 |
+
<?php if($survey->getId()):?>
|
11 |
+
<div class="entry-edit">
|
12 |
+
<fieldset>
|
13 |
+
<div class="survey">
|
14 |
+
<div class="entry-edit-head">
|
15 |
+
<h4 class="icon-head head-account">
|
16 |
+
<?php echo Mage::helper('onestepcheckout')->__('Survey Information') ?>
|
17 |
+
</h4>
|
18 |
+
</div>
|
19 |
+
</div>
|
20 |
+
<div class="grid">
|
21 |
+
<div class="hor-scroll">
|
22 |
+
<table cellspacing="0" class="data">
|
23 |
+
<tbody>
|
24 |
+
<tr class="odd">
|
25 |
+
<td class="a-left" style="width:25%;border-right:none !important;font-weight:bold" ><?php echo Mage::helper('onestepcheckout')->__('Survey Question :') ?></td>
|
26 |
+
<td class="a-left">
|
27 |
+
<?php echo $survey->getQuestion();?>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
<tr class="even">
|
31 |
+
<td class="a-left" style="width:25%;border-right:none !important;font-weight:bold"><?php echo Mage::helper('onestepcheckout')->__('Answer: ') ?></td>
|
32 |
+
<td class="a-left">
|
33 |
+
<?php echo $survey->getAnswer();?>
|
34 |
+
</td>
|
35 |
+
</tr>
|
36 |
+
</tbody>
|
37 |
+
</table>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</fieldset>
|
41 |
+
</div>
|
42 |
+
<?php endif;?>
|
43 |
+
<?php if($comment):?>
|
44 |
+
<div class="entry-edit" >
|
45 |
+
<fieldset>
|
46 |
+
<div class="survey">
|
47 |
+
<div class="entry-edit-head">
|
48 |
+
<h4 class="icon-head head-account">
|
49 |
+
<?php echo Mage::helper('onestepcheckout')->__('Comment') ?>
|
50 |
+
</h4>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
<div class="grid">
|
54 |
+
<div class="hor-scroll">
|
55 |
+
<table cellspacing="0" class="data">
|
56 |
+
<tbody>
|
57 |
+
<tr class="even">
|
58 |
+
<td class="a-left">
|
59 |
+
<?php echo $comment;?>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
</tbody>
|
63 |
+
</table>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</fieldset>
|
67 |
+
</div>
|
68 |
+
<?php endif;?>
|
69 |
+
<?php } ?>
|
app/design/frontend/abserve/shoestore/etc/theme.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<theme>
|
29 |
+
<parent />
|
30 |
+
</theme>
|
app/design/frontend/abserve/shoestore/etc/widget.xml
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<widgets>
|
29 |
+
<new_products>
|
30 |
+
<parameters>
|
31 |
+
<template>
|
32 |
+
<values>
|
33 |
+
<list_default translate="label">
|
34 |
+
<value>catalog/product/widget/new/column/new_default_list.phtml</value>
|
35 |
+
<label>New Products Images and Names Template</label>
|
36 |
+
</list_default>
|
37 |
+
<list_names translate="label">
|
38 |
+
<value>catalog/product/widget/new/column/new_names_list.phtml</value>
|
39 |
+
<label>New Products Names Only Template</label>
|
40 |
+
</list_names>
|
41 |
+
<list_images translate="label">
|
42 |
+
<value>catalog/product/widget/new/column/new_images_list.phtml</value>
|
43 |
+
<label>New Products Images Only Template</label>
|
44 |
+
</list_images>
|
45 |
+
</values>
|
46 |
+
</template>
|
47 |
+
</parameters>
|
48 |
+
<supported_blocks>
|
49 |
+
<left_column>
|
50 |
+
<block_name>left</block_name>
|
51 |
+
<template>
|
52 |
+
<default>list_default</default>
|
53 |
+
<names_only>list_names</names_only>
|
54 |
+
<images_only>list_images</images_only>
|
55 |
+
</template>
|
56 |
+
</left_column>
|
57 |
+
<main_content>
|
58 |
+
<block_name>content</block_name>
|
59 |
+
<template>
|
60 |
+
<grid>default</grid>
|
61 |
+
<list>list</list>
|
62 |
+
</template>
|
63 |
+
</main_content>
|
64 |
+
<right_column>
|
65 |
+
<block_name>right</block_name>
|
66 |
+
<template>
|
67 |
+
<default>list_default</default>
|
68 |
+
<names_only>list_names</names_only>
|
69 |
+
<images_only>list_images</images_only>
|
70 |
+
</template>
|
71 |
+
</right_column>
|
72 |
+
</supported_blocks>
|
73 |
+
</new_products>
|
74 |
+
|
75 |
+
<recently_viewed>
|
76 |
+
<parameters>
|
77 |
+
<template>
|
78 |
+
<values>
|
79 |
+
<list_default translate="label">
|
80 |
+
<value>reports/widget/viewed/column/viewed_default_list.phtml</value>
|
81 |
+
<label>Viewed Products Images and Names Template</label>
|
82 |
+
</list_default>
|
83 |
+
<list_names translate="label">
|
84 |
+
<value>reports/widget/viewed/column/viewed_names_list.phtml</value>
|
85 |
+
<label>Viewed Products Names Only Template</label>
|
86 |
+
</list_names>
|
87 |
+
<list_images translate="label">
|
88 |
+
<value>reports/widget/viewed/column/viewed_images_list.phtml</value>
|
89 |
+
<label>Viewed Products Images Only Template</label>
|
90 |
+
</list_images>
|
91 |
+
</values>
|
92 |
+
</template>
|
93 |
+
</parameters>
|
94 |
+
<supported_blocks>
|
95 |
+
<left_column>
|
96 |
+
<block_name>left</block_name>
|
97 |
+
<template>
|
98 |
+
<default>list_default</default>
|
99 |
+
<names_only>list_names</names_only>
|
100 |
+
<images_only>list_images</images_only>
|
101 |
+
</template>
|
102 |
+
</left_column>
|
103 |
+
<main_content>
|
104 |
+
<block_name>content</block_name>
|
105 |
+
<template>
|
106 |
+
<grid>default</grid>
|
107 |
+
<list>list</list>
|
108 |
+
</template>
|
109 |
+
</main_content>
|
110 |
+
<right_column>
|
111 |
+
<block_name>right</block_name>
|
112 |
+
<template>
|
113 |
+
<default>list_default</default>
|
114 |
+
<names_only>list_names</names_only>
|
115 |
+
<images_only>list_images</images_only>
|
116 |
+
</template>
|
117 |
+
</right_column>
|
118 |
+
</supported_blocks>
|
119 |
+
</recently_viewed>
|
120 |
+
|
121 |
+
<recently_compared>
|
122 |
+
<parameters>
|
123 |
+
<template>
|
124 |
+
<values>
|
125 |
+
<list_default translate="label">
|
126 |
+
<value>reports/widget/compared/column/compared_default_list.phtml</value>
|
127 |
+
<label>Compared Products Images and Names Template</label>
|
128 |
+
</list_default>
|
129 |
+
<list_names translate="label">
|
130 |
+
<value>reports/widget/compared/column/compared_names_list.phtml</value>
|
131 |
+
<label>Compared Product Names Only Template</label>
|
132 |
+
</list_names>
|
133 |
+
<list_images translate="label">
|
134 |
+
<value>reports/widget/compared/column/compared_images_list.phtml</value>
|
135 |
+
<label>Compared Product Images Only Template</label>
|
136 |
+
</list_images>
|
137 |
+
</values>
|
138 |
+
</template>
|
139 |
+
</parameters>
|
140 |
+
<supported_blocks>
|
141 |
+
<left_column>
|
142 |
+
<block_name>left</block_name>
|
143 |
+
<template>
|
144 |
+
<default>list_default</default>
|
145 |
+
<names_only>list_names</names_only>
|
146 |
+
<images_only>list_images</images_only>
|
147 |
+
</template>
|
148 |
+
</left_column>
|
149 |
+
<main_content>
|
150 |
+
<block_name>content</block_name>
|
151 |
+
<template>
|
152 |
+
<grid>default</grid>
|
153 |
+
<list>list</list>
|
154 |
+
</template>
|
155 |
+
</main_content>
|
156 |
+
<right_column>
|
157 |
+
<block_name>right</block_name>
|
158 |
+
<template>
|
159 |
+
<default>list_default</default>
|
160 |
+
<names_only>list_names</names_only>
|
161 |
+
<images_only>list_images</images_only>
|
162 |
+
</template>
|
163 |
+
</right_column>
|
164 |
+
</supported_blocks>
|
165 |
+
</recently_compared>
|
166 |
+
</widgets>
|
app/design/frontend/abserve/shoestore/layout/abservemegamenu/custommenu.xml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<layout version="0.1.0">
|
12 |
+
<default>
|
13 |
+
<block type="custommenu/toggle"></block>
|
14 |
+
</default>
|
15 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/ajaxcart.xml
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<layout version="0.1.0">
|
12 |
+
<default>
|
13 |
+
<reference name="head">
|
14 |
+
<action method="addCss">
|
15 |
+
<stylesheet>css/abserve/abserve.css</stylesheet>
|
16 |
+
</action>
|
17 |
+
<!--ajaxcart assets start-->
|
18 |
+
<action method="addItem">
|
19 |
+
<type>skin_js</type>
|
20 |
+
<name>ajaxcart/growler.js</name>
|
21 |
+
</action>
|
22 |
+
<action method="addCss">
|
23 |
+
<stylesheet>ajaxcart/growler.css</stylesheet>
|
24 |
+
</action>
|
25 |
+
<action method="addCss">
|
26 |
+
<stylesheet>ajaxcart/modalbox.css</stylesheet>
|
27 |
+
</action>
|
28 |
+
<action method="addItem">
|
29 |
+
<type>skin_js</type>
|
30 |
+
<name>ajaxcart/modalbox.js</name>
|
31 |
+
</action>
|
32 |
+
<action method="addItem">
|
33 |
+
<type>skin_js</type>
|
34 |
+
<name>ajaxcart/ajaxcart.js</name>
|
35 |
+
</action>
|
36 |
+
<!--ajaxcart assets end-->
|
37 |
+
|
38 |
+
<!-- product type assets start -->
|
39 |
+
<action method="addJs">
|
40 |
+
<script>varien/product.js</script>
|
41 |
+
</action>
|
42 |
+
<action method="addJs">
|
43 |
+
<script>varien/configurable.js</script>
|
44 |
+
</action>
|
45 |
+
<action method="addItem">
|
46 |
+
<type>skin_js</type>
|
47 |
+
<name>js/bundle.js</name>
|
48 |
+
</action>
|
49 |
+
|
50 |
+
<action method="addItem">
|
51 |
+
<type>js_css</type>
|
52 |
+
<name>calendar/calendar-win2k-1.css</name>
|
53 |
+
<params/>
|
54 |
+
<!--<if/><condition>can_load_calendar_js</condition>-->
|
55 |
+
</action>
|
56 |
+
<action method="addItem">
|
57 |
+
<type>js</type>
|
58 |
+
<name>calendar/calendar.js</name>
|
59 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
60 |
+
</action>
|
61 |
+
<action method="addItem">
|
62 |
+
<type>js</type>
|
63 |
+
<name>calendar/calendar-setup.js</name>
|
64 |
+
<!--<params/><if/><condition>can_load_calendar_js</condition>-->
|
65 |
+
</action>
|
66 |
+
<!-- product type assets end -->
|
67 |
+
</reference>
|
68 |
+
</default>
|
69 |
+
<ajaxcart>
|
70 |
+
<reference name="content">
|
71 |
+
<block type="checkout/cart" name="checkout.cart">
|
72 |
+
<action method="setCartTemplate">
|
73 |
+
<value>checkout/cart.phtml</value>
|
74 |
+
</action>
|
75 |
+
<action method="setEmptyTemplate">
|
76 |
+
<value>checkout/cart/noItems.phtml</value>
|
77 |
+
</action>
|
78 |
+
<action method="chooseTemplate"/>
|
79 |
+
<action method="addItemRender">
|
80 |
+
<type>simple</type>
|
81 |
+
<block>checkout/cart_item_renderer</block>
|
82 |
+
<template>checkout/cart/item/default.phtml</template>
|
83 |
+
</action>
|
84 |
+
<action method="addItemRender">
|
85 |
+
<type>grouped</type>
|
86 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
87 |
+
<template>checkout/cart/item/default.phtml</template>
|
88 |
+
</action>
|
89 |
+
<action method="addItemRender">
|
90 |
+
<type>configurable</type>
|
91 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
92 |
+
<template>checkout/cart/item/default.phtml</template>
|
93 |
+
</action>
|
94 |
+
|
95 |
+
<block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label">
|
96 |
+
<label>Payment Methods Before Checkout Button</label>
|
97 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
98 |
+
template="checkout/onepage/link.phtml"/>
|
99 |
+
</block>
|
100 |
+
|
101 |
+
<block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label">
|
102 |
+
<label>Shopping Cart Form Before</label>
|
103 |
+
</block>
|
104 |
+
|
105 |
+
<block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
|
106 |
+
<label>Payment Methods After Checkout Button</label>
|
107 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage"
|
108 |
+
template="checkout/onepage/link.phtml"/>
|
109 |
+
<block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping"
|
110 |
+
template="checkout/multishipping/link.phtml"/>
|
111 |
+
</block>
|
112 |
+
|
113 |
+
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon"
|
114 |
+
template="checkout/cart/coupon.phtml"/>
|
115 |
+
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping"
|
116 |
+
template="checkout/cart/shipping.phtml"/>
|
117 |
+
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell"
|
118 |
+
template="checkout/cart/crosssell.phtml"/>
|
119 |
+
|
120 |
+
<block type="checkout/cart_totals" name="checkout.cart.totals" as="totals"
|
121 |
+
template="checkout/cart/totals.phtml"/>
|
122 |
+
</block>
|
123 |
+
</reference>
|
124 |
+
</ajaxcart>
|
125 |
+
<ajaxcart_configurable_options>
|
126 |
+
<reference name="content">
|
127 |
+
<block type="catalog/product_view" name="ajaxcart.configurable.options"
|
128 |
+
template="ajaxcart/configurable_options.phtml" as="ajaxcart.configurable.options">
|
129 |
+
<block type="core/template_facade" name="product.info.container1" as="container1">
|
130 |
+
<action method="setDataByKey">
|
131 |
+
<key>alias_in_layout</key>
|
132 |
+
<value>container1</value>
|
133 |
+
</action>
|
134 |
+
<action method="setDataByKeyFromRegistry">
|
135 |
+
<key>options_container</key>
|
136 |
+
<key_in_registry>product</key_in_registry>
|
137 |
+
</action>
|
138 |
+
<action method="append">
|
139 |
+
<block>product.info.options.wrapper</block>
|
140 |
+
</action>
|
141 |
+
<action method="append">
|
142 |
+
<block>product.info.options.wrapper.bottom</block>
|
143 |
+
</action>
|
144 |
+
</block>
|
145 |
+
</block>
|
146 |
+
</reference>
|
147 |
+
</ajaxcart_configurable_options>
|
148 |
+
<ajaxcart_bundle_options>
|
149 |
+
<reference name="content">
|
150 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.bundle" as="product_type_data" template="bundle/catalog/product/view/type/bundle.phtml">
|
151 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
152 |
+
<block type="bundle/catalog_product_price" name="bundle.prices" as="bundle_prices" template="bundle/catalog/product/view/price.phtml">
|
153 |
+
<action method="setMAPTemplate"><tmpl>catalog/product/price_msrp_item.phtml</tmpl></action>
|
154 |
+
</block>
|
155 |
+
</block>
|
156 |
+
</reference>
|
157 |
+
</ajaxcart_bundle_options>
|
158 |
+
<ajaxcart_grouped_options translate="label" module="catalog">
|
159 |
+
<reference name="content">
|
160 |
+
<block type="catalog/product_view" name="ajaxcart.grouped.options"
|
161 |
+
template="ajaxcart/grouped_options.phtml" as="ajaxcart.grouped.options">
|
162 |
+
<block type="catalog/product_view_type_grouped" name="grouped.options"
|
163 |
+
as="grouped.options" template="catalog/product/view/type/grouped.phtml">
|
164 |
+
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"
|
165 |
+
translate="label">
|
166 |
+
<label>Product Extra Info</label>
|
167 |
+
</block>
|
168 |
+
</block>
|
169 |
+
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
|
170 |
+
</block>
|
171 |
+
</reference>
|
172 |
+
</ajaxcart_grouped_options>
|
173 |
+
|
174 |
+
<!-- for magento 1.9 -->
|
175 |
+
<catalog_category_default translate="label">
|
176 |
+
<!-- Mage_Catalog -->
|
177 |
+
<reference name="product_list">
|
178 |
+
<action method="setTemplate"><template>ajaxcart/catalog/product/list.phtml</template></action>
|
179 |
+
</reference>
|
180 |
+
</catalog_category_default>
|
181 |
+
<catalog_category_layered translate="label">
|
182 |
+
<!-- Mage_Catalog -->
|
183 |
+
<reference name="product_list">
|
184 |
+
<action method="setTemplate"><template>ajaxcart/catalog/product/list.phtml</template></action>
|
185 |
+
</reference>
|
186 |
+
</catalog_category_layered>
|
187 |
+
|
188 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/ajaxwishlist.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<layout version="0.1.0">
|
12 |
+
<catalog_product_view>
|
13 |
+
<reference name="head">
|
14 |
+
<action method="addItem"><type>js</type><name>jquery/jquery-ui.js</name></action>
|
15 |
+
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
16 |
+
<action method="addItem"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
17 |
+
</reference>
|
18 |
+
<reference name='product.info.addto'>
|
19 |
+
<action method='setTemplate'><template>ajaxwishlist/catalog/product/view/addto.phtml</template></action>
|
20 |
+
</reference>
|
21 |
+
</catalog_product_view>
|
22 |
+
<catalog_category_default>
|
23 |
+
<reference name="head">
|
24 |
+
<action method="addItem"><type>js</type><name>jquery/jquery-ui.js</name></action>
|
25 |
+
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
26 |
+
<action method="addItem"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
27 |
+
</reference>
|
28 |
+
<reference name='product_list'>
|
29 |
+
<action method='setTemplate'><template>ajaxwishlist/catalog/product/list.phtml</template></action>
|
30 |
+
</reference>
|
31 |
+
</catalog_category_default>
|
32 |
+
<catalog_category_layered>
|
33 |
+
<reference name="head">
|
34 |
+
<action method="addItem"><type>js</type><name>jquery/jquery-ui.js</name></action>
|
35 |
+
<action method="addItem"><type>js</type><name>jquery/noconflict.js</name></action>
|
36 |
+
<action method="addItem"><type>skin_js</type><name>js/ajaxwishlist/ajaxwishlist.js</name></action>
|
37 |
+
</reference>
|
38 |
+
<reference name='product_list'>
|
39 |
+
<action method='setTemplate'><template>ajaxwishlist/catalog/product/list.phtml</template></action>
|
40 |
+
</reference>
|
41 |
+
</catalog_category_layered>
|
42 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/bundle.xml
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<!--
|
32 |
+
Adding custom product price block
|
33 |
+
-->
|
34 |
+
|
35 |
+
<catalog_category_default>
|
36 |
+
<reference name="product_list">
|
37 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
38 |
+
</reference>
|
39 |
+
</catalog_category_default>
|
40 |
+
|
41 |
+
<catalog_category_view>
|
42 |
+
<reference name="product_list">
|
43 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
44 |
+
</reference>
|
45 |
+
</catalog_category_view>
|
46 |
+
|
47 |
+
<catalog_category_layered>
|
48 |
+
<reference name="product_list">
|
49 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
50 |
+
</reference>
|
51 |
+
</catalog_category_layered>
|
52 |
+
|
53 |
+
<catalog_product_compare_index>
|
54 |
+
<reference name="catalog.compare.list">
|
55 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
56 |
+
</reference>
|
57 |
+
</catalog_product_compare_index>
|
58 |
+
|
59 |
+
<catalogsearch_result_index>
|
60 |
+
<reference name="search_result_list">
|
61 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
62 |
+
</reference>
|
63 |
+
</catalogsearch_result_index>
|
64 |
+
|
65 |
+
<catalogsearch_advanced_result>
|
66 |
+
<reference name="search_result_list">
|
67 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
68 |
+
</reference>
|
69 |
+
</catalogsearch_advanced_result>
|
70 |
+
|
71 |
+
<tag_product_list>
|
72 |
+
<reference name="search_result_list">
|
73 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
74 |
+
</reference>
|
75 |
+
</tag_product_list>
|
76 |
+
|
77 |
+
<tag_customer_view>
|
78 |
+
<reference name="customer_view">
|
79 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
80 |
+
</reference>
|
81 |
+
</tag_customer_view>
|
82 |
+
|
83 |
+
<default>
|
84 |
+
<reference name="minicart_head">
|
85 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
|
86 |
+
</reference>
|
87 |
+
<reference name="cart_sidebar">
|
88 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
|
89 |
+
</reference>
|
90 |
+
<reference name="wishlist_sidebar">
|
91 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
92 |
+
</reference>
|
93 |
+
<reference name="catalog_product_price_template">
|
94 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
95 |
+
</reference>
|
96 |
+
</default>
|
97 |
+
|
98 |
+
<catalog_product_view>
|
99 |
+
<reference name="catalog.product.related">
|
100 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
101 |
+
</reference>
|
102 |
+
</catalog_product_view>
|
103 |
+
|
104 |
+
<!--
|
105 |
+
Partof block for simple products
|
106 |
+
-->
|
107 |
+
|
108 |
+
<PRODUCT_TYPE_simple>
|
109 |
+
<!--
|
110 |
+
<reference name="product.info.additional">
|
111 |
+
|
112 |
+
<block type="bundle/catalog_product_list_partof" before="-" name="product.info.partof" as="partof_products" template="bundle/catalog/product/list/partof.phtml">
|
113 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
114 |
+
</block>
|
115 |
+
-->
|
116 |
+
<reference name="product.info.upsell">
|
117 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
118 |
+
<action method="setItemLimit"><type>bundle</type><limit>4</limit></action>
|
119 |
+
</reference>
|
120 |
+
</PRODUCT_TYPE_simple>
|
121 |
+
|
122 |
+
<!--
|
123 |
+
Shopping cart item renderer (sidebar)
|
124 |
+
-->
|
125 |
+
|
126 |
+
<customer_account>
|
127 |
+
<reference name="cart_sidebar">
|
128 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
|
129 |
+
</reference>
|
130 |
+
</customer_account>
|
131 |
+
|
132 |
+
<!--
|
133 |
+
Shopping cart item renderer
|
134 |
+
-->
|
135 |
+
|
136 |
+
<checkout_cart_index>
|
137 |
+
<reference name="checkout.cart">
|
138 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action>
|
139 |
+
</reference>
|
140 |
+
<reference name="checkout.cart.crosssell">
|
141 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
142 |
+
</reference>
|
143 |
+
</checkout_cart_index>
|
144 |
+
|
145 |
+
<!--
|
146 |
+
Onepage Checkout Review Page
|
147 |
+
-->
|
148 |
+
|
149 |
+
<checkout_onepage_review>
|
150 |
+
<reference name="root">
|
151 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
152 |
+
</reference>
|
153 |
+
</checkout_onepage_review>
|
154 |
+
|
155 |
+
<checkout_multishipping_addresses>
|
156 |
+
<reference name="checkout_addresses">
|
157 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
158 |
+
</reference>
|
159 |
+
</checkout_multishipping_addresses>
|
160 |
+
|
161 |
+
<checkout_multishipping_shipping>
|
162 |
+
<reference name="checkout_shipping">
|
163 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
164 |
+
</reference>
|
165 |
+
<reference name="checkout_billing_items">
|
166 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
167 |
+
</reference>
|
168 |
+
</checkout_multishipping_shipping>
|
169 |
+
|
170 |
+
<checkout_multishipping_overview>
|
171 |
+
<reference name="checkout_overview">
|
172 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
173 |
+
</reference>
|
174 |
+
</checkout_multishipping_overview>
|
175 |
+
|
176 |
+
<paypal_express_review>
|
177 |
+
<reference name="paypal.express.review.details">
|
178 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
179 |
+
</reference>
|
180 |
+
</paypal_express_review>
|
181 |
+
<paypal_express_review_details>
|
182 |
+
<reference name="root">
|
183 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
184 |
+
</reference>
|
185 |
+
</paypal_express_review_details>
|
186 |
+
|
187 |
+
<paypaluk_express_review>
|
188 |
+
<reference name="paypal.express.review.details">
|
189 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
190 |
+
</reference>
|
191 |
+
</paypaluk_express_review>
|
192 |
+
<paypaluk_express_review_details>
|
193 |
+
<reference name="root">
|
194 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
195 |
+
</reference>
|
196 |
+
</paypaluk_express_review_details>
|
197 |
+
|
198 |
+
<!--
|
199 |
+
Additional block for bundle product type
|
200 |
+
-->
|
201 |
+
|
202 |
+
<PRODUCT_TYPE_bundle translate="label" module="bundle">
|
203 |
+
<label>Catalog Product View (Bundle)</label>
|
204 |
+
<reference name="head">
|
205 |
+
<action method="addItem"><type>skin_js</type><name>js/bundle.js</name></action>
|
206 |
+
</reference>
|
207 |
+
<reference name="product.info">
|
208 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/price.phtml</template></action>
|
209 |
+
<block type="bundle/catalog_product_price" name="bundle.prices" as="bundle_prices" template="bundle/catalog/product/view/price.phtml">
|
210 |
+
<action method="setMAPTemplate"><tmpl>catalog/product/price_msrp_item.phtml</tmpl></action>
|
211 |
+
</block>
|
212 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.bundle" as="product_type_data" template="bundle/catalog/product/view/type/bundle.phtml"/>
|
213 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.availability" as="product_type_availability" template="bundle/catalog/product/view/type/bundle/availability.phtml" />
|
214 |
+
</reference>
|
215 |
+
<reference name="product.info.options.wrapper">
|
216 |
+
<block type="bundle/catalog_product_view_type_bundle" name="product.info.bundle.options" as="type_bundle_options" template="bundle/catalog/product/view/type/bundle/options.phtml">
|
217 |
+
<action method="addRenderer"><type>select</type><block>bundle/catalog_product_view_type_bundle_option_select</block></action>
|
218 |
+
<action method="addRenderer"><type>multi</type><block>bundle/catalog_product_view_type_bundle_option_multi</block></action>
|
219 |
+
<action method="addRenderer"><type>radio</type><block>bundle/catalog_product_view_type_bundle_option_radio</block></action>
|
220 |
+
<action method="addRenderer"><type>checkbox</type><block>bundle/catalog_product_view_type_bundle_option_checkbox</block></action>
|
221 |
+
</block>
|
222 |
+
<action method="insert"><block>product.info.bundle.options</block></action>
|
223 |
+
</reference>
|
224 |
+
<reference name="product.info.options.wrapper.bottom">
|
225 |
+
<remove name="product.tierprices" />
|
226 |
+
<block type="bundle/catalog_product_view" name="bundle.tierprices" as="tierprices" before="-" template="bundle/catalog/product/view/tierprices.phtml"/>
|
227 |
+
<block type="cataloginventory/qtyincrements" name="product.info.qtyincrements" before="-" template="cataloginventory/qtyincrements.phtml"/>
|
228 |
+
</reference>
|
229 |
+
<reference name="product.clone_prices">
|
230 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/catalog/product/view/price.phtml</template></action>
|
231 |
+
</reference>
|
232 |
+
</PRODUCT_TYPE_bundle>
|
233 |
+
|
234 |
+
<sales_order_view>
|
235 |
+
<reference name="order_items">
|
236 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/items/renderer.phtml</template></action>
|
237 |
+
</reference>
|
238 |
+
</sales_order_view>
|
239 |
+
|
240 |
+
<sales_order_invoice>
|
241 |
+
<reference name="invoice_items">
|
242 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/invoice/items/renderer.phtml</template></action>
|
243 |
+
</reference>
|
244 |
+
</sales_order_invoice>
|
245 |
+
|
246 |
+
<sales_order_shipment>
|
247 |
+
<reference name="shipment_items">
|
248 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/shipment/items/renderer.phtml</template></action>
|
249 |
+
</reference>
|
250 |
+
</sales_order_shipment>
|
251 |
+
|
252 |
+
<sales_order_creditmemo>
|
253 |
+
<reference name="creditmemo_items">
|
254 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/creditmemo/items/renderer.phtml</template></action>
|
255 |
+
</reference>
|
256 |
+
</sales_order_creditmemo>
|
257 |
+
|
258 |
+
<!--
|
259 |
+
Print pages
|
260 |
+
-->
|
261 |
+
|
262 |
+
<sales_order_print>
|
263 |
+
<reference name="sales.order.print">
|
264 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/items/renderer.phtml</template></action>
|
265 |
+
</reference>
|
266 |
+
</sales_order_print>
|
267 |
+
|
268 |
+
<sales_order_printinvoice>
|
269 |
+
<reference name="sales.order.print.invoice">
|
270 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/invoice/items/renderer.phtml</template></action>
|
271 |
+
</reference>
|
272 |
+
</sales_order_printinvoice>
|
273 |
+
|
274 |
+
<sales_order_printshipment>
|
275 |
+
<reference name="sales.order.print.shipment">
|
276 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/shipment/items/renderer.phtml</template></action>
|
277 |
+
</reference>
|
278 |
+
</sales_order_printshipment>
|
279 |
+
|
280 |
+
<sales_order_printcreditmemo>
|
281 |
+
<reference name="sales.order.print.creditmemo">
|
282 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/creditmemo/items/renderer.phtml</template></action>
|
283 |
+
</reference>
|
284 |
+
</sales_order_printcreditmemo>
|
285 |
+
|
286 |
+
<!--
|
287 |
+
For guests
|
288 |
+
-->
|
289 |
+
<sales_guest_view>
|
290 |
+
<reference name="order_items">
|
291 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/items/renderer.phtml</template></action>
|
292 |
+
</reference>
|
293 |
+
</sales_guest_view>
|
294 |
+
|
295 |
+
<sales_guest_invoice>
|
296 |
+
<reference name="invoice_items">
|
297 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/invoice/items/renderer.phtml</template></action>
|
298 |
+
</reference>
|
299 |
+
</sales_guest_invoice>
|
300 |
+
|
301 |
+
<sales_guest_shipment>
|
302 |
+
<reference name="shipment_items">
|
303 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/shipment/items/renderer.phtml</template></action>
|
304 |
+
</reference>
|
305 |
+
</sales_guest_shipment>
|
306 |
+
|
307 |
+
<sales_guest_creditmemo>
|
308 |
+
<reference name="creditmemo_items">
|
309 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/creditmemo/items/renderer.phtml</template></action>
|
310 |
+
</reference>
|
311 |
+
</sales_guest_creditmemo>
|
312 |
+
|
313 |
+
<sales_guest_print>
|
314 |
+
<reference name="sales.order.print">
|
315 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/items/renderer.phtml</template></action>
|
316 |
+
</reference>
|
317 |
+
</sales_guest_print>
|
318 |
+
|
319 |
+
<sales_guest_printinvoice>
|
320 |
+
<reference name="sales.order.print.invoice">
|
321 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/invoice/items/renderer.phtml</template></action>
|
322 |
+
</reference>
|
323 |
+
</sales_guest_printinvoice>
|
324 |
+
|
325 |
+
<sales_guest_printshipment>
|
326 |
+
<reference name="sales.order.print.shipment">
|
327 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/shipment/items/renderer.phtml</template></action>
|
328 |
+
</reference>
|
329 |
+
</sales_guest_printshipment>
|
330 |
+
|
331 |
+
<sales_guest_printcreditmemo>
|
332 |
+
<reference name="sales.order.print.creditmemo">
|
333 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/sales/order/creditmemo/items/renderer.phtml</template></action>
|
334 |
+
</reference>
|
335 |
+
</sales_guest_printcreditmemo>
|
336 |
+
|
337 |
+
<!--
|
338 |
+
Emails
|
339 |
+
-->
|
340 |
+
<sales_email_order_items>
|
341 |
+
<reference name="items">
|
342 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/email/order/items/order/default.phtml</template></action>
|
343 |
+
</reference>
|
344 |
+
</sales_email_order_items>
|
345 |
+
|
346 |
+
<sales_email_order_invoice_items>
|
347 |
+
<reference name="items">
|
348 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/email/order/items/invoice/default.phtml</template></action>
|
349 |
+
</reference>
|
350 |
+
</sales_email_order_invoice_items>
|
351 |
+
|
352 |
+
|
353 |
+
<sales_email_order_shipment_items>
|
354 |
+
<reference name="items">
|
355 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/email/order/items/shipment/default.phtml</template></action>
|
356 |
+
</reference>
|
357 |
+
</sales_email_order_shipment_items>
|
358 |
+
|
359 |
+
<sales_email_order_creditmemo_items>
|
360 |
+
<reference name="items">
|
361 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/sales_order_items_renderer</block><template>bundle/email/order/items/creditmemo/default.phtml</template></action>
|
362 |
+
</reference>
|
363 |
+
</sales_email_order_creditmemo_items>
|
364 |
+
|
365 |
+
<!--
|
366 |
+
RSS
|
367 |
+
-->
|
368 |
+
<rss_catalog_category>
|
369 |
+
<reference name="rss.catalog.category">
|
370 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/rss/catalog/product/price.phtml</template></action>
|
371 |
+
</reference>
|
372 |
+
</rss_catalog_category>
|
373 |
+
<rss_catalog_new>
|
374 |
+
<reference name="rss.catalog.new">
|
375 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/rss/catalog/product/price.phtml</template></action>
|
376 |
+
</reference>
|
377 |
+
</rss_catalog_new>
|
378 |
+
<rss_catalog_tag>
|
379 |
+
<reference name="rss.catalog.tag">
|
380 |
+
<action method="addPriceBlockType"><type>bundle</type><block>bundle/catalog_product_price</block><template>bundle/rss/catalog/product/price.phtml</template></action>
|
381 |
+
</reference>
|
382 |
+
</rss_catalog_tag>
|
383 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/catalog.xml
ADDED
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
Supported layout update handles (action):
|
29 |
+
- catalog_product_gallery
|
30 |
+
- catalog_product_compare_index
|
31 |
+
|
32 |
+
Supported layout update handles (special):
|
33 |
+
- default
|
34 |
+
- catalog_category_default
|
35 |
+
- catalog_category_layered
|
36 |
+
- catalog_product_view
|
37 |
+
|
38 |
+
-->
|
39 |
+
<layout version="0.1.0">
|
40 |
+
|
41 |
+
<!--
|
42 |
+
Default layout, loads most of the pages
|
43 |
+
-->
|
44 |
+
|
45 |
+
<default>
|
46 |
+
|
47 |
+
<!-- Mage_Catalog -->
|
48 |
+
<reference name="left">
|
49 |
+
<!--<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">-->
|
50 |
+
<!--<action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>-->
|
51 |
+
<!--<action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>-->
|
52 |
+
<!--<action method="setLinkUrl"><url>checkout/cart</url></action>-->
|
53 |
+
<!--</block>-->
|
54 |
+
</reference>
|
55 |
+
<reference name="right">
|
56 |
+
<block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
|
57 |
+
<!--<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml">-->
|
58 |
+
<!--<action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action>-->
|
59 |
+
<!--<action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action>-->
|
60 |
+
<!--</block>-->
|
61 |
+
</reference>
|
62 |
+
<reference name="footer_links">
|
63 |
+
<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
|
64 |
+
</reference>
|
65 |
+
<block type="catalog/product_price_template" name="catalog_product_price_template" />
|
66 |
+
</default>
|
67 |
+
|
68 |
+
|
69 |
+
<!--
|
70 |
+
Category default layout
|
71 |
+
-->
|
72 |
+
|
73 |
+
<catalog_category_default translate="label">
|
74 |
+
<label>Catalog Category (Non-Anchor)</label>
|
75 |
+
<reference name="left_first">
|
76 |
+
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml">
|
77 |
+
<block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
|
78 |
+
</block>
|
79 |
+
</reference>
|
80 |
+
<reference name="content">
|
81 |
+
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
|
82 |
+
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
|
83 |
+
<block type="core/text_list" name="product_list.name.after" as="name.after" />
|
84 |
+
<block type="core/text_list" name="product_list.after" as="after" />
|
85 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
86 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
87 |
+
<!-- The following code shows how to set your own pager increments -->
|
88 |
+
<!--
|
89 |
+
<action method="setDefaultListPerPage"><limit>4</limit></action>
|
90 |
+
<action method="setDefaultGridPerPage"><limit>9</limit></action>
|
91 |
+
<action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
|
92 |
+
<action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
|
93 |
+
<action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
|
94 |
+
<action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
|
95 |
+
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
|
96 |
+
-->
|
97 |
+
</block>
|
98 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
99 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
100 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
101 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
102 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
103 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
104 |
+
<!-- Since the addColumnCountLayoutDepend does not work, we are manually setting the max columns -->
|
105 |
+
<action method="setColumnCount"><count>4</count></action>
|
106 |
+
</block>
|
107 |
+
</block>
|
108 |
+
</reference>
|
109 |
+
</catalog_category_default>
|
110 |
+
|
111 |
+
<!--
|
112 |
+
Category layered navigation layout
|
113 |
+
-->
|
114 |
+
|
115 |
+
<catalog_category_layered translate="label">
|
116 |
+
<label>Catalog Category (Anchor)</label>
|
117 |
+
<reference name="root">
|
118 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
119 |
+
</reference>
|
120 |
+
<reference name="left_first">
|
121 |
+
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
|
122 |
+
<block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
|
123 |
+
</block>
|
124 |
+
</reference>
|
125 |
+
<reference name="content">
|
126 |
+
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
|
127 |
+
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
|
128 |
+
<block type="core/text_list" name="product_list.name.after" as="name.after" />
|
129 |
+
<block type="core/text_list" name="product_list.after" as="after" />
|
130 |
+
<!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/su.phtml</template></action> -->
|
131 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
132 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
133 |
+
<!-- The following code shows how to set your own pager increments -->
|
134 |
+
<!--
|
135 |
+
<action method="setDefaultListPerPage"><limit>4</limit></action>
|
136 |
+
<action method="setDefaultGridPerPage"><limit>3</limit></action>
|
137 |
+
<action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
|
138 |
+
<action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
|
139 |
+
<action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
|
140 |
+
<action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
|
141 |
+
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
|
142 |
+
<action method="addPagerLimit"><mode>grid</mode><limit>3</limit></action>
|
143 |
+
<action method="addPagerLimit"><mode>grid</mode><limit>6</limit></action>
|
144 |
+
<action method="addPagerLimit"><mode>grid</mode><limit>9</limit></action>
|
145 |
+
<action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action>
|
146 |
+
-->
|
147 |
+
</block>
|
148 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
149 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
150 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
151 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
152 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
153 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
154 |
+
<!-- Since the addColumnCountLayoutDepend does not work, we are manually setting the max columns -->
|
155 |
+
<action method="setColumnCount"><count>4</count></action>
|
156 |
+
</block>
|
157 |
+
</block>
|
158 |
+
</reference>
|
159 |
+
</catalog_category_layered>
|
160 |
+
|
161 |
+
<!--
|
162 |
+
Compare products page
|
163 |
+
-->
|
164 |
+
|
165 |
+
<catalog_product_compare_index translate="label">
|
166 |
+
<label>Catalog Product Compare List</label>
|
167 |
+
<!-- Mage_Catalog -->
|
168 |
+
<reference name="root">
|
169 |
+
<action method="setTemplate"><template>page/popup.phtml</template></action>
|
170 |
+
</reference>
|
171 |
+
<reference name="head">
|
172 |
+
<action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
|
173 |
+
<action method="addJs"><script>varien/product.js</script></action>
|
174 |
+
<action method="unsetChild"><name>head.viewport</name></action>
|
175 |
+
</reference>
|
176 |
+
<reference name="content">
|
177 |
+
<block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/>
|
178 |
+
</reference>
|
179 |
+
</catalog_product_compare_index>
|
180 |
+
|
181 |
+
<customer_account_index>
|
182 |
+
<reference name="right">
|
183 |
+
<action method="unsetChild"><name>catalog.compare.sidebar</name></action>
|
184 |
+
</reference>
|
185 |
+
</customer_account_index>
|
186 |
+
|
187 |
+
<!--
|
188 |
+
Product view
|
189 |
+
-->
|
190 |
+
|
191 |
+
<catalog_product_view translate="label">
|
192 |
+
<label>Catalog Product View (Any)</label>
|
193 |
+
<!-- Mage_Catalog -->
|
194 |
+
<reference name="root">
|
195 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
196 |
+
</reference>
|
197 |
+
<reference name="head">
|
198 |
+
<action method="addJs"><script>varien/product.js</script></action>
|
199 |
+
<action method="addJs"><script>varien/configurable.js</script></action>
|
200 |
+
<action method="addItem"><type>skin_js</type><script>js/lib/elevatezoom/jquery.elevateZoom-3.0.8.min.js</script></action>
|
201 |
+
|
202 |
+
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
|
203 |
+
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
204 |
+
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
205 |
+
</reference>
|
206 |
+
<reference name="content">
|
207 |
+
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
|
208 |
+
<!--
|
209 |
+
<action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/summary.phtml</template></action>
|
210 |
+
<action method="addReviewSummaryTemplate"><type>short</type><template>review/helper/summary_short.phtml</template></action>
|
211 |
+
<action method="addReviewSummaryTemplate"><type>...</type><template>...</template></action>
|
212 |
+
-->
|
213 |
+
<block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml">
|
214 |
+
<block type="core/text_list" name="product.info.media.after" as="after" />
|
215 |
+
</block>
|
216 |
+
<block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
|
217 |
+
<label>Alert Urls</label>
|
218 |
+
</block>
|
219 |
+
|
220 |
+
<action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
|
221 |
+
|
222 |
+
<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
|
223 |
+
<action method="setColumnCount"><columns>6</columns></action>
|
224 |
+
<action method="setItemLimit"><type>upsell</type><limit>6</limit></action>
|
225 |
+
</block>
|
226 |
+
|
227 |
+
<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
|
228 |
+
<block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml">
|
229 |
+
<action method="addToParentGroup"><group>detailed_info</group></action>
|
230 |
+
<action method="setTitle" translate="value"><value>Description</value></action>
|
231 |
+
</block>
|
232 |
+
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
|
233 |
+
<action method="addToParentGroup"><group>detailed_info</group></action>
|
234 |
+
<action method="setTitle" translate="value"><value>Additional Information</value></action>
|
235 |
+
</block>
|
236 |
+
<block type="catalog/product_list_related" name="catalog.product.related" as="related_products" template="catalog/product/list/related.phtml" />
|
237 |
+
|
238 |
+
<block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
|
239 |
+
<block type="catalog/product_view" name="product.info.sharing" as="sharing" template="catalog/product/view/sharing.phtml"/>
|
240 |
+
<block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
|
241 |
+
|
242 |
+
<block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
|
243 |
+
<label>Product View Extra Hint</label>
|
244 |
+
</block>
|
245 |
+
|
246 |
+
<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">
|
247 |
+
<label>Info Column Options Wrapper</label>
|
248 |
+
<block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/>
|
249 |
+
<block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml">
|
250 |
+
<action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
|
251 |
+
<action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
|
252 |
+
<action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
|
253 |
+
<action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
|
254 |
+
</block>
|
255 |
+
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
|
256 |
+
</block>
|
257 |
+
<block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="catalog/product/view/options/wrapper/bottom.phtml" translate="label">
|
258 |
+
<label>Bottom Block Options Wrapper</label>
|
259 |
+
<action method="insert"><block>product.tierprices</block></action>
|
260 |
+
<block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
|
261 |
+
<action method="append"><block>product.info.addtocart</block></action>
|
262 |
+
<action method="append"><block>product.info.addto</block></action>
|
263 |
+
<action method="append"><block>product.info.sharing</block></action>
|
264 |
+
</block>
|
265 |
+
|
266 |
+
<block type="core/template_facade" name="product.info.container1" as="container1">
|
267 |
+
<action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
|
268 |
+
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
269 |
+
<action method="append"><block>product.info.options.wrapper</block></action>
|
270 |
+
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
271 |
+
</block>
|
272 |
+
<block type="core/template_facade" name="product.info.container2" as="container2">
|
273 |
+
<action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
|
274 |
+
<action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
|
275 |
+
<action method="append"><block>product.info.options.wrapper</block></action>
|
276 |
+
<action method="append"><block>product.info.options.wrapper.bottom</block></action>
|
277 |
+
</block>
|
278 |
+
<action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
279 |
+
<action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
|
280 |
+
</block>
|
281 |
+
</reference>
|
282 |
+
<reference name="right">
|
283 |
+
|
284 |
+
</reference>
|
285 |
+
</catalog_product_view>
|
286 |
+
|
287 |
+
<!--
|
288 |
+
Additional block dependant on product type
|
289 |
+
-->
|
290 |
+
<PRODUCT_TYPE_simple translate="label" module="catalog">
|
291 |
+
<label>Catalog Product View (Simple)</label>
|
292 |
+
<reference name="product.info">
|
293 |
+
<block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
|
294 |
+
<block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
|
295 |
+
<label>Product Extra Info</label>
|
296 |
+
</block>
|
297 |
+
</block>
|
298 |
+
<block type="catalog/product_view_type_simple" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
|
299 |
+
</reference>
|
300 |
+
</PRODUCT_TYPE_simple>
|
301 |
+
<PRODUCT_TYPE_configurable translate="label" module="catalog">
|
302 |
+
<label>Catalog Product View (Configurable)</label>
|
303 |
+
<reference name="product.info">
|
304 |
+
<block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
|
305 |
+
<block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
|
306 |
+
<label>Product Extra Info</label>
|
307 |
+
</block>
|
308 |
+
</block>
|
309 |
+
<block type="catalog/product_view_type_configurable" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
|
310 |
+
</reference>
|
311 |
+
<reference name="product.info.options.wrapper">
|
312 |
+
<block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
|
313 |
+
<block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
|
314 |
+
<block type="core/text_list" name="product.info.options.configurable.after" as="after" />
|
315 |
+
</block>
|
316 |
+
</reference>
|
317 |
+
</PRODUCT_TYPE_configurable>
|
318 |
+
<PRODUCT_TYPE_grouped translate="label" module="catalog">
|
319 |
+
<label>Catalog Product View (Grouped)</label>
|
320 |
+
<reference name="product.info">
|
321 |
+
<block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
|
322 |
+
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra" translate="label">
|
323 |
+
<label>Product Extra Info</label>
|
324 |
+
</block>
|
325 |
+
</block>
|
326 |
+
<block type="catalog/product_view_type_grouped" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/grouped.phtml" />
|
327 |
+
</reference>
|
328 |
+
</PRODUCT_TYPE_grouped>
|
329 |
+
<PRODUCT_TYPE_virtual translate="label" module="catalog">
|
330 |
+
<label>Catalog Product View (Virtual)</label>
|
331 |
+
<reference name="product.info">
|
332 |
+
<block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/default.phtml">
|
333 |
+
<block type="core/text_list" name="product.info.virtual.extra" as="product_type_data_extra" translate="label">
|
334 |
+
<label>Product Extra Info</label>
|
335 |
+
</block>
|
336 |
+
</block>
|
337 |
+
<block type="catalog/product_view_type_virtual" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
|
338 |
+
</reference>
|
339 |
+
</PRODUCT_TYPE_virtual>
|
340 |
+
|
341 |
+
|
342 |
+
|
343 |
+
<!--
|
344 |
+
Product send to friend
|
345 |
+
-->
|
346 |
+
|
347 |
+
<catalog_product_send translate="label">
|
348 |
+
<label>Catalog Product Email to a Friend</label>
|
349 |
+
<!-- Mage_Catalog -->
|
350 |
+
<reference name="root">
|
351 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
352 |
+
</reference>
|
353 |
+
<reference name="head">
|
354 |
+
<action method="addJs"><script>varien/product.js</script></action>
|
355 |
+
</reference>
|
356 |
+
<reference name="content">
|
357 |
+
<block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml">
|
358 |
+
</block>
|
359 |
+
</reference>
|
360 |
+
</catalog_product_send>
|
361 |
+
|
362 |
+
<!--
|
363 |
+
Product additional images gallery popup
|
364 |
+
-->
|
365 |
+
|
366 |
+
<catalog_product_gallery translate="label">
|
367 |
+
<label>Catalog Product Image Gallery Popup</label>
|
368 |
+
<!-- Mage_Catalog -->
|
369 |
+
<reference name="root">
|
370 |
+
<action method="setTemplate"><template>page/popup.phtml</template></action>
|
371 |
+
</reference>
|
372 |
+
<reference name="content">
|
373 |
+
<block type="catalog/product_gallery" name="catalog_product_gallery" template="catalog/product/gallery.phtml"/>
|
374 |
+
</reference>
|
375 |
+
</catalog_product_gallery>
|
376 |
+
|
377 |
+
<!--
|
378 |
+
SEO Site Map
|
379 |
+
-->
|
380 |
+
|
381 |
+
<catalog_seo_sitemap translate="label">
|
382 |
+
<label>Catalog Seo Sitemap (Common)</label>
|
383 |
+
<remove name="right"/>
|
384 |
+
<remove name="left"/>
|
385 |
+
|
386 |
+
<reference name="root">
|
387 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
388 |
+
</reference>
|
389 |
+
<reference name="content">
|
390 |
+
<block type="page/template_container" name="seo.sitemap.container" template="catalog/seo/sitemap/container.phtml">
|
391 |
+
<block type="page/template_links" name="seo.sitemap.links" as="links" template="page/template/links.phtml"/>
|
392 |
+
<block type="page/html_pager" name="seo.sitemap.pager.top" as="pager_top" template="page/html/pager.phtml"/>
|
393 |
+
<block type="page/html_pager" name="seo.sitemap.pager.bottom" as="pager_bottom" template="page/html/pager.phtml"/>
|
394 |
+
</block>
|
395 |
+
</reference>
|
396 |
+
</catalog_seo_sitemap>
|
397 |
+
|
398 |
+
<catalog_seo_sitemap_category translate="label">
|
399 |
+
<label>Catalog Seo Sitemap (Category List)</label>
|
400 |
+
<reference name="head">
|
401 |
+
<action method="setTitle" translate="title" module="catalog"><title>Site Map</title></action>
|
402 |
+
</reference>
|
403 |
+
<update handle="catalog_seo_sitemap" />
|
404 |
+
<reference name="seo.sitemap.container">
|
405 |
+
<action method="setTitle" translate="title" module="catalog"><title>Categories</title></action>
|
406 |
+
<block type="catalog/seo_sitemap_category" name="seo.sitemap.sitemap" as="sitemap" after="pager_top" template="catalog/seo/sitemap.phtml">
|
407 |
+
<action method="bindPager"><pager>seo.sitemap.pager.top</pager></action>
|
408 |
+
<action method="bindPager"><pager>seo.sitemap.pager.bottom</pager></action>
|
409 |
+
<action method="setItemsTitle" translate="title" module="catalog"><title>categories</title></action>
|
410 |
+
</block>
|
411 |
+
</reference>
|
412 |
+
<reference name="seo.sitemap.links">
|
413 |
+
<action method="addLink" translate="label title" module="catalog"><label>Products Sitemap</label><url helper="catalog/map/getProductUrl"/><title>Products Sitemap</title></action>
|
414 |
+
</reference>
|
415 |
+
</catalog_seo_sitemap_category>
|
416 |
+
|
417 |
+
<catalog_seo_sitemap_category_tree translate="label">
|
418 |
+
<label>Catalog Seo Sitemap (Category Tree)</label>
|
419 |
+
<reference name="seo.sitemap.container">
|
420 |
+
<remove name="seo.sitemap.pager.top" />
|
421 |
+
<remove name="seo.sitemap.pager.bottom" />
|
422 |
+
<block type="catalog/seo_sitemap_tree_pager" name="seo.sitemap.tree.pager.top" as="pager_top" template="page/html/pager.phtml"/>
|
423 |
+
<block type="catalog/seo_sitemap_tree_pager" name="seo.sitemap.tree.pager.bottom" as="pager_bottom" template="page/html/pager.phtml"/>
|
424 |
+
<remove name="seo.sitemap.sitemap" />
|
425 |
+
<block type="catalog/seo_sitemap_tree_category" name="seo.sitemap.sitemap_tree" as="sitemap" after="pager_top" template="catalog/seo/tree.phtml">
|
426 |
+
<action method="bindPager"><pager>seo.sitemap.tree.pager.top</pager></action>
|
427 |
+
<action method="bindPager"><pager>seo.sitemap.tree.pager.bottom</pager></action>
|
428 |
+
</block>
|
429 |
+
</reference>
|
430 |
+
</catalog_seo_sitemap_category_tree>
|
431 |
+
|
432 |
+
<catalog_seo_sitemap_product translate="label">
|
433 |
+
<label>Catalog Seo Sitemap (Product List)</label>
|
434 |
+
<reference name="head">
|
435 |
+
<action method="setTitle" translate="title" module="catalog"><title>Site Map</title></action>
|
436 |
+
</reference>
|
437 |
+
<update handle="catalog_seo_sitemap" />
|
438 |
+
<reference name="seo.sitemap.container">
|
439 |
+
<action method="setTitle" translate="title" module="catalog"><title>Products</title></action>
|
440 |
+
<block type="catalog/seo_sitemap_product" name="seo.sitemap.sitemap" as="sitemap" after="pager_top" template="catalog/seo/sitemap.phtml">
|
441 |
+
<action method="bindPager"><pager>seo.sitemap.pager.top</pager></action>
|
442 |
+
<action method="bindPager"><pager>seo.sitemap.pager.bottom</pager></action>
|
443 |
+
<action method="setItemsTitle" translate="title" module="catalog"><title>products</title></action>
|
444 |
+
</block>
|
445 |
+
</reference>
|
446 |
+
<reference name="seo.sitemap.links">
|
447 |
+
<action method="addLink" translate="label title" module="catalog"><label>Categories Sitemap</label><url helper="catalog/map/getCategoryUrl"/><title>Categories Sitemap</title></action>
|
448 |
+
</reference>
|
449 |
+
</catalog_seo_sitemap_product>
|
450 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/catalog_msrp.xml
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<!--
|
31 |
+
Default layout, loads most of the pages
|
32 |
+
-->
|
33 |
+
<catalog_product_view>
|
34 |
+
<update handle="MAP_price_msrp_item" />
|
35 |
+
</catalog_product_view>
|
36 |
+
<wishlist_index_index>
|
37 |
+
<update handle="MAP_price_msrp_wishlist_item" />
|
38 |
+
</wishlist_index_index>
|
39 |
+
<wishlist_shared_index>
|
40 |
+
<update handle="MAP_price_msrp_wishlist_item" />
|
41 |
+
</wishlist_shared_index>
|
42 |
+
<review_product_list>
|
43 |
+
<update handle="MAP_price_msrp_item" />
|
44 |
+
</review_product_list>
|
45 |
+
|
46 |
+
<default>
|
47 |
+
<reference name="head">
|
48 |
+
<action method="addItem" ifconfig="sales/msrp/enabled"><type>skin_js</type><name>js/msrp.js</name></action>
|
49 |
+
<action method="addItem" ifconfig="sales/msrp/enabled"><type>skin_js</type><name>js/msrp_rwd.js</name></action>
|
50 |
+
</reference>
|
51 |
+
<reference name="content">
|
52 |
+
<block type="core/template" template="catalog/msrp/popup.phtml" name="product.tooltip"></block>
|
53 |
+
</reference>
|
54 |
+
</default>
|
55 |
+
<MAP_price_msrp_item>
|
56 |
+
<reference name="catalog_product_price_template">
|
57 |
+
<action method="addPriceBlockType"><type>msrp</type><block>catalog/product_price</block><template>catalog/product/price_msrp_item.phtml</template></action>
|
58 |
+
</reference>
|
59 |
+
<reference name="product.clone_prices">
|
60 |
+
<action method="addPriceBlockType"><type>msrp</type><block>catalog/product_price</block><template>catalog/product/price_msrp_item.phtml</template></action>
|
61 |
+
</reference>
|
62 |
+
</MAP_price_msrp_item>
|
63 |
+
<MAP_price_msrp_wishlist_item>
|
64 |
+
<reference name="catalog_product_price_template">
|
65 |
+
<action method="addPriceBlockType"><type>msrp</type><block>catalog/product_price</block><template>wishlist/render/item/price_msrp_item.phtml</template></action>
|
66 |
+
</reference>
|
67 |
+
</MAP_price_msrp_wishlist_item>
|
68 |
+
<default>
|
69 |
+
<reference name="catalog_product_price_template">
|
70 |
+
<action method="addPriceBlockType"><type>msrp</type><block>catalog/product_price</block><template>catalog/product/price_msrp.phtml</template></action>
|
71 |
+
<action method="addPriceBlockType"><type>msrp_item</type><block>catalog/product_price</block><template>catalog/product/price_msrp_item.phtml</template></action>
|
72 |
+
<action method="addPriceBlockType"><type>msrp_noform</type><block>catalog/product_price</block><template>catalog/product/price_msrp_noform.phtml</template></action>
|
73 |
+
</reference>
|
74 |
+
</default>
|
75 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/catalogsearch.xml
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<default>
|
32 |
+
<reference name="header">
|
33 |
+
<block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"/>
|
34 |
+
</reference>
|
35 |
+
<reference name="footer_links">
|
36 |
+
<action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
|
37 |
+
<label>Search Terms</label>
|
38 |
+
<url helper="catalogsearch/getSearchTermUrl" />
|
39 |
+
<title>Search Terms</title>
|
40 |
+
</action>
|
41 |
+
<action method="addLink" translate="label title" module="catalogsearch">
|
42 |
+
<label>Advanced Search</label>
|
43 |
+
<url helper="catalogsearch/getAdvancedSearchUrl" />
|
44 |
+
<title>Advanced Search</title>
|
45 |
+
</action>
|
46 |
+
</reference>
|
47 |
+
</default>
|
48 |
+
|
49 |
+
<catalogsearch_result_index translate="label">
|
50 |
+
<label>Quick Search Form</label>
|
51 |
+
<reference name="root">
|
52 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
53 |
+
</reference>
|
54 |
+
<reference name="left_first">
|
55 |
+
<block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml">
|
56 |
+
<block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
|
57 |
+
</block>
|
58 |
+
</reference>
|
59 |
+
<reference name="content">
|
60 |
+
<block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
|
61 |
+
<block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
|
62 |
+
<block type="core/text_list" name="product_list.name.after" as="name.after" />
|
63 |
+
<block type="core/text_list" name="product_list.after" as="after" />
|
64 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
65 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
66 |
+
</block>
|
67 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
68 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
69 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
70 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
71 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
72 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
73 |
+
</block>
|
74 |
+
<action method="setListOrders"/>
|
75 |
+
<action method="setListModes"/>
|
76 |
+
<action method="setListCollection"/>
|
77 |
+
</block>
|
78 |
+
</reference>
|
79 |
+
</catalogsearch_result_index>
|
80 |
+
|
81 |
+
<catalogsearch_advanced_index translate="label">
|
82 |
+
<label>Advanced Search Form</label>
|
83 |
+
<!-- Mage_Catalogsearch -->
|
84 |
+
<reference name="root">
|
85 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
86 |
+
</reference>
|
87 |
+
<reference name="head">
|
88 |
+
<action method="setTitle" translate="title" module="catalogsearch"><title>Advanced Search</title></action>
|
89 |
+
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
|
90 |
+
<action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
91 |
+
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
|
92 |
+
</reference>
|
93 |
+
<reference name="content">
|
94 |
+
<block type="catalogsearch/advanced_form" name="catalogsearch_advanced_form" template="catalogsearch/advanced/form.phtml"/>
|
95 |
+
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
|
96 |
+
</reference>
|
97 |
+
</catalogsearch_advanced_index>
|
98 |
+
|
99 |
+
<!--
|
100 |
+
Advanced search results
|
101 |
+
-->
|
102 |
+
|
103 |
+
<catalogsearch_advanced_result translate="label">
|
104 |
+
<label>Advanced Search Result</label>
|
105 |
+
<update handle="page_two_columns_right" />
|
106 |
+
<!-- Mage_Catalogsearch -->
|
107 |
+
<reference name="root">
|
108 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
109 |
+
</reference>
|
110 |
+
<reference name="content">
|
111 |
+
<block type="catalogsearch/advanced_result" name="catalogsearch_advanced_result" template="catalogsearch/advanced/result.phtml">
|
112 |
+
<block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
|
113 |
+
<block type="core/text_list" name="product_list.name.after" as="name.after" />
|
114 |
+
<block type="core/text_list" name="product_list.after" as="after" />
|
115 |
+
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
|
116 |
+
<block type="page/html_pager" name="product_list_toolbar_pager"/>
|
117 |
+
</block>
|
118 |
+
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
|
119 |
+
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
|
120 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
|
121 |
+
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
|
122 |
+
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
|
123 |
+
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
|
124 |
+
</block>
|
125 |
+
<action method="setListOrders"/>
|
126 |
+
<action method="setListModes"/>
|
127 |
+
<action method="setListCollection"/>
|
128 |
+
</block>
|
129 |
+
</reference>
|
130 |
+
</catalogsearch_advanced_result>
|
131 |
+
|
132 |
+
<catalogsearch_term_popular translate="label">
|
133 |
+
<label>Popular Search Terms</label>
|
134 |
+
<remove name="right"/>
|
135 |
+
<remove name="left"/>
|
136 |
+
|
137 |
+
<reference name="head">
|
138 |
+
<action method="setTitle" translate="title" module="catalogsearch"><title>Search Terms</title></action>
|
139 |
+
</reference>
|
140 |
+
<reference name="root">
|
141 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
142 |
+
</reference>
|
143 |
+
<reference name="content">
|
144 |
+
<block type="catalogsearch/term" name="seo.searchterm" template="catalogsearch/term.phtml"/>
|
145 |
+
</reference>
|
146 |
+
</catalogsearch_term_popular>
|
147 |
+
|
148 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/checkout.xml
ADDED
@@ -0,0 +1,542 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<!--
|
32 |
+
Default layout, loads most of the pages
|
33 |
+
-->
|
34 |
+
|
35 |
+
<default>
|
36 |
+
|
37 |
+
<!-- Mage_Checkout -->
|
38 |
+
<reference name="top.links">
|
39 |
+
<block type="checkout/links" name="checkout_cart_link">
|
40 |
+
<action method="addCartLink"></action>
|
41 |
+
<action method="addCheckoutLink"></action>
|
42 |
+
</block>
|
43 |
+
</reference>
|
44 |
+
|
45 |
+
<reference name="header">
|
46 |
+
<block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">
|
47 |
+
<block type="checkout/cart_sidebar" name="minicart_content" template="checkout/cart/minicart/items.phtml">
|
48 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
|
49 |
+
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>
|
50 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/minicart/default.phtml</template></action>
|
51 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/minicart/default.phtml</template></action>
|
52 |
+
|
53 |
+
<block type="core/text_list" name="cart_sidebar.cart_promotion" as="cart_promotion" translate="label" module="checkout">
|
54 |
+
<label>Mini-cart promotion block</label>
|
55 |
+
</block>
|
56 |
+
<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">
|
57 |
+
<label>Shopping Cart Sidebar Extra Actions</label>
|
58 |
+
</block>
|
59 |
+
</block>
|
60 |
+
</block>
|
61 |
+
</reference>
|
62 |
+
|
63 |
+
<reference name="right">
|
64 |
+
<!--<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">-->
|
65 |
+
<!--<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
66 |
+
<!--<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
67 |
+
<!--<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
68 |
+
<!--<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">-->
|
69 |
+
<!--<label>Shopping Cart Sidebar Extra Actions</label>-->
|
70 |
+
<!--</block>-->
|
71 |
+
<!--</block>-->
|
72 |
+
</reference>
|
73 |
+
</default>
|
74 |
+
|
75 |
+
<checkout_cart_index translate="label">
|
76 |
+
<label>Shopping Cart</label>
|
77 |
+
<remove name="right"/>
|
78 |
+
<remove name="left"/>
|
79 |
+
<!-- Mage_Checkout -->
|
80 |
+
<reference name="root">
|
81 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
82 |
+
</reference>
|
83 |
+
<reference name="content">
|
84 |
+
<block type="checkout/cart" name="checkout.cart">
|
85 |
+
<action method="setCartTemplate"><value>checkout/cart.phtml</value></action>
|
86 |
+
<action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>
|
87 |
+
<action method="chooseTemplate"/>
|
88 |
+
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action>
|
89 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/item/default.phtml</template></action>
|
90 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/item/default.phtml</template></action>
|
91 |
+
|
92 |
+
<block type="core/text_list" name="checkout.cart.empty.widget" as="checkout_cart_empty_widget" translate="label">
|
93 |
+
<label>Empty Shopping Cart Content Before</label>
|
94 |
+
</block>
|
95 |
+
|
96 |
+
<block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label">
|
97 |
+
<label>Payment Methods Before Checkout Button</label>
|
98 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage.top" template="checkout/onepage/link.phtml" after="-" />
|
99 |
+
</block>
|
100 |
+
|
101 |
+
<block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label">
|
102 |
+
<label>Shopping Cart Items Before</label>
|
103 |
+
</block>
|
104 |
+
|
105 |
+
<block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
|
106 |
+
<label>Payment Methods After Checkout Button</label>
|
107 |
+
<block type="checkout/onepage_link" name="checkout.cart.methods.onepage.bottom" template="checkout/onepage/link.phtml"/>
|
108 |
+
<block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping" template="checkout/multishipping/link.phtml"/>
|
109 |
+
</block>
|
110 |
+
|
111 |
+
<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
|
112 |
+
<block type="core/text_list" name="checkout.cart.extra" translate="label">
|
113 |
+
<label>Checkout Forms Extra</label>
|
114 |
+
</block>
|
115 |
+
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
|
116 |
+
<block type="core/text_list" name="checkout.cart.widget" as="checkout_cart_widget" translate="label">
|
117 |
+
<label>Shopping Cart Items After</label>
|
118 |
+
</block>
|
119 |
+
<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>
|
120 |
+
|
121 |
+
<block type="checkout/cart_totals" name="checkout.cart.totals" as="totals" template="checkout/cart/totals.phtml"/>
|
122 |
+
</block>
|
123 |
+
</reference>
|
124 |
+
<block type="core/text_list" name="additional.product.info" translate="label">
|
125 |
+
<label>Additional Product Info</label>
|
126 |
+
</block>
|
127 |
+
</checkout_cart_index>
|
128 |
+
|
129 |
+
<checkout_cart_configure translate="label">
|
130 |
+
<label>Configure Cart Item</label>
|
131 |
+
<update handle="catalog_product_view"/>
|
132 |
+
<reference name="product.info">
|
133 |
+
<block type="checkout/cart_item_configure" name="checkout.cart.item.configure.block"></block>
|
134 |
+
</reference>
|
135 |
+
</checkout_cart_configure>
|
136 |
+
|
137 |
+
<!--
|
138 |
+
Multi address shipping checkout main layout,
|
139 |
+
will be rendered on all checkout pages
|
140 |
+
-->
|
141 |
+
|
142 |
+
<checkout_multishipping translate="label">
|
143 |
+
<label>Multishipping Checkout</label>
|
144 |
+
<!-- Mage_Checkout -->
|
145 |
+
<remove name="right"/>
|
146 |
+
<remove name="left"/>
|
147 |
+
|
148 |
+
<reference name="root">
|
149 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
150 |
+
</reference>
|
151 |
+
<reference name="content">
|
152 |
+
<block type="checkout/multishipping_state" name="checkout_state" template="checkout/multishipping/state.phtml"/>
|
153 |
+
</reference>
|
154 |
+
</checkout_multishipping>
|
155 |
+
|
156 |
+
<checkout_multishipping_login>
|
157 |
+
<update handle="customer_account_login"/>
|
158 |
+
</checkout_multishipping_login>
|
159 |
+
|
160 |
+
<checkout_multishipping_register>
|
161 |
+
<update handle="customer_account_create"/>
|
162 |
+
</checkout_multishipping_register>
|
163 |
+
|
164 |
+
<!--
|
165 |
+
Multi address shipping checkout selection of address per item page
|
166 |
+
-->
|
167 |
+
|
168 |
+
<checkout_multishipping_address_select translate="label">
|
169 |
+
<label>Multishipping Checkout Shipping Address Selection</label>
|
170 |
+
<update handle="checkout_multishipping"/>
|
171 |
+
<!-- Mage_Checkout -->
|
172 |
+
<reference name="content">
|
173 |
+
<block type="checkout/multishipping_address_select" name="checkout_address_select" template="checkout/multishipping/address/select.phtml"/>
|
174 |
+
</reference>
|
175 |
+
</checkout_multishipping_address_select>
|
176 |
+
|
177 |
+
<checkout_multishipping_address_selectbilling translate="label">
|
178 |
+
<label>Multishipping Checkout Billing Address Selection</label>
|
179 |
+
<update handle="checkout_multishipping"/>
|
180 |
+
<!-- Mage_Checkout -->
|
181 |
+
<reference name="content">
|
182 |
+
<block type="checkout/multishipping_address_select" name="checkout_address_select" template="checkout/multishipping/address/select.phtml"/>
|
183 |
+
</reference>
|
184 |
+
</checkout_multishipping_address_selectbilling>
|
185 |
+
|
186 |
+
|
187 |
+
<checkout_multishipping_address_newshipping translate="label">
|
188 |
+
<label>Multishipping Checkout Shipping Address Creation</label>
|
189 |
+
<update handle="checkout_multishipping"/>
|
190 |
+
<update handle="checkout_multishipping_customer_address"/>
|
191 |
+
</checkout_multishipping_address_newshipping>
|
192 |
+
|
193 |
+
<checkout_multishipping_address_newbilling translate="label">
|
194 |
+
<label>Multishipping Checkout Billing Address Creation</label>
|
195 |
+
<update handle="checkout_multishipping"/>
|
196 |
+
<update handle="checkout_multishipping_customer_address"/>
|
197 |
+
</checkout_multishipping_address_newbilling>
|
198 |
+
|
199 |
+
<checkout_multishipping_address_editshipping translate="label">
|
200 |
+
<label>Multishipping Checkout Shipping Address Edit Form</label>
|
201 |
+
<update handle="checkout_multishipping"/>
|
202 |
+
<update handle="checkout_multishipping_customer_address"/>
|
203 |
+
</checkout_multishipping_address_editshipping>
|
204 |
+
|
205 |
+
<checkout_multishipping_address_editaddress>
|
206 |
+
<update handle="checkout_multishipping"/>
|
207 |
+
<update handle="checkout_multishipping_customer_address"/>
|
208 |
+
</checkout_multishipping_address_editaddress>
|
209 |
+
|
210 |
+
<checkout_multishipping_address_editbilling translate="label">
|
211 |
+
<label>Multishipping Checkout Billing Address Edit Form</label>
|
212 |
+
<update handle="checkout_multishipping"/>
|
213 |
+
<update handle="checkout_multishipping_customer_address"/>
|
214 |
+
</checkout_multishipping_address_editbilling>
|
215 |
+
|
216 |
+
<checkout_multishipping_customer_address translate="label">
|
217 |
+
<label>Multishipping Checkout Customer Address Edit Form</label>
|
218 |
+
<reference name="content">
|
219 |
+
<block type="customer/address_edit" name="customer_address_edit" template="customer/address/edit.phtml"/>
|
220 |
+
</reference>
|
221 |
+
</checkout_multishipping_customer_address>
|
222 |
+
|
223 |
+
<!--
|
224 |
+
Multi address shipping checkout address page
|
225 |
+
-->
|
226 |
+
|
227 |
+
<checkout_multishipping_addresses translate="label">
|
228 |
+
<label>Multishipping Checkout Address (Any) Form</label>
|
229 |
+
<update handle="checkout_multishipping"/>
|
230 |
+
<!-- Mage_Checkout -->
|
231 |
+
<reference name="content">
|
232 |
+
<block type="checkout/multishipping_addresses" name="checkout_addresses" template="checkout/multishipping/addresses.phtml">
|
233 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
234 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/item/default.phtml</template></action>
|
235 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/item/default.phtml</template></action>
|
236 |
+
</block>
|
237 |
+
</reference>
|
238 |
+
<block type="core/text_list" name="additional.product.info" translate="label">
|
239 |
+
<label>Additional Product Info</label>
|
240 |
+
</block>
|
241 |
+
</checkout_multishipping_addresses>
|
242 |
+
|
243 |
+
<!--
|
244 |
+
Multi address shipping checkout shipping information
|
245 |
+
-->
|
246 |
+
|
247 |
+
<checkout_multishipping_shipping translate="label">
|
248 |
+
<label>Multishipping Checkout Shipping Information Step</label>
|
249 |
+
<update handle="checkout_multishipping"/>
|
250 |
+
<!-- Mage_Checkout -->
|
251 |
+
<reference name="content">
|
252 |
+
<block type="checkout/multishipping_shipping" name="checkout_shipping" template="checkout/multishipping/shipping.phtml">
|
253 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
254 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/item/default.phtml</template></action>
|
255 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/item/default.phtml</template></action>
|
256 |
+
|
257 |
+
<block type="checkout/multishipping_billing_items" name="checkout_billing_items" template="checkout/multishipping/billing/items.phtml">
|
258 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
259 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/item/default.phtml</template></action>
|
260 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/item/default.phtml</template></action>
|
261 |
+
</block>
|
262 |
+
</block>
|
263 |
+
</reference>
|
264 |
+
<block type="core/text_list" name="additional.product.info" translate="label">
|
265 |
+
<label>Additional Product Info</label>
|
266 |
+
</block>
|
267 |
+
</checkout_multishipping_shipping>
|
268 |
+
|
269 |
+
<!--
|
270 |
+
Multi address shipping checkout billing information
|
271 |
+
-->
|
272 |
+
|
273 |
+
<checkout_multishipping_billing translate="label">
|
274 |
+
<label>Multishipping Checkout Billing Information Step</label>
|
275 |
+
<update handle="checkout_multishipping"/>
|
276 |
+
<!-- Mage_Checkout -->
|
277 |
+
<reference name="content">
|
278 |
+
<block type="checkout/multishipping_billing" name="checkout_billing" template="checkout/multishipping/billing.phtml">
|
279 |
+
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
|
280 |
+
<block type="core/text_list" name="payment_methods_before" translate="label">
|
281 |
+
<label>Payment Methods Before</label>
|
282 |
+
</block>
|
283 |
+
<block type="core/text_list" name="payment_methods_after" translate="label">
|
284 |
+
<label>Payment Methods After</label>
|
285 |
+
</block>
|
286 |
+
|
287 |
+
<!--<block type="checkout/multishipping_billing_items" name="checkout_billing_items" template="checkout/multishipping/billing/items.phtml">
|
288 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
289 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/item/default.phtml</template></action>
|
290 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/item/default.phtml</template></action>
|
291 |
+
</block>-->
|
292 |
+
|
293 |
+
</block>
|
294 |
+
</reference>
|
295 |
+
</checkout_multishipping_billing>
|
296 |
+
|
297 |
+
<!--
|
298 |
+
Multi address shipping checkout overview
|
299 |
+
-->
|
300 |
+
|
301 |
+
<checkout_multishipping_overview translate="label">
|
302 |
+
<label>Multishipping Checkout Overview</label>
|
303 |
+
<update handle="checkout_multishipping"/>
|
304 |
+
<!-- Mage_Checkout -->
|
305 |
+
<reference name="content">
|
306 |
+
<block type="checkout/multishipping_overview" name="checkout_overview" template="checkout/multishipping/overview.phtml">
|
307 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/multishipping/item/default.phtml</template></action>
|
308 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/item/default.phtml</template></action>
|
309 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/item/default.phtml</template></action>
|
310 |
+
<action method="addRowItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/multishipping/overview/item.phtml</template></action>
|
311 |
+
<action method="addRowItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/multishipping/overview/item.phtml</template></action>
|
312 |
+
<block type="checkout/multishipping_payment_info" name="payment_info">
|
313 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
314 |
+
</block>
|
315 |
+
<block type="checkout/agreements" name="checkout.multishipping.agreements" as="agreements" template="checkout/multishipping/agreements.phtml"/>
|
316 |
+
<block type="checkout/cart_totals" name="totals" />
|
317 |
+
<block type="core/text_list" name="checkout.multishipping.overview.items.after" as="items_after" translate="label">
|
318 |
+
<label>Overview Items After</label>
|
319 |
+
</block>
|
320 |
+
</block>
|
321 |
+
</reference>
|
322 |
+
<block type="core/text_list" name="additional.product.info" translate="label">
|
323 |
+
<label>Additional Product Info</label>
|
324 |
+
</block>
|
325 |
+
</checkout_multishipping_overview>
|
326 |
+
|
327 |
+
<!--
|
328 |
+
Multi address shipping checkout success
|
329 |
+
-->
|
330 |
+
|
331 |
+
<checkout_multishipping_success translate="label">
|
332 |
+
<label>Multishipping Checkout Success</label>
|
333 |
+
<update handle="checkout_multishipping"/>
|
334 |
+
<!-- Mage_Checkout -->
|
335 |
+
<reference name="content">
|
336 |
+
<block type="checkout/multishipping_success" name="checkout_success" template="checkout/multishipping/success.phtml"/>
|
337 |
+
</reference>
|
338 |
+
</checkout_multishipping_success>
|
339 |
+
|
340 |
+
<!--
|
341 |
+
One page checkout main layout
|
342 |
+
-->
|
343 |
+
|
344 |
+
<checkout_onepage_index translate="label">
|
345 |
+
<label>One Page Checkout</label>
|
346 |
+
<!-- Mage_Checkout -->
|
347 |
+
<remove name="left"/>
|
348 |
+
|
349 |
+
<reference name="root">
|
350 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
351 |
+
</reference>
|
352 |
+
<reference name="right">
|
353 |
+
<action method="unsetChildren"></action>
|
354 |
+
<block type="page/html_wrapper" name="checkout.progress.wrapper" translate="label">
|
355 |
+
<label>Checkout Progress Wrapper</label>
|
356 |
+
<action method="setElementId"><value>checkout-progress-wrapper</value></action>
|
357 |
+
<block type="checkout/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
|
358 |
+
<block type="checkout/onepage_progress" name="billing.progress" template="checkout/onepage/progress/billing.phtml"></block>
|
359 |
+
<block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
|
360 |
+
<block type="checkout/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
|
361 |
+
<block type="checkout/onepage_progress" name="payment.progress" template="checkout/onepage/progress/payment.phtml"></block>
|
362 |
+
</block>
|
363 |
+
</block>
|
364 |
+
</reference>
|
365 |
+
<reference name="content">
|
366 |
+
<block type="checkout/onepage" name="checkout.onepage" template="checkout/onepage.phtml">
|
367 |
+
<block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml">
|
368 |
+
<block type="page/html_wrapper" name="checkout.onepage.login.before" as="login_before" translate="label">
|
369 |
+
<label>Login/Registration Before</label>
|
370 |
+
<action method="setMayBeInvisible"><value>1</value></action>
|
371 |
+
</block>
|
372 |
+
</block>
|
373 |
+
<block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml"/>
|
374 |
+
<block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="checkout/onepage/shipping.phtml"/>
|
375 |
+
<block type="checkout/onepage_shipping_method" name="checkout.onepage.shipping_method" as="shipping_method" template="checkout/onepage/shipping_method.phtml">
|
376 |
+
<block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="checkout/onepage/shipping_method/available.phtml"/>
|
377 |
+
<block type="checkout/onepage_shipping_method_additional" name="checkout.onepage.shipping_method.additional" as="additional" template="checkout/onepage/shipping_method/additional.phtml"/>
|
378 |
+
</block>
|
379 |
+
<block type="checkout/onepage_payment" name="checkout.onepage.payment" as="payment" template="checkout/onepage/payment.phtml">
|
380 |
+
<block type="checkout/onepage_payment_methods" name="checkout.payment.methods" as="methods" template="checkout/onepage/payment/info.phtml">
|
381 |
+
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
|
382 |
+
</block>
|
383 |
+
<block type="core/template" name="checkout.onepage.payment.additional" as="additional" />
|
384 |
+
<block type="core/template" name="checkout.onepage.payment.methods_additional" as="methods_additional" />
|
385 |
+
</block>
|
386 |
+
<block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml"/>
|
387 |
+
</block>
|
388 |
+
</reference>
|
389 |
+
</checkout_onepage_index>
|
390 |
+
|
391 |
+
<!--
|
392 |
+
One page checkout progress block
|
393 |
+
-->
|
394 |
+
|
395 |
+
<checkout_onepage_progress>
|
396 |
+
<!-- Mage_Checkout -->
|
397 |
+
<remove name="right"/>
|
398 |
+
<remove name="left"/>
|
399 |
+
|
400 |
+
<block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress.phtml">
|
401 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
402 |
+
<block type="checkout/onepage_progress" name="billing.progress" template="checkout/onepage/progress/billing.phtml"></block>
|
403 |
+
<block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
|
404 |
+
<block type="checkout/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
|
405 |
+
<block type="checkout/onepage_progress" name="payment.progress" template="checkout/onepage/progress/payment.phtml"></block>
|
406 |
+
</block>
|
407 |
+
</checkout_onepage_progress>
|
408 |
+
|
409 |
+
<!-- Individual blocks for Progress steps begins -->
|
410 |
+
<checkout_onepage_progress_billing>
|
411 |
+
<!-- Mage_Checkout -->
|
412 |
+
<remove name="right"/>
|
413 |
+
<remove name="left"/>
|
414 |
+
|
415 |
+
<block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress/billing.phtml">
|
416 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
417 |
+
</block>
|
418 |
+
</checkout_onepage_progress_billing>
|
419 |
+
|
420 |
+
|
421 |
+
<checkout_onepage_progress_shipping>
|
422 |
+
<!-- Mage_Checkout -->
|
423 |
+
<remove name="right"/>
|
424 |
+
<remove name="left"/>
|
425 |
+
|
426 |
+
<block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress/shipping.phtml">
|
427 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
428 |
+
</block>
|
429 |
+
</checkout_onepage_progress_shipping>
|
430 |
+
|
431 |
+
|
432 |
+
<checkout_onepage_progress_shipping_method>
|
433 |
+
<!-- Mage_Checkout -->
|
434 |
+
<remove name="right"/>
|
435 |
+
<remove name="left"/>
|
436 |
+
|
437 |
+
<block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress/shipping_method.phtml">
|
438 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
439 |
+
</block>
|
440 |
+
</checkout_onepage_progress_shipping_method>
|
441 |
+
|
442 |
+
<checkout_onepage_progress_payment>
|
443 |
+
<!-- Mage_Checkout -->
|
444 |
+
<remove name="right"/>
|
445 |
+
<remove name="left"/>
|
446 |
+
|
447 |
+
<block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress/payment.phtml">
|
448 |
+
<block type="checkout/onepage_payment_info" name="payment_info">
|
449 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
450 |
+
</block>
|
451 |
+
<action method="setInfoTemplate"><method></method><template></template></action>
|
452 |
+
</block>
|
453 |
+
</checkout_onepage_progress_payment>
|
454 |
+
|
455 |
+
<!-- end individual progress blocks -->
|
456 |
+
|
457 |
+
<!--
|
458 |
+
One page checkout payment methods block
|
459 |
+
-->
|
460 |
+
<checkout_onepage_paymentmethod>
|
461 |
+
<remove name="right"/>
|
462 |
+
<remove name="left"/>
|
463 |
+
|
464 |
+
<block type="checkout/onepage_payment_methods" name="root" output="toHtml" template="checkout/onepage/payment/methods.phtml">
|
465 |
+
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
|
466 |
+
<block type="core/template" name="checkout.onepage.payment.methods.scripts" as="scripts" />
|
467 |
+
<block type="core/template" name="checkout.onepage.payment.methods.additional" as="additional" />
|
468 |
+
</block>
|
469 |
+
</checkout_onepage_paymentmethod>
|
470 |
+
|
471 |
+
|
472 |
+
<!--
|
473 |
+
One page checkout shipping methods block
|
474 |
+
-->
|
475 |
+
|
476 |
+
<checkout_onepage_shippingmethod>
|
477 |
+
<!-- Mage_Checkout -->
|
478 |
+
<remove name="right"/>
|
479 |
+
<remove name="left"/>
|
480 |
+
|
481 |
+
<block type="checkout/onepage_shipping_method_available" name="root" output="toHtml" template="checkout/onepage/shipping_method/available.phtml"/>
|
482 |
+
</checkout_onepage_shippingmethod>
|
483 |
+
|
484 |
+
<checkout_onepage_additional>
|
485 |
+
<!-- Mage_Checkout -->
|
486 |
+
<remove name="right"/>
|
487 |
+
<remove name="left"/>
|
488 |
+
|
489 |
+
<block type="checkout/onepage_shipping_method_additional" name="root" output="toHtml" template="checkout/onepage/shipping_method/additional.phtml">
|
490 |
+
<action method="setDontDisplayContainer"><param>1</param></action>
|
491 |
+
</block>
|
492 |
+
</checkout_onepage_additional>
|
493 |
+
|
494 |
+
<!--
|
495 |
+
One page checkout order review block
|
496 |
+
-->
|
497 |
+
|
498 |
+
<checkout_onepage_review translate="label">
|
499 |
+
<label>One Page Checkout Overview</label>
|
500 |
+
<!-- Mage_Checkout -->
|
501 |
+
<remove name="right"/>
|
502 |
+
<remove name="left"/>
|
503 |
+
|
504 |
+
<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
|
505 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
506 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
|
507 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
|
508 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
|
509 |
+
<block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label">
|
510 |
+
<label>Items Before</label>
|
511 |
+
</block>
|
512 |
+
<block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
|
513 |
+
<label>Items After</label>
|
514 |
+
</block>
|
515 |
+
<block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
|
516 |
+
<block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/>
|
517 |
+
</block>
|
518 |
+
<block type="core/text_list" name="additional.product.info" translate="label">
|
519 |
+
<label>Additional Product Info</label>
|
520 |
+
</block>
|
521 |
+
</checkout_onepage_review>
|
522 |
+
|
523 |
+
<checkout_onepage_success translate="label">
|
524 |
+
<label>One Page Checkout Success</label>
|
525 |
+
<reference name="root">
|
526 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
527 |
+
</reference>
|
528 |
+
<reference name="content">
|
529 |
+
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml"/>
|
530 |
+
</reference>
|
531 |
+
</checkout_onepage_success>
|
532 |
+
<checkout_onepage_failure translate="label">
|
533 |
+
<label>One Page Checkout Failure</label>
|
534 |
+
<reference name="root">
|
535 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
536 |
+
</reference>
|
537 |
+
<reference name="content">
|
538 |
+
<block type="checkout/onepage_failure" name="checkout.failure" template="checkout/onepage/failure.phtml"/>
|
539 |
+
</reference>
|
540 |
+
</checkout_onepage_failure>
|
541 |
+
|
542 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/cms.xml
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="0.1.0">
|
29 |
+
<!--
|
30 |
+
Default layout, loads most of the pages
|
31 |
+
-->
|
32 |
+
|
33 |
+
<default>
|
34 |
+
<reference name="footer">
|
35 |
+
<block type="cms/block" name="cms_footer_links" before="footer_links">
|
36 |
+
<!--
|
37 |
+
The content of this block is taken from the database by its block_id.
|
38 |
+
You can manage it in admin CMS -> Static Blocks
|
39 |
+
-->
|
40 |
+
<action method="setBlockId"><block_id>footer_links_company</block_id></action>
|
41 |
+
</block>
|
42 |
+
<block type="cms/block" name="cms_footer_links_sm" after="footer_links2">
|
43 |
+
<!--
|
44 |
+
The content of this block is taken from the database by its block_id.
|
45 |
+
You can manage it in admin CMS -> Static Blocks
|
46 |
+
-->
|
47 |
+
<action method="setBlockId"><block_id>footer_links_sm</block_id></action>
|
48 |
+
</block>
|
49 |
+
</reference>
|
50 |
+
</default>
|
51 |
+
|
52 |
+
<cms_menu>
|
53 |
+
<reference name="left_first">
|
54 |
+
<block type="cms/block" name="cms_menu" >
|
55 |
+
<action method="setBlockId"><block_id>cms_menu</block_id></action>
|
56 |
+
</block>
|
57 |
+
</reference>
|
58 |
+
</cms_menu>
|
59 |
+
|
60 |
+
<cms_page translate="label">
|
61 |
+
<label>CMS Pages (All)</label>
|
62 |
+
<remove name="left.permanent.callout"/>
|
63 |
+
|
64 |
+
<update handle="cms_menu"/>
|
65 |
+
|
66 |
+
<reference name="content">
|
67 |
+
<block type="core/template" name="page_content_heading" template="cms/content_heading.phtml"/>
|
68 |
+
<block type="page/html_wrapper" name="cms.wrapper" translate="label">
|
69 |
+
<label>CMS Content Wrapper</label>
|
70 |
+
<action method="setElementClass"><value>std</value></action>
|
71 |
+
<block type="cms/page" name="cms_page"/>
|
72 |
+
</block>
|
73 |
+
</reference>
|
74 |
+
</cms_page>
|
75 |
+
|
76 |
+
<cms_index_index translate="label">
|
77 |
+
<label>CMS Home Page</label>
|
78 |
+
</cms_index_index>
|
79 |
+
|
80 |
+
<cms_index_defaultindex>
|
81 |
+
<remove name="right"/>
|
82 |
+
<remove name="left"/>
|
83 |
+
|
84 |
+
<reference name="root">
|
85 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
86 |
+
</reference>
|
87 |
+
<reference name="content">
|
88 |
+
<block type="core/template" name="default_home_page" template="cms/default/home.phtml"/>
|
89 |
+
</reference>
|
90 |
+
</cms_index_defaultindex>
|
91 |
+
|
92 |
+
<cms_index_noroute translate="label">
|
93 |
+
<label>CMS No-Route Page</label>
|
94 |
+
</cms_index_noroute>
|
95 |
+
|
96 |
+
<cms_index_defaultnoroute>
|
97 |
+
<remove name="right"/>
|
98 |
+
<remove name="left"/>
|
99 |
+
|
100 |
+
<reference name="root">
|
101 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
102 |
+
</reference>
|
103 |
+
<reference name="content">
|
104 |
+
<block type="core/template" name="default_no_route" template="cms/default/no-route.phtml"/>
|
105 |
+
</reference>
|
106 |
+
</cms_index_defaultnoroute>
|
107 |
+
|
108 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/configurableswatches.xml
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="0.1.0">
|
29 |
+
|
30 |
+
<product_list>
|
31 |
+
<reference name="head">
|
32 |
+
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/product-media.js</name></action>
|
33 |
+
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/swatches-list.js</name></action>
|
34 |
+
</reference>
|
35 |
+
<reference name="product_list.name.after">
|
36 |
+
<block type="core/template" name="product_list.swatches" template="configurableswatches/catalog/product/list/swatches.phtml" />
|
37 |
+
</reference>
|
38 |
+
<reference name="product_list.after">
|
39 |
+
<block type="configurableswatches/catalog_media_js_list" name="configurableswatches.media.js.list" />
|
40 |
+
</reference>
|
41 |
+
</product_list>
|
42 |
+
|
43 |
+
<catalog_category_default>
|
44 |
+
<update handle="product_list"/>
|
45 |
+
</catalog_category_default>
|
46 |
+
|
47 |
+
<catalog_category_layered>
|
48 |
+
<update handle="product_list"/>
|
49 |
+
</catalog_category_layered>
|
50 |
+
|
51 |
+
<catalogsearch_result_index>
|
52 |
+
<update handle="product_list"/>
|
53 |
+
</catalogsearch_result_index>
|
54 |
+
|
55 |
+
<catalogsearch_advanced_result>
|
56 |
+
<update handle="product_list"/>
|
57 |
+
</catalogsearch_advanced_result>
|
58 |
+
|
59 |
+
<PRODUCT_TYPE_configurable>
|
60 |
+
<reference name="head">
|
61 |
+
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/product-media.js</name></action>
|
62 |
+
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/swatches-product.js</name></action>
|
63 |
+
</reference>
|
64 |
+
<reference name="product.info.media">
|
65 |
+
<action method="setGalleryFilterHelper"><helper>configurableswatches/productimg</helper></action>
|
66 |
+
<action method="setGalleryFilterMethod"><method>filterImageInGallery</method></action>
|
67 |
+
</reference>
|
68 |
+
<reference name="product.info.media.after">
|
69 |
+
<block type="configurableswatches/catalog_media_js_product" name="configurableswatches.media.js.product" />
|
70 |
+
</reference>
|
71 |
+
<reference name="product.info.options.configurable.renderers">
|
72 |
+
<block type="configurableswatches/catalog_product_view_type_configurable_swatches" template="configurableswatches/catalog/product/view/type/options/configurable/swatches.phtml" />
|
73 |
+
</reference>
|
74 |
+
<reference name="product.info.options.configurable.after">
|
75 |
+
<block type="core/template" template="configurableswatches/catalog/product/view/type/configurable/swatch-js.phtml" />
|
76 |
+
</reference>
|
77 |
+
</PRODUCT_TYPE_configurable>
|
78 |
+
|
79 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/contacts.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="0.1.0">
|
29 |
+
<contacts_index_index translate="label">
|
30 |
+
<label>Contact Us Form</label>
|
31 |
+
<reference name="head">
|
32 |
+
<action method="setTitle" translate="title" module="contacts"><title>Contact Us</title></action>
|
33 |
+
</reference>
|
34 |
+
<reference name="root">
|
35 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
36 |
+
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
|
37 |
+
</reference>
|
38 |
+
<update handle="cms_menu"/>
|
39 |
+
<reference name="content">
|
40 |
+
<block type="core/template" name="contactForm" template="contacts/form.phtml"/>
|
41 |
+
</reference>
|
42 |
+
</contacts_index_index>
|
43 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/customer.xml
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
Supported layout update handles (action):
|
29 |
+
- customer_account_index
|
30 |
+
- customer_address_index
|
31 |
+
- customer_address_view
|
32 |
+
- customer_account_login
|
33 |
+
- customer_account_logoutsuccess
|
34 |
+
- customer_account_create
|
35 |
+
- customer_account_forgotpassword
|
36 |
+
- customer_account_confirmation
|
37 |
+
- customer_account_edit
|
38 |
+
|
39 |
+
Supported layout update handles (special):
|
40 |
+
- default
|
41 |
+
|
42 |
+
-->
|
43 |
+
<layout version="0.1.0">
|
44 |
+
|
45 |
+
<!--
|
46 |
+
Default layout, loads most of the pages
|
47 |
+
-->
|
48 |
+
|
49 |
+
<default>
|
50 |
+
<!-- Mage_Customer -->
|
51 |
+
<reference name="top.links">
|
52 |
+
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
|
53 |
+
<action method="addLink" translate="label title before_text" module="customer"><label>Register</label><url helper="customer/getRegisterUrl" /><title>Register</title><prepare/><urlParams/><position>100</position><li/><a/></action>
|
54 |
+
</reference>
|
55 |
+
<reference name="footer_links2">
|
56 |
+
<action method="addLink" translate="label title" module="catalog"><label>My Account</label><url helper="customer/getAccountUrl" /><title>My Account</title></action>
|
57 |
+
</reference>
|
58 |
+
</default>
|
59 |
+
|
60 |
+
<!--
|
61 |
+
Load this update on every page when customer is logged in
|
62 |
+
-->
|
63 |
+
|
64 |
+
<customer_logged_in>
|
65 |
+
<reference name="top.links">
|
66 |
+
<action method="removeLinkByUrl"><url helper="customer/getRegisterUrl" /></action>
|
67 |
+
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
|
68 |
+
</reference>
|
69 |
+
</customer_logged_in>
|
70 |
+
|
71 |
+
<!--
|
72 |
+
Load this update on every page when customer is logged out
|
73 |
+
-->
|
74 |
+
|
75 |
+
<customer_logged_out>
|
76 |
+
<!---<reference name="right">
|
77 |
+
<block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
|
78 |
+
</reference>-->
|
79 |
+
<reference name="top.links">
|
80 |
+
<action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
|
81 |
+
</reference>
|
82 |
+
<remove name="reorder"></remove>
|
83 |
+
</customer_logged_out>
|
84 |
+
|
85 |
+
<!--
|
86 |
+
Layout for customer login page
|
87 |
+
-->
|
88 |
+
|
89 |
+
<customer_account_login translate="label">
|
90 |
+
<label>Customer Account Login Form</label>
|
91 |
+
<!-- Mage_Customer -->
|
92 |
+
<remove name="right"/>
|
93 |
+
<remove name="left"/>
|
94 |
+
|
95 |
+
<reference name="root">
|
96 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
97 |
+
</reference>
|
98 |
+
<reference name="content">
|
99 |
+
<block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml" />
|
100 |
+
</reference>
|
101 |
+
</customer_account_login>
|
102 |
+
|
103 |
+
<!--
|
104 |
+
Layout for customer log out page
|
105 |
+
-->
|
106 |
+
|
107 |
+
<customer_account_logoutsuccess translate="label">
|
108 |
+
<label>Customer Account Logout Success</label>
|
109 |
+
<!-- Mage_Customer -->
|
110 |
+
<remove name="right"/>
|
111 |
+
<remove name="left"/>
|
112 |
+
|
113 |
+
<reference name="root">
|
114 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
115 |
+
</reference>
|
116 |
+
<reference name="content">
|
117 |
+
<block type="core/template" name="customer_logout" template="customer/logout.phtml"/>
|
118 |
+
</reference>
|
119 |
+
</customer_account_logoutsuccess>
|
120 |
+
|
121 |
+
<!--
|
122 |
+
New customer registration
|
123 |
+
-->
|
124 |
+
|
125 |
+
<customer_account_create translate="label">
|
126 |
+
<label>Customer Account Registration Form</label>
|
127 |
+
<!-- Mage_Customer -->
|
128 |
+
<remove name="right"/>
|
129 |
+
<remove name="left"/>
|
130 |
+
|
131 |
+
<reference name="root">
|
132 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
133 |
+
</reference>
|
134 |
+
<reference name="content">
|
135 |
+
<block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
|
136 |
+
<block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
|
137 |
+
<label>Form Fields Before</label>
|
138 |
+
</block>
|
139 |
+
</block>
|
140 |
+
</reference>
|
141 |
+
</customer_account_create>
|
142 |
+
|
143 |
+
<customer_account_forgotpassword translate="label">
|
144 |
+
<label>Customer Forgot Password Form</label>
|
145 |
+
<remove name="right"/>
|
146 |
+
<remove name="left"/>
|
147 |
+
|
148 |
+
<reference name="head">
|
149 |
+
<action method="setTitle" translate="title" module="customer"><title>Forgot Your Password</title></action>
|
150 |
+
</reference>
|
151 |
+
<reference name="root">
|
152 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
153 |
+
<action method="setHeaderTitle" translate="title" module="customer"><title>Password forgotten</title></action>
|
154 |
+
</reference>
|
155 |
+
<reference name="content">
|
156 |
+
<!--<block type="core/template" name="forgotPassword" template="customer/form/forgotpassword.phtml"/>-->
|
157 |
+
<block type="customer/account_forgotpassword" name="forgotPassword" template="customer/form/forgotpassword.phtml" />
|
158 |
+
</reference>
|
159 |
+
</customer_account_forgotpassword>
|
160 |
+
|
161 |
+
<customer_account_resetpassword translate="label">
|
162 |
+
<label>Reset a Password</label>
|
163 |
+
<remove name="right"/>
|
164 |
+
<remove name="left"/>
|
165 |
+
|
166 |
+
<reference name="head">
|
167 |
+
<action method="setTitle" translate="title" module="customer">
|
168 |
+
<title>Reset a Password</title>
|
169 |
+
</action>
|
170 |
+
</reference>
|
171 |
+
<reference name="root">
|
172 |
+
<action method="setTemplate">
|
173 |
+
<template>page/1column.phtml</template>
|
174 |
+
</action>
|
175 |
+
<action method="setHeaderTitle" translate="title" module="customer">
|
176 |
+
<title>Reset a Password</title>
|
177 |
+
</action>
|
178 |
+
</reference>
|
179 |
+
<reference name="content">
|
180 |
+
<block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>
|
181 |
+
</reference>
|
182 |
+
</customer_account_resetpassword>
|
183 |
+
|
184 |
+
<customer_account_confirmation>
|
185 |
+
<remove name="right"/>
|
186 |
+
<remove name="left"/>
|
187 |
+
|
188 |
+
<reference name="root">
|
189 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
190 |
+
<action method="setHeaderTitle" translate="title" module="customer"><title>Send confirmation link</title></action>
|
191 |
+
</reference>
|
192 |
+
<reference name="content">
|
193 |
+
<block type="core/template" name="accountConfirmation" template="customer/form/confirmation.phtml"/>
|
194 |
+
</reference>
|
195 |
+
</customer_account_confirmation>
|
196 |
+
|
197 |
+
<customer_account_edit translate="label">
|
198 |
+
<label>Customer Account Edit Form</label>
|
199 |
+
<update handle="customer_account"/>
|
200 |
+
<reference name="root">
|
201 |
+
<action method="setHeaderTitle" translate="title" module="customer"><title>Edit Account Info</title></action>
|
202 |
+
</reference>
|
203 |
+
<reference name="my.account.wrapper">
|
204 |
+
<block type="customer/form_edit" name="customer_edit" template="customer/form/edit.phtml"/>
|
205 |
+
</reference>
|
206 |
+
|
207 |
+
<reference name="left">
|
208 |
+
<action method="unsetChild"><name>left.permanent.callout</name></action>
|
209 |
+
</reference>
|
210 |
+
</customer_account_edit>
|
211 |
+
|
212 |
+
<!--
|
213 |
+
Customer account pages, rendered for all tabs in dashboard
|
214 |
+
-->
|
215 |
+
|
216 |
+
<customer_account translate="label">
|
217 |
+
<label>Customer My Account (All Pages)</label>
|
218 |
+
<!--remove name="catalog.compare.sidebar"/>
|
219 |
+
<remove name="sale.reorder.sidebar"/-->
|
220 |
+
<!-- Mage_Customer -->
|
221 |
+
<reference name="root">
|
222 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
223 |
+
<action method="addBodyClass"><class>customer-account</class></action>
|
224 |
+
</reference>
|
225 |
+
|
226 |
+
<reference name="content">
|
227 |
+
<block type="page/html_wrapper" name="my.account.wrapper" translate="label">
|
228 |
+
<label>My Account Wrapper</label>
|
229 |
+
<action method="setElementClass"><value>my-account</value></action>
|
230 |
+
</block>
|
231 |
+
</reference>
|
232 |
+
|
233 |
+
<reference name="left_first">
|
234 |
+
<block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
|
235 |
+
<action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
|
236 |
+
<action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
|
237 |
+
<action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
|
238 |
+
</block>
|
239 |
+
</reference>
|
240 |
+
<reference name="left">
|
241 |
+
<!--<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml">-->
|
242 |
+
<!--<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
243 |
+
<!--<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
244 |
+
<!--<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>-->
|
245 |
+
<!--</block>-->
|
246 |
+
<block type="catalog/product_compare_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
|
247 |
+
<remove name="tags_popular"/>
|
248 |
+
|
249 |
+
</reference>
|
250 |
+
</customer_account>
|
251 |
+
|
252 |
+
<!--
|
253 |
+
Customer account home dashboard layout
|
254 |
+
-->
|
255 |
+
|
256 |
+
<customer_account_index translate="label">
|
257 |
+
<label>Customer My Account Dashboard</label>
|
258 |
+
<update handle="customer_account"/>
|
259 |
+
<!-- Mage_Customer -->
|
260 |
+
<reference name="root">
|
261 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
262 |
+
</reference>
|
263 |
+
<reference name="my.account.wrapper">
|
264 |
+
<block type="customer/account_dashboard" name="customer_account_dashboard" template="customer/account/dashboard.phtml">
|
265 |
+
<block type="customer/account_dashboard_hello" name="customer_account_dashboard_hello" as="hello" template="customer/account/dashboard/hello.phtml"/>
|
266 |
+
<block type="core/template" name="customer_account_dashboard_top" as="top" />
|
267 |
+
<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>
|
268 |
+
<block type="customer/account_dashboard_newsletter" name="customer_account_dashboard_newsletter" as="newsletter" template="customer/account/dashboard/newsletter.phtml"/>
|
269 |
+
<block type="customer/account_dashboard_address" name="customer_account_dashboard_address" as="address" template="customer/account/dashboard/address.phtml"/>
|
270 |
+
</block>
|
271 |
+
</reference>
|
272 |
+
|
273 |
+
</customer_account_index>
|
274 |
+
|
275 |
+
<!--
|
276 |
+
Customer account address book
|
277 |
+
-->
|
278 |
+
|
279 |
+
<customer_address_index translate="label">
|
280 |
+
<label>Customer My Account Address Book</label>
|
281 |
+
<!-- Mage_Customer -->
|
282 |
+
<update handle="customer_account"/>
|
283 |
+
<reference name="my.account.wrapper">
|
284 |
+
<block type="customer/address_book" name="address_book" template="customer/address/book.phtml"/>
|
285 |
+
</reference>
|
286 |
+
</customer_address_index>
|
287 |
+
|
288 |
+
<!--
|
289 |
+
Customer account address edit page
|
290 |
+
-->
|
291 |
+
|
292 |
+
<customer_address_form translate="label">
|
293 |
+
<label>Customer My Account Address Edit Form</label>
|
294 |
+
<!-- Mage_Customer -->
|
295 |
+
<update handle="customer_account"/>
|
296 |
+
<reference name="my.account.wrapper">
|
297 |
+
<block type="customer/address_edit" name="customer_address_edit" template="customer/address/edit.phtml"/>
|
298 |
+
</reference>
|
299 |
+
</customer_address_form>
|
300 |
+
|
301 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/directory.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<default>
|
31 |
+
<reference name="head">
|
32 |
+
<block type="core/template" name="optional_zip_countries" as="optional_zip_countries" template="directory/js/optional_zip_countries.phtml" />
|
33 |
+
</reference>
|
34 |
+
|
35 |
+
<reference name="header">
|
36 |
+
<block type="directory/currency" name="currency" as="currency_switcher" template="directory/currency.phtml"/>
|
37 |
+
</reference>
|
38 |
+
|
39 |
+
<reference name="footer">
|
40 |
+
<block type="directory/currency" name="footer_currency" after="footer_store_language" template="directory/currency.phtml"/>
|
41 |
+
</reference>
|
42 |
+
</default>
|
43 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/downloadable.xml
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<customer_account>
|
32 |
+
<reference name="customer_account_navigation">
|
33 |
+
<action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>
|
34 |
+
</reference>
|
35 |
+
</customer_account>
|
36 |
+
|
37 |
+
<downloadable_customer_products translate="label">
|
38 |
+
<label>Customer My Account Downloadable Items</label>
|
39 |
+
<update handle="customer_account"/>
|
40 |
+
<reference name="my.account.wrapper">
|
41 |
+
<block type="downloadable/customer_products_list" name="downloadable_customer_products_list" template="downloadable/customer/products/list.phtml" />
|
42 |
+
</reference>
|
43 |
+
<reference name="root">
|
44 |
+
<action method="setHeaderTitle" translate="title" module="downloadable"><title>My Downloadable Products</title></action>
|
45 |
+
</reference>
|
46 |
+
</downloadable_customer_products>
|
47 |
+
|
48 |
+
<checkout_cart_index>
|
49 |
+
<reference name="checkout.cart">
|
50 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/cart/item/default.phtml</template></action>
|
51 |
+
</reference>
|
52 |
+
</checkout_cart_index>
|
53 |
+
|
54 |
+
<checkout_onepage_review>
|
55 |
+
<reference name="root">
|
56 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
|
57 |
+
</reference>
|
58 |
+
</checkout_onepage_review>
|
59 |
+
|
60 |
+
<checkout_onepage_success>
|
61 |
+
<reference name="checkout.success">
|
62 |
+
<block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
|
63 |
+
</reference>
|
64 |
+
</checkout_onepage_success>
|
65 |
+
|
66 |
+
<checkout_multishipping_addresses>
|
67 |
+
<reference name="checkout_addresses">
|
68 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
|
69 |
+
</reference>
|
70 |
+
</checkout_multishipping_addresses>
|
71 |
+
|
72 |
+
<checkout_multishipping_shipping>
|
73 |
+
<reference name="checkout_billing_items">
|
74 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
|
75 |
+
</reference>
|
76 |
+
</checkout_multishipping_shipping>
|
77 |
+
|
78 |
+
<checkout_multishipping_overview>
|
79 |
+
<reference name="checkout_overview">
|
80 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/multishipping/item/downloadable.phtml</template></action>
|
81 |
+
</reference>
|
82 |
+
</checkout_multishipping_overview>
|
83 |
+
|
84 |
+
<checkout_multishipping_success>
|
85 |
+
<reference name="checkout_success">
|
86 |
+
<block type="downloadable/checkout_success" name="downloadable.checkout.success" template="downloadable/checkout/success.phtml"/>
|
87 |
+
</reference>
|
88 |
+
</checkout_multishipping_success>
|
89 |
+
|
90 |
+
<paypal_express_review>
|
91 |
+
<reference name="paypal.express.review.details">
|
92 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
|
93 |
+
</reference>
|
94 |
+
</paypal_express_review>
|
95 |
+
<paypal_express_review_details>
|
96 |
+
<reference name="root">
|
97 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
|
98 |
+
</reference>
|
99 |
+
</paypal_express_review_details>
|
100 |
+
|
101 |
+
<paypaluk_express_review>
|
102 |
+
<reference name="paypal.express.review.details">
|
103 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
|
104 |
+
</reference>
|
105 |
+
</paypaluk_express_review>
|
106 |
+
<paypaluk_express_review_details>
|
107 |
+
<reference name="root">
|
108 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/checkout_cart_item_renderer</block><template>downloadable/checkout/onepage/review/item.phtml</template></action>
|
109 |
+
</reference>
|
110 |
+
</paypaluk_express_review_details>
|
111 |
+
|
112 |
+
<sales_order_view>
|
113 |
+
<reference name="order_items">
|
114 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
|
115 |
+
</reference>
|
116 |
+
</sales_order_view>
|
117 |
+
|
118 |
+
<sales_order_invoice>
|
119 |
+
<reference name="invoice_items">
|
120 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
|
121 |
+
</reference>
|
122 |
+
</sales_order_invoice>
|
123 |
+
|
124 |
+
<sales_order_creditmemo>
|
125 |
+
<reference name="creditmemo_items">
|
126 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
|
127 |
+
</reference>
|
128 |
+
</sales_order_creditmemo>
|
129 |
+
|
130 |
+
<!--
|
131 |
+
Print pages
|
132 |
+
-->
|
133 |
+
|
134 |
+
<sales_order_print>
|
135 |
+
<reference name="sales.order.print">
|
136 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
|
137 |
+
</reference>
|
138 |
+
</sales_order_print>
|
139 |
+
|
140 |
+
<sales_order_printinvoice>
|
141 |
+
<reference name="sales.order.print.invoice">
|
142 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
|
143 |
+
</reference>
|
144 |
+
</sales_order_printinvoice>
|
145 |
+
|
146 |
+
<sales_order_printcreditmemo>
|
147 |
+
<reference name="sales.order.print.creditmemo">
|
148 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
|
149 |
+
</reference>
|
150 |
+
</sales_order_printcreditmemo>
|
151 |
+
|
152 |
+
<!--
|
153 |
+
EOF Print pages
|
154 |
+
-->
|
155 |
+
|
156 |
+
<!--
|
157 |
+
For guests
|
158 |
+
-->
|
159 |
+
<sales_guest_view>
|
160 |
+
<reference name="order_items">
|
161 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
|
162 |
+
</reference>
|
163 |
+
</sales_guest_view>
|
164 |
+
|
165 |
+
<sales_guest_invoice>
|
166 |
+
<reference name="invoice_items">
|
167 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
|
168 |
+
</reference>
|
169 |
+
</sales_guest_invoice>
|
170 |
+
|
171 |
+
<sales_guest_creditmemo>
|
172 |
+
<reference name="creditmemo_items">
|
173 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
|
174 |
+
</reference>
|
175 |
+
</sales_guest_creditmemo>
|
176 |
+
|
177 |
+
<sales_guest_print>
|
178 |
+
<reference name="sales.order.print">
|
179 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/items/renderer/downloadable.phtml</template></action>
|
180 |
+
</reference>
|
181 |
+
</sales_guest_print>
|
182 |
+
|
183 |
+
<sales_guest_printinvoice>
|
184 |
+
<reference name="sales.order.print.invoice">
|
185 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/invoice/items/renderer/downloadable.phtml</template></action>
|
186 |
+
</reference>
|
187 |
+
</sales_guest_printinvoice>
|
188 |
+
|
189 |
+
<sales_guest_printcreditmemo>
|
190 |
+
<reference name="sales.order.print.creditmemo">
|
191 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_item_renderer_downloadable</block><template>downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml</template></action>
|
192 |
+
</reference>
|
193 |
+
</sales_guest_printcreditmemo>
|
194 |
+
|
195 |
+
<!--
|
196 |
+
Emails
|
197 |
+
-->
|
198 |
+
|
199 |
+
<sales_email_order_items>
|
200 |
+
<reference name="items">
|
201 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_order_downloadable</block><template>downloadable/email/order/items/order/downloadable.phtml</template></action>
|
202 |
+
</reference>
|
203 |
+
</sales_email_order_items>
|
204 |
+
|
205 |
+
<sales_email_order_invoice_items>
|
206 |
+
<reference name="items">
|
207 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/invoice/downloadable.phtml</template></action>
|
208 |
+
</reference>
|
209 |
+
</sales_email_order_invoice_items>
|
210 |
+
|
211 |
+
<sales_email_order_creditmemo_items>
|
212 |
+
<reference name="items">
|
213 |
+
<action method="addItemRender"><type>downloadable</type><block>downloadable/sales_order_email_items_downloadable</block><template>downloadable/email/order/items/creditmemo/downloadable.phtml</template></action>
|
214 |
+
</reference>
|
215 |
+
</sales_email_order_creditmemo_items>
|
216 |
+
|
217 |
+
<PRODUCT_TYPE_downloadable translate="label" module="downloadable">
|
218 |
+
<label>Catalog Product View (Downloadable)</label>
|
219 |
+
<reference name="product.info">
|
220 |
+
<block type="downloadable/catalog_product_view_type" name="product.info.downloadable" as="product_type_availability" template="downloadable/catalog/product/type.phtml">
|
221 |
+
<!--<block type="downloadable/catalog_product_view_type" name="product.info.downloadable" as="product_type_data" template="downloadable/catalog/product/type.phtml">-->
|
222 |
+
<block type="cataloginventory/stockqty_default" name="product.info.downloadable.extra" as="product_type_data_extra" template="cataloginventory/stockqty/default.phtml"/>
|
223 |
+
</block>
|
224 |
+
<block type="downloadable/catalog_product_samples" name="product.info.downloadable.samples" as="product_type_data" template="downloadable/catalog/product/samples.phtml"/>
|
225 |
+
</reference>
|
226 |
+
<reference name="product.info.options.wrapper">
|
227 |
+
<block type="downloadable/catalog_product_links" name="product.info.downloadable.options" as="type_downloadable_options" before="-" template="downloadable/catalog/product/links.phtml"/>
|
228 |
+
<action method="insert"><block>product.info.downloadable.options</block></action>
|
229 |
+
</reference>
|
230 |
+
</PRODUCT_TYPE_downloadable>
|
231 |
+
|
232 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/newsletter.xml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<!--
|
32 |
+
Default layout, loads most of the pages
|
33 |
+
-->
|
34 |
+
|
35 |
+
<default>
|
36 |
+
|
37 |
+
<!-- Mage_Newsletter -->
|
38 |
+
<reference name="footer">
|
39 |
+
<block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" before="footer_store_language" template="newsletter/subscribe.phtml"/>
|
40 |
+
</reference>
|
41 |
+
</default>
|
42 |
+
|
43 |
+
<!--
|
44 |
+
Customer account pages, rendered for all tabs in dashboard
|
45 |
+
-->
|
46 |
+
|
47 |
+
<customer_account>
|
48 |
+
<!-- Mage_Newsletter -->
|
49 |
+
<reference name="customer_account_navigation">
|
50 |
+
<action method="addLink" translate="label" module="newsletter"><name>newsletter</name><path>newsletter/manage/</path><label>Newsletter Subscriptions</label></action>
|
51 |
+
</reference>
|
52 |
+
<remove name="left.newsletter"/>
|
53 |
+
</customer_account>
|
54 |
+
|
55 |
+
<newsletter_manage_index translate="label">
|
56 |
+
<label>Customer My Account Newsletter Subscriptions</label>
|
57 |
+
<update handle="customer_account"/>
|
58 |
+
<reference name="my.account.wrapper">
|
59 |
+
<block type="customer/newsletter" name="customer_newsletter">
|
60 |
+
<block type="page/html_wrapper" name="customer.newsletter.form.before" as="form_before" translate="label">
|
61 |
+
<label>Newsletter Subscription Form Before</label>
|
62 |
+
</block>
|
63 |
+
</block>
|
64 |
+
</reference>
|
65 |
+
</newsletter_manage_index>
|
66 |
+
|
67 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/oauth.xml
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="1.0.0.0">
|
29 |
+
<oauth_root_handle>
|
30 |
+
<reference name="root">
|
31 |
+
<action method="setTemplate">
|
32 |
+
<template>page/1column.phtml</template>
|
33 |
+
</action>
|
34 |
+
</reference>
|
35 |
+
<reference name="head">
|
36 |
+
<action method="removeItem"><type>js</type><name>lib/ccard.js</name></action>
|
37 |
+
<action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
|
38 |
+
<action method="removeItem"><type>js</type><name>scriptaculous/builder.js</name></action>
|
39 |
+
<action method="removeItem"><type>js</type><name>scriptaculous/dragdrop.js</name></action>
|
40 |
+
<action method="removeItem"><type>js</type><name>scriptaculous/controls.js</name></action>
|
41 |
+
<action method="removeItem"><type>js</type><name>scriptaculous/slider.js</name></action>
|
42 |
+
<action method="removeItem"><type>js</type><name>varien/js.js</name></action>
|
43 |
+
<action method="removeItem"><type>js</type><name>varien/menu.js</name></action>
|
44 |
+
</reference>
|
45 |
+
<remove name="top.links"/>
|
46 |
+
<remove name="top.search"/>
|
47 |
+
<remove name="top.menu"/>
|
48 |
+
<remove name="footer"/>
|
49 |
+
</oauth_root_handle>
|
50 |
+
|
51 |
+
<oauth_root_handle_simple>
|
52 |
+
<remove name="js_cookie" />
|
53 |
+
<block type="page/html" name="root" output="toHtml" template="page/empty.phtml">
|
54 |
+
<block type="page/html_head" name="head" as="head" template="oauth/authorize/head-simple.phtml">
|
55 |
+
<action method="addCss"><stylesheet>css/oauth-simple.css</stylesheet></action>
|
56 |
+
</block>
|
57 |
+
<block type="core/text_list" name="content"/>
|
58 |
+
</block>
|
59 |
+
</oauth_root_handle_simple>
|
60 |
+
|
61 |
+
<!-- Authorization -->
|
62 |
+
<oauth_authorize_index translate="label">
|
63 |
+
<update handle="oauth_root_handle"/>
|
64 |
+
<label>OAuth authorization for customer</label>
|
65 |
+
<reference name="content">
|
66 |
+
<block type="oauth/authorize" name="oauth.authorize.form" template="oauth/authorize/form/login.phtml"/>
|
67 |
+
<block type="oauth/authorize_button" name="oauth.authorize.button" template="oauth/authorize/button.phtml" />
|
68 |
+
</reference>
|
69 |
+
</oauth_authorize_index>
|
70 |
+
|
71 |
+
<oauth_authorize_simple translate="label">
|
72 |
+
<update handle="oauth_root_handle_simple"/>
|
73 |
+
<remove name="header"/>
|
74 |
+
<label>OAuth authorization Pop Up for customer</label>
|
75 |
+
<reference name="content">
|
76 |
+
<block type="oauth/authorize" name="oauth.authorize.form" template="oauth/authorize/form/login-simple.phtml"/>
|
77 |
+
<block type="oauth/authorize_button" name="oauth.authorize.button" template="oauth/authorize/button-simple.phtml" />
|
78 |
+
</reference>
|
79 |
+
</oauth_authorize_simple>
|
80 |
+
<!-- EOF Authorization -->
|
81 |
+
|
82 |
+
<!-- Confirm Authorization -->
|
83 |
+
<oauth_authorize_confirm translate="label">
|
84 |
+
<update handle="oauth_root_handle"/>
|
85 |
+
<label>Confirm OAuth token authorization</label>
|
86 |
+
<reference name="content">
|
87 |
+
<block type="oauth/authorize_button" name="oauth.authorize.confirm" template="oauth/authorize/confirm.phtml"/>
|
88 |
+
</reference>
|
89 |
+
</oauth_authorize_confirm>
|
90 |
+
|
91 |
+
<oauth_authorize_confirmsimple translate="label">
|
92 |
+
<update handle="oauth_root_handle_simple"/>
|
93 |
+
<remove name="header"/>
|
94 |
+
<reference name="content">
|
95 |
+
<block type="oauth/authorize_button" name="oauth.authorize.confirm" template="oauth/authorize/confirm-simple.phtml"/>
|
96 |
+
</reference>
|
97 |
+
</oauth_authorize_confirmsimple>
|
98 |
+
<!-- EOF Confirm Authorization -->
|
99 |
+
|
100 |
+
<!-- Reject Authorization -->
|
101 |
+
<oauth_authorize_reject translate="label">
|
102 |
+
<update handle="oauth_root_handle"/>
|
103 |
+
<label>Reject OAuth token authorization</label>
|
104 |
+
<reference name="content">
|
105 |
+
<block type="oauth/authorize_button" name="oauth.authorize.reject" template="oauth/authorize/reject.phtml"/>
|
106 |
+
</reference>
|
107 |
+
</oauth_authorize_reject>
|
108 |
+
|
109 |
+
<oauth_authorize_rejectsimple translate="label">
|
110 |
+
<update handle="oauth_root_handle_simple"/>
|
111 |
+
<remove name="header"/>
|
112 |
+
<reference name="content">
|
113 |
+
<block type="oauth/authorize_button" name="oauth.authorize.reject" template="oauth/authorize/reject-simple.phtml"/>
|
114 |
+
</reference>
|
115 |
+
</oauth_authorize_rejectsimple>
|
116 |
+
<!-- EOF Reject Authorization -->
|
117 |
+
|
118 |
+
<!-- My Applications-->
|
119 |
+
<customer_account>
|
120 |
+
<reference name="customer_account_navigation">
|
121 |
+
<action method="addLink" translate="label" module="oauth">
|
122 |
+
<name>OAuth Customer Tokens</name>
|
123 |
+
<path>oauth/customer_token</path>
|
124 |
+
<label>My Applications</label>
|
125 |
+
</action>
|
126 |
+
</reference>
|
127 |
+
</customer_account>
|
128 |
+
|
129 |
+
<oauth_customer_token_index translate="label">
|
130 |
+
<label>Customer My Account My OAuth Applications</label>
|
131 |
+
<update handle="customer_account"/>
|
132 |
+
<reference name="my.account.wrapper">
|
133 |
+
<block type="oauth/customer_token_list" name="oauth_customer_token_list" template="oauth/customer/token/list.phtml"/>
|
134 |
+
</reference>
|
135 |
+
</oauth_customer_token_index>
|
136 |
+
<!-- EOF My Applications-->
|
137 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/onestepcheckout.xml
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Abserve
|
5 |
+
* @package Abserve_Module
|
6 |
+
* @author Abserve Developer
|
7 |
+
* @license http://abservetech.com/license-agreement/
|
8 |
+
* @copyright Copyright (c) 2015 abservetech (http://abservetech.com)
|
9 |
+
*/
|
10 |
+
-->
|
11 |
+
<layout version="0.1.0">
|
12 |
+
<onestepcheckout_index_index>
|
13 |
+
<reference name="root">
|
14 |
+
<action method="setTemplate">
|
15 |
+
<template>page/1column.phtml</template>
|
16 |
+
</action>
|
17 |
+
</reference>
|
18 |
+
<reference name="head">
|
19 |
+
<!-- Amazon payment-->
|
20 |
+
<action method="addJs" ifconfig="payment/amazon_payments/enabled"><script>prototype/window.js</script></action>
|
21 |
+
<action method="addItem" ifconfig="payment/amazon_payments/enabled"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
|
22 |
+
<action method="addItem" ifconfig="payment/amazon_payments/enabled"><type>js_css</type><name>prototype/windows/themes/alphacube.css</name></action>
|
23 |
+
<action method="addItem" ifconfig="payment/amazon_payments/enabled"><type>skin_css</type><name>amazon_payments/css/popup_alphacube.css</name><params/></action>
|
24 |
+
<block type="core/template" name="amazon_payments.script" template="amazon_payments/script.phtml" />
|
25 |
+
<!-- /Amazon scripts-->
|
26 |
+
<action method="removeItem">
|
27 |
+
<type>js</type>
|
28 |
+
<name>varien/form.js</name>
|
29 |
+
<params />
|
30 |
+
</action>
|
31 |
+
<action method="addJs">
|
32 |
+
<script>abserve/varien/form.js</script>
|
33 |
+
</action>
|
34 |
+
<action method="addJs">
|
35 |
+
<script>abserve/onestepcheckout.js</script>
|
36 |
+
</action>
|
37 |
+
<action method="addJs">
|
38 |
+
<script>calendar/calendar.js</script>
|
39 |
+
</action>
|
40 |
+
<action method="addJs">
|
41 |
+
<script>calendar/calendar-setup.js</script>
|
42 |
+
</action>
|
43 |
+
<!--action method="addItem">
|
44 |
+
<type>js</type>
|
45 |
+
<name>abserve/responsive/jquery.mediaqueries.js</name>
|
46 |
+
<if>lt IE 9</if>
|
47 |
+
</action-->
|
48 |
+
|
49 |
+
<action method="addJs">
|
50 |
+
<script>abserve/tinybox.js</script>
|
51 |
+
</action>
|
52 |
+
<action method="addJs">
|
53 |
+
<script>abserve/window.js</script>
|
54 |
+
</action>
|
55 |
+
<action method="addJs">
|
56 |
+
<script>abserve/geoip.js</script>
|
57 |
+
</action>
|
58 |
+
<action method="addCss">
|
59 |
+
<stylesheet>css/abserve/onestepcheckout.css</stylesheet>
|
60 |
+
</action>
|
61 |
+
<action method="addCss"><stylesheet>css/phoenix/wirecard_checkout_page/stylesheet.css</stylesheet></action>
|
62 |
+
<action method="addCss">
|
63 |
+
<stylesheet>css/abserve/mobileonestepcheckout.css</stylesheet>
|
64 |
+
<!--params>media="only screen and (min-width: 0px) and (max-width: 680px)"</params-->
|
65 |
+
</action>
|
66 |
+
<action method="addCss">
|
67 |
+
<stylesheet>css/abserve/tinybox.css</stylesheet>
|
68 |
+
</action>
|
69 |
+
<action method="removeItem">
|
70 |
+
<type>skin_js</type>
|
71 |
+
<name>sagepaysuite/js/sagePaySuite_Checkout.js</name>
|
72 |
+
<params />
|
73 |
+
</action>
|
74 |
+
<action method="addItem">
|
75 |
+
<type>skin_js</type>
|
76 |
+
<name>onestepcheckout/js/sagePaySuite_Checkout.js</name>
|
77 |
+
</action>
|
78 |
+
<action method="addItem">
|
79 |
+
<type>skin_js</type>
|
80 |
+
<name>js/opcheckout.js</name>
|
81 |
+
</action>
|
82 |
+
<block type="page/html_head" name="mobie_view" template="onestepcheckout/head.phtml"/>
|
83 |
+
</reference>
|
84 |
+
<reference name="content">
|
85 |
+
<block type="onestepcheckout/onestepcheckout" name="onestepcheckout" template="onestepcheckout/onestepcheckout.phtml">
|
86 |
+
<block type="onestepcheckout/onestepcheckout" name="onestepcheckout_billing" as="onestepcheckout.billing" template="onestepcheckout/onestepcheckout/billing.phtml" />
|
87 |
+
<block type="onestepcheckout/onestepcheckout" name="onestepcheckout_shipping" as="onestepcheckout.shipping" template="onestepcheckout/onestepcheckout/shipping.phtml" />
|
88 |
+
<block type="checkout/onepage_shipping_method_available" name="onestepcheckout_shipping_method" as="onestepcheckout.shipping_method" template="onestepcheckout/onestepcheckout/shipping_method.phtml"/>
|
89 |
+
<block type="checkout/onepage_payment_methods" name="onestepcheckout_payment_method" as="onestepcheckout.payment_method" template="onestepcheckout/onestepcheckout/payment_method.phtml">
|
90 |
+
<action method="setMethodFormTemplate">
|
91 |
+
<method>purchaseorder</method>
|
92 |
+
<template>payment/form/purchaseorder.phtml</template>
|
93 |
+
</action>
|
94 |
+
</block>
|
95 |
+
<block type="checkout/onepage_review" name="onestepcheckout.onestepcheckout.review" as="onestepcheckout.review" template="onestepcheckout/onestepcheckout/review.phtml">
|
96 |
+
<block type="checkout/agreements" name="onestepcheckout.onestepcheckout.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
|
97 |
+
<block type="checkout/onepage_review_info" name="review_info" as="info" template="onestepcheckout/onestepcheckout/review/info.phtml">
|
98 |
+
<action method="addItemRender">
|
99 |
+
<type>default</type>
|
100 |
+
<block>checkout/cart_item_renderer</block>
|
101 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
102 |
+
</action>
|
103 |
+
<action method="addItemRender">
|
104 |
+
<type>grouped</type>
|
105 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
106 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
107 |
+
</action>
|
108 |
+
<action method="addItemRender">
|
109 |
+
<type>configurable</type>
|
110 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
111 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
112 |
+
</action>
|
113 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>onestepcheckout/onestepcheckout/review/item.phtml</template></action>
|
114 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onestepcheckout/onestepcheckout/review/totals.phtml"/>
|
115 |
+
</block>
|
116 |
+
</block>
|
117 |
+
<block type="tco/iframe" name="tco.iframe" as="tco_iframe">
|
118 |
+
<action method="setBlockId">
|
119 |
+
<block_id>tcoiframe</block_id>
|
120 |
+
</action>
|
121 |
+
</block>
|
122 |
+
<!-- Amazon payment button-->
|
123 |
+
<block type="amazon_payments/button" name="amazon_button" template="amazon_payments/button.phtml"/>
|
124 |
+
<!-- /Amazon payment button-->
|
125 |
+
</block>
|
126 |
+
</reference>
|
127 |
+
<reference name="before_body_end">
|
128 |
+
<block type="core/template" template="onestepcheckout/login_popup.phtml" name="login-popup" />
|
129 |
+
<block type="wirecard_checkout_page/seamless_script" name="wirecard_checkout_page_js" template="wirecard_checkout_page/seamless/script.phtml" />
|
130 |
+
</reference>
|
131 |
+
</onestepcheckout_index_index>
|
132 |
+
|
133 |
+
<onestepcheckout_index_show_login>
|
134 |
+
<reference name="root">
|
135 |
+
<action method="setTemplate">
|
136 |
+
<template>page/empty.phtml</template>
|
137 |
+
</action>
|
138 |
+
<reference name="content">
|
139 |
+
<block type="onestepcheckout/onestepcheckout" name="onestepcheckout_login" template="onestepcheckout/onestepcheckout/login.phtml"/>
|
140 |
+
</reference>
|
141 |
+
</reference>
|
142 |
+
</onestepcheckout_index_show_login>
|
143 |
+
|
144 |
+
<onestepcheckout_index_show_password>
|
145 |
+
<reference name="root">
|
146 |
+
<action method="setTemplate">
|
147 |
+
<template>page/empty.phtml</template>
|
148 |
+
</action>
|
149 |
+
<reference name="content">
|
150 |
+
<block type="onestepcheckout/onestepcheckout" name="onestepcheckout_login" template="onestepcheckout/onestepcheckout/forgotpassword.phtml"/>
|
151 |
+
</reference>
|
152 |
+
</reference>
|
153 |
+
</onestepcheckout_index_show_password>
|
154 |
+
<!--<checkout_cart_index>
|
155 |
+
<reference name="checkout.cart.methods">
|
156 |
+
<update handle="checkout.cart.methods.onepage" />
|
157 |
+
<reference name="checkout.cart.methods.onepage">
|
158 |
+
<action method="setTemplate"><template>onestepcheckout/link.phtml</template></action>
|
159 |
+
</reference>
|
160 |
+
</reference>
|
161 |
+
</checkout_cart_index>-->
|
162 |
+
<onestepcheckout_onestepcheckout_shippingmethod>
|
163 |
+
<block type="checkout/onepage_shipping_method_available" name="shippingmethod" output="toHtml" template="onestepcheckout/onestepcheckout/shipping_method.phtml"/>
|
164 |
+
</onestepcheckout_onestepcheckout_shippingmethod>
|
165 |
+
<onestepcheckout_onestepcheckout_paymentmethod>
|
166 |
+
<block type="checkout/onepage_payment_methods" name="paymentmethod" output="toHtml" template="onestepcheckout/onestepcheckout/payment_method.phtml">
|
167 |
+
<action method="setMethodFormTemplate">
|
168 |
+
<method>purchaseorder</method>
|
169 |
+
<template>payment/form/purchaseorder.phtml</template>
|
170 |
+
</action>
|
171 |
+
</block>
|
172 |
+
</onestepcheckout_onestepcheckout_paymentmethod>
|
173 |
+
<onestepcheckout_onestepcheckout_review>
|
174 |
+
<block type="checkout/onepage_review_info" name="review" output="toHtml" template="onestepcheckout/onestepcheckout/review/info.phtml">
|
175 |
+
<action method="addItemRender">
|
176 |
+
<type>default</type>
|
177 |
+
<block>checkout/cart_item_renderer</block>
|
178 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
179 |
+
</action>
|
180 |
+
<action method="addItemRender">
|
181 |
+
<type>grouped</type>
|
182 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
183 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
184 |
+
</action>
|
185 |
+
<action method="addItemRender">
|
186 |
+
<type>configurable</type>
|
187 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
188 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
189 |
+
</action>
|
190 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>onestepcheckout/onestepcheckout/review/item.phtml</template></action>
|
191 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onestepcheckout/onestepcheckout/review/totals.phtml"/>
|
192 |
+
</block>
|
193 |
+
</onestepcheckout_onestepcheckout_review>
|
194 |
+
<onestepcheckout_index_saveaddressonestepcheckout>
|
195 |
+
<block type="onestepcheckout/reload" output="toHtml" name="onestepcheckout_reload" as="onestepcheckout_reload" template="onestepcheckout/onestepcheckout/reload_data.phtml">
|
196 |
+
<block type="checkout/onepage_shipping_method_available" name="onestepcheckout_shipping_method" as="onestepcheckout_shipping_method" template="onestepcheckout/onestepcheckout/shipping_method.phtml" />
|
197 |
+
<block type="checkout/onepage_payment_methods" name="onestepcheckout_payment_method" as="onestepcheckout_payment_method" template="onestepcheckout/onestepcheckout/payment_method.phtml">
|
198 |
+
<action method="setMethodFormTemplate">
|
199 |
+
<method>purchaseorder</method>
|
200 |
+
<template>payment/form/purchaseorder.phtml</template>
|
201 |
+
</action>
|
202 |
+
</block>
|
203 |
+
<block type="checkout/onepage_review_info" name="onestepcheckout_review" as="onestepcheckout_review" template="onestepcheckout/onestepcheckout/review/info.phtml">
|
204 |
+
<action method="addItemRender">
|
205 |
+
<type>default</type>
|
206 |
+
<block>checkout/cart_item_renderer</block>
|
207 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
208 |
+
</action>
|
209 |
+
<action method="addItemRender">
|
210 |
+
<type>grouped</type>
|
211 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
212 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
213 |
+
</action>
|
214 |
+
<action method="addItemRender">
|
215 |
+
<type>configurable</type>
|
216 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
217 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
218 |
+
</action>
|
219 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>onestepcheckout/onestepcheckout/review/item.phtml</template></action>
|
220 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onestepcheckout/onestepcheckout/review/totals.phtml"/>
|
221 |
+
</block>
|
222 |
+
</block>
|
223 |
+
</onestepcheckout_index_saveaddressonestepcheckout>
|
224 |
+
|
225 |
+
<onestepcheckout_index_save_shipping>
|
226 |
+
<block type="onestepcheckout/reload" name="onestepcheckout_reload" as="onestepcheckout_reload" output="toHtml" template="onestepcheckout/onestepcheckout/reload_payment.phtml">
|
227 |
+
<block type="checkout/onepage_payment_methods" name="onestepcheckout_payment_method" as="onestepcheckout_payment_method" template="onestepcheckout/onestepcheckout/payment_method.phtml">
|
228 |
+
<action method="setMethodFormTemplate">
|
229 |
+
<method>purchaseorder</method>
|
230 |
+
<template>payment/form/purchaseorder.phtml</template>
|
231 |
+
</action>
|
232 |
+
</block>
|
233 |
+
<block type="checkout/onepage_review_info" name="onestepcheckout_review" as="onestepcheckout_review" template="onestepcheckout/onestepcheckout/review/info.phtml">
|
234 |
+
<action method="addItemRender">
|
235 |
+
<type>default</type>
|
236 |
+
<block>checkout/cart_item_renderer</block>
|
237 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
238 |
+
</action>
|
239 |
+
<action method="addItemRender">
|
240 |
+
<type>grouped</type>
|
241 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
242 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
243 |
+
</action>
|
244 |
+
<action method="addItemRender">
|
245 |
+
<type>configurable</type>
|
246 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
247 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
248 |
+
</action>
|
249 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>onestepcheckout/onestepcheckout/review/item.phtml</template></action>
|
250 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onestepcheckout/onestepcheckout/review/totals.phtml"/>
|
251 |
+
</block>
|
252 |
+
</block>
|
253 |
+
</onestepcheckout_index_save_shipping>
|
254 |
+
|
255 |
+
<onestepcheckout_ajax_add_giftwrap>
|
256 |
+
<block type="checkout/onepage_review_info" output="toHtml" name="onestepcheckout_review" as="onestepcheckout_review" template="onestepcheckout/onestepcheckout/review/info.phtml">
|
257 |
+
<action method="addItemRender">
|
258 |
+
<type>default</type>
|
259 |
+
<block>checkout/cart_item_renderer</block>
|
260 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
261 |
+
</action>
|
262 |
+
<action method="addItemRender">
|
263 |
+
<type>grouped</type>
|
264 |
+
<block>checkout/cart_item_renderer_grouped</block>
|
265 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
266 |
+
</action>
|
267 |
+
<action method="addItemRender">
|
268 |
+
<type>configurable</type>
|
269 |
+
<block>checkout/cart_item_renderer_configurable</block>
|
270 |
+
<template>onestepcheckout/onestepcheckout/review/item.phtml</template>
|
271 |
+
</action>
|
272 |
+
<action method="addItemRender"><type>bundle</type><block>bundle/checkout_cart_item_renderer</block><template>onestepcheckout/onestepcheckout/review/item.phtml</template></action>
|
273 |
+
<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="onestepcheckout/onestepcheckout/review/totals.phtml"/>
|
274 |
+
</block>
|
275 |
+
</onestepcheckout_ajax_add_giftwrap>
|
276 |
+
|
277 |
+
<!--Order -->
|
278 |
+
<sales_order_invoice>
|
279 |
+
<reference name="invoice_totals">
|
280 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
281 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
282 |
+
</reference>
|
283 |
+
</sales_order_invoice>
|
284 |
+
<sales_order_print>
|
285 |
+
<reference name="order_totals">
|
286 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
287 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
288 |
+
</reference>
|
289 |
+
</sales_order_print>
|
290 |
+
<sales_order_printinvoice>
|
291 |
+
<reference name="invoice_totals">
|
292 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
293 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
294 |
+
</reference>
|
295 |
+
</sales_order_printinvoice>
|
296 |
+
<!--Email -->
|
297 |
+
<sales_email_order_items>
|
298 |
+
<reference name="items">
|
299 |
+
<action method="setTemplate">
|
300 |
+
<template>onestepcheckout/onestepcheckout/email_onestepcheckout.phtml</template>
|
301 |
+
</action>
|
302 |
+
</reference>
|
303 |
+
<reference name="order_totals">
|
304 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
305 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
306 |
+
</reference>
|
307 |
+
</sales_email_order_items>
|
308 |
+
<sales_email_order_invoice_items>
|
309 |
+
<reference name="invoice_totals">
|
310 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
311 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
312 |
+
</reference>
|
313 |
+
</sales_email_order_invoice_items>
|
314 |
+
<sales_email_order_creditmemo_items>
|
315 |
+
<reference name="creditmemo_totals">
|
316 |
+
<block type="onestepcheckout/sales_order_totals_giftwrap" name="giftwrap" />
|
317 |
+
<block type="onestepcheckout/sales_order_totals_discount" name="onestepcheckout_discount" />
|
318 |
+
</reference>
|
319 |
+
</sales_email_order_creditmemo_items>
|
320 |
+
|
321 |
+
<sales_order_view translate="label">
|
322 |
+
<reference name="order_items">
|
323 |
+
<action method="setTemplate">
|
324 |
+
<template>onestepcheckout/onestepcheckout/order_onestepcheckout.phtml</template>
|
325 |
+
</action>
|
326 |
+
</reference>
|
327 |
+
</sales_order_view>
|
328 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/page.xml
ADDED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
-->
|
28 |
+
<layout version="0.1.0">
|
29 |
+
<!--
|
30 |
+
Default layout, loads most of the pages
|
31 |
+
-->
|
32 |
+
|
33 |
+
<default translate="label" module="page">
|
34 |
+
<label>All Pages</label>
|
35 |
+
<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
|
36 |
+
|
37 |
+
<block type="page/html_head" name="head" as="head">
|
38 |
+
<action method="addJs"><script>prototype/prototype.js</script></action>
|
39 |
+
<action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action>
|
40 |
+
<action method="addJs"><script>lib/jquery/noconflict.js</script></action>
|
41 |
+
<action method="addJs"><script>lib/ccard.js</script></action>
|
42 |
+
<action method="addJs"><script>prototype/validation.js</script></action>
|
43 |
+
<action method="addJs"><script>scriptaculous/builder.js</script></action>
|
44 |
+
<action method="addJs"><script>scriptaculous/effects.js</script></action>
|
45 |
+
<action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
|
46 |
+
<action method="addJs"><script>scriptaculous/controls.js</script></action>
|
47 |
+
<action method="addJs"><script>scriptaculous/slider.js</script></action>
|
48 |
+
<action method="addJs"><script>varien/js.js</script></action>
|
49 |
+
<action method="addJs"><script>varien/form.js</script></action>
|
50 |
+
<action method="addJs"><script>mage/translate.js</script></action>
|
51 |
+
<action method="addJs"><script>mage/cookies.js</script></action>
|
52 |
+
|
53 |
+
<block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
|
54 |
+
|
55 |
+
<!-- Remove items which the RWD package is not dependent upon -->
|
56 |
+
<action method="removeItem"><type>skin_js</type><name>js/ie6.js</name></action>
|
57 |
+
|
58 |
+
<!-- Add vendor dependencies -->
|
59 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/modernizr.custom.min.js</name></action>
|
60 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/selectivizr.js</name></action>
|
61 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/matchMedia.js</name></action>
|
62 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/matchMedia.addListener.js</name></action>
|
63 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/enquire.js</name></action>
|
64 |
+
<action method="addItem"><type>skin_js</type><name>js/app.js</name></action>
|
65 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/jquery.cycle2.min.js</name></action>
|
66 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/jquery.cycle2.swipe.min.js</name></action>
|
67 |
+
<action method="addItem"><type>skin_js</type><name>js/slideshow.js</name></action>
|
68 |
+
<action method="addItem"><type>skin_js</type><name>js/lib/imagesloaded.js</name></action>
|
69 |
+
<action method="addLinkRel"><rel>stylesheet</rel><href>//fonts.googleapis.com/css?family=Raleway:300,400,500,700,600</href></action>
|
70 |
+
<action method="addItem"><type>skin_js</type><name>js/minicart.js</name></action>
|
71 |
+
|
72 |
+
<!-- Add stylesheets with no media queries for use in IE 8 and below -->
|
73 |
+
<action method="addItem"><type>skin_css</type><name>css/styles-ie8.css</name><params/><if><![CDATA[ (lte IE 8) & (!IEMobile)]]></if></action>
|
74 |
+
<action method="addItem"><type>skin_css</type><name>css/madisonisland-ie8.css</name><params/><if><![CDATA[ (lte IE 8) & (!IEMobile)]]></if></action>
|
75 |
+
|
76 |
+
<!-- Add stylesheets with media queries for use by modern browsers -->
|
77 |
+
<action method="addItem"><type>skin_css</type><name>css/styles.css</name><params/><if><![CDATA[<!--[if (gte IE 9) | (IEMobile)]><!-->]]></if></action>
|
78 |
+
<action method="addItem"><type>skin_css</type><name>css/madisonisland.css</name><params/><if><![CDATA[<!--[if (gte IE 9) | (IEMobile)]><!-->]]></if></action>
|
79 |
+
|
80 |
+
<!-- Sets viewport meta tag using text block -->
|
81 |
+
<block type="core/text" name="head.viewport">
|
82 |
+
<action method="setText"><text><![CDATA[<meta name="viewport" content="initial-scale=1.0, width=device-width" />]]> </text></action>
|
83 |
+
</block>
|
84 |
+
</block>
|
85 |
+
|
86 |
+
<block type="core/text_list" name="after_body_start" as="after_body_start" translate="label">
|
87 |
+
<label>Page Top</label>
|
88 |
+
</block>
|
89 |
+
|
90 |
+
<block type="page/html_notices" name="global_notices" as="global_notices" template="page/html/notices.phtml" />
|
91 |
+
|
92 |
+
<block type="page/html_header" name="header" as="header">
|
93 |
+
<block type="page/template_links" name="top.links" as="topLinks"/>
|
94 |
+
<block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
|
95 |
+
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
|
96 |
+
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
|
97 |
+
<label>Navigation Bar</label>
|
98 |
+
<block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml">
|
99 |
+
<block type="page/html_topmenu_renderer" name="catalog.topnav.renderer" template="page/html/topmenu/renderer.phtml"/>
|
100 |
+
</block>
|
101 |
+
</block>
|
102 |
+
<block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
|
103 |
+
<label>Page Header</label>
|
104 |
+
<action method="setElementClass"><value>top-container</value></action>
|
105 |
+
</block>
|
106 |
+
<block type="page/html_welcome" name="welcome" as="welcome"/>
|
107 |
+
</block>
|
108 |
+
|
109 |
+
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
|
110 |
+
|
111 |
+
<block type="core/text_list" name="left_first" as="left_first" translate="label">
|
112 |
+
<label>Left Column First (shows above main column on smaller screens)</label>
|
113 |
+
</block>
|
114 |
+
|
115 |
+
<block type="core/text_list" name="left" as="left" translate="label">
|
116 |
+
<label>Left Column</label>
|
117 |
+
</block>
|
118 |
+
|
119 |
+
<block type="core/messages" name="global_messages" as="global_messages"/>
|
120 |
+
<block type="core/messages" name="messages" as="messages"/>
|
121 |
+
|
122 |
+
<block type="core/text_list" name="content" as="content" translate="label">
|
123 |
+
<label>Main Content Area</label>
|
124 |
+
</block>
|
125 |
+
|
126 |
+
<block type="core/text_list" name="right" as="right" translate="label">
|
127 |
+
<label>Right Column</label>
|
128 |
+
</block>
|
129 |
+
|
130 |
+
<block type="page/html_wrapper" name="footer.before" as="footer_before" translate="label">
|
131 |
+
<label>Page Footer</label>
|
132 |
+
<action method="setElementClass"><value>footer-before-container</value></action>
|
133 |
+
</block>
|
134 |
+
<block type="page/html_footer" name="footer" as="footer" template="page/html/shoestore_footer.phtml">
|
135 |
+
</block>
|
136 |
+
<!-- footer_old -->
|
137 |
+
<!-- <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
|
138 |
+
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
|
139 |
+
<label>Page Footer</label>
|
140 |
+
<action method="setElementClass"><value>bottom-container</value></action>
|
141 |
+
</block>
|
142 |
+
<block type="page/switch" name="store_switcher" as="store_switcher" after="*" template="page/switch/stores.phtml"/>
|
143 |
+
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml">
|
144 |
+
<action method="setTitle"><title>Quick Links</title></action>
|
145 |
+
</block>
|
146 |
+
<block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml">
|
147 |
+
<action method="setTitle"><title>Account</title></action>
|
148 |
+
</block>
|
149 |
+
<block type="cms/block" name="footer_social_links">
|
150 |
+
<action method="setBlockId"><block_id>footer_social_links</block_id></action>
|
151 |
+
</block>
|
152 |
+
</block> -->
|
153 |
+
<!-- End footer_old -->
|
154 |
+
|
155 |
+
<block type="core/text_list" name="before_body_end" as="before_body_end" translate="label">
|
156 |
+
<label>Page Bottom</label>
|
157 |
+
<block type="page/html_cookieNotice" name="global_cookie_notice" as ="global_cookie_notice" template="page/html/cookienotice.phtml" before="-" />
|
158 |
+
</block>
|
159 |
+
</block>
|
160 |
+
|
161 |
+
<block type="core/profiler" output="toHtml" name="core_profiler"/>
|
162 |
+
</default>
|
163 |
+
|
164 |
+
<print translate="label" module="page">
|
165 |
+
<label>All Pages (Print Version)</label>
|
166 |
+
<!-- Mage_Page -->
|
167 |
+
<block type="page/html" name="root" output="toHtml" template="page/print.phtml">
|
168 |
+
|
169 |
+
<!-- This block allows the print.phtml template to get the logo -->
|
170 |
+
<block type="page/html_header" name="header" as="header"/>
|
171 |
+
|
172 |
+
<block type="page/html_head" name="head" as="head">
|
173 |
+
<action method="addJs"><script>prototype/prototype.js</script></action>
|
174 |
+
<action method="addJs"><script>mage/translate.js</script></action>
|
175 |
+
<action method="addJs"><script>lib/ccard.js</script></action>
|
176 |
+
<action method="addJs"><script>prototype/validation.js</script></action>
|
177 |
+
<action method="addJs"><script>varien/js.js</script></action>
|
178 |
+
|
179 |
+
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
|
180 |
+
<action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
|
181 |
+
<action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
|
182 |
+
<action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
|
183 |
+
|
184 |
+
<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
|
185 |
+
<!--<action method="addItem"><type>skin_js</type><name>js/iehover-fix.js</name><params/><if>lt IE 7</if></action>-->
|
186 |
+
</block>
|
187 |
+
|
188 |
+
<block type="core/text_list" name="content" as="content" translate="label">
|
189 |
+
<label>Main Content Area</label>
|
190 |
+
</block>
|
191 |
+
|
192 |
+
</block>
|
193 |
+
</print>
|
194 |
+
|
195 |
+
<!-- Custom page layout handles -->
|
196 |
+
<page_empty translate="label">
|
197 |
+
<label>All Empty Layout Pages</label>
|
198 |
+
<reference name="root">
|
199 |
+
<action method="setTemplate"><template>page/empty.phtml</template></action>
|
200 |
+
<!-- Mark root page block that template is applied -->
|
201 |
+
<action method="setIsHandle"><applied>1</applied></action>
|
202 |
+
<action method="setLayoutCode"><name>empty</name></action>
|
203 |
+
</reference>
|
204 |
+
</page_empty>
|
205 |
+
|
206 |
+
<page_one_column translate="label">
|
207 |
+
<label>All One-Column Layout Pages</label>
|
208 |
+
<reference name="root">
|
209 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
210 |
+
<!-- Mark root page block that template is applied -->
|
211 |
+
<action method="setIsHandle"><applied>1</applied></action>
|
212 |
+
<action method="setLayoutCode"><name>one_column</name></action>
|
213 |
+
</reference>
|
214 |
+
</page_one_column>
|
215 |
+
|
216 |
+
<page_two_columns_left translate="label">
|
217 |
+
<label>All Two-Column Layout Pages (Left Column)</label>
|
218 |
+
<reference name="root">
|
219 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
220 |
+
<!-- Mark root page block that template is applied -->
|
221 |
+
<action method="setIsHandle"><applied>1</applied></action>
|
222 |
+
<action method="setLayoutCode"><name>two_columns_left</name></action>
|
223 |
+
</reference>
|
224 |
+
</page_two_columns_left>
|
225 |
+
|
226 |
+
<page_two_columns_right translate="label">
|
227 |
+
<label>All Two-Column Layout Pages (Right Column)</label>
|
228 |
+
<reference name="root">
|
229 |
+
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
|
230 |
+
<!-- Mark root page block that template is applied -->
|
231 |
+
<action method="setIsHandle"><applied>1</applied></action>
|
232 |
+
<action method="setLayoutCode"><name>two_columns_right</name></action>
|
233 |
+
</reference>
|
234 |
+
</page_two_columns_right>
|
235 |
+
|
236 |
+
<page_three_columns translate="label">
|
237 |
+
<label>All Three-Column Layout Pages</label>
|
238 |
+
<reference name="root">
|
239 |
+
<action method="setTemplate"><template>page/3columns.phtml</template></action>
|
240 |
+
<!-- Mark root page block that template is applied -->
|
241 |
+
<action method="setIsHandle"><applied>1</applied></action>
|
242 |
+
<action method="setLayoutCode"><name>three_columns</name></action>
|
243 |
+
</reference>
|
244 |
+
</page_three_columns>
|
245 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/paypal.xml
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<checkout_cart_index>
|
31 |
+
<reference name="checkout.cart.top_methods">
|
32 |
+
<block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.top" before="checkout.cart.methods.onepage.top" template="paypal/express/shortcut.phtml">
|
33 |
+
<action method="setIsQuoteAllowed"><value>1</value></action>
|
34 |
+
<action method="setShowOrPosition"><value>after</value></action>
|
35 |
+
</block>
|
36 |
+
</reference>
|
37 |
+
|
38 |
+
<reference name="checkout.cart.methods">
|
39 |
+
<block type="paypal/express_shortcut" name="checkout.cart.methods.paypal_express.bottom" before="checkout.cart.methods.onepage.bottom" template="paypal/express/shortcut.phtml">
|
40 |
+
<action method="setIsQuoteAllowed"><value>1</value></action>
|
41 |
+
<action method="setShowOrPosition"><value>after</value></action>
|
42 |
+
</block>
|
43 |
+
</reference>
|
44 |
+
|
45 |
+
<update handle="SHORTCUT_popup" />
|
46 |
+
</checkout_cart_index>
|
47 |
+
|
48 |
+
<paypal_express_review translate="label">
|
49 |
+
<label>PayPal Express Order Review Form</label>
|
50 |
+
<remove name="right"/>
|
51 |
+
<remove name="left"/>
|
52 |
+
|
53 |
+
<reference name="root">
|
54 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
55 |
+
</reference>
|
56 |
+
<reference name="content">
|
57 |
+
<block type="paypal/express_review" name="paypal.express.review" template="paypal/express/review.phtml">
|
58 |
+
<block type="paypal/express_review" name="express.review.shipping.method" as="shipping_method" template="paypal/express/review/shipping/method.phtml"/>
|
59 |
+
<block type="paypal/express_review_details" name="paypal.express.review.details" as="details" template="paypal/express/review/details.phtml">
|
60 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
61 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
|
62 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
|
63 |
+
<block type="checkout/cart_totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
|
64 |
+
</block>
|
65 |
+
<block type="checkout/agreements" name="paypal.express.review.details.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
|
66 |
+
</block>
|
67 |
+
</reference>
|
68 |
+
<reference name="head">
|
69 |
+
<action method="addItem"><type>skin_js</type><name>js/checkout/review.js</name></action>
|
70 |
+
</reference>
|
71 |
+
<block type="core/text_list" name="additional.product.info" />
|
72 |
+
</paypal_express_review>
|
73 |
+
|
74 |
+
<paypal_express_review_details>
|
75 |
+
<block type="paypal/express_review_details" name="root" output="toHtml" template="paypal/express/review/details.phtml">
|
76 |
+
<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
|
77 |
+
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
|
78 |
+
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>
|
79 |
+
<block type="checkout/cart_totals" name="paypal.express.review.details.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
|
80 |
+
</block>
|
81 |
+
</paypal_express_review_details>
|
82 |
+
|
83 |
+
<!--
|
84 |
+
Available logo types can be assigned with action="setLogoType":
|
85 |
+
- wePrefer_150x60
|
86 |
+
- wePrefer_150x40
|
87 |
+
- nowAccepting_150x60
|
88 |
+
- nowAccepting_150x40
|
89 |
+
- paymentsBy_150x60
|
90 |
+
- paymentsBy_150x40
|
91 |
+
- shopNowUsing_150x60
|
92 |
+
- shopNowUsing_150x40
|
93 |
+
-->
|
94 |
+
<catalog_product_view>
|
95 |
+
<reference name="product.info.addtocart">
|
96 |
+
<block type="page/html_wrapper" name="product.info.addtocart.paypal.wrapper" translate="label">
|
97 |
+
<action method="setMayBeInvisible"><value>true</value></action>
|
98 |
+
<label>PayPal Express Checkout Shortcut Wrapper</label>
|
99 |
+
<block type="paypal/express_shortcut" name="product.info.addtocart.paypal" template="paypal/express/product/shortcut.phtml">
|
100 |
+
<action method="setIsInCatalogProduct"><value>1</value></action>
|
101 |
+
</block>
|
102 |
+
</block>
|
103 |
+
</reference>
|
104 |
+
<update handle="SHORTCUT_popup" />
|
105 |
+
<reference name="right">
|
106 |
+
<block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml">
|
107 |
+
<!--action method="setLogoType"><value>wePrefer_150x60</value></action-->
|
108 |
+
</block>
|
109 |
+
</reference>
|
110 |
+
</catalog_product_view>
|
111 |
+
|
112 |
+
<catalog_category_default>
|
113 |
+
<update handle="SHORTCUT_popup" />
|
114 |
+
<reference name="right">
|
115 |
+
<block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
|
116 |
+
</reference>
|
117 |
+
</catalog_category_default>
|
118 |
+
|
119 |
+
<catalog_category_layered>
|
120 |
+
<update handle="SHORTCUT_popup" />
|
121 |
+
<reference name="right">
|
122 |
+
<block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
|
123 |
+
</reference>
|
124 |
+
</catalog_category_layered>
|
125 |
+
|
126 |
+
<catalog_product_compare_index>
|
127 |
+
<update handle="SHORTCUT_popup" />
|
128 |
+
</catalog_product_compare_index>
|
129 |
+
|
130 |
+
<catalogsearch_result_index>
|
131 |
+
<update handle="SHORTCUT_popup" />
|
132 |
+
</catalogsearch_result_index>
|
133 |
+
|
134 |
+
<catalogsearch_advanced_result>
|
135 |
+
<update handle="SHORTCUT_popup" />
|
136 |
+
</catalogsearch_advanced_result>
|
137 |
+
|
138 |
+
<tag_product_list>
|
139 |
+
<update handle="SHORTCUT_popup" />
|
140 |
+
</tag_product_list>
|
141 |
+
<tag_customer_view>
|
142 |
+
<update handle="SHORTCUT_popup" />
|
143 |
+
</tag_customer_view>
|
144 |
+
|
145 |
+
<wishlist_index_index>
|
146 |
+
<update handle="SHORTCUT_popup" />
|
147 |
+
</wishlist_index_index>
|
148 |
+
<review_product_list>
|
149 |
+
<update handle="SHORTCUT_popup" />
|
150 |
+
</review_product_list>
|
151 |
+
|
152 |
+
<checkout_onepage_success>
|
153 |
+
<update handle="SHORTCUT_popup" />
|
154 |
+
</checkout_onepage_success>
|
155 |
+
<checkout_onepage_failure>
|
156 |
+
<update handle="SHORTCUT_popup" />
|
157 |
+
</checkout_onepage_failure>
|
158 |
+
|
159 |
+
<cms_index_index>
|
160 |
+
<reference name="right">
|
161 |
+
<block type="paypal/logo" name="paypal.partner.right.logo" template="paypal/partner/logo.phtml"/>
|
162 |
+
</reference>
|
163 |
+
</cms_index_index>
|
164 |
+
|
165 |
+
<default>
|
166 |
+
<reference name="topCart.extra_actions">
|
167 |
+
<block type="paypal/express_shortcut" name="paypal.partner.top_cart.shortcut" template="paypal/express/shortcut.phtml"/>
|
168 |
+
</reference>
|
169 |
+
<reference name="cart_sidebar.extra_actions">
|
170 |
+
<block type="paypal/express_shortcut" name="paypal.partner.cart_sidebar.shortcut" template="paypal/express/minicart/shortcut.phtml"/>
|
171 |
+
</reference>
|
172 |
+
</default>
|
173 |
+
|
174 |
+
<checkout_onepage_review>
|
175 |
+
<reference name="checkout.onepage.review.info.items.after">
|
176 |
+
<block type="paypal/iframe" name="paypal.iframe" />
|
177 |
+
</reference>
|
178 |
+
<reference name="checkout.onepage.review.button">
|
179 |
+
<action method="setTemplate"><template helper="paypal/hss/getReviewButtonTemplate"><name>paypal/hss/review/button.phtml</name><block>checkout.onepage.review.button</block></template></action>
|
180 |
+
</reference>
|
181 |
+
</checkout_onepage_review>
|
182 |
+
|
183 |
+
<paypal_payflow_link_iframe>
|
184 |
+
<block type="paypal/payflow_link_iframe" name="payflow.link.iframe" template="paypal/payflowlink/form.phtml" />
|
185 |
+
</paypal_payflow_link_iframe>
|
186 |
+
|
187 |
+
<paypal_payflow_advanced_iframe>
|
188 |
+
<block type="paypal/payflow_advanced_iframe" name="payflow.advanced.iframe" template="paypal/payflowadvanced/form.phtml" />
|
189 |
+
</paypal_payflow_advanced_iframe>
|
190 |
+
|
191 |
+
<paypal_hosted_pro_iframe>
|
192 |
+
<block type="paypal/hosted_pro_iframe" name="hosted.pro.iframe" template="paypal/hss/form.phtml"/>
|
193 |
+
</paypal_hosted_pro_iframe>
|
194 |
+
|
195 |
+
<SHORTCUT_popup>
|
196 |
+
<reference name="product.tooltip">
|
197 |
+
<block type="page/html_wrapper" name="product.info.addtocart.paypal.wrapper" translate="label">
|
198 |
+
<block type="paypal/express_shortcut" name="product.info.addtocart.paypal" template="paypal/express/shortcut.phtml">
|
199 |
+
<action method="setIsInCatalogProduct"><value>1</value></action>
|
200 |
+
<action method="setShowOrPosition"><value>after</value></action>
|
201 |
+
</block>
|
202 |
+
</block>
|
203 |
+
</reference>
|
204 |
+
</SHORTCUT_popup>
|
205 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/persistent.xml
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<customer_account_login>
|
31 |
+
<reference name="customer_form_login">
|
32 |
+
<action method="setTemplate"><template>persistent/customer/form/login.phtml</template></action>
|
33 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
34 |
+
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
|
35 |
+
</reference>
|
36 |
+
</customer_account_login>
|
37 |
+
|
38 |
+
<customer_account_create>
|
39 |
+
<reference name="customer_form_register">
|
40 |
+
<action method="setTemplate"><template>persistent/customer/form/register.phtml</template></action>
|
41 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
42 |
+
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
|
43 |
+
</reference>
|
44 |
+
</customer_account_create>
|
45 |
+
|
46 |
+
<checkout_onepage_index>
|
47 |
+
<reference name="checkout.onepage.login">
|
48 |
+
<action method="setTemplate"><template>persistent/checkout/onepage/login.phtml</template></action>
|
49 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
50 |
+
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
|
51 |
+
</reference>
|
52 |
+
<reference name="checkout.onepage.billing">
|
53 |
+
<action method="setTemplate"><template>persistent/checkout/onepage/billing.phtml</template></action>
|
54 |
+
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
|
55 |
+
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
|
56 |
+
</reference>
|
57 |
+
</checkout_onepage_index>
|
58 |
+
<customer_logged_out>
|
59 |
+
<reference name="right">
|
60 |
+
<block type="sales/reorder_sidebar" name="sale.reorder.sidebar" as="reorder" template="sales/reorder/sidebar.phtml"/>
|
61 |
+
</reference>
|
62 |
+
</customer_logged_out>
|
63 |
+
</layout>
|
app/design/frontend/abserve/shoestore/layout/review.xml
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/afl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magento.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* DISCLAIMER
|
17 |
+
*
|
18 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
19 |
+
* versions in the future. If you wish to customize Magento for your
|
20 |
+
* needs please refer to http://www.magento.com for more information.
|
21 |
+
*
|
22 |
+
* @category design
|
23 |
+
* @package rwd_default
|
24 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
25 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
26 |
+
*/
|
27 |
+
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
|
31 |
+
<customer_account>
|
32 |
+
<!-- Mage_Review -->
|
33 |
+
<reference name="customer_account_navigation">
|
34 |
+
<action method="addLink" translate="label" module="review"><name>reviews</name><path>review/customer</path><label>My Product Reviews</label></action>
|
35 |
+
</reference>
|
36 |
+
|
37 |
+
</customer_account>
|
38 |
+
|
39 |
+
<!--
|
40 |
+
Customer account home dashboard layout
|
41 |
+
-->
|
42 |
+
|
43 |
+
<customer_account_index>
|
44 |
+
|
45 |
+
<!-- Mage_Review -->
|
46 |
+
<reference name="customer_account_dashboard">
|
47 |
+
<block type="review/customer_recent" name="customer_account_dashboard_info1" as="info1" template="review/customer/recent.phtml"/>
|
48 |
+
</reference>
|
49 |
+
|
50 |
+
</customer_account_index>
|
51 |
+
|
52 |
+
<!--
|
53 |
+
Product view page
|
54 |
+
-->
|
55 |
+
|
56 |
+
<catalog_product_view>
|
57 |
+
<reference name="product.info">
|
58 |
+
<block type="review/product_view_list" name="product.reviews" as="reviews" template="review/product/view/list.phtml" after="additional">
|
59 |
+
<action method="addToParentGroup"><group>detailed_info</group></action>
|
60 |
+
<action method="setTitle" translate="value"><value>Reviews</value></action>
|
61 |
+
</block>
|
62 |
+
</reference>
|
63 |
+
</catalog_product_view>
|
64 |
+
|
65 |
+
<!--
|
66 |
+
Product revi
|