Jump to content

Passage d'une variable javascript vers un controller


Recommended Posts

Bonjour,

 

j'aimerais passer une variable javascript "id_product_ajax" :

$(document).ready(function(){
$('#bouton').on('click', function(){

var id_product_ajax = $('#product_page_product_id').val();

    $.fancybox({
       maxWidth    : 615,
	    maxHeight   : 2000,
	    fitToView   : true,
	    width       : '100%',
	    height      : '100%',
	    autoSize    : false,
	    wrapCSS : 'people',
        href: baseDir+'index.php?controller=affichageFancyBox&content_only=1&module=monmodule&fc=module&var='+id_product_ajax,
        type: 'ajax',
    });
});
});

vers mon controlleur

class MonModuleAffichageFancyBoxModuleFrontController extends ModuleFrontController
{

    public $php_self = 'affichageFancyBox';
    
    public function initContent()
    {
        parent::initContent();
        $this->setTemplate('affichageFancyBox.tpl');
    }

}

Quelqu'un aurait-il la solution s'il vous plait?

 

merci

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...