Version Notes
Added productlisting includes image, link and price, too.
Consider table prefix getting subscribers, too.
Download this release
Release Info
Developer | SK |
Extension | Rapidmail_RMConnect |
Version | 1.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.5.2
- app/code/community/Rapidmail/RMConnect/Helper/Data.php +26 -0
- app/code/{local → community}/Rapidmail/RMConnect/Model/Catalog/Api.php +0 -0
- app/code/community/Rapidmail/RMConnect/Model/Catalog/Api/V2.php +62 -0
- app/code/community/Rapidmail/RMConnect/Model/Newsletter/Api.php +53 -0
- app/code/community/Rapidmail/RMConnect/Model/Newsletter/Api/V2.php +12 -0
- app/code/community/Rapidmail/RMConnect/Model/Version/Api.php +27 -0
- app/code/community/Rapidmail/RMConnect/Model/Version/Api/V2.php +12 -0
- app/code/{local → community}/Rapidmail/RMConnect/etc/api.xml +32 -5
- app/code/{local → community}/Rapidmail/RMConnect/etc/config.xml +7 -1
- app/code/{local → community}/Rapidmail/RMConnect/etc/wsdl.xml +45 -3
- app/code/local/Rapidmail/RMConnect/Model/Catalog/Api/V2.php +0 -49
- app/code/local/Rapidmail/RMConnect/Model/Newsletter/Api.php +0 -22
- app/code/local/Rapidmail/RMConnect/Model/Newsletter/Api/V2.php +0 -61
- app/etc/modules/Rapidmail_RMConnect.xml +1 -2
- package.xml +62 -7
app/code/community/Rapidmail/RMConnect/Helper/Data.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Data Helper Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
class Rapidmail_RMConnect_Helper_Data extends Mage_Core_Helper_Abstract {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Get magento shop version info
|
13 |
+
*
|
14 |
+
* @return array
|
15 |
+
*/
|
16 |
+
public function getShopVersion() {
|
17 |
+
|
18 |
+
return array(
|
19 |
+
'shop_version' => Mage::getVersion(),
|
20 |
+
'shop_edition' => Mage::getEdition(),
|
21 |
+
'extension_version' => (string)Mage::getConfig()->getModuleConfig('Rapidmail_RMConnect')->version
|
22 |
+
);
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
app/code/{local → community}/Rapidmail/RMConnect/Model/Catalog/Api.php
RENAMED
File without changes
|
app/code/community/Rapidmail/RMConnect/Model/Catalog/Api/V2.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Catalog API Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Rapidmail_RMConnect_Model_Catalog_Api_V2 extends Mage_Api2_Model_Resource
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Custom product list API method.
|
15 |
+
* The custom implementation will:
|
16 |
+
* - only load the fields we need
|
17 |
+
* - give us a proper URL and image path
|
18 |
+
* - prevent memory problems caused by the default implementation due to categories being loaded
|
19 |
+
*
|
20 |
+
* @return array
|
21 |
+
*/
|
22 |
+
public function productList() {
|
23 |
+
|
24 |
+
$collection = Mage::getModel('catalog/product')
|
25 |
+
->getCollection()
|
26 |
+
->addAttributeToSelect(array(
|
27 |
+
'id',
|
28 |
+
'sku',
|
29 |
+
'name',
|
30 |
+
'image',
|
31 |
+
'url_path',
|
32 |
+
'price',
|
33 |
+
'description',
|
34 |
+
'short_description',
|
35 |
+
'created_at',
|
36 |
+
'updated_at'
|
37 |
+
));
|
38 |
+
|
39 |
+
$result = array();
|
40 |
+
|
41 |
+
foreach ($collection as $product) {
|
42 |
+
|
43 |
+
$result[] = array(
|
44 |
+
'product_id' => $product->getId(),
|
45 |
+
'sku' => $product->getSku(),
|
46 |
+
'name' => $product->getName(),
|
47 |
+
'image' => $product->getImage() != 'no_selection' ? Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage() : '',
|
48 |
+
'url_path' => $product->getUrlPath(),
|
49 |
+
'price' => $product->getPrice(),
|
50 |
+
'description' => $product->getDescription(),
|
51 |
+
'short_description' => $product->getShortDescription(),
|
52 |
+
'created_at' => $product->getCreatedAt(),
|
53 |
+
'updated_at' => $product->getUpdatedAt()
|
54 |
+
);
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
return $result;
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
app/code/community/Rapidmail/RMConnect/Model/Newsletter/Api.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Newsletters subscribers API Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Rapidmail_RMConnect_Model_Newsletter_Api extends Mage_Api_Model_Resource_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Returns newsletter subscribers
|
14 |
+
*
|
15 |
+
* @return array
|
16 |
+
*/
|
17 |
+
public function subscriberList() {
|
18 |
+
|
19 |
+
return Mage::getModel('newsletter/subscriber')
|
20 |
+
->getCollection()
|
21 |
+
->addFieldToSelect('*');
|
22 |
+
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Changes status of subscriber
|
27 |
+
*
|
28 |
+
* @param string $email
|
29 |
+
* @param int $status
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
public function subscriberUpdateStatus($email, $status) {
|
33 |
+
|
34 |
+
$subscriber = Mage::getModel('newsletter/subscriber')
|
35 |
+
->loadByEmail($email);
|
36 |
+
|
37 |
+
if (!$subscriber->getId()) {
|
38 |
+
$this->_fault('subscriber_not_exists');
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
if (!in_array($status, array(Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED, Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE, Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED, Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED))) {
|
43 |
+
$this->_fault('subscriber_invalid_status');
|
44 |
+
}
|
45 |
+
|
46 |
+
try {
|
47 |
+
$subscriber->setStatus($status)
|
48 |
+
->save();
|
49 |
+
} catch (Exception $e) {
|
50 |
+
$this->_fault('status_save_failed', $e->getMessage());
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
app/code/community/Rapidmail/RMConnect/Model/Newsletter/Api/V2.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Newsletters subscribers API Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Rapidmail_RMConnect_Model_Newsletter_Api_V2 extends Rapidmail_RMConnect_Model_Newsletter_Api {
|
11 |
+
|
12 |
+
}
|
app/code/community/Rapidmail/RMConnect/Model/Version/Api.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Newsletters subscribers API Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Rapidmail_RMConnect_Model_Version_Api extends Mage_Api_Model_Resource_Abstract {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Returns Shop Version
|
14 |
+
*
|
15 |
+
* @return array
|
16 |
+
*/
|
17 |
+
public function shopVersion() {
|
18 |
+
|
19 |
+
// Wrap this in additional array to conform to WSDL
|
20 |
+
return array(
|
21 |
+
Mage::helper('rmconnect')
|
22 |
+
->getShopVersion()
|
23 |
+
);
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
app/code/community/Rapidmail/RMConnect/Model/Version/Api/V2.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Newsletters subscribers API Extension
|
5 |
+
*
|
6 |
+
* @category Rapidmail
|
7 |
+
* @package Rapidmail_RMConnect
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Rapidmail_RMConnect_Model_Version_Api_V2 extends Rapidmail_RMConnect_Model_Version_Api {
|
11 |
+
|
12 |
+
}
|
app/code/{local → community}/Rapidmail/RMConnect/etc/api.xml
RENAMED
@@ -11,11 +11,6 @@
|
|
11 |
|
12 |
-->
|
13 |
<config>
|
14 |
-
<modules>
|
15 |
-
<Rapidmail_RMConnect>
|
16 |
-
<version>1.0.0</version>
|
17 |
-
</Rapidmail_RMConnect>
|
18 |
-
</modules>
|
19 |
<api>
|
20 |
<resources>
|
21 |
<rmconnect_newsletter translate="title" module="rmconnect">
|
@@ -37,6 +32,18 @@
|
|
37 |
<code>100</code>
|
38 |
<message>Requested store view not found.</message>
|
39 |
</store_not_exists>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
</faults>
|
41 |
</rmconnect_newsletter>
|
42 |
|
@@ -58,15 +65,35 @@
|
|
58 |
</faults>
|
59 |
</rmconnect_catalog>
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
</resources>
|
62 |
<resources_alias>
|
63 |
<rmconnect_newsletter>rmconnect_newsletter</rmconnect_newsletter>
|
64 |
<rmconnect_catalog>rmconnect_catalog</rmconnect_catalog>
|
|
|
65 |
</resources_alias>
|
66 |
<v2>
|
67 |
<resources_function_prefix>
|
68 |
<rmconnect_newsletter>rmconnectNewsletter</rmconnect_newsletter>
|
69 |
<rmconnect_catalog>rmconnectCatalog</rmconnect_catalog>
|
|
|
70 |
</resources_function_prefix>
|
71 |
</v2>
|
72 |
<acl>
|
11 |
|
12 |
-->
|
13 |
<config>
|
|
|
|
|
|
|
|
|
|
|
14 |
<api>
|
15 |
<resources>
|
16 |
<rmconnect_newsletter translate="title" module="rmconnect">
|
32 |
<code>100</code>
|
33 |
<message>Requested store view not found.</message>
|
34 |
</store_not_exists>
|
35 |
+
<subscriber_not_exists>
|
36 |
+
<code>404</code>
|
37 |
+
<message>Subscriber does not exist.</message>
|
38 |
+
</subscriber_not_exists>
|
39 |
+
<subscriber_invalid_status>
|
40 |
+
<code>400</code>
|
41 |
+
<message>Invalid status specified.</message>
|
42 |
+
</subscriber_invalid_status>
|
43 |
+
<status_save_failed>
|
44 |
+
<code>500</code>
|
45 |
+
<message>Saving new status failed.</message>
|
46 |
+
</status_save_failed>
|
47 |
</faults>
|
48 |
</rmconnect_newsletter>
|
49 |
|
65 |
</faults>
|
66 |
</rmconnect_catalog>
|
67 |
|
68 |
+
<rmconnect_version translate="title" module="rmconnect">
|
69 |
+
<model>rmconnect/version_api</model>
|
70 |
+
<title>shop version API Extension</title>
|
71 |
+
<acl>core</acl>
|
72 |
+
<methods>
|
73 |
+
<shopVersion translate="title" module="rmconnect">
|
74 |
+
<title>Return shop version</title>
|
75 |
+
<method>shopVersion</method>
|
76 |
+
</shopVersion>
|
77 |
+
</methods>
|
78 |
+
<faults module="rmconnect">
|
79 |
+
<store_not_exists>
|
80 |
+
<code>100</code>
|
81 |
+
<message>Requested store view not found.</message>
|
82 |
+
</store_not_exists>
|
83 |
+
</faults>
|
84 |
+
</rmconnect_version>
|
85 |
+
|
86 |
</resources>
|
87 |
<resources_alias>
|
88 |
<rmconnect_newsletter>rmconnect_newsletter</rmconnect_newsletter>
|
89 |
<rmconnect_catalog>rmconnect_catalog</rmconnect_catalog>
|
90 |
+
<rmconnect_version>rmconnect_version</rmconnect_version>
|
91 |
</resources_alias>
|
92 |
<v2>
|
93 |
<resources_function_prefix>
|
94 |
<rmconnect_newsletter>rmconnectNewsletter</rmconnect_newsletter>
|
95 |
<rmconnect_catalog>rmconnectCatalog</rmconnect_catalog>
|
96 |
+
<rmconnect_version>rmconnectVersion</rmconnect_version>
|
97 |
</resources_function_prefix>
|
98 |
</v2>
|
99 |
<acl>
|
app/code/{local → community}/Rapidmail/RMConnect/etc/config.xml
RENAMED
@@ -14,7 +14,7 @@
|
|
14 |
<config>
|
15 |
<modules>
|
16 |
<Rapidmail_RMConnect>
|
17 |
-
<version>1.
|
18 |
</Rapidmail_RMConnect>
|
19 |
</modules>
|
20 |
<global>
|
@@ -23,8 +23,14 @@
|
|
23 |
<rewrite>
|
24 |
<newsletter_api_v2>Rapidmail_RMConnect_Model_Newsletter_Api_V2</newsletter_api_v2>
|
25 |
<catalog_api_v2>Rapidmail_RMConnect_Model_Catalog_Api_V2</catalog_api_v2>
|
|
|
26 |
</rewrite>
|
27 |
</rmconnect>
|
28 |
</models>
|
|
|
|
|
|
|
|
|
|
|
29 |
</global>
|
30 |
</config>
|
14 |
<config>
|
15 |
<modules>
|
16 |
<Rapidmail_RMConnect>
|
17 |
+
<version>1.5.2</version>
|
18 |
</Rapidmail_RMConnect>
|
19 |
</modules>
|
20 |
<global>
|
23 |
<rewrite>
|
24 |
<newsletter_api_v2>Rapidmail_RMConnect_Model_Newsletter_Api_V2</newsletter_api_v2>
|
25 |
<catalog_api_v2>Rapidmail_RMConnect_Model_Catalog_Api_V2</catalog_api_v2>
|
26 |
+
<version_api_v2>Rapidmail_RMConnect_Model_Version_Api_V2</version_api_v2>
|
27 |
</rewrite>
|
28 |
</rmconnect>
|
29 |
</models>
|
30 |
+
<helpers>
|
31 |
+
<rmconnect>
|
32 |
+
<class>Rapidmail_RMConnect_Helper</class>
|
33 |
+
</rmconnect>
|
34 |
+
</helpers>
|
35 |
</global>
|
36 |
</config>
|
app/code/{local → community}/Rapidmail/RMConnect/etc/wsdl.xml
RENAMED
@@ -48,6 +48,21 @@
|
|
48 |
</complexContent>
|
49 |
</complexType>
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
</schema>
|
52 |
</types>
|
53 |
|
@@ -74,6 +89,13 @@
|
|
74 |
<part name="result" type="typens:ArrayOfCatalogProductExtEntity"/>
|
75 |
</message>
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
<portType name="{{var wsdl.handler}}PortType">
|
78 |
<operation name="rmconnectNewsletterSubscriberList">
|
79 |
<documentation>Returns newsletter subscribers</documentation>
|
@@ -140,11 +162,31 @@
|
|
140 |
</operation>
|
141 |
</binding>
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
<service name="{{var wsdl.name}}Service">
|
144 |
<port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
|
145 |
<soap:address location="{{var wsdl.url}}"/>
|
146 |
</port>
|
147 |
</service>
|
148 |
-
</definitions>
|
149 |
-
|
150 |
-
|
48 |
</complexContent>
|
49 |
</complexType>
|
50 |
|
51 |
+
<complexType name="shopVersionEntity">
|
52 |
+
<all>
|
53 |
+
<element name="shop_version" type="xsd:string" minOccurs="0"/>
|
54 |
+
<element name="shop_edition" type="xsd:string" minOccurs="0"/>
|
55 |
+
<element name="extension_version" type="xsd:string" minOccurs="0"/>
|
56 |
+
</all>
|
57 |
+
</complexType>
|
58 |
+
<complexType name="ArrayOfShopVersionEntity">
|
59 |
+
<complexContent>
|
60 |
+
<restriction base="soapenc:Array">
|
61 |
+
<attribute ref="soapenc:arrayType" wsdl:arrayType="typens:shopVersionEntity[]"/>
|
62 |
+
</restriction>
|
63 |
+
</complexContent>
|
64 |
+
</complexType>
|
65 |
+
|
66 |
</schema>
|
67 |
</types>
|
68 |
|
89 |
<part name="result" type="typens:ArrayOfCatalogProductExtEntity"/>
|
90 |
</message>
|
91 |
|
92 |
+
<message name="rmconnectVersionShopVersionRequest">
|
93 |
+
<part name="sessionId" type="xsd:string"/>
|
94 |
+
</message>
|
95 |
+
<message name="rmconnectVersionShopVersionResponse">
|
96 |
+
<part name="result" type="typens:ArrayOfShopVersionEntity"/>
|
97 |
+
</message>
|
98 |
+
|
99 |
<portType name="{{var wsdl.handler}}PortType">
|
100 |
<operation name="rmconnectNewsletterSubscriberList">
|
101 |
<documentation>Returns newsletter subscribers</documentation>
|
162 |
</operation>
|
163 |
</binding>
|
164 |
|
165 |
+
<portType name="{{var wsdl.handler}}PortType">
|
166 |
+
<operation name="rmconnectVersionShopVersion">
|
167 |
+
<documentation>Returns shop version informations</documentation>
|
168 |
+
<input message="typens:rmconnectVersionShopVersionRequest"/>
|
169 |
+
<output message="typens:rmconnectVersionShopVersionResponse"/>
|
170 |
+
</operation>
|
171 |
+
</portType>
|
172 |
+
<binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
|
173 |
+
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
174 |
+
<operation name="rmconnectVersionShopVersion">
|
175 |
+
<soap:operation soapAction="urn:{{var wsdl.handler}}Action"/>
|
176 |
+
<input>
|
177 |
+
<soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
|
178 |
+
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
179 |
+
</input>
|
180 |
+
<output>
|
181 |
+
<soap:body namespace="urn:{{var wsdl.name}}" use="encoded"
|
182 |
+
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
183 |
+
</output>
|
184 |
+
</operation>
|
185 |
+
</binding>
|
186 |
+
|
187 |
<service name="{{var wsdl.name}}Service">
|
188 |
<port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
|
189 |
<soap:address location="{{var wsdl.url}}"/>
|
190 |
</port>
|
191 |
</service>
|
192 |
+
</definitions>
|
|
|
|
app/code/local/Rapidmail/RMConnect/Model/Catalog/Api/V2.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Catalog API Extension
|
5 |
-
*
|
6 |
-
* @category Rapidmail
|
7 |
-
* @package Rapidmail_RMConnect
|
8 |
-
*/
|
9 |
-
|
10 |
-
class Rapidmail_RMConnect_Model_Catalog_Api_V2 extends Mage_Api_Model_Resource_Abstract
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Returns products
|
15 |
-
*
|
16 |
-
* @return array
|
17 |
-
*/
|
18 |
-
public function productList()
|
19 |
-
{
|
20 |
-
|
21 |
-
$collection = Mage::getModel('catalog/product')->getCollection()
|
22 |
-
->addAttributeToSelect('*');
|
23 |
-
|
24 |
-
$result = array();
|
25 |
-
|
26 |
-
foreach ($collection as $product) {
|
27 |
-
|
28 |
-
$result[] = array(
|
29 |
-
'product_id' => $product->getId(),
|
30 |
-
'sku' => $product->getSku(),
|
31 |
-
'name' => $product->getName(),
|
32 |
-
'image' => $product->getImage() != 'no_selection' ? $product->getImage() : '',
|
33 |
-
'url_path' => $product->getUrlPath(),
|
34 |
-
'price' => $product->getPrice(),
|
35 |
-
'description' => $product->getDescription(),
|
36 |
-
'short_description' => $product->getShortDescription(),
|
37 |
-
'created_at' => $product->getCreatedAt(),
|
38 |
-
'updated_at' => $product->getUpdatedAt()
|
39 |
-
);
|
40 |
-
|
41 |
-
}
|
42 |
-
|
43 |
-
return $result;
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
}
|
48 |
-
|
49 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Rapidmail/RMConnect/Model/Newsletter/Api.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Newsletters subscribers API Extension
|
5 |
-
*
|
6 |
-
* @category Rapidmail
|
7 |
-
* @package Rapidmail_RMConnect
|
8 |
-
*/
|
9 |
-
|
10 |
-
class Rapidmail_RMConnect_Model_Newsletter_Api extends Mage_Api_Model_Resource_Abstract
|
11 |
-
{
|
12 |
-
public function subscriberList()
|
13 |
-
{
|
14 |
-
}
|
15 |
-
|
16 |
-
public function subscriberUpdateStatus($email, $status)
|
17 |
-
{
|
18 |
-
}
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Rapidmail/RMConnect/Model/Newsletter/Api/V2.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Newsletters subscribers API Extension
|
5 |
-
*
|
6 |
-
* @category Rapidmail
|
7 |
-
* @package Rapidmail_RMConnect
|
8 |
-
*/
|
9 |
-
|
10 |
-
class Rapidmail_RMConnect_Model_Newsletter_Api_V2 extends Mage_Api_Model_Resource_Abstract
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Returns newsletter subscribers
|
15 |
-
*
|
16 |
-
* @return array
|
17 |
-
*/
|
18 |
-
public function subscriberList()
|
19 |
-
{
|
20 |
-
|
21 |
-
$resource = Mage::getSingleton('core/resource');
|
22 |
-
|
23 |
-
// Get subscribers
|
24 |
-
$results = $resource->getConnection('core_read')->fetchAll('SELECT * FROM newsletter_subscriber');
|
25 |
-
|
26 |
-
return (array)$results;
|
27 |
-
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Changes status of subscriber
|
32 |
-
*
|
33 |
-
* @return array
|
34 |
-
*/
|
35 |
-
public function subscriberUpdateStatus($email, $status)
|
36 |
-
{
|
37 |
-
|
38 |
-
if (!in_array($status, array(Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED, Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE, Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED, Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED))) {
|
39 |
-
return 400;
|
40 |
-
}
|
41 |
-
|
42 |
-
$resource = Mage::getSingleton('core/resource');
|
43 |
-
$db = $resource->getConnection('core_write');
|
44 |
-
|
45 |
-
// Get subscriber
|
46 |
-
$subscriber = $db->fetchRow('SELECT * FROM ' . $resource->getTableName('newsletter/subscriber') . ' WHERE subscriber_email = "' . $db->quote($email) . '" LIMIT 1');
|
47 |
-
|
48 |
-
if (!$subscriber) {
|
49 |
-
return 404;
|
50 |
-
}
|
51 |
-
|
52 |
-
// Update subscriber's status and change time
|
53 |
-
$db->query('UPDATE ' . $resource->getTableName('newsletter/subscriber') . ' SET subscriber_status = ' . (int)$status . ', change_status_at = NOW() WHERE subscriber_email = ' . $db->quote($email) . ' LIMIT 1');
|
54 |
-
|
55 |
-
return 200;
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Rapidmail_RMConnect.xml
CHANGED
@@ -13,11 +13,10 @@
|
|
13 |
<modules>
|
14 |
<Rapidmail_RMConnect>
|
15 |
<active>true</active>
|
16 |
-
<codePool>
|
17 |
<depends>
|
18 |
<Mage_Api />
|
19 |
</depends>
|
20 |
-
<version>1.0.0</version>
|
21 |
</Rapidmail_RMConnect>
|
22 |
</modules>
|
23 |
</config>
|
13 |
<modules>
|
14 |
<Rapidmail_RMConnect>
|
15 |
<active>true</active>
|
16 |
+
<codePool>community</codePool>
|
17 |
<depends>
|
18 |
<Mage_Api />
|
19 |
</depends>
|
|
|
20 |
</Rapidmail_RMConnect>
|
21 |
</modules>
|
22 |
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Rapidmail_RMConnect</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -12,11 +12,66 @@
|
|
12 |
<p>Get the extension key and install the rapidmail Connector.<br />
|
13 |
Also take a look at the <a href="http://doc.rapidmail.net/pages/viewpage.action?pageId=655730">rapidmail user manual</a>
|
14 |
</p></description>
|
15 |
-
<notes>Added productlisting includes image, link and price, too
|
16 |
-
|
17 |
-
|
18 |
-
<
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<compatible/>
|
21 |
-
<dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Rapidmail_RMConnect</name>
|
4 |
+
<version>1.5.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
12 |
<p>Get the extension key and install the rapidmail Connector.<br />
|
13 |
Also take a look at the <a href="http://doc.rapidmail.net/pages/viewpage.action?pageId=655730">rapidmail user manual</a>
|
14 |
</p></description>
|
15 |
+
<notes>Added productlisting includes image, link and price, too.
|
16 |
+

|
17 |
+
Consider table prefix getting subscribers, too.</notes>
|
18 |
+
<authors>
|
19 |
+
<author>
|
20 |
+
<name>SK</name>
|
21 |
+
<user>auto-generated</user>
|
22 |
+
<email>support@rapidmail.de</email>
|
23 |
+
</author>
|
24 |
+
</authors>
|
25 |
+
<date>2014-03-07</date>
|
26 |
+
<time>11:23:49</time>
|
27 |
+
<contents>
|
28 |
+
<target name="magecommunity">
|
29 |
+
<dir name="Rapidmail">
|
30 |
+
<dir name="RMConnect">
|
31 |
+
<dir name="Model">
|
32 |
+
<dir name="Catalog">
|
33 |
+
<dir name="Api">
|
34 |
+
<file name="V2.php" hash="f12dc4f9e5627493a55fb9d5ee90ee50"/>
|
35 |
+
</dir>
|
36 |
+
<file name="Api.php" hash="78966a1f4415bbd81f70c6934995298b"/>
|
37 |
+
</dir>
|
38 |
+
<dir name="Newsletter">
|
39 |
+
<dir name="Api">
|
40 |
+
<file name="V2.php" hash="7d3a9335b48ae157046243e427cb745e"/>
|
41 |
+
</dir>
|
42 |
+
<file name="Api.php" hash="d08bb077ebad4060e1539f9fb5adf6e8"/>
|
43 |
+
</dir>
|
44 |
+
<dir name="Version">
|
45 |
+
<dir name="Api">
|
46 |
+
<file name="V2.php" hash="7d3a9335b48ae157046243e427cb745e"/>
|
47 |
+
</dir>
|
48 |
+
<file name="Api.php" hash="d08bb077ebad4060e1539f9fb5adf6e8"/>
|
49 |
+
</dir>
|
50 |
+
</dir>
|
51 |
+
<dir name="Helper">
|
52 |
+
<file name="Data.php" hash="7d3a9335b48ae157046243e427cb745e"/>
|
53 |
+
</dir>
|
54 |
+
<dir name="etc">
|
55 |
+
<file name="api.xml" hash="016e75b9ec1b65e1facba373edadc0f1"/>
|
56 |
+
<file name="config.xml" hash="df1398c1f6bee0682ca128be496b33bb"/>
|
57 |
+
<file name="wsdl.xml" hash="b95cf8246a21ecf7289fd21f8b1ea805"/>
|
58 |
+
</dir>
|
59 |
+
</dir>
|
60 |
+
</dir>
|
61 |
+
</target>
|
62 |
+
<target name="mageetc">
|
63 |
+
<dir name="modules">
|
64 |
+
<file name="Rapidmail_RMConnect.xml" hash="b38e11f35fa67bc12931927ae58dc8da"/>
|
65 |
+
</dir>
|
66 |
+
</target>
|
67 |
+
</contents>
|
68 |
<compatible/>
|
69 |
+
<dependencies>
|
70 |
+
<required>
|
71 |
+
<php>
|
72 |
+
<min>5.3.0</min>
|
73 |
+
<max>6.0.0.</max>
|
74 |
+
</php>
|
75 |
+
</required>
|
76 |
+
</dependencies>
|
77 |
</package>
|