Skip to content

Commit

Permalink
Multistore export orders
Browse files Browse the repository at this point in the history
  • Loading branch information
altravista committed Mar 23, 2022
1 parent c6a47cc commit 1bb7ebf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
38 changes: 19 additions & 19 deletions Controller/Adminhtml/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Index extends \Magento\Backend\App\Action
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $storeManager;

/**
* @var \Magento\Framework\ObjectManagerInterface
*/
*/
protected $objectManager;

/**
Expand Down Expand Up @@ -66,15 +66,15 @@ public function __construct(

/*
* Execute
*
*
*/
public function execute() {

# INIT FIELDS

$store_id = (int) $this->_request->getParam('store', 0);

if ($store_id === 0)
if ($store_id === 0)
{
$store_id = $this->_storeManager->getStore()->getId();
}
Expand All @@ -84,7 +84,7 @@ public function execute() {
$fdDebugEnabled = $this->_scopeConfig->getValue('feedaty_global/debug/debug_enabled', $scope_store);
$last4months = date('Y-m-d', strtotime("-4 months"));

# END INIT FIELDS
# END INIT FIELDS

# DEBUG

Expand All @@ -95,7 +95,7 @@ public function execute() {
$feedatyHelper->feedatyDebug($message, "FEEDATY CSV PARAMS");
}

# END DEBUG
# END DEBUG

# HANDLER

Expand All @@ -120,7 +120,7 @@ public function execute() {

$this->_csv->setDelimiter($delimiter);
$this->_csv->setEnclosure($enclosure);

# END HANDLER

# FORMAT DATA
Expand All @@ -139,15 +139,15 @@ public function execute() {

$tmp['Id'] = $item->getProductId();

$tmp['Url'] = $fd_oProduct->getUrlModel()->getUrl($fd_oProduct);
$tmp['Url'] = $fd_oProduct->setStoreId($item->getStoreId())->getUrlInStore();

if ($fd_oProduct->getImage() != "no_selection")
{
if ($fd_oProduct->getImage() != "no_selection")
{
// TODO: Use store manager
$store = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore();
$store = $this->_objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore($item->getStoreId());
$tmp['ImageUrl'] = $store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $fd_oProduct->getImage();
}
else
else
{
$tmp['ImageUrl'] = "";
}
Expand All @@ -158,13 +158,13 @@ public function execute() {

$row = [
$order->getId(),
$order->getBillingAddress()->getEmail(),
$order->getBillingAddress()->getEmail(),
$order->getCreatedAt(),
$item->getProductId(),
str_replace('"','""',$tmp['Name']),
$tmp['Url'],
$tmp['ImageUrl'],
$order->getBillingAddress()->getEmail(),
$order->getBillingAddress()->getEmail(),
$order->getCreatedAt(),
$item->getProductId(),
str_replace('"','""',$tmp['Name']),
$tmp['Url'],
$tmp['ImageUrl'],
"Magento".$productMetadata->getVersion()."CSV"
];

Expand Down
2 changes: 1 addition & 1 deletion Cron/Reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function execute()
$totalFeedatyRemovedReviews = $this->_webService->getTotalProductRemovedReviewsCount($storeId);

/**
* Get Feedaty Removed Reviews TotalResults Count
* Get Feedaty Mediated Reviews TotalResults Count
*/
$totalFeedatyMediatedReviews = $this->_webService->getTotalProductMediatedReviewsCount($storeId);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"AFL-3.0"
],

"version": "2.7.6-stable",
"version": "2.8.0-stable",


"type": "magento2-module",
Expand Down

0 comments on commit 1bb7ebf

Please sign in to comment.