1. kingnature
  2. RO CSVI
  3. Friday, 15 January 2016
  4.  Subscribe via email
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" jform:order:orderdatestart=$(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" jform:order:orderdatestart=$(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
Well done. We have updated to Joomla 3.4.8. and updated also CSVI to 6.5. Now the cron job is running as it should. Thanks for your engagement!
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Joomla, FTP and a way to trigger the cron job command. I can understand if SSH access can't be provided, but perhaps access to cPanel to trigger the cron job.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
I will send you access details. Which access do you need?
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Ok, frankly, this makes no sense to me :) CSVI is executing the same query and the export file has all orders. I am out of ideas as to why it would export all orders running the job but only the limited ones when the query is executed via PhpMyAdmin.

As I cannot reproduce it here either, troubleshooting is difficult. If you can provide me access details I can take a look at the system myself and see if I can determine what is happening. You can send them in a private message.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Ups, my mistake. I have corrected it.
Now all orders from 14-01-2016 till 25-01-2016 appear.
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello,

There is a mistake in the prefix replace, emetal1__virtuemart_orders that should be emetal1_virtuemart_orders. If there is an error, you wouldn't get any orders :)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
I executed the query in MySQL. Here is the error:

MySQL report: documentation:
#1054 - Unknown column 'emetal1__virtuemart_orders.created_on' in 'field list'
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Ok, so the order status S is not limiting the number of orders. At least that is clear.

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
  1. more than a month ago
  2. RO CSVI
  3. # 8
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. more than a month ago
  2. RO CSVI
  3. # 9
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
  1. more than a month ago
  2. RO CSVI
  3. # 10
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.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 11
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?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
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.
  1. more than a month ago
  2. RO CSVI
  3. # 13
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
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
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
The debug log looks better. Strange enough I switched back to "Don't use", but now the output is just from yesterday instead of the last 5 days. The new debug log is attached.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 15
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.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Sorry about. Attached is the log file.
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 17
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.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 18
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.
  1. more than a month ago
  2. RO CSVI
  3. # 19
Accepted Answer Pending Moderation
Please post the debug log so I can see what CSVI is doing.

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
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!