Version Notes
- Added catalog feed endpoint for better product information syncronization
Download this release
Release Info
Developer | Daniel Moreira |
Extension | Fp_Followprice |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
app/code/community/Fp/Followprice/controllers/FeedController.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Fp_Followprice_FeedController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function showAction(){
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getResponse()->setHeader('Content-Type','text/xml');
|
7 |
+
$this->renderLayout();
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Fp/Followprice/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fp_Followprice>
|
5 |
-
<version>1.0.
|
6 |
</Fp_Followprice>
|
7 |
</modules>
|
8 |
<default>
|
@@ -90,11 +90,20 @@
|
|
90 |
</routers>
|
91 |
</admin>
|
92 |
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
<layout>
|
94 |
<updates>
|
95 |
-
<
|
96 |
<file>fp/followprice.xml</file>
|
97 |
-
</
|
98 |
</updates>
|
99 |
</layout>
|
100 |
</frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fp_Followprice>
|
5 |
+
<version>1.0.7.0</version>
|
6 |
</Fp_Followprice>
|
7 |
</modules>
|
8 |
<default>
|
90 |
</routers>
|
91 |
</admin>
|
92 |
<frontend>
|
93 |
+
<routers>
|
94 |
+
<followprice>
|
95 |
+
<use>standard</use>
|
96 |
+
<args>
|
97 |
+
<module>Fp_Followprice</module>
|
98 |
+
<frontName>followprice</frontName>
|
99 |
+
</args>
|
100 |
+
</followprice>
|
101 |
+
</routers>
|
102 |
<layout>
|
103 |
<updates>
|
104 |
+
<followprice>
|
105 |
<file>fp/followprice.xml</file>
|
106 |
+
</followprice>
|
107 |
</updates>
|
108 |
</layout>
|
109 |
</frontend>
|
app/design/frontend/base/default/layout/fp/followprice.xml
CHANGED
@@ -18,4 +18,11 @@
|
|
18 |
</block>
|
19 |
</reference>
|
20 |
</catalog_product_view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
</layout>
|
18 |
</block>
|
19 |
</reference>
|
20 |
</catalog_product_view>
|
21 |
+
<followprice_feed_show>
|
22 |
+
<reference name="root">
|
23 |
+
<action method="setTemplate">
|
24 |
+
<template>fp/feed_show.phtml</template>
|
25 |
+
</action>
|
26 |
+
</reference>
|
27 |
+
</followprice_feed_show>
|
28 |
</layout>
|
app/design/frontend/base/default/template/fp/feed_show.phtml
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$collection = Mage::getResourceModel('catalog/product_collection');
|
3 |
+
echo '<?xml version="1.0"?>';
|
4 |
+
?>
|
5 |
+
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
|
6 |
+
<channel>
|
7 |
+
<title><?php echo Mage::app()->getStore()->getFrontendName(); ?></title>
|
8 |
+
<link><?php echo Mage::getBaseUrl(); ?></link>
|
9 |
+
<?php foreach($collection as $product) { ?>
|
10 |
+
<?php
|
11 |
+
// Get product
|
12 |
+
$_product = Mage::getModel('catalog/product')->load($product->getId());
|
13 |
+
|
14 |
+
// Get availability
|
15 |
+
$stock = $_product->stock_item;
|
16 |
+
$availability = $stock->is_in_stock;
|
17 |
+
if ($availability == 0) {
|
18 |
+
$availability = "out of stock";
|
19 |
+
} else {
|
20 |
+
$availability = "in stock";
|
21 |
+
}
|
22 |
+
|
23 |
+
//Get Categories
|
24 |
+
$categoryIds = $_product->getCategoryIds();
|
25 |
+
$firstCategoryId = $categoryIds[0];
|
26 |
+
$_category = Mage::getModel('catalog/category')->load($firstCategoryId);
|
27 |
+
$_categoryparent = Mage::getModel('catalog/category')->load($firstCategoryId)->getParentCategory();
|
28 |
+
$fp_category = $_categoryparent->getName();
|
29 |
+
$fp_subcategory = $_category->getName();
|
30 |
+
?>
|
31 |
+
<item>
|
32 |
+
<g:id><?php echo $product->getId(); ?></g:id>
|
33 |
+
<g:title><![CDATA[<?php echo $_product->getName(); ?>]]></g:title>
|
34 |
+
<g:description><![CDATA[<?php echo $_product->getDescription(); ?>]]></g:description>
|
35 |
+
<g:link><![CDATA[<?php echo $_product->getProductUrl(); ?>]]></g:link>
|
36 |
+
<g:image_link><![CDATA[<?php echo $_product->getImageUrl(); ?>]]></g:image_link>
|
37 |
+
<g:availability><?php echo $availability; ?></g:availability>
|
38 |
+
<g:price><?php echo str_replace(',', '', number_format($_product->getPrice(), 2)); ?> <?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?></g:price>
|
39 |
+
<?php if($_product->getSpecialPrice()){ ?>
|
40 |
+
<g:sale_price><?php echo str_replace(',', '', number_format($_product->getSpecialPrice(), 2)); ?> <?php echo Mage::app()->getStore()->getCurrentCurrencyCode(); ?></g:sale_price>
|
41 |
+
<g:sale_price_effective_date><?php echo substr(str_replace(" ", "T", $_product->getSpecialFromDate()), 0, -3); ?>/<?php echo substr(str_replace(" ", "T", $_product->getSpecialToDate()), 0, -3); ?></g:sale_price_effective_date>
|
42 |
+
<?php } ?>
|
43 |
+
<?php if ($fp_subcategory) { ?>
|
44 |
+
<g:product_type><![CDATA[<?php echo $fp_category . ' > ' . $fp_subcategory ?>]]></g:product_type>
|
45 |
+
<?php } ?>
|
46 |
+
</item>
|
47 |
+
<?php } ?>
|
48 |
+
</channel>
|
49 |
+
</rss>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fp_Followprice</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>devel</stability>
|
6 |
<license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License </license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Displays a button for customers to follow your products and get notified via facebook and email once the price drops or if there are changes in availability.</summary>
|
10 |
<description>Displays a button for customers to follow your products and get notified on price and availability changes.</description>
|
11 |
-
<notes>-
|
12 |
<authors><author><name>Daniel Moreira</name><user>danielmoreira</user><email>daniel.moreira@followprice.co</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>12:
|
15 |
-
<contents><target name="magecommunity"><dir name="Fp"><dir name="Followprice"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="81c6b8799b9074538a824269ff5d358e"/><dir name="System"><dir name="Config"><file name="Style.php" hash="0ecdb2763298753653d565da26330b76"/></dir></dir></dir><file name="FollowpriceButtonAtProduct.php" hash="fbc58b2a7413a64446f95b137e47d3e7"/></dir><dir name="Helper"><file name="Data.php" hash="b57fb5daa7144cb08d3fc44010ce71eb"/></dir><dir name="Model"><file name="Allignment.php" hash="324d087936b060290b6d3545388f9b53"/><file name="Enable.php" hash="1f04e57aa590140099225d11a801240c"/><file name="Observer.php" hash="a67bb3d273107c48154a1ee81691127c"/><file name="Position.php" hash="00ce4ba5ca600ee097af0aa1cd651b67"/><file name="Style.php" hash="b9f370ba2b7b8b8fbdf932c7eeaed9b0"/></dir><dir name="controllers"><file name="IndexController.php" hash="81854deadf1dffbd0402f0670e4b8e36"/></dir><dir name="etc"><file name="config.xml" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>4.0.0</min><max>7.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fp_Followprice</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
<stability>devel</stability>
|
6 |
<license uri="http://opensource.org/licenses/MIT">Massachusetts Institute of Technology License </license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Displays a button for customers to follow your products and get notified via facebook and email once the price drops or if there are changes in availability.</summary>
|
10 |
<description>Displays a button for customers to follow your products and get notified on price and availability changes.</description>
|
11 |
+
<notes>- Added catalog feed endpoint for better product information syncronization</notes>
|
12 |
<authors><author><name>Daniel Moreira</name><user>danielmoreira</user><email>daniel.moreira@followprice.co</email></author></authors>
|
13 |
+
<date>2016-01-13</date>
|
14 |
+
<time>12:20:13</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Fp"><dir name="Followprice"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="81c6b8799b9074538a824269ff5d358e"/><dir name="System"><dir name="Config"><file name="Style.php" hash="0ecdb2763298753653d565da26330b76"/></dir></dir></dir><file name="FollowpriceButtonAtProduct.php" hash="fbc58b2a7413a64446f95b137e47d3e7"/></dir><dir name="Helper"><file name="Data.php" hash="b57fb5daa7144cb08d3fc44010ce71eb"/></dir><dir name="Model"><file name="Allignment.php" hash="324d087936b060290b6d3545388f9b53"/><file name="Enable.php" hash="1f04e57aa590140099225d11a801240c"/><file name="Observer.php" hash="a67bb3d273107c48154a1ee81691127c"/><file name="Position.php" hash="00ce4ba5ca600ee097af0aa1cd651b67"/><file name="Style.php" hash="b9f370ba2b7b8b8fbdf932c7eeaed9b0"/></dir><dir name="controllers"><file name="FeedController.php" hash="a467b6fee5de6db6daec1d6c374da9d5"/><file name="IndexController.php" hash="81854deadf1dffbd0402f0670e4b8e36"/></dir><dir name="etc"><file name="config.xml" hash="1ce17a3b5b76b1500e5700ebd313f1b2"/><file name="system.xml" hash="ac1ec9cc0faa9c7a9e37fc71be318bf3"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="Fp_Followprice"><dir name="system"><dir name="config"><file name="style.phtml" hash="a8aa43dd93f3e775cd9c3b8a236ab318"/></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="followprice.xml" hash="8aa83cf222a39c8f21c33643e2de56c3"/></dir><dir name="template"><dir name="fp"><file name="followprice.phtml" hash="035f279160af34e7b18685a7ac02c091"/><file name="notification.phtml" hash="7fb8d2a952c69acedfed238892fb4015"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="fp"><file name="followprice.xml" hash="be602110072e458f43f72926f53bd241"/></dir></dir><dir name="template"><dir name="fp"><file name="feed_show.phtml" hash="09ee406db7b22d36f8faee37099ac948"/><file name="followprice_button.phtml" hash="2640e11eb1483b04c43177299722fa13"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fp_Followprice.xml" hash="ddee688a2070307d097e00b76175a18c"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="followprice"><file name="dashboard-back.png" hash="d7040bc21d87f650dccde302e126c70c"/><file name="error.png" hash="93d23857d03b5a44187dc574ce1e5465"/><file name="full-logo.svg" hash="807ad65eedeec0b8ce102468badf51bc"/><file name="gear.png" hash="1f954abb69be98641b73fe0fbf42c1ce"/><file name="notice.png" hash="3d0191d064e33a2f4eb27c5585a1d501"/><file name="success.png" hash="73197733740767729f71ccfd0d72e03b"/><file name="warning.png" hash="dc5512924fdd1df2b9158f11d6c07a05"/></dir></dir><file name="followprice_report.css" hash="9c4cb3aa615015efbaedc852d27655f0"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="followprice"><file name="followprice.js" hash="ea9e3e7ccdd647a7de2c8de75fb75b41"/><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>4.0.0</min><max>7.0.0</max></php></required></dependencies>
|
18 |
</package>
|