Back to PhocacartRenderMedia class

Method loadPhocaSwapImage

public
loadPhocaSwapImage
()

Method loadPhocaSwapImage - Source code

/*
        public function loadEqualHeights() {

            if ($this->p['equal_height'] == 1) {
                return 'row-flex';
            } else {
                return '';
            }

            /*if ($load == 1) {

                //$app			= JFactory::getApplication();
                //$paramsC 		= PhocacartUtils::getComponentParameters();
                //$equal_height_method	= $paramsC->get( 'equal_height_method', 1 );
                $equal_height_method 	= 0;// FLEXBOX USED

                if ($equal_height_method == 1) {
                    $this->document->addScript(Uri::root(true).'/media/com_phocacart/js/jquery.equal.heights.js');
                    //$this->document->addScript(JUri::root(true).'/media/com_phocacart/js/jquery.equalminheights.min.js');
                    $this->document->addScriptDeclaration(
                    'jQuery(window).load(function(){
                        jQuery(\'.ph-thumbnail-c\').equalHeights();
                    });');
                } else if ($equal_height_method == 2) {
                    $this->document->addScript(Uri::root(true).'/media/com_phocacart/js/jquery.matchheight.min.js');
                    $this->document->addScriptDeclaration(
                    'jQuery(window).load(function(){
                        jQuery(\'.ph-thumbnail-c\').matchHeight();
                    });');
                } else if ($equal_height_method == 3) {

                    $this->document->addScript(Uri::root(true).'/media/com_phocacart/js/jquery.matchheight.min.js');
                    $this->document->addScriptDeclaration(
                    'jQuery(window).load(function(){
                        jQuery(\'.ph-thumbnail-c.grid\').matchHeight({
                           byRow: false,
                           property: \'height\',
                           target: null,
                           remove: false
                        });
                    });');
                }
                // not ph-thumbnail but only ph-thumbnail-c (in component area so module will not influence it)
            }
        }*/
public function loadPhocaSwapImage()
{
    if ($this->p['dynamic_change_image'] == 1 && $this->load) {
        //$this->document->addScript(JUri::root(true).'/media/com_phocacart/js/phoca/jquery.phocaswapimage'.$this->t['min'].'.js');
        //HTMLHelper::_('script', 'media/com_phocacart/js/phoca/jquery.phocaswapimage' . $this->t['min'] . '.js', array('version' => 'auto'), $this->scriptAtribute);
        $this->wa->registerAndUseScript('com_phocacart.phocaswapimage', 'media/com_phocacart/js/phoca/jquery.phocaswapimage' . $this->t['min'] . '.js', array('version' => 'auto'), $this->scriptAtributeInline);
    }
}