This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from everlytic/feature/evr-299-magento
feature/evr-299-magento - Created special route to allow to allow for…
- Loading branch information
Showing
14 changed files
with
233 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Magento to newer | ||
* versions in the future. If you wish to customize Magento for your | ||
* needs please refer to http://www.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Customer | ||
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* API2 class for customer | ||
* | ||
* @category Mage | ||
* @package Mage_Customer | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Ev_Customerapi_Model_Api2_Customer extends Mage_Api2_Model_Resource | ||
{ | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
app/code/local/Ev/Customerapi/Model/Api2/Customer/Rest/Admin/V1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Magento to newer | ||
* versions in the future. If you wish to customize Magento for your | ||
* needs please refer to http://www.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Catalog | ||
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* API2 for catalog_product (Admin) | ||
* | ||
* @category Mage | ||
* @package Mage_Catalog | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Ev_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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<api2> | ||
<resource_groups> | ||
<ev_customerapi translate="title" module="ev_customerapi"> | ||
<title>Ev</title> | ||
<sort_order>10</sort_order> | ||
</ev_customerapi> | ||
</resource_groups> | ||
<resources> | ||
<ev_customerapi translate="title" module="ev_customerapi"> | ||
<group>ev_customerapi</group> | ||
<model>ev_customerapi/api2_customer</model> | ||
<working_model>customer/customer</working_model> | ||
<title>Ev Customers</title> | ||
<sort_order>10</sort_order> | ||
<privileges> | ||
<guest> | ||
<retrieve>1</retrieve> | ||
</guest> | ||
<admin> | ||
<retrieve>1</retrieve> | ||
</admin> | ||
</privileges> | ||
<attributes translate="" module="ev_customerapi"> | ||
<entity_id>Customer ID</entity_id> | ||
<firstname>First Name</firstname> | ||
<lastname>Last Name</lastname> | ||
<email>Email</email> | ||
<gender>Gender</gender> | ||
<postcode>Post Code</postcode> | ||
<street>Street</street> | ||
<region>Region</region> | ||
<telephone>Telephone</telephone> | ||
<city>City</city> | ||
<country_id>Country</country_id> | ||
</attributes> | ||
<routes> | ||
<route_collection> | ||
<route>/ev/v1/customers</route> | ||
<action_type>collection</action_type> | ||
</route_collection> | ||
</routes> | ||
<versions>1</versions> | ||
</ev_customerapi> | ||
</resources> | ||
</api2> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<Ev_Customerapi> | ||
<version>0.1.0</version> | ||
</Ev_Customerapi> | ||
</modules> | ||
<global> | ||
<models> | ||
<ev_customerapi> | ||
<class>Ev_Customerapi_Model</class> | ||
</ev_customerapi> | ||
</models> | ||
</global> | ||
</config> |
4 changes: 2 additions & 2 deletions
4
...ocal/Everlytic/Productapi/Helper/Data.php → app/code/local/Ev/Productapi/Helper/Data.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?php | ||
namespace Everlytic\Extension\Helper; | ||
namespace Ev\Extension\Helper; | ||
|
||
use Mage_Core_Helper_Abstract; | ||
|
||
class Data extends Mage_Core_Helper_Abstract | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
* @package Mage_Catalog | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Everlytic_Productapi_Model_Api2_Product extends Mage_Api2_Model_Resource | ||
class Ev_Productapi_Model_Api2_Product extends Mage_Api2_Model_Resource | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
* @package Mage_Catalog | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
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 | ||
|
@@ -95,8 +95,11 @@ private function handleSearch($searchQuery) | |
); | ||
$collection->setPageSize(10)->setCurPage(1); | ||
$products = $collection->load(); | ||
$store = Mage::app()->getDefaultStoreView(); | ||
$storeId = $store->getStoreId(); | ||
|
||
foreach ($products as $product) { | ||
$product->setStoreId($storeId); | ||
$this->_prepareProductForResponse($product); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<Ev_Productapi> | ||
<version>0.1.0</version> | ||
</Ev_Productapi> | ||
</modules> | ||
<global> | ||
<helpers> | ||
<ev_productapi> | ||
<class>Ev_Productapi_Helper</class> | ||
</ev_productapi> | ||
</helpers> | ||
<models> | ||
<ev_productapi> | ||
<class>Ev_Productapi_Model</class> | ||
</ev_productapi> | ||
</models> | ||
</global> | ||
<frontend> | ||
<routers> | ||
<ev_productapi> | ||
<use>standard</use> | ||
<args> | ||
<module>Ev_Productapi</module> | ||
<frontName>add-to-cart</frontName> | ||
</args> | ||
</ev_productapi> | ||
</routers> | ||
</frontend> | ||
</config> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<Ev_Productapi> | ||
<active>true</active> | ||
<codePool>local</codePool> | ||
<version>0.1.0</version> | ||
<depends> | ||
<Mage_Checkout /> | ||
</depends> | ||
</Ev_Productapi> | ||
<Ev_Customerapi> | ||
<active>true</active> | ||
<codePool>local</codePool> | ||
<version>0.1.0</version> | ||
<depends> | ||
<Mage_Checkout /> | ||
</depends> | ||
</Ev_Customerapi> | ||
</modules> | ||
</config> |
Oops, something went wrong.