Here's my code:
Display part:
if ($isCheckout !== true) {
// IF THIS IS THE CHECKOUT, HIDE THE SHIPPING BUTTONS
echo "<p class='red'><strong>Select delivery destination</strong></p><p><input type='radio' id='uk' name='shipping' value='1'";
if ($this->shippingarea == 1) {echo " checked='checked'";} // makes checkbox 'sticky'
echo " /> United Kingdom\n"; // United Kingdom
echo "<input type='radio' id='europe' name='shipping' value='2'";
if ($this->shippingarea == 2){echo " checked='checked'";} // Europe
echo " /> Europe\n";
echo "<input type='radio' id='world' name='shipping' value='3'";
if ($this->shippingarea == 3){echo " checked='checked'";} // International
echo " /> International</p>\n";
Code for calculation(which i think has something wrong to it:
// If any items in the cart
if($this->itemCount > 0)
{
switch ($this->shippingarea)
{
case 1:
if ($this->itemCount < 3){$this->shippingfee = ($this->itemCount * 0.50) + 0.50;}
else
{$this->shippingfee = 0;}
break;
case 2:
$this->shippingfee = ($this->itemCount * 0.50) + 0.50;
break;
case 3:
$this->shippingfee = ($this->itemCount * 0.50) + 0.50;
}
Checkout page where it is calculated:
if ($isCheckout === true) {
echo "\t\t\t\t\t\t<span id='jcart-subtotal'>" . $text['shipping_name'] . ": <strong>" . $text['currency_symbol'] . number_format($this->shippingfee,2) . "</strong></span>\n";
This post has been edited by iheartbreakz: 18 September 2012 - 10:03 PM

New Topic/Question
Reply



MultiQuote




|