1. sandstorm871
  2. RO CSVI
  3. Tuesday, 24 November 2015
  4.  Subscribe via email
I am running a basic export to get a CSV file with my current Virtuemart products.
"product_sku","product_parent_sku","product_name"

When this exports, if a product has 4 children. I am getting an export showing the parent 4 times and then the 4 children products - See screenshot

Is there a setting I may have missed to only show the parent product once?

Also is there anything I can do within the export to only export those products that have a parent/child. So that the export ignores all products that are parent only?

Thanks,
Andy
Accepted Answer Pending Moderation
Perfect B)

Adding the virtuemart_product_id to the template, setting unpublished & running the export again has produced the export file exactly as I wanted it. Parent Products, With Children underneath the parent & no duplicate parents.

Thanks for your help & patience
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Perfect, I found out why it is not using the field. Can you add the field virtuemart_product_id to the template but set it unpublished. This way it is used for export but won't show up in your exported file.

Curious what will come out.
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. # 2
Accepted Answer Pending Moderation
OK, I added the backup template here.

I have this site in a test server if its easier to take a look there, as its J3/VM3, that I am migrating from J2.5/VM2
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hey Andy,

The debug log is useful more often than none ;) I see you have set to order by the product ID but it is not applied to the query, so no ordering is happening. Could you backup this export template and post it here, so I can run the same template as you and see what happens.

I did create my own template and sorted the output, the sorting was applied.

so is this just the mood of the database?
We are not quite there yet.
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. # 4
Accepted Answer Pending Moderation
Some of these in particular products have been added by CSVi, some added manually, some of the initial CSVi imported products have been added to or removed, etc

So I don't think using sort by "virtuemart_product_id" will help us in this case
However I have again just ran this & added the export file & debug if it helps with anything?

The export with noting altered in the group or sort fields, looks great apart from the duplicate parent products, so is this just the mood of the database?
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hey Andy,

but the exported file doesn't show parents & then children (Neatly in order).
The order is determined by something. If nothing is specified for the ordering it is up to the good mood of the database. I assume the order can be handled by sorting on the virtuemart_product_id field because if you imported the products with CSVI, this number should be sequential. That is why I asked to order on that field.

Just group in by product_sku , does remove the duplicate parents, but doesn't keep the same neat exported file.
Now add the virtuemart_product_id sorting to that template. Does it come out nice and neat?

If it doesn't come out nice and neat, we need to find out which field controls the niceness or if it is the mercy of the database ;)
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. # 6
Accepted Answer Pending Moderation
Do the group by on product_sku and product_name but also set the Sort Order on the virtuemart_product_id field.

This removes the duplicate parent products, but the exported file doesn't show parents & then children (Neatly in order).

Sorting the Product_Name afterwards myself also doesn't help as, sometimes the children products have completly different name to parent i.e Parent = T Shirt & Children - Red,Blue,Yellow

Can you set the group by field to only product_sku, run the export and post the debug log for me?
I got this wrong in my previous post. Just group in by product_sku , does remove the duplicate parents, but doesn't keep the same neat exported file.
I have however just ran this and added the exported file & debug log if you still need to take a look.

As in previous post. I just need the nice neat export as in "Product-MV-1.csv" but without the duplicated parent products.
This is because I will set up different export templates, to help the shop admin with product prices, stock, etc & I know duplicate parents will just cause confusion
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hey Andy,

Grouping on just the product_sku field is something I would think would be enough to clean up that list. Can you set the group by field to only product_sku, run the export and post the debug log for me? I would like to see what happens there.

As for the fourth export, I would say do the group by on product_sku and product_name but also set the Sort Order on the virtuemart_product_id field. That is another one you can try.
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. # 8
Accepted Answer Pending Moderation
I Have read through the Group & Sort By tutorial in this link, but am struggling to understand it in order to get what I need.

My normal export is attached "Product-MV-1.csv" , Ideally I want this, but without the duplicate parent products, as it is all laid out nice & neat, with the parent first & all the children underneath there parent.

I have tried setting Group by field as below;


  1. Product_Name

  2. Product_SKU

  3. Product_Name & Product_SKU

  4. Product_SKU & Product_Name



This 1st 3 don't change anything in the exported file.

The last one (Product_SKU & Product_Name) seems to remove the duplicate parents, but the exported file is all messed up and not neat, like the original download.
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello Andy,

only export those products that have a parent/child
You want to export all products that are either parent or child and not the single products? If that is the case, then that is not possible. You can see the option Tharuna mentioned and click on the Help button, it will explain what it exports.
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. # 10
Accepted Answer Pending Moderation
Hello Andy,
I am running a basic export to get a CSV file with my current Virtuemart products.
"product_sku","product_parent_sku","product_name"

When this exports, if a product has 4 children. I am getting an export showing the parent 4 times and then the 4 children products - See screenshot

Is there a setting I may have missed to only show the parent product once?


Please use groupby and sortby tutorials to set to groupby product_parent_id field.


Also is there anything I can do within the export to only export those products that have a parent/child. So that the export ignores all products that are parent only?

In template settings on options tab, set Child products only to yes to retrieve the required data.
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
  • Page :
  • 1


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