Tag Archives: making things easier to use

what relative links and absolute links are and when to use them

When you place a link to a page or media that is on your server, use relative links.
If you are linking to something on another website (ie not on your server) use absolute links.

“What’s the difference between relative and absolute links?”

A ‘relative link’ doesn’t require the “http://yourdomain.com…” at the start, because the resource is on your server.

Here are some examples of relative links:

<a href="mypages.html">About Me</a>
<img src="mypic.jpg"/>
<a href="articles.php?tPath=3">My Page</a>

 

[important]

TIP: If you are using a url rewriter use the cart’s default urls, in relative link style:

USE:    <a href="pages.php?pID=2">Links</a>
NOT:   <a href="difference-between-relative-absolute-links.html">Links</a>

 

[/important]

 

An ‘absolute link’ does require the “http://yourdomain.com…” at the start, because the resource is on another server.
Absolute links are sometimes referred to as ‘hard-coded’ links.

Here are some examples of absolute links:

<script href="https://www.google.com/jquery/repository/jquery1.1.min.js">
<img src="https://wwwbestpiceverofsand.com/pic1.jpg">

Why do both the absolute link examples start https?

If you link to content that will be displayed on an https:// page, unless you link ALL of the content on that page using https:// or relative links, you will get the dreaded ‘mix of insecure content’ warning which will alarm your customers (especially if it happens in the checkout area) and probably lose you the sale.

If you need to link to an external site (therefore use an absolute link), the site needs to provide the option of linking via https://. If it doesn’t, can you save the resource locally and use a relative link to that? (you should always checkout copyright ownership and license and if necessary contact the owner of the image/external content if you are planning on making a local copy for use from your server.)

Why is this stuff about relative links and absolute links important?

1. to avoid seeing warnings about insecure / secure content which can lose you business
2. to future-proof against any change of url writing

Where is this particularly relevant?

On your homepage, especially in introductory text (eg mainpage.php module) and in article and info pages.

how to install ajax country state selector

The address book feature of oscommerce-based carts is fairly weak in some areas. This modification and free code module will help in the new account creation area by changing the clunky ‘choose a country, type in a state’ method of the current carts* to one that uses ajax to pull a list of states from the database based on the selected country. And by default it will load the store’s country (s most traders do in fact sell mostly to their own country.)

(* In fact the default cart behaviour in oscommerce 2.2 and cre loaded is to make you GUESS the spelling of the state and then if you get it wrong it’ll throw an error and THEN show you a dropdown list of states from the database. Madness.)

Ajax Country State Selector
(cre loaded port, from oscommerce contribution country state selector by steve lionel)

Written for:
any version of cre loaded 6.2.x -> 6.5.x, but easy to convert for all osCommerce-based carts (including oscMax, zencart)

Video Demo:


What it does:

Ajax Country State Selector improves the address handling functions of the cart and makes it quicker and easier for customers to create and edit addresses, whether in their account or in the checkout. The store’s default country and any states of that country are loaded with the page. On change of country, any states associated with that country will be loaded too.

Ease of use:
Should know how to check and setup zones if missing from cart. Otherwise, nothing to do.

Limitations:
The code provided ONLY shows a modified create account page – there are several other address areas in the cart that would need to be edited if this functionality was required for all screens. However, if new customers can get their accounts setup correctly then some of the subsequent address issues may be avoided.

The other real possibility is that the ajax functionality fails. There can be many reasons for this, and may be caused by conflict with a highly modified template that already uses javascript extensively. NO GUARANTEES are provided with this script.

Experience needed to install:
Beginner – upload 3 files, edit 5 files.

Don’t want to install it yourself?
No problem – drop me an email and I can install it for you at a minimal price.