1. ArchiStrateG
  2. RO CSVI
  3. Thursday, 07 February 2019
  4.  Subscribe via email
Hi all. Help me please.

May I hide a line with an empty field from XML export file for some items ?
For example, I have some items with saleprice. When I exprot saleprice in XML line <saleprice> I got an empty value for items without discount. May I hide this line from XML file ? I ask about it because some marketplace mark a lines without a value like an error and reject such file.

Now I have:
Item 1
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
Item 2
<product_name>Проектор Excelvan CL720 LED</product_name>
<salesprice></salesprice>
<product_price>5740.65</product_price>

But I need to get such view for an Item 2
<product_name>Проектор Excelvan CL720 LED</product_name>
<product_price>5740.65</product_price>

Template and export file are attached
Accepted Answer Pending Moderation
Hello,
You can use CSVI Skip rule plugin to hide the rows with empty saleprice value. Remember that in the rule you need to set Values to match field as empty.
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
Tharuna, thank you for your reply.

I have tried this type of rule but it skip whole item at all, not a one empty line.
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,
There is no such possibility to remove only the single item, skip rule will remove the entire row.
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 have a reverse result. When I applicate a skip rule with a Skip empty fields option for a field which may be an empty for some items, there are not at all such items in an export file. But I need to skip just a line with an empty field, not whole item.

For this situation
Item 1
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
Item 2
<product_name>Проектор Excelvan CL720 LED</product_name>
<salesprice></salesprice>
<product_price>5740.65</product_price>

I receive this one:
Item 1
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
Item 2

But I need to get this one:
Item 1
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
Item 2
<product_name>Проектор Excelvan CL720 LED</product_name>
<product_price>5740.65</product_price>

How can I get this with CSVI ?
A template with the rule and export file are attached
csvi_templates_pro-ekran.geleos.net_20190207.xml exportttest.xml
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,
It is not possible to remove one line with any of the current CSVI rules. You can only remove whole item with Skip rule plugin.

You can try to write your own plugin to get this functionality.
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
Am I only man who need this possibility ?
I have a lot of problem with our marketpalces without such option. Maybe I'm not only one with such difficults.

What about include it in the next CSVI update ?
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello,
We will add a setting in template to include empty nodes or not for a export XML file. We will develop this feature and send you the patch file for testing.
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
Accepted Answer Pending Moderation
Thank you very much!
How much time is needed for it?

Also I need that this setting will work for such kind of an empty records
<param name="Diagonal"></param>

And will I be able to apply this setting to another template because this one is just a demo template to show what I need ?
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello,
How much time is needed for it?

Code is ready with this feature and is attached with patch file. All you need to do is

1. Load the patch file using CSVI Maintenance menu.
2. In your export template settings on XML Layout, set Include empty node values to No. Save the template.
3. Run the export.

Also I need that this setting will work for such kind of an empty records
<param name="Diagonal"></param>

And will I be able to apply this setting to another template because this one is just a demo template to show what I need ?

This will work unless you have the node setup in XML layout in export template settings and it is one of the CSVI export template field.

patch_xml_2019_02_08.zip
Attachments (1)
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. # 9
Accepted Answer Pending Moderation
Tharuna, thank you very much for so fast solution of my problem!
For fields like <field></field> it works very well.
But still 1 question about a name field like this <param name="field">
Now I named a Column header of a field like <param name="Гарантия, мес">
and get in the file
<param name="Гарантия, мес">6</param name="Гарантия, мес">
But I need a
<param name="Гарантия, мес">6</param>
How can I get such result?
Will the rule of Multireplace work on layout ? Dont think so.
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello,
But still 1 question about a name field like this <param name="field">
Now I named a Column header of a field like <param name="Гарантия, мес">
and get in the file
<param name="Гарантия, мес">6</param name="Гарантия, мес">

What you set in column header is what is used as a node name. Since you set the column header as <param name="Гарантия, мес">, node name is created same as the column header.

But I need a
<param name="Гарантия, мес">6</param>
How can I get such result?

Why not set this node in XML layout tab in body section in your template settings? You can simply set in body field in XML layout tab as <param name="Гарантия, мес">[export_field_name]</param> and it should work. Note that export_field_name is the CSVI template field name.
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. # 11
Accepted Answer Pending Moderation
Now with such XML layout:
<offer id=[product_sku]>
<name>[product_name]</name>
<product_price>[product_price]</product_price>
<salesprice>[salesprice]</salesprice>
<param name="Диагональ экрана, дюймы">[waranty]</param>
</offer>

I receive such export file
<item>
<product_sku>100168</product_sku>
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
<waranty>1</waranty>
</item>

The empty fields are realy hidden, but I did'n get an XML layout like this
<item>
<offer id=100168>
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
<param name="Диагональ экрана, дюймы">1<param>
</item>

The template and export file are attached
csvi_templates_pro-ekran.geleos.net_20190208.xml exportttest.xml
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello,
The empty fields are realy hidden, but I did'n get an XML layout like this
<item>
<offer id=100168>
<product_name>Проектор UNIC UC46 WiFi</product_name>
<salesprice>2990</salesprice>
<product_price>3074.29</product_price>
<param name="Диагональ экрана, дюймы">1<param>
</item>

You need to set the columns headers to change the node name as in the attached picture. Of course i don't have warranty custom field so i have used CSVI custom field and added a default value. This screenshot is just an example on how to set the column header to get the needed node names.

Now the real problem is getting the attribute id=100168 and name="Диагональ экрана, дюймы" in your XML. There is no option in CSVI to add this attribute to XML layout. What you can do is, try creating your own export XML handler in the folder administrator/components/com_csvi/helper/file/export/xml. Duplicate csvimproved.php file in the folder and rename the file to say csvimprovedcustom.php. Edit the file and change the class name in the file CsviHelperFileExportXmlCsvimproved to class CsviHelperFileExportXmlCsvimprovedcustom, where csvimprovedcustom is the name of your new file. Now in the new file at around line 128 in the method element($column_header, $cdata = false), do the changes to include attribute for node names offer and param, save the file. Now edit your template and on File tab set set Website field to the csvimprovedcustom file handler you just created. This should help to fix your attribute issue.

Screenshot 2019-02-08 at 5.45.26 PM.png
Attachments (1)
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. # 13
Accepted Answer Pending Moderation

You need to set the columns headers to change the node name as in the attached picture.

Yes, I know it and have did it. But still get a result shown in my previous message. You may check my template.
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello,
There was no column headers set in the template you posted except for waranty field. Screenshot attached.

Screenshot 2019-02-08 at 6.06.18 PM.png
Attachments (1)
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. # 15
Accepted Answer Pending Moderation
But why column header name replace a XML layout
<param name="Диагональ экрана, дюймы">[waranty]</param>
and I receive
<waranty>1</waranty>
instead
<param name="Диагональ экрана, дюймы">1</param>
?

Correctly not replace but ignore XML layout, also like for this line
<offer id=[product_sku]>
I receive
<product_sku>100168</product_sku>
instead
<offer id=100168>

If the patch will not ignore the XML layout - I'll get what I need.
I'll be able to put all additional params like
<param name="Диагональ экрана, дюймы">1</param>
in to layout and CSVI just skip the lines for items with an empty values of this params.
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hello,

You posted your template but I cannot see one thing. Did you set the Website to custom as shown in attached screenshot? This is required to get the XML output to use your format like
<item>
<offer id=100168>


Does that answer your question?
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. # 17
Accepted Answer Pending Moderation
Oops. No I have not did it.
But now I swith it to custom and receive a column header name for fields with an emty values instead to skip them.
Maybe I do somethig wrong again ?
The template and the export files are attached
exportttest.xml csvi_templates_pro-ekran.geleos.net_20190213.xml
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 18
Accepted Answer Pending Moderation
Hello,
After the last patch we did little more improvements to the feature. I have attached the latest patch file here. Load the patch file from CSVI maintenance page and then try the export by setting the Website field to Custom.

patch_csvi_2019_02_14.zip
Attachments (1)
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. # 19
Accepted Answer Pending Moderation
Yes, now it works perfectly! Thank you very much! You client relationship is amazing !
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1


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