Jump to content

Ajax controller fancybox


Recommended Posts

Bonjour,

 

j'ai commencé à créer un module.

 

J'affiche un bouton sur ma page Produit.

 

J'aimerais faire apparaître au clic du bouton une FancyBox remplie en ajax, via un controller je pense.

 

Quelqu'un aurait une idée du code ajax entre autre à écrire?

 

Je vous remercie par avance.

Link to comment
Share on other sites

class XDModuleDisplayAjaxController
{
    public function __construct($module, $file, $path)
    {
        $this->file = $file;
        $this->module = $module;
        $this->context = Context::getContext();
        $this->_path = $path;

    }

    public function run()
    {
        return $this->module->display($this->file, 'displayProductButtons.tpl', $this->cache_id);
    }
}
 

Link to comment
Share on other sites

J'ai réécrit mon controller

class MonModuleAffichageFancyBoxModuleFrontController extends ModuleFrontController
{

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

}

Je le vois bien dans l'admin / Préférences/ SEO

 

par contre, je ne vois pas quelle forme de l'UR il faut mettre pour href="url_de_mon_controller"

 

Merci par avance

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...