Version Notes
TurnTo Admin Extension
2.0 Adds support for Single Sign On
2.1 Re-wrote catalog feed generator
2.1.6 - Better catalog support in catalog feed generator.
2.2.0 - Support for sku average rating feed
2.2.2 - Minor bug fix
2.2.4 - Fixed excessive load time on configuration screen.
2.2.5 - Catalog Feed tweaks
2.2.7 - Support for Magento Security Patch (SUPEE-6788)
2.2.9 - Historical Feed bug fix
2.2.10 - Minor bug fix for historical feed exporter
2.2.11 - Fixed circular reference in category tree. Optimized memory usage in catalog feed generator.
2.3.0 - Added ability to push the historical feed nightly
Download this release
Release Info
| Developer | TurnTo Networks |
| Extension | socialcommerce_suite_by_turnto |
| Version | 2.3.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.11 to 2.3.0
- app/code/community/Turnto/Admin/Helper/Data.php +169 -2
- app/code/community/Turnto/Admin/Model/Observer.php +9 -0
- app/code/community/Turnto/Admin/controllers/Adminhtml/TurntoController.php +152 -235
- app/code/community/Turnto/Admin/controllers/IndexController.php +10 -4
- app/code/community/Turnto/Admin/etc/config.xml +18 -2
- app/code/community/Turnto/Admin/etc/system.xml +79 -24
- app/code/community/Turnto/Login/etc/config.xml +1 -1
- app/design/adminhtml/default/default/template/turnto/catalog_feed_tab.phtml +13 -9
- app/design/adminhtml/default/default/template/turnto/historical_feed_tab.phtml +22 -7
- package.xml +6 -5
app/code/community/Turnto/Admin/Helper/Data.php
CHANGED
|
@@ -12,6 +12,10 @@ class Turnto_Admin_Helper_Data extends Mage_Core_Helper_Data
|
|
| 12 |
return $this->checkFeed($feed_url);
|
| 13 |
}
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
public function checkFeed($url = null)
|
| 16 |
{
|
| 17 |
|
|
@@ -33,8 +37,8 @@ class Turnto_Admin_Helper_Data extends Mage_Core_Helper_Data
|
|
| 33 |
{
|
| 34 |
|
| 35 |
$url = Mage::getStoreConfig('turnto_admin/feedconfig/url');
|
| 36 |
-
$site_key = Mage::getStoreConfig('turnto_admin/
|
| 37 |
-
$site_auth = Mage::getStoreConfig('turnto_admin/
|
| 38 |
|
| 39 |
if (!$url || !$site_key || !$site_auth)
|
| 40 |
return null;
|
|
@@ -165,4 +169,167 @@ class Turnto_Admin_Helper_Data extends Mage_Core_Helper_Data
|
|
| 165 |
|
| 166 |
return $updated;
|
| 167 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
| 12 |
return $this->checkFeed($feed_url);
|
| 13 |
}
|
| 14 |
|
| 15 |
+
public function isHistoricalOrderFeedPushEnabled() {
|
| 16 |
+
return Mage::getStoreConfig('turnto_admin/historicalfeedconfig/enabled') != null;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
public function checkFeed($url = null)
|
| 20 |
{
|
| 21 |
|
| 37 |
{
|
| 38 |
|
| 39 |
$url = Mage::getStoreConfig('turnto_admin/feedconfig/url');
|
| 40 |
+
$site_key = Mage::getStoreConfig('turnto_admin/general/site_key');
|
| 41 |
+
$site_auth = Mage::getStoreConfig('turnto_admin/general/site_auth');
|
| 42 |
|
| 43 |
if (!$url || !$site_key || !$site_auth)
|
| 44 |
return null;
|
| 169 |
|
| 170 |
return $updated;
|
| 171 |
}
|
| 172 |
+
|
| 173 |
+
public function generateHistoricalOrdersFeed($startDate, $storeId, $fileName) {
|
| 174 |
+
$path = Mage::getBaseDir('media') . DS . 'turnto/';
|
| 175 |
+
mkdir($path, 0755);
|
| 176 |
+
|
| 177 |
+
$handle = fopen($path . $fileName, 'w');
|
| 178 |
+
|
| 179 |
+
if (!$handle) {
|
| 180 |
+
Mage::throwException($this->__('Could not create historical feed file in directory ' . $path));
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
fwrite($handle, "ORDERID\tORDERDATE\tEMAIL\tITEMTITLE\tITEMURL\tITEMLINEID\tZIP\tFIRSTNAME\tLASTNAME\tSKU\tPRICE\tITEMIMAGEURL\tDELIVERYDATE");
|
| 184 |
+
fwrite($handle, "\n");
|
| 185 |
+
|
| 186 |
+
$fromDate = date('Y-m-d H:i:s', strtotime($startDate));
|
| 187 |
+
Mage::app();
|
| 188 |
+
$orders = Mage::getModel('sales/order')
|
| 189 |
+
->getCollection()
|
| 190 |
+
->addFieldToFilter('store_id', $storeId)
|
| 191 |
+
->addAttributeToFilter('created_at', array('from'=>$fromDate))
|
| 192 |
+
->addAttributeToSort('entity_id', 'ASC')
|
| 193 |
+
->setPageSize(100);
|
| 194 |
+
|
| 195 |
+
$pages = $orders->getLastPageNumber();
|
| 196 |
+
|
| 197 |
+
for ($curPage = 1; $curPage <= $pages; $curPage++) {
|
| 198 |
+
$orders->setCurPage($curPage);
|
| 199 |
+
$orders->load();
|
| 200 |
+
foreach ($orders as $order) {
|
| 201 |
+
$itemlineid = 0;
|
| 202 |
+
foreach ($order->getAllVisibleItems() as $item) {
|
| 203 |
+
//ORDERID
|
| 204 |
+
fwrite($handle, $order->getRealOrderId());
|
| 205 |
+
fwrite($handle, "\t");
|
| 206 |
+
//ORDERDATE
|
| 207 |
+
fwrite($handle, $order->getCreatedAtDate()->toString('Y-MM-d'));
|
| 208 |
+
fwrite($handle, "\t");
|
| 209 |
+
//EMAIL
|
| 210 |
+
fwrite($handle, $order->getCustomerEmail());
|
| 211 |
+
fwrite($handle, "\t");
|
| 212 |
+
//ITEMTITLE
|
| 213 |
+
fwrite($handle, $item->getName());
|
| 214 |
+
fwrite($handle, "\t");
|
| 215 |
+
//ITEMURL
|
| 216 |
+
$product = $item->getProduct();
|
| 217 |
+
fwrite($handle, $product->getProductUrl());
|
| 218 |
+
fwrite($handle, "\t");
|
| 219 |
+
//ITEMLINEID
|
| 220 |
+
fwrite($handle, $itemlineid++);
|
| 221 |
+
fwrite($handle, "\t");
|
| 222 |
+
//ZIP
|
| 223 |
+
fwrite($handle, $order->getShippingAddress()->getPostcode());
|
| 224 |
+
fwrite($handle, "\t");
|
| 225 |
+
//FIRSTNAME
|
| 226 |
+
$name = explode(' ', $order->getCustomerName());
|
| 227 |
+
fwrite($handle, $name[0]);
|
| 228 |
+
fwrite($handle, "\t");
|
| 229 |
+
//LASTNAME
|
| 230 |
+
if (isset($name[1])) {
|
| 231 |
+
fwrite($handle, $name[1]);
|
| 232 |
+
}
|
| 233 |
+
fwrite($handle, "\t");
|
| 234 |
+
//SKU
|
| 235 |
+
fwrite($handle, $item->getSku());
|
| 236 |
+
fwrite($handle, "\t");
|
| 237 |
+
//PRICE
|
| 238 |
+
fwrite($handle, $item->getOriginalPrice());
|
| 239 |
+
fwrite($handle, "\t");
|
| 240 |
+
//ITEMIMAGEURL
|
| 241 |
+
if ($product->getImage() != null && $product->getImage() != "no_selection") {
|
| 242 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage()));
|
| 243 |
+
} else if ($product->getSmallImage() != null && $product->getSmallImage() != "no_selection") {
|
| 244 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getSmallImage()));
|
| 245 |
+
} else if ($product->getThumbnail() != null && $product->getThumbnail() != "no_selection") {
|
| 246 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail()));
|
| 247 |
+
}
|
| 248 |
+
fwrite($handle, "\t");
|
| 249 |
+
|
| 250 |
+
//DELIVERYDATE
|
| 251 |
+
$shipDate = $this->getDateOfShipmentContainingItem($order, $item);
|
| 252 |
+
if ($shipDate != null) {
|
| 253 |
+
fwrite($handle, $shipDate->toString('Y-MM-d'));
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
fwrite($handle, "\n");
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
$orders->clear();
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
fclose($handle);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
private function getDateOfShipmentContainingItem($order, $item) {
|
| 266 |
+
// get the shipments for this order
|
| 267 |
+
$shipments = $order->getShipmentsCollection();
|
| 268 |
+
foreach ($shipments as $shipment) {
|
| 269 |
+
// get the items in this shipment
|
| 270 |
+
$items = $shipment->getItemsCollection();
|
| 271 |
+
foreach ($items as $it) {
|
| 272 |
+
// check if this shipment contains the item that was passed in
|
| 273 |
+
if ($item->getId() == $it->getId()) {
|
| 274 |
+
return $shipment->getCreatedAtDate();
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
return null;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
public function pushHistoricalOrdersFeed() {
|
| 283 |
+
$path = Mage::getBaseDir('media') . DS . 'turnto/';
|
| 284 |
+
mkdir($path, 0755);
|
| 285 |
+
|
| 286 |
+
$logFile = 'turnto_historical_feed_job.log';
|
| 287 |
+
|
| 288 |
+
Mage::log('Started pushHistoricalOrdersFeed', null, $logFile);
|
| 289 |
+
|
| 290 |
+
$fileName = 'magento_auto_histfeed.csv';
|
| 291 |
+
$storeId = Mage::getStoreConfig('turnto_admin/general/storeId');
|
| 292 |
+
$storeId = $storeId ? $storeId : 1;
|
| 293 |
+
$this->generateHistoricalOrdersFeed(mktime(0, 0, 0, date("m"), date("d"), date("Y") - 2), $storeId, $fileName);
|
| 294 |
+
|
| 295 |
+
$file = $path . $fileName;
|
| 296 |
+
$siteKey = Mage::getStoreConfig('turnto_admin/general/site_key');
|
| 297 |
+
$authKey = Mage::getStoreConfig('turnto_admin/general/site_auth');
|
| 298 |
+
$baseUrl = Mage::getStoreConfig('turnto_admin/general/url');
|
| 299 |
+
if (!$baseUrl) {
|
| 300 |
+
$baseUrl = "http://www.turnto.com";
|
| 301 |
+
}
|
| 302 |
+
$url = $baseUrl . "/feedUpload/postfile";
|
| 303 |
+
$feedStyle = "tab-style.1";
|
| 304 |
+
|
| 305 |
+
if (!$siteKey || !$authKey) {
|
| 306 |
+
return;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
Mage::log('Filename: ' . $fileName, null, $logFile);
|
| 310 |
+
Mage::log('Store Id: ' . $storeId, null, $logFile);
|
| 311 |
+
Mage::log('siteKey: ' . $siteKey, null, $logFile);
|
| 312 |
+
Mage::log('authKey: ' . $authKey, null, $logFile);
|
| 313 |
+
|
| 314 |
+
$fields = array('siteKey' => $siteKey, 'authKey' => $authKey, 'feedStyle' => $feedStyle, 'file' => "@$file");
|
| 315 |
+
$fields_string = '';
|
| 316 |
+
foreach ($fields as $key => $value) {
|
| 317 |
+
$fields_string .= $key . '=' . $value . '&';
|
| 318 |
+
}
|
| 319 |
+
rtrim($fields_string, '&');
|
| 320 |
+
|
| 321 |
+
$ch = curl_init($url);
|
| 322 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
| 323 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 324 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
| 325 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
|
| 326 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 327 |
+
|
| 328 |
+
$response = curl_exec($ch);
|
| 329 |
+
curl_close($ch);
|
| 330 |
+
|
| 331 |
+
Mage::log('Ended pushHistoricalOrdersFeed', null, $logFile);
|
| 332 |
+
|
| 333 |
+
echo $response;
|
| 334 |
+
}
|
| 335 |
}
|
app/code/community/Turnto/Admin/Model/Observer.php
CHANGED
|
@@ -11,6 +11,15 @@ class Turnto_Admin_Model_Observer
|
|
| 11 |
|
| 12 |
//return $this;
|
| 13 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
}
|
| 11 |
|
| 12 |
//return $this;
|
| 13 |
}
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
public function pushHistoricalOrdersFeed() {
|
| 17 |
+
$helper = Mage::helper('adminhelper1');
|
| 18 |
+
if ($helper->isHistoricalOrderFeedPushEnabled()) {
|
| 19 |
+
// get historical orders for the past 2 years
|
| 20 |
+
$helper->pushHistoricalOrdersFeed();
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
|
| 24 |
|
| 25 |
}
|
app/code/community/Turnto/Admin/controllers/Adminhtml/TurntoController.php
CHANGED
|
@@ -2,264 +2,181 @@
|
|
| 2 |
|
| 3 |
class Turnto_Admin_Adminhtml_TurntoController extends Mage_Adminhtml_Controller_Action
|
| 4 |
{
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
$this->_addLeft($this->getLayout()->createBlock('Turnto_Admin_Block_ShowTabsAdminBlock'));
|
| 14 |
-
|
| 15 |
-
$this->renderLayout();
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
public function redirectAction()
|
| 19 |
-
{
|
| 20 |
-
$this->_redirectUrl('http://www.turnto.com');
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
public function ratingsAction()
|
| 24 |
{
|
| 25 |
-
|
| 26 |
-
Mage::helper('adminhelper1')->loadRatings();
|
| 27 |
-
$message = $this->__('Products Ratings successfully updated.');
|
| 28 |
-
Mage::getSingleton('adminhtml/session')->addSuccess($message);
|
| 29 |
-
$this->_redirect('*/*/', array('active_tab' => 'turnto_ratings_feed_tab'));
|
| 30 |
-
|
| 31 |
}
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
{
|
| 35 |
$post = $this->getRequest()->getPost();
|
| 36 |
$catalogFeed = true;
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
try {
|
| 39 |
if (empty($post)) {
|
| 40 |
Mage::throwException($this->__('Invalid form data.'));
|
| 41 |
}
|
| 42 |
-
|
| 43 |
-
$path = Mage::getBaseDir('media') . DS . 'turnto/';
|
| 44 |
-
mkdir($path, 0755);
|
| 45 |
-
|
| 46 |
-
if($post['feed_type'] == 'historical'){
|
| 47 |
-
/* form processing */
|
| 48 |
-
$startDate = $post['start_date'];
|
| 49 |
-
|
| 50 |
-
if($startDate == null || $startDate == ""){
|
| 51 |
-
Mage::getSingleton('adminhtml/session')->addError("Start Date is required");
|
| 52 |
-
$this->_redirect('*/*/', array('active_tab' => 'turnto_hist_feed_tab'));
|
| 53 |
-
return;
|
| 54 |
-
}
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
fwrite($handle, "\n");
|
| 65 |
-
|
| 66 |
-
$fromDate = date('Y-m-d H:i:s', strtotime($startDate));
|
| 67 |
-
Mage::app();
|
| 68 |
-
$orders = Mage::getModel('sales/order')
|
| 69 |
-
->getCollection()
|
| 70 |
-
->addFieldToFilter('store_id', $scope)
|
| 71 |
-
->addAttributeToFilter('created_at', array('from'=>$fromDate))
|
| 72 |
-
->addAttributeToSort('entity_id', 'DESC')
|
| 73 |
-
->setPageSize(100);
|
| 74 |
|
| 75 |
-
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
fwrite($handle, "\t");
|
| 95 |
-
//ITEMURL
|
| 96 |
-
$product = $item->getProduct();
|
| 97 |
-
fwrite($handle, $product->getProductUrl());
|
| 98 |
-
fwrite($handle, "\t");
|
| 99 |
-
//ITEMLINEID
|
| 100 |
-
fwrite($handle, $itemlineid++);
|
| 101 |
-
fwrite($handle, "\t");
|
| 102 |
-
//ZIP
|
| 103 |
-
fwrite($handle, $order->getShippingAddress()->getPostcode());
|
| 104 |
-
fwrite($handle, "\t");
|
| 105 |
-
//FIRSTNAME
|
| 106 |
-
$name = explode(' ', $order->getCustomerName());
|
| 107 |
-
fwrite($handle, $name[0]);
|
| 108 |
-
fwrite($handle, "\t");
|
| 109 |
-
//LASTNAME
|
| 110 |
-
if (isset($name[1])) {
|
| 111 |
-
fwrite($handle, $name[1]);
|
| 112 |
-
}
|
| 113 |
-
fwrite($handle, "\t");
|
| 114 |
-
//SKU
|
| 115 |
-
fwrite($handle, $item->getSku());
|
| 116 |
-
fwrite($handle, "\t");
|
| 117 |
-
//PRICE
|
| 118 |
-
fwrite($handle, $item->getOriginalPrice());
|
| 119 |
-
fwrite($handle, "\t");
|
| 120 |
-
//ITEMIMAGEURL
|
| 121 |
-
if ($product->getImage() != null && $product->getImage() != "no_selection") {
|
| 122 |
-
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage()));
|
| 123 |
-
} else if ($product->getSmallImage() != null && $product->getSmallImage() != "no_selection") {
|
| 124 |
-
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getSmallImage()));
|
| 125 |
-
} else if ($product->getThumbnail() != null && $product->getThumbnail() != "no_selection") {
|
| 126 |
-
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail()));
|
| 127 |
-
}
|
| 128 |
-
fwrite($handle, "\n");
|
| 129 |
-
}
|
| 130 |
-
}
|
| 131 |
-
$orders->clear();
|
| 132 |
-
}
|
| 133 |
-
|
| 134 |
-
fclose($handle);
|
| 135 |
-
|
| 136 |
-
$message = $this->__('The historical feed was successfully generated. Click the "Download historical feed" link to download.');
|
| 137 |
-
$catalogFeed = false;
|
| 138 |
-
}
|
| 139 |
-
else{
|
| 140 |
-
/* form processing */
|
| 141 |
-
$websiteId = $post['websiteId'];
|
| 142 |
-
$storeId = 1;
|
| 143 |
-
if (isset($websiteId)) {
|
| 144 |
-
$split = explode('_', $websiteId);
|
| 145 |
-
$websiteId = $split[0];
|
| 146 |
-
$storeId = $split[1];
|
| 147 |
-
} else {
|
| 148 |
-
$websiteId = 1;
|
| 149 |
-
}
|
| 150 |
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
if(!isset($storeId)){
|
| 154 |
-
$storeId = 1;
|
| 155 |
-
}
|
| 156 |
-
$baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
|
| 157 |
-
$baseMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product';
|
| 158 |
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
//ISCATEGORY
|
| 203 |
-
fwrite($handle, "n");
|
| 204 |
-
fwrite($handle, "\n");
|
| 205 |
-
}
|
| 206 |
-
}
|
| 207 |
-
|
| 208 |
-
$categories = Mage::getModel('catalog/category')->setStoreId($storeId)->getCollection()->addAttributeToSelect('name');
|
| 209 |
-
if ($categories) {
|
| 210 |
-
foreach ($categories as $category) {
|
| 211 |
-
if ($category->getId() == 1) {
|
| 212 |
-
continue;
|
| 213 |
-
}
|
| 214 |
-
$category->setStoreId($storeId);
|
| 215 |
-
fwrite($handle, $category->getId());
|
| 216 |
-
fwrite($handle, "\t");
|
| 217 |
-
//IMAGEURL
|
| 218 |
-
fwrite($handle, "\t");
|
| 219 |
-
//TITLE
|
| 220 |
-
fwrite($handle, $category->getName());
|
| 221 |
-
fwrite($handle, "\t");
|
| 222 |
-
//PRICE
|
| 223 |
-
fwrite($handle, "\t");
|
| 224 |
-
//CURRENCY
|
| 225 |
-
fwrite($handle, "\t");
|
| 226 |
-
//ACTIVE
|
| 227 |
-
fwrite($handle, "Y");
|
| 228 |
-
fwrite($handle, "\t");
|
| 229 |
-
//ITEMURL
|
| 230 |
-
fwrite($handle, $category->getUrl());
|
| 231 |
-
fwrite($handle, "\t");
|
| 232 |
-
//CATEGORY
|
| 233 |
-
fwrite($handle, $category->getParentCategory()->getId());
|
| 234 |
-
fwrite($handle, "\t");
|
| 235 |
-
//KEYWORDS
|
| 236 |
-
fwrite($handle, "\t");
|
| 237 |
-
//REPLACEMENTSKU
|
| 238 |
-
fwrite($handle, "\t");
|
| 239 |
-
//VIRTUALPARENTCODE
|
| 240 |
-
fwrite($handle, "\t");
|
| 241 |
-
//CATEGORYPATHJSON
|
| 242 |
-
fwrite($handle, "\t");
|
| 243 |
-
//ISCATEGORY
|
| 244 |
-
fwrite($handle, "Y");
|
| 245 |
-
fwrite($handle, "\n");
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
|
|
|
|
|
|
|
|
|
| 253 |
}
|
| 254 |
Mage::getSingleton('adminhtml/session')->addSuccess($message);
|
| 255 |
} catch (Exception $e) {
|
| 256 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 257 |
}
|
| 258 |
-
|
| 259 |
-
if($catalogFeed){
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
}
|
| 265 |
}
|
| 2 |
|
| 3 |
class Turnto_Admin_Adminhtml_TurntoController extends Mage_Adminhtml_Controller_Action
|
| 4 |
{
|
| 5 |
+
public function indexAction()
|
| 6 |
+
{
|
| 7 |
+
$this->loadLayout();
|
| 8 |
+
|
| 9 |
+
$resource = Mage::getSingleton('core/resource');
|
| 10 |
+
|
| 11 |
+
Mage::register('websites', Mage::app()->getWebsites());
|
| 12 |
+
Mage::register('stores', Mage::app()->getStores());
|
| 13 |
+
|
| 14 |
+
$this->_addLeft($this->getLayout()->createBlock('Turnto_Admin_Block_ShowTabsAdminBlock'));
|
| 15 |
+
|
| 16 |
+
$this->renderLayout();
|
| 17 |
+
}
|
| 18 |
|
| 19 |
+
public function redirectAction()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
{
|
| 21 |
+
$this->_redirectUrl('http://www.turnto.com');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
|
| 24 |
+
public function ratingsAction()
|
| 25 |
+
{
|
| 26 |
+
|
| 27 |
+
Mage::helper('adminhelper1')->loadRatings();
|
| 28 |
+
$message = $this->__('Products Ratings successfully updated.');
|
| 29 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($message);
|
| 30 |
+
$this->_redirect('*/*/', array('active_tab' => 'turnto_ratings_feed_tab'));
|
| 31 |
+
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
public function postAction()
|
| 35 |
{
|
| 36 |
$post = $this->getRequest()->getPost();
|
| 37 |
$catalogFeed = true;
|
| 38 |
+
$websiteId = $post['websiteId'];
|
| 39 |
+
$storeId = $post['storeId'];
|
| 40 |
+
$path = Mage::getBaseDir('media') . DS . 'turnto/';
|
| 41 |
+
|
| 42 |
try {
|
| 43 |
if (empty($post)) {
|
| 44 |
Mage::throwException($this->__('Invalid form data.'));
|
| 45 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
if ($post['feed_type'] == 'historical') {
|
| 48 |
+
/* form processing */
|
| 49 |
+
$startDate = $post['start_date'];
|
| 50 |
|
| 51 |
+
if ($startDate == null || $startDate == "") {
|
| 52 |
+
Mage::getSingleton('adminhtml/session')->addError("Start Date is required");
|
| 53 |
+
$this->_redirect('*/*/', array('active_tab' => 'turnto_hist_feed_tab'));
|
| 54 |
+
return;
|
| 55 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
$helper = Mage::helper('adminhelper1');
|
| 58 |
+
$helper->generateHistoricalOrdersFeed($startDate, $storeId, 'histfeed.csv');
|
| 59 |
|
| 60 |
+
$message = $this->__('The historical feed was successfully generated. Click the "Download historical feed" link to download.');
|
| 61 |
+
$catalogFeed = false;
|
| 62 |
+
} else {
|
| 63 |
+
/* form processing */
|
| 64 |
+
if (isset($websiteId)) {
|
| 65 |
+
$split = explode('_', $websiteId);
|
| 66 |
+
$websiteId = $split[0];
|
| 67 |
+
$storeId = $split[1];
|
| 68 |
+
} else {
|
| 69 |
+
$websiteId = 1;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
if (!isset($storeId)) {
|
| 73 |
+
$storeId = 1;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
$handle = fopen($path . 'catfeed.csv', 'w');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
fwrite($handle, "SKU\tIMAGEURL\tTITLE\tPRICE\tCURRENCY\tACTIVE\tITEMURL\tCATEGORY\tKEYWORDS\tREPLACEMENTSKU\tINSTOCK\tVIRTUALPARENTCODE\tCATEGORYPATHJSON\tISCATEGORY");
|
| 79 |
+
fwrite($handle, "\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
$products = Mage::getModel('catalog/product')->setStoreId($storeId)->getCollection()->addAttributeToSelect('name')->addAttributeToSelect('*')->addAttributeToSelect('price')->addAttributeToSelect('image')->addWebsiteFilter($websiteId);
|
| 82 |
+
if ($products) {
|
| 83 |
+
foreach ($products as $product) {
|
| 84 |
+
$product->setStoreId($storeId);
|
| 85 |
+
fwrite($handle, $product->getSku());
|
| 86 |
+
fwrite($handle, "\t");
|
| 87 |
+
if ($product->getImage() != null && $product->getImage() != "no_selection") {
|
| 88 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage()));
|
| 89 |
+
} else if ($product->getSmallImage() != null && $product->getSmallImage() != "no_selection") {
|
| 90 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getSmallImage()));
|
| 91 |
+
} else if ($product->getThumbnail() != null && $product->getThumbnail() != "no_selection") {
|
| 92 |
+
fwrite($handle, Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail()));
|
| 93 |
+
}
|
| 94 |
+
fwrite($handle, "\t");
|
| 95 |
+
fwrite($handle, $product->getName());
|
| 96 |
+
fwrite($handle, "\t");
|
| 97 |
+
fwrite($handle, $product->getPrice());
|
| 98 |
+
fwrite($handle, "\t");
|
| 99 |
+
//CURRENCY
|
| 100 |
+
fwrite($handle, "\t");
|
| 101 |
+
//ACTIVE
|
| 102 |
+
fwrite($handle, "Y");
|
| 103 |
+
fwrite($handle, "\t");
|
| 104 |
+
//ITEMURL
|
| 105 |
+
fwrite($handle, $product->getProductUrl());
|
| 106 |
+
fwrite($handle, "\t");
|
| 107 |
+
//CATEGORY
|
| 108 |
+
$ids = $product->getCategoryIds();
|
| 109 |
+
fwrite($handle, (isset($ids[0]) ? $ids[0] : ''));
|
| 110 |
+
fwrite($handle, "\t");
|
| 111 |
+
// KEYWORDS
|
| 112 |
+
fwrite($handle, "\t");
|
| 113 |
+
// REPLACEMENTSKU
|
| 114 |
+
fwrite($handle, "\t");
|
| 115 |
+
//VIRTUALPARENTCODE
|
| 116 |
+
fwrite($handle, "\t");
|
| 117 |
+
//CATEGORYPATHJSON
|
| 118 |
+
fwrite($handle, "\t");
|
| 119 |
+
//ISCATEGORY
|
| 120 |
+
fwrite($handle, "n");
|
| 121 |
+
fwrite($handle, "\n");
|
| 122 |
+
}
|
| 123 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
+
$categories = Mage::getModel('catalog/category')->setStoreId($storeId)->getCollection()->addAttributeToSelect('name');
|
| 126 |
+
if ($categories) {
|
| 127 |
+
foreach ($categories as $category) {
|
| 128 |
+
if ($category->getId() == 1) {
|
| 129 |
+
continue;
|
| 130 |
+
}
|
| 131 |
+
$category->setStoreId($storeId);
|
| 132 |
+
fwrite($handle, $category->getId());
|
| 133 |
+
fwrite($handle, "\t");
|
| 134 |
+
//IMAGEURL
|
| 135 |
+
fwrite($handle, "\t");
|
| 136 |
+
//TITLE
|
| 137 |
+
fwrite($handle, $category->getName());
|
| 138 |
+
fwrite($handle, "\t");
|
| 139 |
+
//PRICE
|
| 140 |
+
fwrite($handle, "\t");
|
| 141 |
+
//CURRENCY
|
| 142 |
+
fwrite($handle, "\t");
|
| 143 |
+
//ACTIVE
|
| 144 |
+
fwrite($handle, "Y");
|
| 145 |
+
fwrite($handle, "\t");
|
| 146 |
+
//ITEMURL
|
| 147 |
+
fwrite($handle, $category->getUrl());
|
| 148 |
+
fwrite($handle, "\t");
|
| 149 |
+
//CATEGORY
|
| 150 |
+
fwrite($handle, $category->getParentCategory()->getId());
|
| 151 |
+
fwrite($handle, "\t");
|
| 152 |
+
//KEYWORDS
|
| 153 |
+
fwrite($handle, "\t");
|
| 154 |
+
//REPLACEMENTSKU
|
| 155 |
+
fwrite($handle, "\t");
|
| 156 |
+
//VIRTUALPARENTCODE
|
| 157 |
+
fwrite($handle, "\t");
|
| 158 |
+
//CATEGORYPATHJSON
|
| 159 |
+
fwrite($handle, "\t");
|
| 160 |
+
//ISCATEGORY
|
| 161 |
+
fwrite($handle, "Y");
|
| 162 |
+
fwrite($handle, "\n");
|
| 163 |
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
fclose($handle);
|
| 168 |
+
|
| 169 |
+
$message = $this->__('The catalog feed was successfully generated. Click the "Download catalog feed" link to download.');
|
| 170 |
}
|
| 171 |
Mage::getSingleton('adminhtml/session')->addSuccess($message);
|
| 172 |
} catch (Exception $e) {
|
| 173 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
| 174 |
}
|
| 175 |
+
|
| 176 |
+
if ($catalogFeed) {
|
| 177 |
+
$this->_redirect('*/*/', array('active_tab' => 'turnto_catalog_feed_tab'));
|
| 178 |
+
} else {
|
| 179 |
+
$this->_redirectUrl(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'media/turnto/histfeed.csv');
|
| 180 |
+
}
|
| 181 |
}
|
| 182 |
}
|
app/code/community/Turnto/Admin/controllers/IndexController.php
CHANGED
|
@@ -27,17 +27,18 @@ class Turnto_Admin_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 27 |
$baseMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product';
|
| 28 |
|
| 29 |
|
| 30 |
-
echo "SKU\tIMAGEURL\tTITLE\tPRICE\tCURRENCY\tACTIVE\tITEMURL\tCATEGORY\tKEYWORDS\tREPLACEMENTSKU\tINSTOCK\tVIRTUALPARENTCODE\tCATEGORYPATHJSON\tISCATEGORY";
|
| 31 |
echo "\n";
|
| 32 |
|
| 33 |
$pageSize = 100;
|
| 34 |
-
$
|
| 35 |
->getCollection()
|
| 36 |
->addStoreFilter($storeId)
|
| 37 |
->addWebsiteFilter($websiteId)
|
| 38 |
-
->
|
|
|
|
| 39 |
$page = 1;
|
| 40 |
-
$pages = ceil(count
|
| 41 |
do {
|
| 42 |
$collection = Mage::getModel('catalog/product')
|
| 43 |
->getCollection()
|
|
@@ -115,6 +116,9 @@ class Turnto_Admin_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 115 |
echo "\t";
|
| 116 |
//ISCATEGORY
|
| 117 |
echo "n";
|
|
|
|
|
|
|
|
|
|
| 118 |
echo "\n";
|
| 119 |
}
|
| 120 |
$page++;
|
|
@@ -157,6 +161,8 @@ class Turnto_Admin_IndexController extends Mage_Core_Controller_Front_Action
|
|
| 157 |
echo "\t";
|
| 158 |
//ISCATEGORY
|
| 159 |
echo "Y";
|
|
|
|
|
|
|
| 160 |
echo "\n";
|
| 161 |
}
|
| 162 |
}
|
| 27 |
$baseMediaUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product';
|
| 28 |
|
| 29 |
|
| 30 |
+
echo "SKU\tIMAGEURL\tTITLE\tPRICE\tCURRENCY\tACTIVE\tITEMURL\tCATEGORY\tKEYWORDS\tREPLACEMENTSKU\tINSTOCK\tVIRTUALPARENTCODE\tCATEGORYPATHJSON\tISCATEGORY\tBRAND";
|
| 31 |
echo "\n";
|
| 32 |
|
| 33 |
$pageSize = 100;
|
| 34 |
+
$count = Mage::getModel('catalog/product')
|
| 35 |
->getCollection()
|
| 36 |
->addStoreFilter($storeId)
|
| 37 |
->addWebsiteFilter($websiteId)
|
| 38 |
+
->getSize();
|
| 39 |
+
|
| 40 |
$page = 1;
|
| 41 |
+
$pages = ceil($count / $pageSize);
|
| 42 |
do {
|
| 43 |
$collection = Mage::getModel('catalog/product')
|
| 44 |
->getCollection()
|
| 116 |
echo "\t";
|
| 117 |
//ISCATEGORY
|
| 118 |
echo "n";
|
| 119 |
+
echo "\t";
|
| 120 |
+
//BRAND
|
| 121 |
+
echo $product->getAttributeText('manufacturer');
|
| 122 |
echo "\n";
|
| 123 |
}
|
| 124 |
$page++;
|
| 161 |
echo "\t";
|
| 162 |
//ISCATEGORY
|
| 163 |
echo "Y";
|
| 164 |
+
echo "\t";
|
| 165 |
+
//BRAND
|
| 166 |
echo "\n";
|
| 167 |
}
|
| 168 |
}
|
app/code/community/Turnto/Admin/etc/config.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<config>
|
| 4 |
<modules>
|
| 5 |
<Turnto_Admin>
|
| 6 |
-
<version>2.2.
|
| 7 |
</Turnto_Admin>
|
| 8 |
</modules>
|
| 9 |
|
|
@@ -133,7 +133,15 @@
|
|
| 133 |
<turnto_admin>
|
| 134 |
<feedconfig>
|
| 135 |
<url>http://static.www.turnto.com/static/export/</url>
|
| 136 |
-
</feedconfig>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
</turnto_admin>
|
| 138 |
</default>
|
| 139 |
<crontab>
|
|
@@ -146,6 +154,14 @@
|
|
| 146 |
<model>turnto_admin/observer::getProductsRatingsFeed</model>
|
| 147 |
</run>
|
| 148 |
</turnto_products_ratings>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
</jobs>
|
| 150 |
</crontab>
|
| 151 |
</config>
|
| 3 |
<config>
|
| 4 |
<modules>
|
| 5 |
<Turnto_Admin>
|
| 6 |
+
<version>2.2.11</version>
|
| 7 |
</Turnto_Admin>
|
| 8 |
</modules>
|
| 9 |
|
| 133 |
<turnto_admin>
|
| 134 |
<feedconfig>
|
| 135 |
<url>http://static.www.turnto.com/static/export/</url>
|
| 136 |
+
</feedconfig>
|
| 137 |
+
<historicalfeedconfig>
|
| 138 |
+
<storeId>1</storeId>
|
| 139 |
+
<websiteId>1</websiteId>
|
| 140 |
+
</historicalfeedconfig>
|
| 141 |
+
<general>
|
| 142 |
+
<static_url>http://static.www.turnto.com</static_url>
|
| 143 |
+
<url>http://www.turnto.com</url>
|
| 144 |
+
</general>
|
| 145 |
</turnto_admin>
|
| 146 |
</default>
|
| 147 |
<crontab>
|
| 154 |
<model>turnto_admin/observer::getProductsRatingsFeed</model>
|
| 155 |
</run>
|
| 156 |
</turnto_products_ratings>
|
| 157 |
+
<turnto_historical_orders_feed>
|
| 158 |
+
<schedule>
|
| 159 |
+
<cron_expr>* * * * *</cron_expr>
|
| 160 |
+
</schedule>
|
| 161 |
+
<run>
|
| 162 |
+
<model>turnto_admin/observer::pushHistoricalOrdersFeed</model>
|
| 163 |
+
</run>
|
| 164 |
+
</turnto_historical_orders_feed>
|
| 165 |
</jobs>
|
| 166 |
</crontab>
|
| 167 |
</config>
|
app/code/community/Turnto/Admin/etc/system.xml
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
|
| 15 |
<sections>
|
| 16 |
<turnto_admin translate="label" >
|
| 17 |
-
<label>
|
| 18 |
<tab>turnto_extensions</tab>
|
| 19 |
<frontend_type>text</frontend_type>
|
| 20 |
<sort_order>261</sort_order>
|
|
@@ -22,6 +22,55 @@
|
|
| 22 |
<show_in_website>1</show_in_website>
|
| 23 |
<show_in_store>1</show_in_store>
|
| 24 |
<groups>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
<feedconfig translate="label" >
|
| 26 |
<label>Turnto Feed Configuration</label>
|
| 27 |
<frontend_type>text</frontend_type>
|
|
@@ -47,41 +96,47 @@
|
|
| 47 |
<show_in_store>1</show_in_store>
|
| 48 |
<validate>required-entry</validate>
|
| 49 |
</url>
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
<show_in_default>1</show_in_default>
|
| 55 |
<show_in_website>1</show_in_website>
|
| 56 |
<show_in_store>1</show_in_store>
|
| 57 |
-
<
|
| 58 |
-
</
|
| 59 |
-
<
|
| 60 |
-
<label>
|
| 61 |
<frontend_type>text</frontend_type>
|
| 62 |
-
<sort_order>
|
| 63 |
<show_in_default>1</show_in_default>
|
| 64 |
<show_in_website>1</show_in_website>
|
| 65 |
<show_in_store>1</show_in_store>
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
<
|
| 71 |
-
<frontend_type>select</frontend_type>
|
| 72 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 73 |
-
<sort_order>40</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 |
-
|
| 78 |
-
</enabled>
|
| 79 |
-
-->
|
| 80 |
</fields>
|
| 81 |
-
|
| 82 |
-
|
| 83 |
</groups>
|
| 84 |
-
|
| 85 |
</turnto_admin>
|
| 86 |
</sections>
|
| 87 |
</config>
|
| 14 |
|
| 15 |
<sections>
|
| 16 |
<turnto_admin translate="label" >
|
| 17 |
+
<label>Configuration</label>
|
| 18 |
<tab>turnto_extensions</tab>
|
| 19 |
<frontend_type>text</frontend_type>
|
| 20 |
<sort_order>261</sort_order>
|
| 22 |
<show_in_website>1</show_in_website>
|
| 23 |
<show_in_store>1</show_in_store>
|
| 24 |
<groups>
|
| 25 |
+
<general translate="label">
|
| 26 |
+
<label>General Settings</label>
|
| 27 |
+
<frontend_type>text</frontend_type>
|
| 28 |
+
<sort_order>1</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 |
+
<expanded>1</expanded>
|
| 33 |
+
<fields>
|
| 34 |
+
<site_key translate="label">
|
| 35 |
+
<label>Site Key*</label>
|
| 36 |
+
<frontend_type>text</frontend_type>
|
| 37 |
+
<sort_order>20</sort_order>
|
| 38 |
+
<show_in_default>1</show_in_default>
|
| 39 |
+
<show_in_website>1</show_in_website>
|
| 40 |
+
<show_in_store>1</show_in_store>
|
| 41 |
+
<validate>required-entry</validate>
|
| 42 |
+
</site_key>
|
| 43 |
+
<site_auth translate="label">
|
| 44 |
+
<label>Authorization Key*</label>
|
| 45 |
+
<frontend_type>text</frontend_type>
|
| 46 |
+
<sort_order>30</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 |
+
<validate>required-entry</validate>
|
| 51 |
+
</site_auth>
|
| 52 |
+
<static_url>
|
| 53 |
+
<label>Static URL</label>
|
| 54 |
+
<frontend_type>text</frontend_type>
|
| 55 |
+
<sort_order>40</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 |
+
<validate>required-entry</validate>
|
| 60 |
+
<comment>Default is http://static.www.turnto.com. Should not ever be changed, unless instructed by TurnTo.</comment>
|
| 61 |
+
</static_url>
|
| 62 |
+
<url>
|
| 63 |
+
<label>URL</label>
|
| 64 |
+
<frontend_type>text</frontend_type>
|
| 65 |
+
<sort_order>50</sort_order>
|
| 66 |
+
<show_in_default>1</show_in_default>
|
| 67 |
+
<show_in_website>1</show_in_website>
|
| 68 |
+
<show_in_store>1</show_in_store>
|
| 69 |
+
<validate>required-entry</validate>
|
| 70 |
+
<comment>Default is http://www.turnto.com. Should not ever be changed, unless instructed by TurnTo.</comment>
|
| 71 |
+
</url>
|
| 72 |
+
</fields>
|
| 73 |
+
</general>
|
| 74 |
<feedconfig translate="label" >
|
| 75 |
<label>Turnto Feed Configuration</label>
|
| 76 |
<frontend_type>text</frontend_type>
|
| 96 |
<show_in_store>1</show_in_store>
|
| 97 |
<validate>required-entry</validate>
|
| 98 |
</url>
|
| 99 |
+
</fields>
|
| 100 |
+
</feedconfig>
|
| 101 |
+
<historicalfeedconfig>
|
| 102 |
+
<label>Historical Orders Feed Push</label>
|
| 103 |
+
<tab>turnto_extensions</tab>
|
| 104 |
+
<frontend_type>text</frontend_type>
|
| 105 |
+
<sort_order>1</sort_order>
|
| 106 |
+
<show_in_default>1</show_in_default>
|
| 107 |
+
<show_in_website>1</show_in_website>
|
| 108 |
+
<show_in_store>1</show_in_store>
|
| 109 |
+
<expanded>1</expanded>
|
| 110 |
+
<fields>
|
| 111 |
+
<enabled translate="label">
|
| 112 |
+
<label>Enabled Historical Orders Feed Push</label>
|
| 113 |
+
<frontend_type>select</frontend_type>
|
| 114 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 115 |
+
<sort_order>10</sort_order>
|
| 116 |
<show_in_default>1</show_in_default>
|
| 117 |
<show_in_website>1</show_in_website>
|
| 118 |
<show_in_store>1</show_in_store>
|
| 119 |
+
<comment>When set to Yes, Turnto historical orders feed will be pushed to TurnTo nightly.</comment>
|
| 120 |
+
</enabled>
|
| 121 |
+
<storeId>
|
| 122 |
+
<label>Store ID</label>
|
| 123 |
<frontend_type>text</frontend_type>
|
| 124 |
+
<sort_order>20</sort_order>
|
| 125 |
<show_in_default>1</show_in_default>
|
| 126 |
<show_in_website>1</show_in_website>
|
| 127 |
<show_in_store>1</show_in_store>
|
| 128 |
+
</storeId>
|
| 129 |
+
<websiteId>
|
| 130 |
+
<label>Website ID</label>
|
| 131 |
+
<frontend_type>text</frontend_type>
|
| 132 |
+
<sort_order>20</sort_order>
|
|
|
|
|
|
|
|
|
|
| 133 |
<show_in_default>1</show_in_default>
|
| 134 |
<show_in_website>1</show_in_website>
|
| 135 |
<show_in_store>1</show_in_store>
|
| 136 |
+
</websiteId>
|
|
|
|
|
|
|
| 137 |
</fields>
|
| 138 |
+
</historicalfeedconfig>
|
|
|
|
| 139 |
</groups>
|
|
|
|
| 140 |
</turnto_admin>
|
| 141 |
</sections>
|
| 142 |
</config>
|
app/code/community/Turnto/Login/etc/config.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<config>
|
| 4 |
<modules>
|
| 5 |
<Turnto_Login>
|
| 6 |
-
<version>2.2.
|
| 7 |
</Turnto_Login>
|
| 8 |
</modules>
|
| 9 |
|
| 3 |
<config>
|
| 4 |
<modules>
|
| 5 |
<Turnto_Login>
|
| 6 |
+
<version>2.2.11</version>
|
| 7 |
</Turnto_Login>
|
| 8 |
</modules>
|
| 9 |
|
app/design/adminhtml/default/default/template/turnto/catalog_feed_tab.phtml
CHANGED
|
@@ -34,20 +34,24 @@ To manually create a catalog feed press Generate to build a catalog feed. This f
|
|
| 34 |
-->
|
| 35 |
<tr>
|
| 36 |
<?php
|
| 37 |
-
echo '<td>Website
|
| 38 |
echo '<td><select id="websiteId" name="websiteId">';
|
| 39 |
foreach (Mage::registry('websites') as $website) {
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
foreach ($stores as $store) {
|
| 43 |
-
//echo '<option value="'.$website->getId().'_'.store->getId().'">Website</option>';
|
| 44 |
-
echo '<option value="'.$website->getId().'_'.$store->getId().'">'.$website->getId().': '.$website->getName().' '.$store->getId().': '.$store->getName().'</option>';
|
| 45 |
-
}
|
| 46 |
-
}
|
| 47 |
-
}
|
| 48 |
echo '</select></td>'
|
| 49 |
?>
|
| 50 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
<tr>
|
| 52 |
<td></td>
|
| 53 |
<td align="right">
|
| 34 |
-->
|
| 35 |
<tr>
|
| 36 |
<?php
|
| 37 |
+
echo '<td>Website:</td>';
|
| 38 |
echo '<td><select id="websiteId" name="websiteId">';
|
| 39 |
foreach (Mage::registry('websites') as $website) {
|
| 40 |
+
echo '<option value="'.$website->getId().'">'.$website->getId().': '.$website->getName().'</option>';
|
| 41 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
echo '</select></td>'
|
| 43 |
?>
|
| 44 |
</tr>
|
| 45 |
+
<tr>
|
| 46 |
+
<?php
|
| 47 |
+
echo '<td>Store:</td>';
|
| 48 |
+
echo '<td><select id="storeId" name="storeId">';
|
| 49 |
+
foreach (Mage::registry('stores') as $store) {
|
| 50 |
+
echo '<option value="'.$store->getId().'">'.$store->getId().': '.$store->getName().'</option>';
|
| 51 |
+
}
|
| 52 |
+
echo '</select></td>'
|
| 53 |
+
?>
|
| 54 |
+
</tr>
|
| 55 |
<tr>
|
| 56 |
<td></td>
|
| 57 |
<td align="right">
|
app/design/adminhtml/default/default/template/turnto/historical_feed_tab.phtml
CHANGED
|
@@ -7,21 +7,36 @@
|
|
| 7 |
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
| 8 |
<input name="feed_type" type="hidden" value="historical" />
|
| 9 |
<table>
|
| 10 |
-
<?php if(count(Mage::registry('
|
| 11 |
<tr>
|
| 12 |
-
<td>
|
| 13 |
-
<td><select id="
|
| 14 |
<?php
|
| 15 |
-
$
|
| 16 |
-
foreach($
|
| 17 |
-
echo '<option value="'.$
|
| 18 |
}
|
| 19 |
?>
|
| 20 |
</td>
|
| 21 |
</tr>
|
| 22 |
<?php } else { ?>
|
| 23 |
-
<input name="
|
| 24 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
<tr>
|
| 26 |
<td>From Date:</td>
|
| 27 |
<td>
|
| 7 |
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
| 8 |
<input name="feed_type" type="hidden" value="historical" />
|
| 9 |
<table>
|
| 10 |
+
<?php if(count(Mage::registry('stores')) > 1) { ?>
|
| 11 |
<tr>
|
| 12 |
+
<td>Store:</td>
|
| 13 |
+
<td><select id="storeId" name="storeId">
|
| 14 |
<?php
|
| 15 |
+
$stores = Mage::registry('stores');
|
| 16 |
+
foreach($stores as $store) {
|
| 17 |
+
echo '<option value="'.$store->getId().'">'.$store->getId().': '.$store->getName().'</option>';
|
| 18 |
}
|
| 19 |
?>
|
| 20 |
</td>
|
| 21 |
</tr>
|
| 22 |
<?php } else { ?>
|
| 23 |
+
<input name="storeId" id="storeId" type="hidden" value="1"/>
|
| 24 |
<?php } ?>
|
| 25 |
+
<!-- --><?php //if(count(Mage::registry('websites')) > 1) { ?>
|
| 26 |
+
<!-- <tr>-->
|
| 27 |
+
<!-- <td>Website:</td>-->
|
| 28 |
+
<!-- <td><select id="websiteId" name="websiteId">-->
|
| 29 |
+
<!-- --><?php
|
| 30 |
+
// $websites = Mage::registry('websites');
|
| 31 |
+
// foreach($websites as $website) {
|
| 32 |
+
// echo '<option value="'.$website->getId().'">'.$website->getId().': '.$website->getName().'</option>';
|
| 33 |
+
// }
|
| 34 |
+
// ?>
|
| 35 |
+
<!-- </td>-->
|
| 36 |
+
<!-- </tr>-->
|
| 37 |
+
<!-- --><?php //} else { ?>
|
| 38 |
+
<!-- <input name="websiteId" id="websiteId" type="hidden" value="1"/>-->
|
| 39 |
+
<!-- --><?php //} ?>
|
| 40 |
<tr>
|
| 41 |
<td>From Date:</td>
|
| 42 |
<td>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>socialcommerce_suite_by_turnto</name>
|
| 4 |
-
<version>2.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.turntonetworks.com/terms-of-use">TurnTo Networks</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -20,11 +20,12 @@
|
|
| 20 |
2.2.7 - Support for Magento Security Patch (SUPEE-6788)
|
| 21 |
2.2.9 - Historical Feed bug fix
|
| 22 |
2.2.10 - Minor bug fix for historical feed exporter
|
| 23 |
-
2.2.11 - Fixed circular reference in category tree
|
|
|
|
| 24 |
<authors><author><name>TurnTo</name><user>TurnTo</user><email>contact@turnto.com</email></author></authors>
|
| 25 |
-
<date>
|
| 26 |
-
<time>
|
| 27 |
-
<contents><target name="magecommunity"><dir name="Turnto"><dir name="Admin"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="84d005b13b3e39da048078bfc275bdf5"/></dir></dir></dir><file name="CatalogFeed.php" hash="f974cfdc687bf5edb3fdccb879547200"/><file name="HistoricalFeed.php" hash="a4d2b29c6d8bb2ed59aa884e02abc23b"/><file name="Overview.php" hash="51c8ed09153f1dc3b3d02aa0ab83f195"/><file name="RatingsFeed.php" hash="264cf15842c2738f1b77bce6ff9b9f0a"/><dir name="Review"><file name="Helper.php" hash="2ecc1a9252af9d40666b4f3a6603b522"/></dir><file name="ShowTabsAdminBlock.php" hash="403c3a8f95c65e361471b28fae25d2e3"/></dir><dir name="Helper"><file name="Data.php" hash="
|
| 28 |
<compatible/>
|
| 29 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
| 30 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>socialcommerce_suite_by_turnto</name>
|
| 4 |
+
<version>2.3.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.turntonetworks.com/terms-of-use">TurnTo Networks</license>
|
| 7 |
<channel>community</channel>
|
| 20 |
2.2.7 - Support for Magento Security Patch (SUPEE-6788)
|
| 21 |
2.2.9 - Historical Feed bug fix
|
| 22 |
2.2.10 - Minor bug fix for historical feed exporter
|
| 23 |
+
2.2.11 - Fixed circular reference in category tree. Optimized memory usage in catalog feed generator.
|
| 24 |
+
2.3.0 - Added ability to push the historical feed nightly</notes>
|
| 25 |
<authors><author><name>TurnTo</name><user>TurnTo</user><email>contact@turnto.com</email></author></authors>
|
| 26 |
+
<date>2016-02-03</date>
|
| 27 |
+
<time>15:43:25</time>
|
| 28 |
+
<contents><target name="magecommunity"><dir name="Turnto"><dir name="Admin"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Feed.php" hash="84d005b13b3e39da048078bfc275bdf5"/></dir></dir></dir><file name="CatalogFeed.php" hash="f974cfdc687bf5edb3fdccb879547200"/><file name="HistoricalFeed.php" hash="a4d2b29c6d8bb2ed59aa884e02abc23b"/><file name="Overview.php" hash="51c8ed09153f1dc3b3d02aa0ab83f195"/><file name="RatingsFeed.php" hash="264cf15842c2738f1b77bce6ff9b9f0a"/><dir name="Review"><file name="Helper.php" hash="2ecc1a9252af9d40666b4f3a6603b522"/></dir><file name="ShowTabsAdminBlock.php" hash="403c3a8f95c65e361471b28fae25d2e3"/></dir><dir name="Helper"><file name="Data.php" hash="815707c134f0809156a3510fe4c1dfa3"/></dir><dir name="Model"><dir name="Catalog"><file name="Product.php" hash="5325442b4449b7eb75547f50698400a6"/></dir><file name="Observer.php" hash="ab972bf9ec9edb07345828fb4e69141d"/><file name="Rating.php" hash="2f3d43beb74018b394d7bf6ba1098e5c"/><dir name="Resource"><dir name="Rating"><file name="Collection.php" hash="2f0709f0f5f3bde0725c2db266f16e7d"/></dir><file name="Rating.php" hash="0a7f9415ba76c6e121e0f3281479a4df"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="d78518e5502f5c19ff02892e2fa9fe78"/><file name="TurntoController.php" hash="f8c35059af46ed080a7a2d28c917042b"/></dir><file name="IndexController.php" hash="770506bcae219ba1ffefa9f5d03bade8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2583ebaabc3e8844fe27e70d1b519f3a"/><file name="config.xml" hash="2c836a50bf4d822e08910300ec0188a1"/><file name="system.xml" hash="59125e06282c4feb985e4e8854092249"/></dir><dir name="sql"><dir name="turnto_admin_setup"><file name="mysql4-install-2.2.0.php" hash="747fc729ae7587b41c3f3cce62aba82b"/></dir></dir></dir><dir name="Login"><dir name="Block"><file name="Login.php" hash="a51bc0ee76d20a9f4cb32bb21420ecd9"/><file name="Reg.php" hash="4eece8d78391b6578b0ba5e2c764dba5"/></dir><dir name="Helper"><file name="Data.php" hash="e87f15957335101d5ae643befcc06817"/></dir><dir name="controllers"><file name="IndexController.php" hash="087867555ca6d8174fb1301f3b558720"/></dir><dir name="etc"><file name="config.xml" hash="104b76b3d6e9ecbd8d5411fb82703208"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Turnto_Admin.xml" hash="0932b63ab068e1e8b12ff7b997ae83ee"/><file name="Turnto_Login.xml" hash="734c463c75970bd14ac7d7a90fa2de11"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="turnto"><dir name="adminhtml"><dir name="system"><dir name="config"><file name="feed.phtml" hash="c4b453ab154a34408bc34021630653bf"/></dir></dir></dir><file name="catalog_feed_tab.phtml" hash="1fd3b2a33022b15b84906e6cb93c1098"/><file name="historical_feed_tab.phtml" hash="14b3a1940e98f3f44db732afd1c81946"/><file name="overview.phtml" hash="4cc20b32c3b0cd36cd349f0be44e4615"/><file name="product_ratings_feed_tab.phtml" hash="3733a056ab45f0af0b6a93ea30e257e0"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="turnto"><dir name="login"><file name="login.phtml" hash="7ec602a8ca09180f324229a77ea3e2db"/><file name="login_form.phtml" hash="a176124e54fc105d09e8a219114d9cfe"/><file name="reg.phtml" hash="7ec602a8ca09180f324229a77ea3e2db"/><file name="reg_form.phtml" hash="8d513aa7b9b582f748f5a484f2e81568"/></dir></dir></dir><dir name="layout"><file name="turnto_login.xml" hash="e9c1993c14add5a7be5c4079547d3609"/></dir></dir></dir></dir></target></contents>
|
| 29 |
<compatible/>
|
| 30 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
| 31 |
</package>
|
