I got the code:
function list_rates( &$d ) {
global $vendor_name, $VM_LANG, $shipping_rate;
$html = "<strong>".$VM_LANG->_('PHPSHOP_FREE_SHIPPING_CUSTOMER_TEXT')."</strong> ";
$html .= "<input type=\"radio\" name=\"shipping_rate_id\" value=\"free_shipping|$vendor_name|".$VM_LANG->_('PHPSHOP_FREE_SHIPPING')."|0|1\" checked=\"checked\" />";
$html .= "<strong><br />You can still upgrade to express shipping ($6.00)";
$html .= "<input type=\"radio\" name=\"shipping_rate_id\" value=\"express_shipping\" />";
$html .= "<strong> or same day shipping ($12.00)";
$html .= "<input type=\"radio\" name=\"shipping_rate_id\" value=\"sameday_shipping\" />";
echo $html;
return True;
}
Now, if the first radio button is checked, i want to return 0. If the second was checked then i want to return 6 and return 12 for the 3rd radio button selection. The if and return has to be done in another function here:
function get_rate( &$d ) {
if ($selected_radio == 'free_shipping') {
$shipping_rate = 0; }
if ($selected_radio == 'express_shipping') {
$shipping_rate = 6; }
if ($selected_radio == 'sameday_shipping') {
$shipping_rate = 12; }
return $shipping_rate;
}
I tried this if, but it didn't work. I'm not an expert in php, so I am still learning
My basic question is: how to?

New Topic/Question
Reply



MultiQuote




|