1. mikekiy
  2. RO CSVI
  3. Thursday, 30 March 2017
  4.  Subscribe via email
Hello,

So we have a query. We are exporting Hikashop Orders and it works well, but we import into an accounts system and the accounts system needs a column to always have a value. For example, we export the 'Name' which is a custom Hikashop Company Name Field on the order, since admins can process orders. This isn't always filled out if there isn't a company purchasing, so we then need to fill this out with the users full name if the company name is empty.

I would expect to see an options / conditions tab on the field in CSVI, so we can say 'If Empty' Load Field: First Name & Last name

Is this at all possible? Or do we need to look at just using a custom SQL Export Query in PhpMyAdmin or similar?

Many thanks
Tony
Accepted Answer Pending Moderation
Hello Tony,
You can do this by writing your own custom code in override file for your import. Please have a look at Override for import/export document to know how you can create an override and how to use it on import.
Kind regards,

Tharuna

=========================
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. # 1
Accepted Answer Pending Moderation
Hello Tharuna,

I've looked at this and Im trying to adjust the data after the switches by using $this->fields->set('my_Field', 'my_field_value'); But it looks like a protected field. Can you advise how to update the value directly?

Many thanks
Tony
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Tony,
Are you trying to add your own field too? Your previous post says that you want to fill out company name with name if there is no company value set. If that is the case then as an example in order import, look for field billing_company_name and shipping_company_name. Add a if condition to check if they are empty, if yes fill it with name field.
Kind regards,

Tharuna

=========================
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. # 3
Accepted Answer Pending Moderation
I made the same question but for VirtueMart https://csvimproved.com/forum?view=topic&catid=44&id=33698

Now that I read this post just wanted to say that a future rule plugin would be really nice.

Conditional fields can be really useful both for import and exports with the "IF" condition as in his example.
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
We are looking into developing this conditional rule plugin. Will post the patch file when it is ready.
Kind regards,

Tharuna

=========================
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. # 5
Accepted Answer Pending Moderation
Hello,

It's ok I figured it out. I was being silly I was trying to re-set it with set but it had already been set into a protected property so I handled it at the top of the for each loop and then inserted the record value of x field if this field was X field and met Y value.

Many thanks
Tony
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Tony,
Glad to know that you figured it out :)
Kind regards,

Tharuna

=========================
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. # 7
  • Page :
  • 1


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