Magento 2: I need to get Current quote data from checkout cart model in Custom cron jobcommands need to be execute to run cron jobDoes Magento Cron Job reindex data now?Magento 2 cron job for custom moduleMagento cron job disappearingI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existGet pending cron job by nameTurning off custom cron jobMagento need cron job? if i remove cronMagento 2 How to remove price filter from category if module is enable?
Extreme, but not acceptable situation and I can't start the work tomorrow morning
Are white and non-white police officers equally likely to kill black suspects?
Doomsday-clock for my fantasy planet
map list to bin numbers
Why doesn't a const reference extend the life of a temporary object passed via a function?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
Ideas for 3rd eye abilities
Is this food a bread or a loaf?
Lied on resume at previous job
Add an angle to a sphere
Is "plugging out" electronic devices an American expression?
"listening to me about as much as you're listening to this pole here"
What is the meaning of "of trouble" in the following sentence?
Is there a familial term for apples and pears?
How to move the player while also allowing forces to affect it
New order #4: World
What causes the sudden spool-up sound from an F-16 when enabling afterburner?
Is there a way to make member function NOT callable from constructor?
LWC and complex parameters
A poker game description that does not feel gimmicky
What is the offset in a seaplane's hull?
What does 'script /dev/null' do?
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Finding files for which a command fails
Magento 2: I need to get Current quote data from checkout cart model in Custom cron job
commands need to be execute to run cron jobDoes Magento Cron Job reindex data now?Magento 2 cron job for custom moduleMagento cron job disappearingI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existGet pending cron job by nameTurning off custom cron jobMagento need cron job? if i remove cronMagento 2 How to remove price filter from category if module is enable?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to get current quote data for cronjob in cron/run.php. But it's not working.
Please check my code. I am stuck with this. Magento2 version is CE 2.2.6
namespace ABCAbandonCron;
use PsrLogLoggerInterface;
class Run
protected $logger;
protected $scopeConfig;
public function __construct(
LoggerInterface $logger,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
$this->logger = $logger;
$this->scopeConfig = $scopeConfig;
public function execute()
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObj = $objectManager->get('MagentoCheckoutModelCart');
$quoteId = $cartObj->getQuote()->getId();
$itemsArray = $cartObj->getQuote()->getAllItems();
foreach($itemsArray as $item)
$productName[] = $item->getName();
if(is_array($productName))
$productNames .= implode(';',$productName);
$abdata['productNames'] = $productNames;
$abdata['quoteid'] = $quoteId;
return $abdata;
magento2 cron
add a comment |
I want to get current quote data for cronjob in cron/run.php. But it's not working.
Please check my code. I am stuck with this. Magento2 version is CE 2.2.6
namespace ABCAbandonCron;
use PsrLogLoggerInterface;
class Run
protected $logger;
protected $scopeConfig;
public function __construct(
LoggerInterface $logger,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
$this->logger = $logger;
$this->scopeConfig = $scopeConfig;
public function execute()
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObj = $objectManager->get('MagentoCheckoutModelCart');
$quoteId = $cartObj->getQuote()->getId();
$itemsArray = $cartObj->getQuote()->getAllItems();
foreach($itemsArray as $item)
$productName[] = $item->getName();
if(is_array($productName))
$productNames .= implode(';',$productName);
$abdata['productNames'] = $productNames;
$abdata['quoteid'] = $quoteId;
return $abdata;
magento2 cron
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
Can you share the code?
– Shiwani
Apr 5 at 13:00
add a comment |
I want to get current quote data for cronjob in cron/run.php. But it's not working.
Please check my code. I am stuck with this. Magento2 version is CE 2.2.6
namespace ABCAbandonCron;
use PsrLogLoggerInterface;
class Run
protected $logger;
protected $scopeConfig;
public function __construct(
LoggerInterface $logger,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
$this->logger = $logger;
$this->scopeConfig = $scopeConfig;
public function execute()
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObj = $objectManager->get('MagentoCheckoutModelCart');
$quoteId = $cartObj->getQuote()->getId();
$itemsArray = $cartObj->getQuote()->getAllItems();
foreach($itemsArray as $item)
$productName[] = $item->getName();
if(is_array($productName))
$productNames .= implode(';',$productName);
$abdata['productNames'] = $productNames;
$abdata['quoteid'] = $quoteId;
return $abdata;
magento2 cron
I want to get current quote data for cronjob in cron/run.php. But it's not working.
Please check my code. I am stuck with this. Magento2 version is CE 2.2.6
namespace ABCAbandonCron;
use PsrLogLoggerInterface;
class Run
protected $logger;
protected $scopeConfig;
public function __construct(
LoggerInterface $logger,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
$this->logger = $logger;
$this->scopeConfig = $scopeConfig;
public function execute()
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cartObj = $objectManager->get('MagentoCheckoutModelCart');
$quoteId = $cartObj->getQuote()->getId();
$itemsArray = $cartObj->getQuote()->getAllItems();
foreach($itemsArray as $item)
$productName[] = $item->getName();
if(is_array($productName))
$productNames .= implode(';',$productName);
$abdata['productNames'] = $productNames;
$abdata['quoteid'] = $quoteId;
return $abdata;
magento2 cron
magento2 cron
edited Apr 5 at 11:26
Ashish Viradiya
1,2301831
1,2301831
asked Apr 5 at 10:10
ShiwaniShiwani
145
145
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
Can you share the code?
– Shiwani
Apr 5 at 13:00
add a comment |
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
Can you share the code?
– Shiwani
Apr 5 at 13:00
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
Can you share the code?
– Shiwani
Apr 5 at 13:00
Can you share the code?
– Shiwani
Apr 5 at 13:00
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268919%2fmagento-2-i-need-to-get-current-quote-data-from-checkout-cart-model-in-custom-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268919%2fmagento-2-i-need-to-get-current-quote-data-from-checkout-cart-model-in-custom-c%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What should the "current quote" be in cron context? Usually a user has a session and when something is added to cart a quote is created and assigned to that session (i.e. the quote id is kept in the session) - whitout such session data there is no "current quote".
– HelgeB
Apr 5 at 12:17
Can you share the code?
– Shiwani
Apr 5 at 13:00