[RESOLVED] Can the Cron delete the trigger file?

  • Posts: 36
  • Thank you received: 1
8 years 6 months ago #239491

-- url of the page with the problem -- : htttp://www.safehomesreport.com
-- HikaShop version -- : 3.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Chrome latest
-- Error-message(debug-mod must be tuned on) -- : No Error, question

I'm importing products using the import products automatically feature: www.hikashop.com/support/support/documen...hop-import.html#cron
I write the csv file with the new product information when the file is loaded.
Is there a way to delete the csv AFTER the cron runs? Otherwise my process runs the same record over and over and over.
www.hikashop.com/support/support/documen...ron-task.html#server

I check for new files frequently (2 times every 5 minutes), so removing the file would be helpful.

Last edit: 8 years 5 months ago by joyhanawa. Reason: update subject

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 6 months ago #239518

Hi,

There is no option to do that.
That however sounds like a really good idea and is easy to add. Here is a new version of the plugin with that option.

File Attachment:

File Name: datafeed.zip
File Size:3 KB

Attachments:
Last edit: 8 years 6 months ago by nicolas.
The following user(s) said Thank You: joyhanawa

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1
8 years 6 months ago #239589

Thanks for the new code! I think I must be missing something.

I replaced my existing files in the /administrator/components/com_hikashop/extensions/plg_hikashop_datafeed directory and the /plugins/hikashop/datafeed directories.
I was able to change my setting in Hikashop - Product Cron Update
"DELETE_FILE_AFTER_IMPORT" to YES and I saved it, but it is not removing the file.

The Cron shows last run time 09:18, (one minute ago) and it has run 20 times since I made the change.
Do I need to clear cache?

Sorry, not sure what else I need to do to make this fix work.

Attachments:
Last edit: 8 years 6 months ago by joyhanawa. Reason: Adding the cron report

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 6 months ago #239610

Hi,

Try changing the line:

if($url && !empty($plugin->params['deletefile'])){
to:
if(!$url && !empty($plugin->params['deletefile'])){
in the plugin php file and that should help.

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1
8 years 6 months ago #239633

Hi Nicolas,
I added the ! but it isn't deleting the file.
Any ideas?

Last edit: 8 years 6 months ago by joyhanawa. Reason: simplifying

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 1
8 years 6 months ago #239985

Hi Nicolas,
I had to modify the code because my Joomla site is nested in a master domain the $path was not working. Here's my code... It works great! Thank you so much for adding this.
When you publish a new release can you modify the code to behave like this?

if(!$url && !empty($plugin->params)){
$deletefilepath=JPATH_ROOT.DS.(str_replace(JURI::base(),'',$path));
unlink($deletefilepath);

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 6 months ago #240239

Hi,

We will test that code and see if we include it like that or not for the next version.
Thank you for this report.

Please Log in or Create an account to join the conversation.

Time to create page: 0.121 seconds
Powered by Kunena Forum