Generating Popups

Hello,

I would be interestet to generate Popups which will appear after a logged in user has surfed 3 Pages of the shop.

This means It has to be included in header or footer. Second thing is, that I already build a view, a template and a core class for the page that now have to be shown and used inside a popup. Quite similar to the basket or Jquerys NyroModal

I would be very happy if somone could give me a hint or two how to popup the template including class-functionality.

Regards

hi lib,

1st of all in yourcase I would do a module for oxViewConfig by adding a method which checks if you show the popup or not. Let’s call it myViewConfig::isPopup(). It would return bool value. You can call this method on each click from _header.tpl template. The code in template could look something like this:

[{$oViewConfig->isPopup()}]
<!-- JS code showing popup -->
[{/if}]

Now all you have to do is to implement some counter which is stored in session and is incremented in your isPopup() method. After counter value reaches 3 isPopup() would return true.

Ah and one more thing you might need to do change $this->blForceSessionStart value to true in config.inc.php in order to enamble sessions from the first click.