I have a small PHP and JS code that checks and sets some coockies as soon as a new visitor comes to our website. These coockies determine which website to direct the visitor to
As soon as a visitor comes for first time a dialog box appears and asks him if he is from Argentina or International. When he clicks on one choice it sets the coockie and continues.
So next time the visitor comes it will remember to which website to direct him.
Now the catch is that say a visitor goes to http://www.domain.com, clicks on ‘International’, sets the coockie ‘int’ and redirects him to http://www.domain.com/international
next time he saw a link to a promotion, http://www.domain.com/the-promotion — based on the coockie, the website should redirect him to http://www.domain.com/international/the-promotion.
So this script will check what coockie is set, if needed add ‘/international’, and redirect to the final location.
So based on this tutorial I thought I need to do this as a module and place the block code on the app/design/........./layout/page.xml
but, ofcourse since I’m not sure of what I’m doing I get the following error:
Fatal error: Call to a member function toHtml() on a non-object in C:\AppServ\www\app\code\core\Mage\Core\Block\Abstract.php on line 503
Here is my code:
file is too large. look in attached file
<!-- LIGHTBOX Coockies Module #Custom -->
<!-- // LIGHTBOX Coockies Module -->
I’d really appreciate your help!! And perhaps someone might benefir (although something tells me I’m reinventing the wheel)
THANK You for your help!!