( ! ) Warning: get_browser(): browscap ini directive not set in /var/www/vendorama/cart/includes/browser.inc on line 127
Call Stack
#TimeMemoryFunctionLocation
10.0003365176{main}( ).../index.php:0
20.0005365680include_once( '/var/www/vendorama/cart/includes/global.inc' ).../index.php:3
30.0010367960include_once( '/var/www/vendorama/cart/includes/browser.inc' ).../global.inc:82
40.0036381760get_browser ( ).../browser.inc:127
Docs: Examples of Extensions on Vendo

Docs: Examples of Extensions

You need to be logged in to edit this page.

example 1: page redirection

In this example someone has linked to your website with an incorrect or obsolete URL: www.yourwebsite.co.nz/homepage

While there are other ways you can set redirects, you can edit your top.inc file and set up a simple redirect:

<?
if($_SERVER['REQUEST_URI']=='/homepage') {
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: /" );
exit;
}
?>

example 2: custom text

You can use the $_PAGE['custom_text'] variable to display text on any page below the h1 tag. In this example we can use the $_PAGE['custom_text'] variable to display a message on the cart page:

<?
if($_PAGE['page']=='order'){
      $_PAGE['custom_text'] = "<p>When you are ready to pay for your order click the <a href=\"/checkout/\">checkout</a> button.</p>";
}
?>

example 3: creating a snippet

In this example we create a Snippet to insert into the footer.html file of the template. This snippet will display the appropriate phone number prefix depending on the session country code of the person viewing the page (New Zealand country code is '121').

In the top.inc file we insert:

<?
if($_SESSION['country_id']=='121') $snippet1 = '(09)'; else $snippet1 = '0064 9';
?>

in our template/footer.html file we add:

<div class="contact_number">For help please phone us on {$SNIPPET1} 555 2528</div>

 

Revisions history (20)    ( hide | show )     Extensions > Examples of Extensions