Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error at Settings -> Cron manager -> Calculate products prices (both manually and cron)


Recommended Posts

Posted (edited)

Hi,

 

below is the error I'm getting can someone help me plase?

@Ivan Holbi

 

console/app.log

Date: 2024-01-15 09:15:01
IP: -
Level: info
Category: application

Description:

$_GET = []
                    
$_POST = []

$_FILES = []

$_COOKIE = []

$_SERVER = [
    'MAILTO' => ''
    '_' => '/usr/local/bin/lsphp'
    'LANG' => 'en_US.UTF-8'
    'OLDPWD' => '/home/user_name'
    'XDG_SESSION_ID' => '191687'
    'USER' => 'user_name'
    'PWD' => '/home/user_name/public_html'
    'HOME' => '/home/user_name'
    'SHELL' => '/bin/bash'
    'SHLVL' => '1'
    'LOGNAME' => 'user_name'
    'DBUS_SESSION_BUS_ADDRESS' => 'unix:path=/run/user/1037/bus'
    'XDG_RUNTIME_DIR' => '/run/user/1037'
    'PATH' => '/usr/bin:/bin'
    'PHP_SELF' => ''
    'SCRIPT_NAME' => ''
    'SCRIPT_FILENAME' => 'yii.php'
    'PATH_TRANSLATED' => 'yii.php'
    'DOCUMENT_ROOT' => ''
    'REQUEST_TIME_FLOAT' => 1705310101.4622
    'REQUEST_TIME' => 1705310101
    'argv' => [
        0 => 'yii.php'
        1 => 'events/auto-calc-price-by-supplier'
        2 => '& '
    ]
    'argc' => 3
]

console/app.log

Date: 2024-01-15 09:15:01
IP: -
Level: error
Category: yii\console\UnknownCommandException

Description: 
yii\base\InvalidRouteException: Unable to resolve the request: events/auto-calc-price-by-supplier in /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Controller.php:149
                    Stack trace:
#0 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('auto-calc-price...', Array)
#1 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Module.php(552): yii\console\Controller->runAction('auto-calc-price...', Array)
#2 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('events/auto-cal...', Array)
#3 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('events/auto-cal...', Array)
#4 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))
#5 /home/user_name/public_html/yii.php(27): yii\base\Application->run()
#6 {main}

Next yii\console\UnknownCommandException: Unknown command "events/auto-calc-price-by-supplier". in /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php:183
Stack trace:
#0 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('events/auto-cal...', Array)
#1 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))
#2 /home/user_name/public_html/yii.php(27): yii\base\Application->run()
#3 {main}

console/app.log

Date: 2024-01-15 09:15:01
IP: -
Level: info
Category: application

Description:
                    php: 7.4.33
db_server: localhost
db_version: MySQL 5.5.5-10.6.16-MariaDB-cll-lve
osCommerce version: osCommerce 4.13.60075
osCommerce revision: 60075
DEFAULT_LANGUAGE: en
DEFAULT_CURRENCY: GBP
$_GET = []

$_POST = []

$_FILES = []

$_COOKIE = []

$_SERVER = [
    'MAILTO' => ''
    '_' => '/usr/local/bin/lsphp'
    'LANG' => 'en_US.UTF-8'
    'OLDPWD' => '/home/user_name'
    'XDG_SESSION_ID' => '191687'
    'USER' => 'user_name'
    'PWD' => '/home/user_name/public_html'
    'HOME' => '/home/user_name'
    'SHELL' => '/bin/bash'
    'SHLVL' => '1'
    'LOGNAME' => 'user_name'
    'DBUS_SESSION_BUS_ADDRESS' => 'unix:path=/run/user/1037/bus'
    'XDG_RUNTIME_DIR' => '/run/user/1037'
    'PATH' => '/usr/bin:/bin'
    'PHP_SELF' => ''
    'SCRIPT_NAME' => ''
    'SCRIPT_FILENAME' => 'yii.php'
    'PATH_TRANSLATED' => 'yii.php'
    'DOCUMENT_ROOT' => ''
    'REQUEST_TIME_FLOAT' => 1705310101.4622
    'REQUEST_TIME' => 1705310101
    'argv' => [
        0 => 'yii.php'
        1 => 'events/auto-calc-price-by-supplier'
        2 => '& '
    ]
    'argc' => 3
]

console/app.log

Date: 2024-01-15 09:15:01
IP: -
Level: error
Category: yii\console\UnknownCommandException

Description:
yii\base\InvalidRouteException: Unable to resolve the request: events/auto-calc-price-by-supplier in /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Controller.php:149
                    Stack trace:
#0 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('auto-calc-price...', Array)
#1 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Module.php(552): yii\console\Controller->runAction('auto-calc-price...', Array)
#2 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('events/auto-cal...', Array)
#3 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('events/auto-cal...', Array)
#4 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))
#5 /home/user_name/public_html/yii.php(27): yii\base\Application->run()
#6 {main}

Next yii\console\UnknownCommandException: Unknown command "events/auto-calc-price-by-supplier". in /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php:183
Stack trace:
#0 /home/user_name/public_html/lib/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('events/auto-cal...', Array)
#1 /home/user_name/public_html/lib/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest(Object(yii\console\Request))
#2 /home/user_name/public_html/yii.php(27): yii\base\Application->run()
#3 {main}

Edited by simon5968
  • simon5968 changed the title to Error at Settings -> Cron manager -> Calculate products prices (both manually and cron)
Posted

when i use start button to the left to run it I get this:

Quote

Calculate products prices
#!/usr/bin/env php Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/user_name/public_html/includes/application_top_console.php on line 15 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/user_name/public_html/includes/application_top_console.php on line 16 Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /home/user_name/public_html/includes/application_top_console.php on line 17 Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /home/user_name/public_html/includes/functions/sessions.php on line 90 Warning: session_name(): Cannot change session name when headers already sent in /home/user_name/public_html/includes/functions/sessions.php on line 160 Warning: session_save_path(): Cannot change save path when headers already sent in /home/user_name/public_html/includes/functions/sessions.php on line 176 Warning: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent in /home/user_name/public_html/includes/application_top_console.php on line 167 Unknown command: events/auto-calc-price-by-supplier

@Ivan Holbi

Posted
1 hour ago, simon5968 said:

below is the error I'm getting can someone help me plase?

Please edit this job, then turn on the Expert mode and change a command in arguments:

image.png.99b2376395a7e786aa2e5114d84497aa.png

Posted

OK I.ve done that and thank you for spotting that.

now my possable problem is, I have LISTING 6341 active 9322 in total will this do all of them Batch by Batch (of 1000) without needing to be run again or will it do one Batch of 1000 each time it runs knowing which products it has done?

Posted

now I'm getting a message as follows on all the first 1000 :

Quote
console/supplier.log
Date: 2024-01-15 12:10:03
IP: -
Level: info
Category: suppliers/auto-update-price

Description:
Autoupdate price for product #451: #Canceled - supplier price is empty

but this is not correct please see attached:

all of my products I spent one full day making sure each had a 

Screenshot 2024-01-15 123819.png

Screenshot 2024-01-15 123350.png

Screenshot 2024-01-15 123237.png

Screenshot 2024-01-15 110629.png

Posted

@Ivan Holbi @pandrei I not sure what's happing with this as the screenshots show all my products have a cost / net price / supplier price  and RRP price the only thing they do not have at time of uploading is the retail price set as this is workedout on Price based on cost (supplier) on Supplier rule ((PRICE-DISCOUNT+0.75)+MARGIN)+SURCHARGE, so as i can see all my uplaods are corect. given I have 9000+ products with 25000 images and all product have the correct images.

Posted
On 1/15/2024 at 2:08 PM, simon5968 said:

now my possable problem is, I have LISTING 6341 active 9322 in total will this do all of them Batch by Batch (of 1000) without needing to be run again or will it do one Batch of 1000 each time it runs knowing which products it has done?

Once the price of a product is calculated, it is considered calculated. A new calculation will start if you import suppliers for this product again.

On 1/15/2024 at 3:11 PM, simon5968 said:

 I not sure what's happing with this as the screenshots show all my products have a cost / net price / supplier price  and RRP price the only thing they do not have at time of uploading is the retail price set as this is workedout on Price based on cost (supplier) on Supplier rule ((PRICE-DISCOUNT+0.75)+MARGIN)+SURCHARGE, so as i can see all my uplaods are corect. given I have 9000+ products with 25000 images and all product have the correct images.

I see what you want. What happens if you open and save product #451? When you open it after saving, does the price change after auto calculation?

Also, in the last screenshot I see that you have the same problem that I answered you about earlier in this thread:

image.thumb.png.c6445d8a3735dc0f44c18f69d14536af.png

Posted
3 hours ago, pandrei said:

I see what you want. What happens if you open and save product #451? When you open it after saving, does the price change after auto calculation?

yes.

So the question is why is the cron job saying "supplier price is empty" what table column is it looking at?

3 hours ago, pandrei said:

Also, in the last screenshot I see that you have the same problem that I answered you about earlier in this thread:

I know I did not mean to upload it.

Posted

Thank you for the access.

There were two problems:

1. Empty path to php. So, the CronScheduler did not work. I set 'php' - it works for your case:

image.png.7f4a776c651b5cb62928b0cd004a0ad7.png

2. Suppliers, Categories and Brands should have default rule (for any currencies). I fixed it for supplier:

image.thumb.png.7a7e1b1a0032ead77e75f83d489f6f08.png

Now it works:

image.thumb.png.442100d69c2e0b9094011e7dfeb9deab.png

Posted

Is there a way I can have the corn to run at say 2:30am each day and for the corn-job to auto loop all the products instead of having to have the corn job set to run every x minutes? 

Posted
12 hours ago, simon5968 said:

Is there a way I can have the corn to run at say 2:30am each day and for the corn-job to auto loop all the products instead of having to have the corn job set to run every x minutes? 

Yes it is possible. You can change the timing of a cron job by editing the cron job. But to change the package size you will have to edit the php files.

What's the problem with starting every x minutes? If the job determines that all prices are set and there is nothing to do, then it takes microseconds.

Posted

I will be codeing a script to go to my suppliers site and get a list of there productes and there stock level and cost each day around 2:30am as the supplier updates there details at 2:15am each day. so the cron running every 5 minutes is just a wast until 2:30am when it only needs to be run between a set time each day.

Posted
15 hours ago, simon5968 said:

I will be codeing a script to go to my suppliers site and get a list of there productes and there stock level and cost each day around 2:30am as the supplier updates there details at 2:15am each day. so the cron running every 5 minutes is just a wast until 2:30am when it only needs to be run between a set time each day.

I see. As I said, you can change the timing of a cron job by editing the cron job.

To set the batch size, you should edit lib/console/controllers/EventsController.php:288

    public function actionAutoCalcProductPriceBySupplier()
    {
        \common\helpers\PriceFormula::batchProductAutoCalcPriceBySupplier(/* batch size */10000, /* time limit in millisec*/ 10000 ); 
    }

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...