Hi there
We upgraded from CSVI 5.2.1 to CSVI 6.4.3. We created a new template and everything is working except the jform command from the cronjob to have a certain range of date in the export file. We have changed the cronjob accordingly to your website.
Old cronjob (which worked for years):
/usr/local/bin/php /home/xxx/www/xxx/administrator/components/com_csvi/helper/cron.php username="USER" passwd="PW" template_id="1" jformrderrderdatestart=$(date -v-5d +"\%d-\%m-\%Y" >/dev/null 2>&1
New cron job:
/usr/local/bin/php /home/xxx/www/xxx/administrator/components/com_csvi/helper/cron.php username="USER" passwd="PW" --key="winter" --template_id="1" jformrderrderdatestart=$(date -v-5d +"\%d-\%m-\%Y" >/dev/null 2>&1
The new cron job generate the file but with all orders from the whole database. It looks as the jform command is not working anymore with CSVI 6. Can you give us a hint?
Accepted Answer
Pending Moderation
Hello,
The jform format no longer works in CSVI 6 indeed. Which date range is that? I can't get that code to work to get me a range.
What you can do, is set the Date range in the template to Last Run and in your cron job schedule how often you want to run it, for example every 5 days (guessing from the date syntax). That should give you the same output.
Or do you want to run this every day and get the last 5 days?
The jform format no longer works in CSVI 6 indeed. Which date range is that? I can't get that code to work to get me a range.
What you can do, is set the Date range in the template to Last Run and in your cron job schedule how often you want to run it, for example every 5 days (guessing from the date syntax). That should give you the same output.
Or do you want to run this every day and get the last 5 days?
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hello,
We need the cron job to run all 5 Minutes. And on each run must have the output of the last 5 days. So last run does not work.
Is there another possibility?
We need the cron job to run all 5 Minutes. And on each run must have the output of the last 5 days. So last run does not work.
Is there another possibility?
Accepted Answer
Pending Moderation
Hello,
Attaches is a new cron patch file that you can load via the Maintenance menu. Once you have that done, the option to add command line parameters can be used again.
The parameters will need to be added in the form of:
Give that a try and let me know how it goes.
Attaches is a new cron patch file that you can load via the Maintenance menu. Once you have that done, the option to add command line parameters can be used again.
The parameters will need to be added in the form of:
--form.orderdatestart=xxx
Give that a try and let me know how it goes.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hello,
I did accordingly and have copied the cron.php to the right location on the server.
Here is my new php line:
/usr/local/bin/php /home/xxx/www/xxx/administrator/components/com_csvi/helper/cron.php username="User" passwd="pwd" --key="key" --template_id="1" --form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
But now the following error occurs:
Use --help to see the help information
Processing started...
Template virtuemartxml
PHP Fatal error: Call to undefined method CsviHelperTemplate::getEnabled() in /home/emetal1/www/http://kingnature.ch/administrator/components/com_csvi/helper/cron.php on line 239
Fatal error: Call to undefined method CsviHelperTemplate::getEnabled() in /home/emetal1/www/http://kingnature.ch/administrator/components/com_csvi/helper/cron.php on line 239
I did accordingly and have copied the cron.php to the right location on the server.
Here is my new php line:
/usr/local/bin/php /home/xxx/www/xxx/administrator/components/com_csvi/helper/cron.php username="User" passwd="pwd" --key="key" --template_id="1" --form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
But now the following error occurs:
Use --help to see the help information
Processing started...
Template virtuemartxml
PHP Fatal error: Call to undefined method CsviHelperTemplate::getEnabled() in /home/emetal1/www/http://kingnature.ch/administrator/components/com_csvi/helper/cron.php on line 239
Fatal error: Call to undefined method CsviHelperTemplate::getEnabled() in /home/emetal1/www/http://kingnature.ch/administrator/components/com_csvi/helper/cron.php on line 239
Accepted Answer
Pending Moderation
Ha,
So the command line argument is working but I sent you a too new of a file. I have attached the cron file for your CSVI version. That should make it good to go.
So the command line argument is working but I sent you a too new of a file. I have attached the cron file for your CSVI version. That should make it good to go.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
The cron job is now working without error. But it exports the full xml. Not just the last 5 days. It might be the command must be different then the one we have put in.
Actual command
--form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
Any ideas?
Actual command
--form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
Any ideas?
Accepted Answer
Pending Moderation
Please post the debug log so I can see what CSVI is doing.
The actual command looks good to me.
The actual command looks good to me.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Here is the debug:
Use --help to see the help information
Processing started...
Template virtuemartxml
The xml file is exported and created. But it containts not just the last 5 days but the all orders of the database.
Use --help to see the help information
Processing started...
Template virtuemartxml
The xml file is exported and created. But it containts not just the last 5 days but the all orders of the database.
Accepted Answer
Pending Moderation
Hello,
That is not the debug but the output of the cron command
Please check the link at the top of the page under Looking for a useful answer? It explains where to get the debug information.
That is not the debug but the output of the cron command
Please check the link at the top of the page under Looking for a useful answer? It explains where to get the debug information.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
No worries, with the debug log I can see a lot now.
The orderdatestart does come through into the template but only as number 14. This was a mistake by me in the code and fixed in the attached updated patch file.
The Date range is still set to This week, so this needs to be set back to Don't use otherwise your order date start won't be used.
With these two changes, see how the export looks like. If it still isn't right, please post the new debug log.
The orderdatestart does come through into the template but only as number 14. This was a mistake by me in the code and fixed in the attached updated patch file.
The Date range is still set to This week, so this needs to be set back to Don't use otherwise your order date start won't be used.
With these two changes, see how the export looks like. If it still isn't right, please post the new debug log.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hello,
We are getting somewhere. However I find it strange that you say you only get yesterday's output because if I look at the constraint
Perhaps it has something to do with the order status of needing to be U or C. I guess you do have orders older than yesterday right?
We are getting somewhere. However I find it strange that you say you only get yesterday's output because if I look at the constraint
WHERE `#__virtuemart_orders`.`created_on` >= '2016-01-14 00:00:00' AND `#__virtuemart_orders`.`order_status` IN ('U','C')
we can clearly see it takes orders created on and after the 14th of January.Perhaps it has something to do with the order status of needing to be U or C. I guess you do have orders older than yesterday right?
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
It is really somewhat strange. There are a lot of older orders, between 2016-01-14 to 2016-01-18 which should be in the export file. In the todays output (2016-01-20) there are just orders from 2016-01-18 and 2016-01-19. No orders from 2016-01-20 eventhough there are 3 orders of today. Honestly I dont see where the failure is.
Accepted Answer
Pending Moderation
Let's try something else, if you run this template manually do you then get all the orders from the last 5 days? You will have to put in the order date manually of course.
If you don't get all the orders again, if you remove the order status, do you get all the orders in that case?
If you don't get all the orders again, if you remove the order status, do you get all the orders in that case?
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
We found a small error in Virtuemart. My guy has fixed it. If I put in manually the start and end dates, it export it correctly. Also when it goes via cron job and when the start and end date are set in CSVI it runs correctly. With "Dont Use" it creates a large file with all the data. That means the cron job command with the data range has no effect.
The log with the manual range which has worked is attached.
The log with the manual range which has worked is attached.
Accepted Answer
Pending Moderation
With "Dont Use" it creates a large file with all the data. That means the cron job command with the data range has no effect.That statement is not correct because we can see in the query the created date filter is set in the query and you also said that it exports some orders but not all.
So I put the new and the previous debug log next to each other and they are pretty much exactly the same, only difference is the filter. See here the cron job:
WHERE `#__virtuemart_orders`.`created_on` >= '2016-01-14 00:00:00' AND `#__virtuemart_orders`.`order_status` IN ('U','C')
See here the manual job:WHERE `#__virtuemart_orders`.`created_on` >= '2016-01-13 16:06:56' AND `#__virtuemart_orders`.`created_on` <= '2016-01-20 16:06:59' AND `#__virtuemart_orders`.`order_status` IN ('U','C','S')
In the manual one you have added one more order status S, which is missing in the cronjob run and you have set an end date which is not set in the cron job.
I am thinking the omission of the S order status might account for the missing orders in your cron job run.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
You are right. The error was with the missing order S. But neverless. The problem is still here. Here again my settings:
1. I put in "Don't use" into the data range
2. I use the following command in the cron job: --form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
3. I added the order S (which in the end has nothing to do with the data range problem)
The output then is that the file contents all orders from the last 4 years. So the command in the cron job is not working as your also mentioned before. If we put in manually the data range in the CSVI it works. If we try to do that with the cron job it does not work. I see now 2 options:
1. We amend the cron job command so it works
2. We change the PHP in CSVI and change the option yesterday to the last 5 days. I think that might work too.
What do you propose?
1. I put in "Don't use" into the data range
2. I use the following command in the cron job: --form.orderdatestart=$(date -v-5d +"\%d-\%m-\%Y"
3. I added the order S (which in the end has nothing to do with the data range problem)
The output then is that the file contents all orders from the last 4 years. So the command in the cron job is not working as your also mentioned before. If we put in manually the data range in the CSVI it works. If we try to do that with the cron job it does not work. I see now 2 options:
1. We amend the cron job command so it works
2. We change the PHP in CSVI and change the option yesterday to the last 5 days. I think that might work too.
What do you propose?
Accepted Answer
Pending Moderation
Ok, so the order status S is not limiting the number of orders. At least that is clear.
As for your date command, I can't check that because that format is not supported by my server. However the log shows it as a regular 14-01-2016 date, so that all looks OK.
So the command in the cron job is not working as your also mentioned before.I still don't understand why because the query looks good. This is the query from a previous cron command
SELECT `#__virtuemart_orders`.`virtuemart_order_id`,
`address_1`,
`city`,
`company`,
`first_name`,
`last_name`,
`phone_1`,
`zip`,
`order_item_name`,
`order_shipment`,
`shipment_name`,
`#__virtuemart_orders`.`created_on`,
`payment_name`,
`user_info1`.`virtuemart_country_id`,
`product_item_price`,
`product_tax`,
`product_quantity`,
`user_info1`.`email`,
`customer_note`,
`order_billTax`,
`order_item_sku`,
`product_discountedPriceWithoutTax`,
`address_2`,
`title`,
`#__virtuemart_orders`.`virtuemart_shipmentmethod_id`
FROM `#__virtuemart_orders`
LEFT JOIN `#__virtuemart_order_items` ON `#__virtuemart_orders`.`virtuemart_order_id` = `#__virtuemart_order_items`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_order_userinfos` AS `user_info1` ON `#__virtuemart_orders`.`virtuemart_order_id` = `user_info1`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_orderstates` ON `#__virtuemart_orders`.`order_status` = `#__virtuemart_orderstates`.`order_status_code`
LEFT JOIN `#__virtuemart_product_manufacturers` ON `#__virtuemart_order_items`.`virtuemart_product_id` = `#__virtuemart_product_manufacturers`.`virtuemart_product_id`
LEFT JOIN `#__virtuemart_manufacturers` ON `#__virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = `#__virtuemart_manufacturers`.`virtuemart_manufacturer_id`
LEFT JOIN `#__users` ON `#__users`.`id` = `user_info1`.`virtuemart_user_id`
LEFT JOIN `#__virtuemart_countries` ON `#__virtuemart_countries`.`virtuemart_country_id` = `user_info1`.`virtuemart_country_id`
LEFT JOIN `#__virtuemart_invoices` ON `#__virtuemart_orders`.`virtuemart_order_id` = `#__virtuemart_invoices`.`virtuemart_order_id`
LEFT JOIN `#__virtuemart_paymentmethods_de_de` ON `#__virtuemart_orders`.`virtuemart_paymentmethod_id` = `#__virtuemart_paymentmethods_de_de`.`virtuemart_paymentmethod_id`
LEFT JOIN `#__virtuemart_shipmentmethods_de_de` ON `#__virtuemart_orders`.`virtuemart_shipmentmethod_id` = `#__virtuemart_shipmentmethods_de_de`.`virtuemart_shipmentmethod_id`
WHERE `#__virtuemart_orders`.`created_on` >= '2016-01-14 00:00:00' AND `#__virtuemart_orders`.`order_status` IN ('U','C')
when you run this query using PhpMyAdmin (change the #_ to your prefix), do you get only the orders since January 14th 2016?What do you propose?I would like to understand why you get all the orders. I don't see any issues with the query that retrieves the orders. The cron command should just work for you as it does for me here.
As for your date command, I can't check that because that format is not supported by my server. However the log shows it as a regular 14-01-2016 date, so that all looks OK.
Kind regards,
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
RolandD
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- Page :
- 1
- 2
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »