How to ad extra fields to the csv file /massaction

  • Posts: 138
  • Thank you received: 1
10 years 3 months ago #173135

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : ?
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : no error

Hello,

We export the orderdetails by massaction in a csv file. This works fine now but we want some extra fields in the file. For example we did check the box adres. So the file is showing the adress. But before the adres we want another field. In this field we want standard data. So this data is not depending on the order or the customer. For example we want in the first field our company name: Extreme. Then in the second one we want the adres etc and then in the 4 we want another standard value.

Where can we ad these extra fields and standard data? If its code do you have some code?

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
10 years 3 months ago #173147

Hi,

You would have to edit the file administrator/components/com_hikashop/classes/massaction.php and change the code of the _exportCSV function for that.
Or you could creatre a new hikashop plugin implementing the mass action triggers (not yet documented but you can look at the system/massaction and hikashop/massactionorder plugins for some examples. That second method would allow you to develop your modifications without loosing them when you update HikaShop but it's more complex to do it.
In both cases, it requires strong PHP knowledge.

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #173799

Hi,

So we are thinking it would be possible to it without a lot of problems if we do it like this:

We go to the joomlabackend and accept the box for order_id. We dont need this in our csv file but we need it for the next step. We then go to the file administrator/components/com_hikashop/classes/massaction.php and search for the php code wich is telling what it should show when this box is accepted. We then take away this code and just put a simple code in like this:

<?php
echo "The name of the company";
?>

The result will be that we get the name of our company in the csv file and we just do this with a few more boxes and its the way we want it.

So if this would work wich php part of for example the order_id should we replace / take away? Could you help us with this?

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
10 years 2 months ago #173846

Hi,

It's easier than that.
In that function, you have the lines:
$export->writeLine($row);
which writes the lines of the CSV. So just before it, add in the $row array the elements that you want.

You can also contact our partners for a quote for the development so that they do it for you:
www.hikashop.com/home/our-partners.html

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #173951

Hi thanks for that. We should be able to do that ourself. However there is a new problem. We updated the hikashop version as you recommended and now we are back to zero... The massaction is again not showing the adress information. Instead it is showing nothing.. just this:


order_number shipping_address_id shipping_order_id billing_address_id billing_order_id

Things we not even linked. We did not change anything to the php file. Hopefully you can fix it. If you want you can still use the ftp login to get in.

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
10 years 2 months ago #173989

Hi,

Which package did you downloaded ?
The HikaShop starter package got a strange encoding problem that is fixed now ; the encoding problem could introduce problems with "downloadable content" like the CSV generation.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #174066

We donwloaded teh last bussniss package. We did not upload the last starterpackage. Why would we?

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
10 years 2 months ago #174107

Hi,

It's just that some users have several websites, one with licence or other without. So I preferred to be sure !

When you updated HikaShop, all files were restored to the original, so if you modified some HikaShop core files, your modification are erased.
Please check that the file "administrator/components/com_hikashop/classes/massaction.php" is not saved with the encoding "UTF8", this encoding can add a special blank character that your webserver will read and send as content (and break the possibility to change the header afterwards).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #174122

First of all you people made a change... See above conversation. Second how do i check this? Im not a php person. PLease i would love to get this standard option in bussinesmodel to work after spending so much time on it.

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

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
10 years 2 months ago #174124

Hi,

The HikaShop 2.3.3 package is the same than HikaShop 2.3.2 except for the security and the Joomla 3.3.4 patches.

You told us about a problem and I remember that we got a trouble in the starter package which could explain such kind of trouble ; but I'm not saying that it is the problem.
Currently we do not have any access or details to explain what the problem is, I just made a speculation on something that we solved recently which could probably make the same kind of problem.

For the moment, I do not understand your last message, I do not know about what you're talking about, the HikaShop version you were using before the 2.3.3 update, what is the real problem with the download of the CSV, if you got some error message in your PHP error log, etc.

Please understand that I just made a speculation on a possible idea for the idea of the problem you got.
If you want to help us to help you, we will require more details about your configuration and maybe some accesses to see the problem directly.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
10 years 2 months ago #174266

Hi,

It's normal that you have the problem again after the update as the fix was not release in the 2.3.3 since it is just a security release. The fix will be included in the 2.3.4 version to be released soon.
Replace the file administrator/components/com_hikashop/classes/massaction.php with the one in the archive enclosed and that should fix the problem.

File Attachment:

File Name: massaction...0-03.zip
File Size:16 KB

Attachments:
The following user(s) said Thank You: extreme

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #174270

Thanks all is fine with the world ;)

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

  • Posts: 138
  • Thank you received: 1
10 years 2 months ago #174537

Fow who is interested we got the extra fields etc to work by hardcoding the fields. As described above.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum