There is a quick and right approach to implement new code.
Quick and dirty approach is to integrate your HTML and JavaScript that opens popup into header of the storefront.
Code can be added into following template file:
storefront/view/default/template/common/header.tpl
For right approach will require creation of the block to be used in the layout. This can be done in the core or as an extension:
Overview:
1. Create new block in SQL that can be enabled in the layout
2. Create controller/template files for the block
3. Add Javascripts and css if needed.
4. Build extension if needed.
Note: the block now can be included in to any place in the layout. Since this block will occupy no space and will only show popup, it can be included in any location on the layout.
1. To insert block into the system you can perform 2 ways.
a. Create block with series of SQL insert statements (I will not bother here, Feel free to check tables).
b. Create block with running XML for layout.
Check this manual for layout/block section
http://docs.abantecart.com/pages/developer/template_customization_or_development_guide.htmlBasically you need to run below code 1 time or include in extension installation file
$file = DIR_EXT . 'layout.xml';
$layout = new ALayoutManager('default');
$layout->loadXml(array('file' => $file));
Where layout.xml is file with new block:
<block>
<block_txt_id>newsletter_popup</block_txt_id>
<controller>blocks/newsletter_popup </controller>
<templates>
<template>
<parent_block>header</parent_block>
<template_name>blocks/newsletter_popup.tpl</template_name>
</template>
</templates>
</block>
2. Create 2 new files
Controller:
storefront/controller/blocks/newsletter_popup.php
Tempalte:
storefront/view/default/template/blocks/newsletter_popup.tpl
Now you can code your controller and template.
3. JavaScripts and CSS are going to
/storefront/view/default/javascript
and
/storefront/view/default/stylesheet
You can include them with methods addScript(), addScriptBottom and addStyle() in the controller or you can include them in the head.tpl
4. You can build extension with Devtools
http://docs.abantecart.com/pages/developer/template_dev_tools.htmlNote: Allot of information about architecture, layouts and blocks can be located in the manuals:
http://docs.abantecart.com/pages/developer/architecture.html