1. vasite
  2. RO CSVI
  3. Wednesday, 16 October 2019
  4.  Subscribe via email
Hello
I am trying to customize CSVI export of j2store for bestlist
I have found the bestlist template in administrator/components/com_csvi/helpers/file/export/xml
In an old version of CSVI, I had used something like this below:


function Element($column_header, $cdata=false) {
switch ($column_header) {

case 'image':
$this->node = '<image>https://www.mysite.com';
$this->node .= $this->contents;
$this->node .= '</image>';
$this->node .= "\n";
break;

case 'link':
$this->node = '<link>https://www.mysite.com/products/';
$this->node .= $this->contents;
$this->node .= '-item</link>';
$this->node .= "\n";
break;
[...]


Now I tried something similar but with no result.
I can do only basic things in php, so I would be very happy if you could give the basic pattern to make this modification (for example to add the full url infron of image and link results).
Thank you in advcance
Accepted Answer Pending Moderation
Hello,

Your code example looks fine to me. Do you get any particular error?

(for example to add the full url infron of image and link results).
We will check to add the full URL as a core field. As for the image, which image field are you exporting? It looks like this should be main_image instead of image.
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. # 1
Accepted Answer Pending Moderation
Yes you are right, I checked again my code and found the solution. Here it is what worked for me:
Inside "public function element($column_header, $cdata = false)" and before "return $this->node;" we add:

switch ($column_header) {

case 'image':
$this->node = '<image>'.JURI::root();
$this->node .= $this->contents;
$this->node .= '</image>';
$this->node .= "\n";
break;

case 'link':
$this->node = '<link>'.JURI::root().'products/';
$this->node .= $this->contents;
$this->node .= '</link>';
$this->node .= "\n";
break;
}
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Now I need something more difficult for me...
I want to add 2 more fields:
<size> and <color>
I really cannot find how I will achieve this in j2store...
Any ideas?
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hello,
In the current J2Store export we do not support J2Store options as individual template fields so you cannot use size and color as export fields. You need to add option_names and option_values fields to your template fields to export these fields with values. We are working on the task of supporting options as export fields and will send the patch for testing 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. # 4
Accepted Answer Pending Moderation
It will be good to add this feature soon. For the time, is there a chance to achieve this? I have added option_names and option_values on my template, but they dont show anything. I will add some links to my site on the 'Site Details section'
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hello,
Ok you are looking at exporting product options whereas fields option_name and option_value will export the Variant options for a variable product and so it did not show anything on export. We are already in the process of developing the feature of having options as individual export fields. We should be able to send you the patch as soon as possible.
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. # 6
Accepted Answer Pending Moderation
Dear Tharuna
Another think to add here is that price option shows only the basic price and not the special price.:(
Please consider this to your next developement.
Thank you!
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello,
J2Store product export exports only the basic price. To export special prices you need to use J2Store price export. Using J2Store price export you can export both basic price using field regular_price and other special prices for a product.
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. # 8
Accepted Answer Pending Moderation
Yes but I need to have all in one xml. I use bestlist export type. If I select Operation: Price
then i will have only some of the fields available (only sku, title and prices), no categories, no description, no image url.
How can I have one xml with everything?
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hello,
There is a reason why multiple prices are not included in product export and are set as separate export. With Product export for every special price, the product details are duplicated in the export file. As of now you can have special prices only as a separate export.

There are two options to do this

1. You can use Advanced custom table export, join the #__content, #__j2store_products, #__j2store_product_price and #__j2store_variant tables and export the needed fields. The issue with this export is that the export of the fields are direct and there is no extra processing done as we have in J2Store product export.

2. Another way is that if possible you can do custom coding according to your need and set the export as an override as explained in the linked document.
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. # 10
  • Page :
  • 1


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