Bug: Children's products do not inherit images from the parent product (if they don't have their own images).
- piekielko
- RO CSVI
- Tuesday, 30 September 2025
- Subscribe via email
Bug: The maximum number of images specified in the export form for Virtuemart products is not respected. All images are displayed in the export.
Bug: Children's products do not inherit images from the parent product (if they don't have their own images).
Bug: Children's products do not inherit images from the parent product (if they don't have their own images).
0
Accepted Answer
Pending Moderation
Hello,
Please post export debug log to check. To get the debug log see How to collect debug information? document.
Please post export debug log to check. To get the debug log see How to collect debug information? document.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
I solved the problem with the non-functioning image limit myself. Set to 10:
I found another bug. I have 2354 products in the Virtuemart database. When I export the full list of products in XML format for the Google Merchant template, or when I export from the price template, etc., I get the full list, but...
When I use the traditional export template for the Virtuemart component, Operation -> Product, export type -> CSV, Template fields -> product_sku, virtuemart_product_id
It just exports 365 products. I used the old export templates, created a new clean one - each time the export is the same.
This is not a browser cache issue.
$images = array_slice($images, 0, 10);I found another bug. I have 2354 products in the Virtuemart database. When I export the full list of products in XML format for the Google Merchant template, or when I export from the price template, etc., I get the full list, but...
When I use the traditional export template for the Virtuemart component, Operation -> Product, export type -> CSV, Template fields -> product_sku, virtuemart_product_id
It just exports 365 products. I used the old export templates, created a new clean one - each time the export is the same.
This is not a browser cache issue.
Attachments (1)
Accepted Answer
Pending Moderation
For the time being, I will have to revert to the older version of CSVI 8.
I tested the same case on other websites – the result is similar. In some domains, the product export returned just 4 random products, even though there are hundreds of them. The export of Virtuemart products simply does not work as it should.
If you want to test this export, I can give you access to my server.
I tested the same case on other websites – the result is similar. In some domains, the product export returned just 4 random products, even though there are hundreds of them. The export of Virtuemart products simply does not work as it should.
If you want to test this export, I can give you access to my server.
Accepted Answer
Pending Moderation
Hello,
Posting debug log would have helped me to find if it is a real bug. So I still request you to post the debug log to check.
Debug log shows that you are exporting unpublished products. In export template on File tab check Export state field. That is set to Unpublished and so export gets only those products. Set this to All and save the template. Run the export and check.
I solved the problem with the non-functioning image limit myself. Set to 10:
Posting debug log would have helped me to find if it is a real bug. So I still request you to post the debug log to check.
When I use the traditional export template for the Virtuemart component, Operation -> Product, export type -> CSV, Template fields -> product_sku, virtuemart_product_id
It just exports 365 products. I used the old export templates, created a new clean one - each time the export is the same.
This is not a browser cache issue.
Debug log shows that you are exporting unpublished products. In export template on File tab check Export state field. That is set to Unpublished and so export gets only those products. Set this to All and save the template. Run the export and check.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hi tharuna
Debugging only shows the end result—I don't think that adds much.
I already wrote earlier – you have an error in the forms. Some fields in these forms are simply dead – this data is not passed to the function that generates the export. If, in my case, I selected the “-ALL-” option, I should see all products – published and unpublished.
The same applies to images—if I specify that I want to display a maximum of 10 photos, it does not work—all of them are displayed.
Debugging only shows the end result—I don't think that adds much.
I already wrote earlier – you have an error in the forms. Some fields in these forms are simply dead – this data is not passed to the function that generates the export. If, in my case, I selected the “-ALL-” option, I should see all products – published and unpublished.
The same applies to images—if I specify that I want to display a maximum of 10 photos, it does not work—all of them are displayed.
Attachments (1)
Accepted Answer
Pending Moderation
Hello,
That is correct. All should get both published and unpublished products in export. But in the debug log posted I see query filters records with unpublished products. See the query below from debug log. It has a where condition filtering products which are unpublished. Is this the right debug log then?
I requested for debug log twice and still haven't got it. May I ask if you are using file_url field or picture_url field in export? We have picture limit only on picture_url field and not on file_url field. So if you are using file_url field you will see all images displayed. I would have got these details from debug log and so have been asking for it.
I already wrote earlier – you have an error in the forms. Some fields in these forms are simply dead – this data is not passed to the function that generates the export. If, in my case, I selected the “-ALL-” option, I should see all products – published and unpublished.
That is correct. All should get both published and unpublished products in export. But in the debug log posted I see query filters records with unpublished products. See the query below from debug log. It has a where condition filtering products which are unpublished. Is this the right debug log then?
SELECT `ucray_virtuemart_products`.`virtuemart_product_id`,
`ucray_virtuemart_products`.`product_parent_id`,
`ucray_virtuemart_products`.`product_sku`
FROM `ucray_virtuemart_products`
LEFT JOIN `ucray_virtuemart_product_prices` ON `ucray_virtuemart_products`.`virtuemart_product_id` = `ucray_virtuemart_product_prices`.`virtuemart_product_id`
LEFT JOIN `ucray_virtuemart_product_manufacturers` ON `ucray_virtuemart_products`.`virtuemart_product_id` = `ucray_virtuemart_product_manufacturers`.`virtuemart_product_id`
LEFT JOIN `ucray_virtuemart_manufacturers` ON `ucray_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = `ucray_virtuemart_manufacturers`.`virtuemart_manufacturer_id`
LEFT JOIN `ucray_virtuemart_manufacturers_pl_pl` ON `ucray_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` = `ucray_virtuemart_manufacturers_pl_pl`.`virtuemart_manufacturer_id`
LEFT JOIN `ucray_virtuemart_product_categories` ON `ucray_virtuemart_products`.`virtuemart_product_id` = `ucray_virtuemart_product_categories`.`virtuemart_product_id`
LEFT JOIN `ucray_virtuemart_currencies` ON `ucray_virtuemart_currencies`.`virtuemart_currency_id` = `ucray_virtuemart_product_prices`.`product_currency`
LEFT JOIN `ucray_virtuemart_product_shoppergroups` ON `ucray_virtuemart_product_shoppergroups`.`virtuemart_product_id` = `ucray_virtuemart_products`.`virtuemart_product_id`
WHERE ucray_virtuemart_products.published = 0
GROUP BY `ucray_virtuemart_products`.`virtuemart_product_id`
ORDER BY `ucray_virtuemart_products`.`product_sku` ASC
The same applies to images—if I specify that I want to display a maximum of 10 photos, it does not work—all of them are displayed.
I requested for debug log twice and still haven't got it. May I ask if you are using file_url field or picture_url field in export? We have picture limit only on picture_url field and not on file_url field. So if you are using file_url field you will see all images displayed. I would have got these details from debug log and so have been asking for it.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
I tested the Export state field. If I select
- ALL: just unpublished products are displayed. (real bug)
- Unpublished: unpublished products are displayed.
- Published: only published products are displayed.
This answer resolves my doubts - Yes, I use file_url. I wanted a clean address for images — and now I understand the problem. Thanks for explaining.
- ALL: just unpublished products are displayed. (real bug)
- Unpublished: unpublished products are displayed.
- Published: only published products are displayed.
So if you are using file_url field you will see all images displayed.
This answer resolves my doubts - Yes, I use file_url. I wanted a clean address for images — and now I understand the problem. Thanks for explaining.
Accepted Answer
Pending Moderation
Hello,
Ok, I was able to see this issue. Please load the attached patch file and check the export. Let me know on how that goes.
I tested the Export state field. If I select
- ALL: just unpublished products are displayed. (real bug)
- Unpublished: unpublished products are displayed.
- Published: only published products are displayed.
Ok, I was able to see this issue. Please load the attached patch file and check the export. Let me know on how that goes.
Attachments (1)
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Thanks—that patch solved the first problem.
There is one more thing to fix. There is a problem with prices. If products do not have prices (0 or null), an error occurs.
This can be temporarily circumvented by setting a simple rule in the export template – minimum value for prices: 1
But this does not solve the problem of exporting children's products, which should inherit prices from the parent product in exports.
Kind regards,
Chris
There is one more thing to fix. There is a problem with prices. If products do not have prices (0 or null), an error occurs.
{"error":true,"code":0,"message":"Division by zero"}This can be temporarily circumvented by setting a simple rule in the export template – minimum value for prices: 1
But this does not solve the problem of exporting children's products, which should inherit prices from the parent product in exports.
Kind regards,
Chris
Accepted Answer
Pending Moderation
Hello Chris,
Do you have any rule applied on product price? Can you post template XML to check? To get the template XML file from RO CSVI templates list page select the export template and click on Backup templates button. Post the downloaded XML file.
There is one more thing to fix. There is a problem with prices. If products do not have prices (0 or null), an error occurs.
Do you have any rule applied on product price? Can you post template XML to check? To get the template XML file from RO CSVI templates list page select the export template and click on Backup templates button. Post the downloaded XML file.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hi tharuna
This is my modified Google template, which I use to send regular and promotional prices. This is not included in your official template. But the problem with prices does not concern my template, but every template that exports prices from Virtuemart. If the price has a value of 0 or null, this error occurs: "Division by zero".
This is my modified Google template, which I use to send regular and promotional prices. This is not included in your official template. But the problem with prices does not concern my template, but every template that exports prices from Virtuemart. If the price has a value of 0 or null, this error occurs: "Division by zero".
<?php
/**
* @package CSVI
* @subpackage Export
* @author Krzysztof (customizacja)
*/
use Rolandd\Component\Rocsvi\Site\Entity\Template as TemplateEntity;
defined('_JEXEC') or die;
class CsviHelperFileExportXmlGoogle
{
private TemplateEntity $template;
private $settings;
public $contents = '';
public $node = '';
public function __construct(TemplateEntity $template)
{
$this->template = $template;
$this->settings = new CsviHelperSettings();
}
public function headerText($exportFields)
{
$this->contents = '<?xml version="1.0" encoding="UTF-8"?>' . chr(10);
$this->contents .= '<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0">' . chr(10);
$this->contents .= '<channel>' . chr(10);
$this->contents .= '<title>' . $this->settings->get('gb_title') . '</title>' . chr(10);
$this->contents .= '<link>' . $this->settings->get('gb_link') . '</link>' . chr(10);
$this->contents .= '<description>' . $this->settings->get('gb_description') . '</description>' . chr(10);
return $this->contents;
}
public function FooterText()
{
return "</channel>\n</rss>\n";
}
public function NodeStart()
{
return "<item>\n";
}
public function NodeEnd()
{
return "</item>\n";
}
public function Element($column_header, $cdata = false)
{
$this->contents = trim($this->contents);
$includeEmptyValues = $this->template->get('include_empty_nodes');
if (!$includeEmptyValues && !$this->contents) {
return '';
}
$node = (false !== stripos($column_header, 'c:'))
? "<{$column_header} type=\"string\">"
: "<{$column_header}>";
if ($cdata) $node .= '<![CDATA[';
$node .= $this->contents;
if ($cdata) $node .= ']]>';
$node .= "</{$column_header}>\n";
return $node;
}
public function ContentText($content, $column_header, $fieldName, $cdata = false)
{
$this->contents = '';
$xml = '';
switch ($fieldName) {
case 'custom_shipping':
if ($column_header === 'g:shipping' && strpos($content, ':')) {
list($country, $service, $price) = explode(':', $content);
$this->contents = "<g:country>{$country}</g:country>\n<g:service>{$service}</g:service>\n<g
rice>{$price}</g
rice>\n";
}
break;
case 'custom':
if ($column_header === 'g:tech_spec_link') {
$cdata = true;
$this->contents = $content;
} elseif ($column_header === 'g:tax') {
list($country, $region, $rate, $tax_ship) = explode(':', $content);
$this->contents = "<g:country>{$country}</g:country>\n<g:region>{$region}</g:region>\n<g:rate>{$rate}</g:rate>\n<g:tax_ship>{$tax_ship}</g:tax_ship>\n";
} else {
$this->contents = $content;
}
break;
case 'category_path':
$paths = explode('|', $content);
if (!empty($paths[0])) {
$this->contents = str_replace($this->template->get('category_separator', '/'), ' > ', $paths[0]);
}
break;
case 'basepricewithtax':
list($priceRaw, $saleRaw, $currency) = array_pad(explode('|', $content), 2, null);
$norm = function($v) {
$v = trim((string)$v);
$v = preg_replace('/[^\d.\-]/', '', $v);
return (float)$v;
};
$price = $norm($priceRaw);
$sale = $saleRaw !== null ? $norm($saleRaw) : 0.0;
$fmt = fn($n,$cur) => number_format((float)$n,2,'.','') . ' ' . $cur;
$xml = "<g
rice>{$fmt($price,$currency)}</g
rice>\n";
if ($sale > 0 && $sale < $price) {
$xml .= "<g:sale_price>{$fmt($sale,$currency)}</g:sale_price>\n";
$start = gmdate('c', strtotime('today 00:00 UTC'));
$end = gmdate('c', strtotime('+4 days 23:59:59 UTC'));
$xml .= "<g:sale_price_effective_date>{$start}/{$end}</g:sale_price_effective_date>\n";
}
return $xml;
case 'Rozmiar jubilerski':
if ($content > 0) {
return "<g:size>{$content}</g:size>\n";
}
break;
case 'product_weight':
$weight = ($content > 0) ? round($content) : 10;
return "<g:shipping_weight>{$weight} g</g:shipping_weight>\n";
case 'product_desc':
if (trim($content) !== '') {
$clean = strip_tags($content);
$clean = preg_replace('/\s+/u', ' ', $clean);
$clean = mb_substr($clean, 0, 5000);
return "<g:description><![CDATA[{$clean}]]></g:description>\n";
}
break;
case 'file_url':
$domain = 'https://img.piekielko.com/';
$images = strpos($content, '|') !== false ? explode('|',$content) : [$content];
$images = array_slice($images, 0, 10);
foreach ($images as $index => $image) {
$this->contents = $domain . ltrim(trim($image), '/');
$xml .= $this->Element($index === 0 ? 'g:image_link' : 'g:additional_image_link', $cdata);
}
return $xml;
default:
// Mapowanie kategorii i custom labeli
if ($column_header === 'g:google_product_category') {
$map = [16=>'194',117=>'194',127=>'194',129=>'194',130=>'194',131=>'194',7=>'200',91=>'200',6=>'196',133=>'196',134=>'196',135=>'196',8=>'191',125=>'201',28=>'192',30=>'192',37=>'192',10=>'192',9=>'505372',12=>'505372',13=>'505372',23=>'505372',26=>'505372',41=>'505372',44=>'505372',65=>'499972',24=>'502988',14=>'169',19=>'3032',22=>'6551',11=>'4226',15=>'5914',17=>'5388'];
$id = $map[(int)$content] ?? '188';
return "<g:google_product_category>{$id}</g:google_product_category>\n";
}
if ($column_header === 'g:custom_label_0') {
$labels = [16=>'kolczyki',117=>'kolczyki',127=>'kolczyki',129=>'kolczyki',130=>'kolczyki',131=>'kolczyki',7=>'pierścionki',91=>'pierścionki',6=>'naszyjniki',133=>'naszyjniki',134=>'naszyjniki',135=>'naszyjniki',8=>'bransolety',10=>'zawieszki',28=>'zawieszki',30=>'zawieszki',37=>'zawieszki',9=>'półfabrykaty',12=>'naszywki',13=>'frędzle',23=>'koraliki',26=>'półfabrykaty',41=>'naszywki',44=>'naszywki',65=>'Antyki i kolekcje',125=>'kolczyki',24=>'spinki',14=>'paski',19=>'torebki',22=>'portfele',11=>'guziki',15=>'headpiece',17=>'stroje'];
$lab = $labels[(int)$content] ?? '';
return "<g:custom_label_0>{$lab}</g:custom_label_0>\n";
}
// Standardowe traktowanie
if (!$cdata) {
$this->contents = str_replace(['&','>','<'], ['&','>','<'], $content);
} else {
$this->contents = $content;
}
break;
}
$column_header = $column_header ?? $fieldName;
return $this->Element($column_header, $cdata) . $xml;
}
public function prepareContent($contents)
{
return implode('', $contents);
}
}
Accepted Answer
Pending Moderation
Hello,
That is modified code and not template I asked for. I asked for export template XML file so I can test and see if I can see the error.
I have few prices set to 0 in VirtueMart and don't see this error in VirtueMart Google merchant export. So need to find out what is triggering this error. If it is template or data you have in VirtueMart. Is there any site I can test this? You can post the site details under your reply and I will take a look at it.
This is my modified Google template, which I use to send regular and promotional prices.
That is modified code and not template I asked for. I asked for export template XML file so I can test and see if I can see the error.
But the problem with prices does not concern my template, but every template that exports prices from Virtuemart. If the price has a value of 0 or null, this error occurs: "Division by zero".
I have few prices set to 0 in VirtueMart and don't see this error in VirtueMart Google merchant export. So need to find out what is triggering this error. If it is template or data you have in VirtueMart. Is there any site I can test this? You can post the site details under your reply and I will take a look at it.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Accepted Answer
Pending Moderation
Hi
The error during direct export of an empty basepricewithtax field will not appearr because there are no mathematical calculations there. It will simply return 0 or an empty field, but...
Have you tested exporting prices based on exchange rates? I get this error in this mode.
Kind regards,
Chris
The error during direct export of an empty basepricewithtax field will not appearr because there are no mathematical calculations there. It will simply return 0 or an empty field, but...
Have you tested exporting prices based on exchange rates? I get this error in this mode.
Kind regards,
Chris
Accepted Answer
Pending Moderation
Hello Chris,
Yes tested with exchange rates and still don't see the error. It could be because of difference in VirtueMart data we are using in export. If you can post the requested details I will check the export on your site.
Have you tested exporting prices based on exchange rates? I get this error in this mode.
Yes tested with exchange rates and still don't see the error. It could be because of difference in VirtueMart data we are using in export. If you can post the requested details I will check the export on your site.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »