Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add link to image?


collector1

Recommended Posts

HI, I have added a new box to the main page and I've put an image in that box. I would like to add a hyperlink to the image. Can any one please advise?

 

bm_hoarderscollectables

 

function bm_hoarderscollectables() {

$this->title = MODULE_BOXES_HOARDERSCOLLECTABLES_TITLE;

$this->description = MODULE_BOXES_HOARDERSCOLLECTABLES_DESCRIPTION;

 

if ( defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS') ) {

$this->sort_order = MODULE_BOXES_HOARDERSCOLLECTABLES_SORT_ORDER;

$this->enabled = (MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS == 'True');

 

$this->group = ((MODULE_BOXES_HOARDERSCOLLECTABLES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');

}

}

 

function execute() {

global $oscTemplate;

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_HOARDERSCOLLECTABLES_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

tep_image( DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) .

'</center></div>' .

' </div>' .

'</div>';

 

$oscTemplate->addBlock($data, $this->group);

}

 

function isEnabled() {

return $this->enabled;

}

 

function check() {

return defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS');

}

 

Many Thanks.

Link to comment
Share on other sites

Replace this

' <div class="img"><center>' . 
tep_image( DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . 
'</center></div>' . 

by this

' <div class="img" style="text-align:center;">' . 
'  <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</a>' .
'</div>' . 

 

You can replace FILENAME_DEFAULT by any file you want to link to.

Link to comment
Share on other sites

would be like this

 

' <a href="http://multimixer.gr">'

 

I changed and got this error line 13 being class bm-hoarderscollectables (

 

Fatal error: Cannot redeclare class bm_hoarderscollectables in /home/hoar3157/public_html/www.hoarderscollectables.co.uk/includes/modules/boxes/bm_hoarderscollectables.php on line 13

 

class bm_hoarderscollectables {

var $code = 'bm_hoarderscollectables';

var $group = 'boxes';

var $title;

var $description;

var $sort_order;

var $enabled = false;

 

function bm_hoarderscollectables() {

$this->title = MODULE_BOXES_HOARDERSCOLLECTABLES_TITLE;

$this->description = MODULE_BOXES_HOARDERSCOLLECTABLES_DESCRIPTION;

 

if ( defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS') ) {

$this->sort_order = MODULE_BOXES_HOARDERSCOLLECTABLES_SORT_ORDER;

$this->enabled = (MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS == 'True');

 

$this->group = ((MODULE_BOXES_HOARDERSCOLLECTABLES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');

}

}

 

function execute() {

global $oscTemplate;

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_HOARDERSCOLLECTABLES_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img" style="text-align:center;">' .

' <a href="http://multimixer.gr">' . tep_image(DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</a>' .

'</div>' .

' </div>' .

'</div>';

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...