Author Topic: pop up Newsletter  (Read 5917 times)

Offline ymaster

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
pop up Newsletter
« on: January 10, 2016, 06:32:30 AM »
Dear Sir,
             how can i make Newsletter popup for my site front page
Please reply soon as possible

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: pop up Newsletter
« Reply #1 on: January 10, 2016, 02:08:15 PM »
As soon as possible?  :o

See if this will help you:
http://stackoverflow.com/questions/19707236/show-popup-after-page-load

You can add this code as new block or add it into header/footer template (.tpl)
“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

Offline Trendslink

  • Newbie
  • *
  • Posts: 21
  • Karma: +1/-0
    • View Profile
Re: pop up Newsletter
« Reply #2 on: May 02, 2016, 04:17:17 AM »
i need this also. Anybody can teach how to do that? i'm nooby

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: pop up Newsletter
« Reply #3 on: May 05, 2016, 07:53:15 PM »
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.html

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


Note: Allot of information about architecture, layouts and blocks can be located in the manuals:
http://docs.abantecart.com/pages/developer/architecture.html
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

 

Database Error

Please try again. If you come back to this error screen, report the error to an administrator.