joomlavirtuemart

Creating language file joomla 3.8.3 (php related)


I have this piece code inside quick view for virtuemart plugin, which is about the "QUICK VIEW" button, and is connected to the backend where I can change its label name. I would rather love to have it connected to .ini file so I can make it multilanguage ready. Any help is highly appreciated.

        jQuery(document).ready(function ($) {
            function _SJQuickView(){
                var $item_class = $('<?php echo $cls_str; ?>');
                if ($item_class.length > 0) {
                    for (var i = 0; i < $item_class.length; i++) {
                        if($($item_class[i]).find('.sj_quickview_handler').length <= 0){
                            var producturlpath = $($item_class[i]).find('a', $(this)).attr('href');
                            if(typeof producturlpath !== 'undefined' && producturlpath.length > 0 ){
                                producturlpath = ( producturlpath.indexOf('?')  >= 0 ) ? producturlpath + '&tmpl=component' : producturlpath + '?tmpl=component' ;
                                var _quickviewbutton = "<a  class='sj_quickview_handler' href='" + producturlpath + "'><?php echo $this->_params->get('label_button','quick view');?></a>";
                                $($item_class[i]).append(_quickviewbutton);
                            }
                        }
                    }
                }
            }

This piece is I believe the crucial:

var _quickviewbutton = "<a  class='sj_quickview_handler' href='" + producturlpath + "'><?php echo $this->_params->get('label_button','quick view');?></a>";

Solution

  • It's easy. Just replace code with

    var _quickviewbutton = "";

    and just add translation with QUICK_VIEW