export to csv/xls and email to address not working

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #223672

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5.29

We use Hikashop for employees to place orders for branded merchandise at our company. We have a custom payment method called 'Payroll Deduction'. Currently, when a order is placed via this payment method the Name, Order#, Total & order notes are manually added to a spreadsheet and then forwarded via email to Human Resources to process the deduction. This is done about once a week. I would like to use a mass action to automate this.

Here is what is needed:

- Only include orders in the report that use the 'payroll deduction' payment method
- Generate a csv or xls that includes the following fields: Name, Order#, Date, Total
- Report automatically ran once per week and emailed

I have created a mass action that is triggered every week, filtered by order_payment_method and shows the columns needed. However, I am having 2 issues:

1) Not sure how to make this only pull a report for orders in the last week - no option for date range
2) I can get it to display to the screen, but cannot get it to save to the export path or send via email

Pls advise

Thank you

Last edit: 8 years 11 months ago by dustinjc.

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #223674

I found a way to get it to write to the folder/file, but still no attachment in the email.

In administrator/components/com_hikashop/classes/massaction.php about line 2435 there is the following:

JFile::write($uploadFolder.$name, $data);

The value that is passed for $uploadFolder.$name in my case is: /home/countyma/public_html/\home\countyma\public_html\order-export\hr_payroll_deduct.csv

by changing this line to the following:

JFile::write($name, $data);

The value passed is:
\home\countyma\public_html\order-export\hr_payroll_deduct.csv

This is the correct path to the file and results in it being overwritten as intended.

Any idea why this is? I don't want to have to hack the class file to get this to work properly. Pls advise.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #223723

Hi,

Which version do you have ? We made improvements about this recently.
It is in the latest 2.6.0 version, yours probably doesn't have the latest hot fixes.

Please try to download this latest version from our website and install it on yours.

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #223757

Looks like I have the latest version. This is what is says in admin: "You have the latest stable version of HikaShop Business: 2.6.0"

Pls advise.

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

  • Posts: 112
  • Thank you received: 3
8 years 11 months ago #223820

I am running into the same problem on cleanearnow.com where the file is showing up in the /tmp folder as it is supposed to and an email is sent to the specified address. But, the email is empty. It does not contain the css file. I am using Hikashop 2.6.0.

Last edit: 8 years 11 months ago by tbroderick.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #223767

Hi,

My bad, I think I don't explained correctly.
You have the 2.6.0 which is the latest version number, but we released new packages still with the version number 2.6.0 but with some fixes. So the latest 2.6.0 doesn't have the same content than the first 2.6.0.

That's why I asked to download and install again this version ;)

If that doesn't solve your issue, then a backend and FTP access will allow us to debug the issue on your end directly.
These informations can be sent via our contact form with a link to this topic in your message:
hikashop.com/support/contact-us.html

The following user(s) said Thank You: tbroderick

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

  • Posts: 112
  • Thank you received: 3
8 years 11 months ago #223927

Worked...Thanks!

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #224273

This did not work for me (updated to com_hikashop_business_v2.6.0_2015-12-15_19-44-32.zip). Still no file saved in the destination director and no attachment in email. Pls advise.

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

  • Posts: 112
  • Thank you received: 3
8 years 11 months ago #224277

One thing I forgot to do on my first attempt was name the file. So, in my case, it was: /tmp/test.csv

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #224278

File is named - the only way I can get the file to show up in the folder is by hacking the core as mentioned above.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #224320

Hi,

What path do you have set ?
In your case I think that you must fill the field with: \order-export\hr_payroll_deduct.csv

If that doesn't solve your issue, then a backend and FTP access will allow us to debug the issue on your end directly.
These informations can be sent via our contact form with a link to this topic in your message:
hikashop.com/support/contact-us.html

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #224429

That is the path I have - still not working. Also tried putting in in /tmp/hr_payroll_deduct.csv. Not working there either. I will submit the FTP/backend info as requested.

Thank you

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #224448

Hi,

Problem solved, and thanks to you we correct an issue about that on our end.
There was an issue with the slashes and backslashes for the root path, we were not setting them correctly in some cases.

The following user(s) said Thank You: dustinjc

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #224491

Thank you! Working as expected - the csv is being delivered to the email address entered. To make this report complete I need one more thing. How would I go about only including orders within a date range? Specifically, this report should only include orders for the past 7 days.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #224493

Hi,

You can filter on an order date column like "order_created" or "order_modified" based on what you want and filter on ">=" "{time}-604800" (7 days in seconds)

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 11 months ago #224620

Perfect! Thank you. I really appreciate your prompt help with everything! One additional question: With a trigger set to 'Every weeks' what day/time does that occur?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 11 months ago #224685

When you save your first mass action using that trigger, the system will launch the mass action in the next call of the cron task.
That will set the start of the week.
There is no option to change it. You'll have to go in your phpmyadmin and open the table hikashop_config your database. There, you can change the value of the entry with the namekey massaction_last_trigger_week
The value needs to be the unix timestamp of the date/time one week before the date/time that you want the mass action to be triggered next time.

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 10 months ago #225273

For some reason none of my mass actions are triggering. The one you helped me with here is set to occur once per week. I have one other that is set to occur daily. Neither are happening on their own. The only way I can get them to work is by manually pressing the 'process' button in the administrator. Is there something else I need to do to get cron tasks to work?

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #225284

Hi,

Are you sure that your cron settings are correct under Configuration > Cron ?
There you should see the last execution date. On your account on our website, you must have fill the url of your website for the subscription site option: www.hikashop.com/my-account/your-subscriptions.html

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

  • Posts: 176
  • Thank you received: 5
  • Hikashop Business
8 years 10 months ago #225323

Ok - got it set up in my account. However, when going to "Create/edit cron task" I receive the following error: "Error triggering your website on the url: www.xxxxxxxx.com/index.php?option=com_hi...&ctrl=cron&no_html=1 " Is this a concern?

Last edit: 8 years 10 months ago by dustinjc. Reason: censor domain url

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

Time to create page: 0.116 seconds
Powered by Kunena Forum