PDA

View Full Version : Problem with new box



hedro
02-17-2005, 06:13 AM
Hi
at the moment I am trying to add a mod which can be found here,
http://www.oscommerce.com/community/contributions,2899

Switch between Displaying Prices Inc./Ex. VAT

it uses a box to enable the user to switch between prices including/excluding tax

the box code supplied is as follows



<!-- ==== START CONTRIBUTION "Switch between displaying prices Inc./Ex. VAT" ===================================-->
<tr>
<td colspan="2" class="boxText" align="left" colspan="2">
<?php if ($vat_disp == '1') { ?>
All prices displayed:<br><b>Inc. VAT</b>
<?php } else { ?>
All prices displayed:<br><b>Ex. VAT</b>
<?php } ?>
</td>
</tr>

<tr>
<td colspan="2" align="right" valign="bottom">
<?php if ($vat_disp == '1') {
echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'vat_disp')) . 'vat_disp=0') . '">' . tep_image_button('button_inc_ex_vat.gif', To_Prices_Ex_VAT) . '</a>';
} else {
echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'vat_disp')) . 'vat_disp=1') . '">' . tep_image_button('button_inc_ex_vat.gif', To_Prices_Inc_VAT) . '</a>';
}
?>
</td>
</tr>
<!-- ==== FINISH CONTRIBUTION "Switch between displaying prices Inc./Ex. VAT" ===================================-->


I have tried to fix it to work with BTS
using this


<?php
/*
$Id: languages.php,v 1.1.1.1 2005/01/15 06:43:51 Michael Sasek Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- languages //-->
<?php

$boxHeading = BOX_HEADING_VAT;
$corner_left = 'square';
$corner_right = 'square';
$boxContent_attributes = ' align="center"';
$box_base_name = 'displayvat'; // for easy unique box template setup (added BTSv1.2)
$box_id = $box_base_name . 'Box'; // for CSS styling paulm (editted BTSv1.2)
// START CONTRIBUTION "Switch between displaying prices Inc./Ex. VAT for BTS / osCMax"
$boxContent = '<table border="0" width="100%" cellspacing="0" cellpadding="0" class="infoBoxContents">
<tr><td class="infoBoxContents" align="right" valign="bottom">'
if ($vat_disp == '1') {
$boxContent = 'All prices displayed:<br><b>Inc. VAT</b>'
} else {
$boxContent = 'All prices displayed:<br><b>Ex. VAT</b>'
}
$boxContent = '</td></tr><tr><td class="infoBoxContents" align="right" valign="bottom">'
if ($vat_disp == '1') {
$boxContent = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'vat_disp')) . 'vat_disp=0') . '">' . tep_image_button('button_inc_ex_vat.gif', To_Prices_Ex_VAT) . '</a>';
} else {
$boxContent = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency', 'vat_disp')) . 'vat_disp=1') . '">' . tep_image_button('button_inc_ex_vat.gif', To_Prices_Inc_VAT) . '</a>';
}
$boxContent = '</td></tr></table>'
// FINISH CONTRIBUTION "Switch between displaying prices Inc./Ex. VAT for BTS / osCMax"
// bof BTSv1.2
if(file_exists(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php')) {
// if exists, load unique box template for this box from templates/boxes/
require(DIR_WS_BOX_TEMPLATES . $box_base_name . '.tpl.php');
}
else {
// load default box template: templates/boxes/box.tpl.php
require(DIR_WS_BOX_TEMPLATES . TEMPLATENAME_BOX);
}
// eof BTSv1.2
$boxContent_attributes = '';
?>


But no luck, can anyone more experienced than me with php guide me down the correct path as I am about ready to jump off a very tall building.

I have modified my column_right file to place this box at the top of the column above the shopping cart box but now all it does is display an empty right column.

the site can be seen on my dev server (unreliable linux ppc sitting under my desk, read slow if working :lol: ) http://oksports.sytes.net

Thanks,