Author Topic: Virtuemart Multi image upload not adding images  (Read 200 times)

Megan3487

  • Beginner
  • *
  • Posts: 1
  • A beginner
Virtuemart Multi image upload not adding images
« on: July 29, 2020, 05:32:29 am »
I wanted to put this here for anyone with a similar issue, Virtuemart Multi Image Uploader doesn't save images to the product.

This is caused by a new table column called 'has_medias'.

/plugins/system/virtuemart_multiupload/ajax/process.php

Code: [Select]
// New query to update VM Medias table
    $query = $db->getQuery(true);
    $query->update('#__virtuemart_products')
        ->set('has_medias = 1')
        ->where('virtuemart_product_id = ' . (int) $virtuemart_product_id);

    $db->setQuery($query);
    $result = $db->execute();

    if ($db->getErrorNum())
    {
        $json['error'] = JText::sprintf('Error setting has_medias on #__virtuemart_virtuemart_products', $db->getErrorNum(), $db->getErrorMsg()).'<br />';
        return false;
    }
    // End new Query

This is mainly just an FYI for others. The above code needs to be added. To the end of the main function with query updates. VM adds in a new has_medias column and therefor on new products the multi-added images are not shown until has_media is set to 1.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27798
  • Always on vacation
    • Jenkin Hill Internet
Re: Virtuemart Multi image upload not adding images
« Reply #1 on: July 29, 2020, 10:31:45 am »
The Virtuemart Multi Image Upload plugin by cmsmart has not been updated for more than a year.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4347
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Virtuemart Multi image upload not adding images
« Reply #2 on: August 01, 2020, 15:30:08 pm »
HI,
Thanks for report.
The problem is that the table changes are not grouped, so if you do a plugin, you have no informations.
I have another problem to fix, now VM seems to have has_category column, but i dont know for now, the exact release about all this changes.
Same for new category child update.
If someone have all information about table changes easy to find, i thank you.
Problem is to easy check the release to know if i work with the new fields or not, because this informations are not grouped in one page with the VM version.