Hi,
Thanks for the report. It is something we already fixed but the patch is not release yet.
In the file "components/com_hikamarket/views/productmarket/view.html.php", replace
if(!empty($file_id)){
$fileClass = hikamarket::get('shop.class.file');
$element = $fileClass->get($file_id);
}
$element->product_id = $product_id;
By
if(!empty($file_id)){
$fileClass = hikamarket::get('shop.class.file');
$element = $fileClass->get($file_id);
}
$element->product_id = $product_id;
if(!empty($element->product_id)) {
$productClass = hikamarket::get('shop.class.product');
$product = $productClass->get((int)$element->product_id);
$element->product_type = $product->product_type;
}
Then, in the view "productmarket / form_file", you can replace
750, 460, 'onclick="return window.productMgr.addFile(this);"', '', 'link'
By
750, 460, 'onclick="return window.productMgr.addFile(this, '.(int)$this->product->product_id.',\''.$product_type.'\');"', '', 'link'
And also
window.productMgr.addFile = function(el, pid, type) {
var t = window.hikamarket;
if(type === undefined || type == '') type = 'product';
By
window.productMgr.addFile = function(el, pid, type) {
var t = window.hikamarket;
if(type === undefined || type == '') type = 'product';
if(type == 'variant') type = 'product_variant';
It will fix the loading of the product type and provide a more valid data for the variant saving.
Regards,