I had already asked for help to resolve this issue. But I have got an advise to describe my issue in more details for increasing chances to get an answer. And I will try to do it. I have a
checkout page in my website. There are 3 payment methods (Bank transfer, PayPal, Hello).(
please see the image_checkout1). "Hello" is the payment method added by myself. I need to stylize using CSS, Hello payment method. I found in the Dev. dashboard html code which creates these payment methods in a browser.(
please see the image_checkout2). After that I found php file, below is code which dynamically creates these label tags(if I understand this process correctly).
function getRadioPaymode($var, $default, $disabled, $type){
$app = JFactory::getApplication();
$db = JFactory::getDbo();
$html = '';
$gatewayType = 'TRUE';
$i = 0;
$option = '';
if($disabled == 1)
$option = 'disabled';
if($type == 'deposit')
$gatewayType = 'is_deposit=1';
if($type == 'subscription')
$gatewayType = 'is_subscription=1';
$query = "SELECT gwcode AS value, gateway_name AS text FROM #__jblance_paymode ".
"WHERE published=1 AND ".$gatewayType." ".
"ORDER BY ordering";
$db->setQuery($query);
$paymodes = $db->loadObjectList();
if(empty($paymodes)){
$html = '<p class="alert alert-error">'.JText::_('COM_JBLANCE_NO_PAYMENT_GATEWAY_ENABLED').'</p>';
return $html;
}
foreach($paymodes as $item){
$checked = $img = '';
$imgPath = "components/com_jblance/gateways/images/$item->value.png";
if(++$i == 1) $checked="checked";
if(JFile::exists($imgPath))
$img = '<img class="img-polaroid" title="" src="'.$imgPath.'" alt="'.$item->text.'" style="margin-left:10px; width:100px; height:30px;">';
$html .= "\n\t".
'<label class="radio" style="min-height:42px;">'. "\n".
'<input type="radio" style="float:none;" name="'.$var.'" id="'.$var.'" value="'.$item->value.'" '.$checked.'>'.
$img.
'<span style="margin-left: 10px;">'.JText::_($item->text).'</span>'.
'</label>';
}
$html .= "\n";
return $html;
}
Below is a part of code of php file which is rendering the page with the issue. And in this code is function which added above.
<div class="sp10"> </div>
<div id="div-gateway" class="well well-small white">
<div class="control-group">
<label class="control-label" for="delivery"><?php echo JText::_('COM_JBLANCE_PAYMENT'); ?>:</label>
<div class="controls">
<?php
$list_paymode = $model->getRadioPaymode('gateway', '', '', 'subscription');
echo $list_paymode;
var_dump($list_paymode);
?>
</div>
</div>
</div>
What I have tried:
After that as I asked for help on this site in the first time. I have got a solution. I have inserted a code from this solution. This is my code after adding the code from the solution
$idlist = array("ida", "idb", "idc");
foreach($idlist as $id){
$html .= "\n\t".
'<label id="' . $id . '" class="radio" style="min-height:42px;">'. "\n".
'<input type="radio" style="float:none;" name="'.$var.'" id="'.$var.'" value="'.$item->value.'" '.$checked.'>'.
$img.
'<span style="margin-left: 10px;">'.JText::_($item->text).'</span>'.
'</label>';
}
}
$html .= "\n";
return $html;
Ids were added into the label tags, but now I have 9 payment methods instead of 3 on the page (3 Bank transfer, 3 PayPal, 3 Hello)(
please see the checkout_image3). I am new to php, I am just creating websites using CMS. Please help me to resolve this issue.