I had a unique need that I solved with the terms and conditions module. I wanted to only show the t&c when they bought a certain product (this one requires a 5 month commitment). I wrote a simple function to see if the product was in the cart and I passed that into the 'enabled' flag in uc_checkout_pane. This pane shows up whether enabled is true or false. I did a work around by wrappig the entire call in my function, but thought you might want to know that you cannot disable a pane with the 'enabled' flag
function uc_gtct_checkout_pane() {
if (check_leapforward()) {
$panes[] = array(
'id' => 'gtct',
'callback' => 'uc_checkout_pane_gtct',
'title' => t('Terms and Conditions'),
'desc' => t("Please confirm if you agree with our terms and conditions that aply on all our deliveries."),
'weight' => 1,
'process' => TRUE,
'collapsible' => FALSE,
);
return $panes;
}
}
function check_leapforward()
{
$items = uc_cart_get_contents();
foreach($items as $cartitem) {
if ($cartitem->model =='VIT029') {
return true;
}
}
return false;
}




Joined: 10/29/2007