diff --git a/README.md b/README.md index 86b72ae..c68ac08 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -Everlytic Magento 1.9 Extension +Ev Magento 1.9 Extension ===================== ![Maintenance](https://img.shields.io/maintenance/yes/2019) ---------- -This repo contains the Magento Extension that allows connection to the Everlytic App . +This repo contains the Magento Extension that allows connection to the Ev App . ###### Features: -- Custom route to allow Everlytic to read product data from a Magento 1.9 installation. +- Custom route to allow Ev to read product data from a Magento 1.9 installation. #### Installation @@ -14,7 +14,7 @@ This repo contains the Magento Extension that allows connection to the Everlytic ###### Post Installation: - Clear your cache, see the menu System > Cache Management -- Visit, System > Web Services > Rest Roles > Role API Resources to give access to the role to be used. Click on the Resource access drop-down and give access to Everlytic +- Visit, System > Web Services > Rest Roles > Role API Resources to give access to the role to be used. Click on the Resource access drop-down and give access to Ev - Visit, System > Web Services > Rest Attributes. Choose the User Type, advisably Admin and choose the attributes to give access to. ##### Compatibility @@ -30,4 +30,4 @@ TBD Copyright --------- -(c) 2019 Everlytic \ No newline at end of file +(c) 2019 Ev diff --git a/app/code/local/Everlytic/Customerapi/Model/Api2/Customer.php b/app/code/local/Everlytic/Customerapi/Model/Api2/Customer.php new file mode 100644 index 0000000..2f58214 --- /dev/null +++ b/app/code/local/Everlytic/Customerapi/Model/Api2/Customer.php @@ -0,0 +1,37 @@ + + */ +class Everlytic_Customerapi_Model_Api2_Customer extends Mage_Api2_Model_Resource +{ + +} diff --git a/app/code/local/Everlytic/Customerapi/Model/Api2/Customer/Rest/Admin/V1.php b/app/code/local/Everlytic/Customerapi/Model/Api2/Customer/Rest/Admin/V1.php new file mode 100644 index 0000000..8502874 --- /dev/null +++ b/app/code/local/Everlytic/Customerapi/Model/Api2/Customer/Rest/Admin/V1.php @@ -0,0 +1,56 @@ + + */ +class Everlytic_Customerapi_Model_Api2_Customer_Rest_Admin_V1 extends Mage_Customer_Model_Api2_Customer_Rest +{ + /** + * Get customers list + * + * @return array + */ + protected function _retrieveCollection() + { + $data = Mage::getResourceModel('customer/customer_collection') + ->addNameToSelect() + ->addAttributeToSelect('gender') + ->joinAttribute('street', 'customer_address/street', 'default_billing', null, 'left') + ->joinAttribute('region', 'customer_address/region', 'default_billing', null, 'left') + ->joinAttribute('city', 'customer_address/city', 'default_billing', null, 'left') + ->joinAttribute('postcode', 'customer_address/postcode', 'default_billing', null, 'left') + ->joinAttribute('country_id', 'customer_address/country_id', 'default_billing', null, 'left') + ->joinAttribute('telephone', 'customer_address/telephone', 'default_billing', null, 'left') + ->load(); + $data = $data->toArray(); + return isset($data['items']) ? $data['items'] : $data; + } +} diff --git a/app/code/local/Everlytic/Customerapi/etc/api2.xml b/app/code/local/Everlytic/Customerapi/etc/api2.xml new file mode 100644 index 0000000..1119e35 --- /dev/null +++ b/app/code/local/Everlytic/Customerapi/etc/api2.xml @@ -0,0 +1,48 @@ + + + + + + Everlytic + 10 + + + + + everlytic_customerapi + everlytic_customerapi/api2_customer + customer/customer + Everlytic Customers + 10 + + + 1 + + + 1 + + + + Customer ID + First Name + Last Name + Email + Gender + Post Code + Street + Region + Telephone + City + Country + + + + /everlytic/v1/customers + collection + + + 1 + + + + diff --git a/app/code/local/Everlytic/Customerapi/etc/config.xml b/app/code/local/Everlytic/Customerapi/etc/config.xml new file mode 100644 index 0000000..a98abee --- /dev/null +++ b/app/code/local/Everlytic/Customerapi/etc/config.xml @@ -0,0 +1,15 @@ + + + + + 0.1.0 + + + + + + Everlytic_Customerapi_Model + + + + diff --git a/app/code/local/Everlytic/Productapi/Helper/Data.php b/app/code/local/Everlytic/Productapi/Helper/Data.php index efa7a28..0bcc01c 100644 --- a/app/code/local/Everlytic/Productapi/Helper/Data.php +++ b/app/code/local/Everlytic/Productapi/Helper/Data.php @@ -1,9 +1,9 @@ */ -class Everlytic_Productapi_Model_Api2_Product extends Mage_Api2_Model_Resource +class Ev_Productapi_Model_Api2_Product extends Mage_Api2_Model_Resource { } diff --git a/app/code/local/Everlytic/Productapi/Model/Api2/Product/Rest/Admin/V1.php b/app/code/local/Everlytic/Productapi/Model/Api2/Product/Rest/Admin/V1.php index d6bf0f2..6d3fbf7 100644 --- a/app/code/local/Everlytic/Productapi/Model/Api2/Product/Rest/Admin/V1.php +++ b/app/code/local/Everlytic/Productapi/Model/Api2/Product/Rest/Admin/V1.php @@ -31,7 +31,7 @@ * @package Mage_Catalog * @author Magento Core Team */ -class Everlytic_Productapi_Model_Api2_Product_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Rest +class Ev_Productapi_Model_Api2_Product_Rest_Admin_V1 extends Mage_Catalog_Model_Api2_Product_Rest { /** * The greatest decimal value which could be stored. Corresponds to DECIMAL (12,4) SQL type diff --git a/app/code/local/Everlytic/Productapi/controllers/IndexController.php b/app/code/local/Everlytic/Productapi/controllers/IndexController.php index 70d5bd5..0e0015e 100644 --- a/app/code/local/Everlytic/Productapi/controllers/IndexController.php +++ b/app/code/local/Everlytic/Productapi/controllers/IndexController.php @@ -1,6 +1,6 @@ getRequest()->getParam('product'); $key = Mage::getSingleton('core/session')->getFormKey();; @@ -11,4 +11,4 @@ public function indexAction(){ $this->_redirect('checkout/cart/add', array('product'=>$product, 'form_key'=>$key)); } } -} \ No newline at end of file +} diff --git a/app/code/local/Everlytic/Productapi/etc/api2.xml b/app/code/local/Everlytic/Productapi/etc/api2.xml index acdec9d..eb55f6d 100644 --- a/app/code/local/Everlytic/Productapi/etc/api2.xml +++ b/app/code/local/Everlytic/Productapi/etc/api2.xml @@ -2,17 +2,17 @@ - - Everlytic + + Ev 10 - + - - everlytic_productapi - everlytic_productapi/api2_product + + ev_productapi + ev_productapi/api2_product catalog/product - Everlytic Products + Ev Products 10 @@ -22,7 +22,7 @@ 1 - + Product ID Product Name Product Description @@ -41,7 +41,7 @@ 1 - + - \ No newline at end of file + diff --git a/app/code/local/Everlytic/Productapi/etc/config.xml b/app/code/local/Everlytic/Productapi/etc/config.xml index f7c751e..31d8923 100644 --- a/app/code/local/Everlytic/Productapi/etc/config.xml +++ b/app/code/local/Everlytic/Productapi/etc/config.xml @@ -1,31 +1,31 @@ - + 0.1.0 - + - - Everlytic_Productapi_Helper - + + Ev_Productapi_Helper + - - Everlytic_Productapi_Model - + + Ev_Productapi_Model + - + standard - Everlytic_Productapi + Ev_Productapi add-to-cart - + - \ No newline at end of file + diff --git a/app/etc/modules/Mage_Everlytic.xml b/app/etc/modules/Mage_Everlytic.xml index 070d285..1cf98cf 100644 --- a/app/etc/modules/Mage_Everlytic.xml +++ b/app/etc/modules/Mage_Everlytic.xml @@ -9,5 +9,13 @@ + + true + local + 0.1.0 + + + + - \ No newline at end of file +