New Arrival Products in Magento - magento

My magento application use to change automatically the flag new arrival in all products as soon as they reach 2 weeks in the system. And now it is not happening anymore. The flag is located on Catalog > Manage Products > Tab Custom.
Could someone tell me where exactly in the code Magento sets this flag as true/false, please. And then I can investigate what is going on.
Thanks in advance.

As Bhavik Shah points out, it is likely the cron job is failing to run - try trigger the cron manually by hitting: http://yourstoreaddress.com/cron.php
Second step would be editing your cron.php in your store root to the below then turn on logging in System > Configuration > Developer > Log Settings:
Mage::app('admin')->setUseSessionInUrl(false);
try {
Mage::getConfig()->init()->loadEventObservers('crontab');
Mage::app()->addEventArea('crontab');
Mage::dispatchEvent('default');
Mage::log("Cron run"); //Add this line and you will get a log entry
} catch (Exception $e) {
Mage::printException($e);
}
This will tell you if the cron job was run and when in /var/log/system.log
Obviously check your PHP and server logs for any errors - also check the exceptions log under /var/log/exception.log
All this will hopefully help you in finding the root cause of the problem.

Related

Magento 1.9.2.2 Order Confirmation Email Not Sent To Customers

I have done virtually everything but this problem persists. Upon creating an order, the customer does not receive a confirmation email. The problem started some 6 months ago and it was On and Off until a month ago when it ceased sending completely. Please does anyone have any idea how I can fix this? Thanks.
NB: The cron is set correctly and is working properly.
In Magento 1.9.1 and above versions, the emails are not being sent directly during checkout but instead are being queued. The queue is being processed via your Magento cron jobs. Please ensure your cron jobs has been set up and is running correctly.
Ist check your cron if cron is running mail is definetly send other wise 1 more option you can take just do small change in core file-
Template.php is located in => /app/code/core/Mage/Core/Model/Email/Template.php
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
use
if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

Magento 1.9.1.0 Order Confirmation Emails - Not Sending

I've recently upgraded to Magento CE 1.9.1.0 and our order confirmation emails are not being sent to customers or the employees here that are setup to receive notifications.
I checked the Email Logs and don't see the emails hitting the server at all.
Emails come through from the Contact Form, New User Account Signup and a few test scripts I created on the server. I made sure that Disable Email Communications was set to "No".
Any ideas? They worked great in 1.7.0.2 before we upgraded.
Starting from Magento 1.9 the order confirmation emails are not sent during checkout anymore, instead they are sent with the Cron. To verify this works properly:
make sure your system Cron is up and running (you can check the Cron logs: /var/log/cron to verify that).
make sure Magento Cron is setup correctly and is running every some minutes. You should see something like this in the Crontab of your system:
*/5 * * * * /public_html/cron.sh
This schedules a task to run cron.sh every five minute. (More reading)
There are good extensions like AOE Scheduler in Magento that help you to monitor and manage Cron jobs.
An alternative way to this is to disable the Cron for these kind of emails (order confirmation). To do this you can go to this path:
public_html/app/code/core/Mage/Sales/Model/Order.php
Copy that file and bring it to this path (if the path doesn't exist create it):
public_html/app/code/local/Mage/Sales/Model/Order.php
And then change this line:
$mailer->setQueue($emailQueue)->send();
To:
$mailer->send();
However I recommend spending some time to setup the Cron instead. I think if they wanted to use Cron for these emails it's for a reason.
Just do a small change in order.php (public_html/app/code/core/Mage/Sales/Model/Order.php)
From
$mailer->setQueue($emailQueue)->send();
To
$mailer->send();
Solution is simple that i found.
go to System -> Configuration -> ASCHRODER EXTENSIONS -> SMTP -> Queue Configuration -> Queue Usage -> Never
Done!
Order Confirmation will be sent quickly. :)
Quick solution is:
Go to the following location: /app/code/core/Mage/Core/Model/Email/Template.php
Change Line 407
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
To:
if (!($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)) {
It will work.
Thanks Pankaj
Please ovewrite 'app/code/core/Mage/Sales/Model/Order.php' file.if you dont want to any changes in xml file so So just copy /app/code/core/Mage/Sales/Model/Order.php into /app/code/local/Mage/Sales/Model/Order.php and be sure to refresh the cache. and change
$mailer->setQueue($emailQueue)->send();
To
$mailer->send();
Goto /app/code/core/Mage/Core/Model/Email/Template.php
Below changes :
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {
To
if (false){
I had exactly the same problem. For me it was a local copy of the order.php that I had made some changes to in the past and that I had copied to \app\code\local\Mage\Sales\Model\Order.php.
Thus, the updated order.php of Magento 1.9.1.0 in the core directory was not in usage - causing the order confirmation emails not to be send automatically via the cron job.
I keep the fingers crossed that you suffer from the same issue.
Just add cron in cpanel or plesk panel. It will available on cpanel -> Advanced and click cron folder. Then proceed:
*/5 in the 'minute' field (may customize this)
* in the 'hour' field
* in the 'day' field
* in the 'month' field
* in the 'weekday' field
comment: http://www.yoursite.com/absolute/path/to/magento/cron.php
There are many answers but none worked for me. How i solved is that,
check that if your default template setup are there in the magento or not. Sometimes during installation its lost and actually "there is no email template by default in system to send your email". Please go to Admin side, System->Transactional Email-> by default you will find no template here. So add one by clicking on button 'Add new Email template. In Load default template panel select a template from the Template drop down suppose forgot Password and click and click Load Template. As earlier said no email template is associated with it so it will not be show in below. The bset thing is to go to install a fresh copy of magento in your local system navigate here and put that same content here and click Save Template button.
Then go to System->Configuration->Customer Configuration ->Password Options->Change the 'Forgot Email Template' dropdown to yours as added above .Happy . thus same thing you can also do for order ,shipment, new account etc.
To debug magento order mail issue regarding new order just run yoursite.com/cron.php
If you recieve any mail now then its cron issue.
You can fix con issue by setting cron in cpanel.

laravel cron tasks with liebig/cron

I'm trying to set up a CRON job for my laravel 4.2 app and am strugglng to get things to work.
I've created a command which works successfully from the command line. I first tried created a CRON task with my service provider but was unable to get this to work. I tried:
/usr/bin/php /var/www/vhosts/mydomin.co.uk/subdomains/golfmanager/httpdocs/artisan reminder:week
This does not appear to work
I then tried:
/usr/bin/lynx -dump /var/www/vhosts/mydomain.co.uk/subdomains/golfmanager/httpdocs/artisan reminder:week
That failed to work either. My understanding is Lynx is a browser? but I assume because all the traffic is re-routed this approach won't work for a Laravel app?
So I then installed the package [liebig/cron][1] with a view to getting that up and running. I created a cron task with an external provider 'cronservice' which appears to be triggering but I'm not getting the expected results from the task.
I have configured the package as described and have current placed the following in bootstratp/start.php
Event::listen('cron.collectJobs', function() {
Cron::add('reminder-week', '*/15 * * * *', function() {
echo "Running Task";
Artisan::call('reminder:week');
return true;
});
});
The package logs activity to a database. I can see a log entry suggesting it's fired but can't see an entry that the job has worked. Laravel log files suggest there is an httpfoundexception
I've not created a route for CRON - the readme suggests it's using an internal one?
I'm quite confused. I'd like to stick with the package approach and the external provider but not sure if I now need to create a route and how I can test the set up is correct and the jobs will work.
I've tried running the script from the browser `http://mydomain.com/cron.php?key=xxxxx' but that also throws an httpnotfound exception
ANy help appreciated to get this to work
I changed the Event::listen code to app/start/glopal.php and all working now.
Re-read the readme more carefully!

Magento Admin Backend Blank Page after login

i have a serious problem in Magento Admin Backend. After login its shows a BLANK Page. i used the same files and database in different server, there it was working fine but when i have transferred files into LIVE then Admin issues came. Please help me over this as i got frustrated from last some dayz. If you need any more dertails then plz ask but i need to resolve this soon. Link: http://studywings.com/index.php/admin/
Magento ver: 1.7
flush your magento root /var/cache folder and /var/session folders, It may have previous server session that may cause problems.
Otherwise disable all third party modules and try again. I think this will help
I had the Same problem,
i have also debug the any errors occured, i tried index.php file
ini_set('display_errors', 1);
error_reporting(E_ALL);
$_SERVER['MAGE_IS_DEVELOPER_MODE'] = true;
pleced above code in index.php file. after that i have tried admin login.
showing the errors are session related, header already send errors.
i have to add the code in root/index.php file in top add the following line.
ob_start();
after that tried the login its worked.
Cheers..!
Is url changes to this after click login button or not?
http://yourdomain.com/index.php/admin/index/index/key/(key value)/
if url changes but not not show the dashboard page then go to
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
make copy of this file
Find the code for setting session cookie parameters these started on line 77
Comment out the final three lines and be sure to remove the comma after $this->getCookie()->getPath(). You should end up with this:
// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
// $this->getCookie()->getDomain(),
// $this->getCookie()->isSecure(),
// $this->getCookie()->getHttponly()
also line 104 comment out :
//call_user_func_array('session_set_cookie_params', $cookieParams);
If there is no change in url after click login then try to uncomment display error and see error_log file of your server
I think this problem is due to file permissions. As you added files from one server to another, permissions might be get changed.. Try to give the permissions to all the files. Check this http://www.mage-shop.com/forum/threads/3-Magento-Admin-Backend-Blank-Page-Error
There are a number of things that can cause it, but it's most common after migrating to a new server, last time it happened to me it was an excessively low php memory_limit setting on the new server - the Admin part of the site uses a lot more resources per user than the frontend.
In general when having this issue:
Flush out your cache by emptying var/cache
Clear out sessions by emptying var/sessions
Check the magento error logs/reports for an error code in var\logs and var/reports
Turn on magento error logs in mysql if logging isn't already on! (look in core_config_data for WHERE path like 'dev/log/active'
Check if your php configuration is displaying errors
Check your apache/php error logs for more clues - memory errors will show up here for example
Try this solution
It sounds like you want to enable Developer mode. Add this to your .htaccess file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
You may also want to enable display errors in index.php:
ini_set('display_errors', 1);
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.
I've got a more detailed posting here:
http://www.molotovbliss.com/debugging-tips-and-tricks-with-magento-commerce
Consider also installing XDebug
Hope this helps you!
Just to complete the other answers....
I am upgrading a magento install, and got the same problem, in the end I had another folder inside of var/
magento/var/minifycache
Only worked after clear deleting the files inside of this folder.
I had the same problem after uninstalling an extension. I thought that clearing cache would be enough, and I did without success... later speaking with the technical team, they commented me that it did not work because I hace memcache installed, and needed to be done the cleaning via system - backend (that i coudl not see...)

Magento: Newsletters not going out

The problem i have is that i have created newsletter template, added few subscribers and i can add the template with subscribers into queue - all that works fine.
I can also run the cron.php from the browser - it runs without errors, but the damn e-mails are not going out anyway. For that reason i have not done the crontab -e and added the stuff into that file yet. As far as i see - it does not matter where you execute the file from - be it crontab, shell or browser - it should work in any case. And i can see that it is not working.
Any ideas?
Alan
May I suggest you take a look at the cron_schedule table of your database ?
As soon as the cron.php file has been called (should it be via crontab or via a browser request), there must be a line added to the table. The line is "newsletter_send_all".
If a previous "neswsletter_send_all" was scheduled it should be run and its status set to "success" and the new one to "pending". Or, if there's a problem, the warning message is stored in the cron_schedule table on the same line as the newsletter_send_all that failed.
If when running cron.php the cron_schedule table is not appended with a new line, there may be a problem with the config.xml file of the Newsletter module or with your cron settings in the admin configuration. About that last subject see : http://www.jnorton.co.uk/blog/setting-magento-cron-system
All the above may give you a few tracks.
Are any emails being sent from Magento? (such as order confirmations)? If not, you might need to setup your email sending options or the outgoing email settings on the server.
Navigate to Configuration>Admin>Security, select “No” in “Add Secret Key to URLs”, save configuration.
Src: http://www.magentocommerce.com/boards/viewthread/2424/P105/#

Resources