VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: EsSa55 on August 30, 2019, 13:37:28 PM

Title: Default Product Image Action Changed
Post by: EsSa55 on August 30, 2019, 13:37:28 PM
In 3.4.2 and below, the default product image action was Upload.

In 3.6.0 it has switched to Replace.

That means unless the action is changed to upload, subsequent selected images will replace the previous one rather than add to it.

How do I change the default back to the Upload action?

See attached screenshot.

TIA

Title: Re: Default Product Image Action Changed
Post by: GJC Web Design on August 30, 2019, 15:43:31 PM
Hi Eddie..   is a "feature" ..  ;)

Think max will remove in the next release...

If u want to "hack it out" then its JS in   components/com_virtuemart/assets/js/mediahandler.js ~ line 41

   $('[name="upload"]').on ('change', function (){
      var rr = $(this).parent().find("[name='media[media_action]']:checked");
      if (typeof $(rr[0]).val() != 'undefined' && $(rr[0]).val() == 0) {
         var rs = $(this).parent().find("[id='media[media_action]upload']").attr('checked', true);
         //var rs = $(this).parent().find("[id='media[media_action]replace']").attr('checked', true);
      }
   });

so comment out

//var rs = $(this).parent().find("[id='media[media_action]replace']").attr('checked', true);
Title: Re: Default Product Image Action Changed
Post by: Milbo on August 30, 2019, 16:28:37 PM
Please continue here. http://forum.virtuemart.net/index.php?topic=143363.0