VirtueMart next button not visible in FF

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jbmaca
Forum Newbie
Posts: 5
Joined: Thu Sep 03, 2009 1:29 am

VirtueMart next button not visible in FF

Post by jbmaca »

Hi,

For some reason, the next button for the VM "select shipping address" checkout step doesn't appear in Firefox and Safari. What's strange though is that it does appear for all the other steps. It appears to be a template issue since changing templates solves the problem - the button appears. This is the template I need to use though so have been trying to figure out what's causing it. The problem doesn't happen in IE8, Chrome or Opera.

I think the file I need to edit is checkout.index.php, specifically the lines quoted below. So far,The only way I could get the next button to appear is by changing the input type value in the line highlighted below to anything but hidden. This however creates a new input box, button, etc depending on what I put in. Can someone please help by pointing me in the right direction? Am I editing the right line of code? Many thanks in advance for the help.

Here's the website: http://www.dibetto.com
// CHECK_OUT_GET_SHIPPING_ADDR

// Lets the user pick or add an alternative Shipping Address

if( in_array('CHECK_OUT_GET_SHIPPING_ADDR', $checkout_steps[$current_stage]) ) {

echo '<a name="CHECK_OUT_GET_SHIPPING_ADDR"></a>';

echo $theme->fetch( 'checkout/get_shipping_address.tpl.php');

$theme->set('basket_html', '');

}

// CHECK_OUT_GET_SHIPPING_METHOD

// Let the user pick a shipping method

if( in_array('CHECK_OUT_GET_SHIPPING_METHOD', $checkout_steps[$current_stage]) ) {

echo '<a name="CHECK_OUT_GET_SHIPPING_METHOD"></a>';

echo $theme->fetch( 'checkout/get_shipping_method.tpl.php');

$theme->set('basket_html', '');

}



// -CHECK_OUT_GET_PAYMENT_METHOD

// let the user choose a payment method

if( in_array('CHECK_OUT_GET_PAYMENT_METHOD', $checkout_steps[$current_stage]) ) {

echo '<a name="CHECK_OUT_GET_PAYMENT_METHOD"></a>';

echo $theme->fetch( 'checkout/get_payment_method.tpl.php');

$theme->set('basket_html', '');

}

// -CHECK_OUT_GET_FINAL_CONFIRMATION

// shows a total summary including all payments, taxes, fees etc.

if( in_array('CHECK_OUT_GET_FINAL_CONFIRMATION', $checkout_steps[$current_stage]) ) {

echo '<a name="CHECK_OUT_GET_FINAL_CONFIRMATION"></a>';

// Now let the user confirm

echo $theme->fetch( 'checkout/get_final_confirmation.tpl.php');

$theme->set('basket_html', '');

}

?>

<br /><?php

foreach( $checkout_steps[$current_stage] as $this_step ) {

echo '<input type="hidden" name="checkout_this_step[]" value="'.$this_step.'" />';

}



// Set Dynamic Page Title: "Checkout: Step x of x"

$ii = 0;

for( $i = 1; $i < 5; $i++ ) {

if( isset( $checkout_steps[$i] ) ) {

$ii += 1;

if( in_array($this_step, $checkout_steps[$i] ) ) {

$mainframe->setPageTitle( sprintf( $VM_LANG->_('VM_CHECKOUT_TITLE_TAG'), $ii, count($checkout_steps) ));

break;

}

}

}



if( !in_array('CHECK_OUT_GET_FINAL_CONFIRMATION', $checkout_steps[$current_stage]) ) {

?>

<div align="center">

<input type="submit" class="button" name="formSubmit" value="<?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_NEXT');?> >>" />

</div>
jbmaca
Forum Newbie
Posts: 5
Joined: Thu Sep 03, 2009 1:29 am

Re: VirtueMart next button not visible in FF

Post by jbmaca »

anyone?
jlucey1
Forum Newbie
Posts: 1
Joined: Sat May 29, 2010 1:50 pm

Re: VirtueMart next button not visible in FF

Post by jlucey1 »

Note the Red text, I have added a HTML Hard space to the layout and this cured the issue for me in FireFox and Safari. Hope it helps you out a bit!! Cheers!


<br /><?php
foreach( $checkout_steps[$current_stage] as $this_step ) {
echo '<input type="hidden" name="checkout_this_step[]" value="'.$this_step.'" />';;
}


// Set Dynamic Page Title: "Checkout: Step x of x"
$ii = 0;
for( $i = 1; $i < 5; $i++ ) {
if( isset( $checkout_steps[$i] ) ) {
$ii += 1;
if( in_array($this_step, $checkout_steps[$i] ) ) {
$mainframe->setPageTitle( sprintf( $VM_LANG->_('VM_CHECKOUT_TITLE_TAG'), $ii, count($checkout_steps) ));
break;
}
}
}

if( !in_array('CHECK_OUT_GET_FINAL_CONFIRMATION', $checkout_steps[$current_stage]) ) {
?>
&nbsp;
<div align="center">

<input type="submit" class="button" name="formSubmit" value="<?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_NEXT');?> >>" />

</div>
<?php
}
// Close the Checkout Form, which was opened in the first checkout template using the variable $basket_html
echo '</form>';

if( !in_array('CHECK_OUT_GET_FINAL_CONFIRMATION', $checkout_steps[$current_stage]) ) {
echo "<script type=\"text/javascript\"><!--
function submit_order( form ) { return true; }
--></script>";
}
}

else {

if (!empty($auth['user_id'])) {
// USER IS LOGGED IN, BUT NO REGISTERED CUSTOMER
// WE NEED SOME ADDITIONAL INFORMATION HERE,
// SO REDIRECT HIM TO shop/shopper_add
$vmLogger->info( $VM_LANG->_('PHPSHOP_NO_CUSTOMER',false) );

include(PAGEPATH. 'checkout_register_form.php');
}

else {
// user is not logged in
echo $theme->fetch( 'checkout/login_registration.tpl.php' );
}
}
}
else {
vmRedirect( $sess->url( 'index.php?page=shop.cart', false, false ) );
}

?>
jbmaca
Forum Newbie
Posts: 5
Joined: Thu Sep 03, 2009 1:29 am

Re: VirtueMart next button not visible in FF

Post by jbmaca »

It worked!!! Such a simple solution too. Thank you so much jlucey1! :D :D :D
Post Reply