- Posts: 177
- Thank you received: 1
Payment method layout - Change Layout
- andreasuriani
-
Topic Author
- Offline
Less
More
9 years 6 months ago #269789
by andreasuriani
Payment method layout - Change Layout was created by andreasuriani
Hello,
sorry to ask but i'm getting crazy!
I'm trying to change payment method layout but i can't understand how!
This is what i see and what i'd like to see..
I'm trying to modify checkout / payment.php but it seems the order to show is correct.. but it doesn't work!
So i need to:
1) Hide Orange Button
2) Move the price payment at the end..
This is my code:
Please help..
sorry to ask but i'm getting crazy!
I'm trying to change payment method layout but i can't understand how!
This is what i see and what i'd like to see..
I'm trying to modify checkout / payment.php but it seems the order to show is correct.. but it doesn't work!
So i need to:
1) Hide Orange Button
2) Move the price payment at the end..
This is my code:
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 3.0.1
* @author hikashop.com
* @copyright (C) 2010-2017 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!empty($this->orderInfos->full_total->prices[0]) && bccomp($this->orderInfos->full_total->prices[0]->price_value_with_tax,0,5)!=0){
if(!empty($this->methods)){
?>
<div id="hikashop_payment_methods" class="hikashop_payment_methods">
<fieldset>
<legend><?php echo JText::_('HIKASHOP_PAYMENT_METHOD');?></legend>
<?php
$done = false;
$row_index=0;
$auto_select_default = $this->config->get('auto_select_default',2);
if($auto_select_default==1 && count($this->methods)>1) $auto_select_default=0;
$odd = 0;
if(!HIKASHOP_RESPONSIVE) {
?>
<table class="hikashop_payment_methods_table">
<?php
foreach($this->methods as $method){
$checked = '';
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
$checked = 'checked="checked"';
$done = true;
}
if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
$checked.=' onclick="this.form.action=this.form.action+\'#hikashop_payment_methods\';this.form.submit(); return false;"';
}
?>
<tr class="row<?php echo $odd; ?>">
<td>
<input class="hikashop_checkout_payment_radio" id="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" type="radio" name="hikashop_payment" value="<?php echo $method->payment_type.'_'.$method->payment_id;?>" <?php echo $checked; ?> />
</td>
<td><label for="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_image">
<?php
if(!empty($method->payment_images)){
$images = explode(',',$method->payment_images);
if(!empty($images)){
foreach($images as $image){
if(!empty($this->images_payment[$image])){
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. $this->images_payment[$image];?>" alt=""/>
<?php
}
}
}
}
?>
</span>
</label>
</td>
<td><label for="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_name"><?php echo $method->payment_name;?></span></label>
<span class="hikashop_checkout_payment_cost">
<?php
if(bccomp($method->payment_price,0,5) === 0) {
$price_text = JText::_('FREE_PAYMENT');
} else {
$pt = (int)$this->params->get('price_with_tax');
$price_text = JText::_('PRICE_BEGINNING');
$price_text .= '<span class="hikashop_checkout_payment_price">';
if($pt){
$price_text .= $this->currencyHelper->format($method->payment_price_with_tax,$method->payment_params->payment_currency);
}
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
if($this->params->get('show_original_price') && isset($method->payment_price_orig) && bccomp($method->payment_price_orig, 0, 5)) {
$price_text .= JText::_('PRICE_BEFORE_ORIG');
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig_with_tax, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
$price_text .= JText::_('PRICE_AFTER_ORIG');
}
$price_text .= '</span> ';
$price_text .= JText::_('PRICE_END');
}
echo $price_text;
?>
</span>
<?php
if(!empty($method->payment_description)){
?>
<br/>
<div class="hikashop_checkout_payment_description"><?php echo $method->payment_description;?></div>
<?php
}
?>
</td>
</tr>
<tr class="hikashop_checkout_payment_ccinfo">
<td colspan="3">
<?php
$this->method =& $method;
$this->setLayout('ccinfo');
echo $this->loadTemplate();
?>
</td>
</tr>
<?php
$row_index++;
$odd = 1-$odd;
}
?>
</table>
<?php
} else {
?>
<div class="controls">
<div class="hika-radio">
<table class="hikashop_payment_methods_table table table-striped table-hover">
<?php
foreach($this->methods as $method){
$checked = '';
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
$checked = 'checked="checked"';
$done = true;
}
if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
$checked.=' onclick="this.form.action=this.form.action+\'#hikashop_payment_methods\';this.form.submit(); return false;"';
}
?>
<tr class="row<?php echo $odd; ?>">
<td>
<input class="hikashop_checkout_payment_radio" id="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" type="radio" name="hikashop_payment" value="<?php echo $method->payment_type.'_'.$method->payment_id;?>" <?php echo $checked; ?> />
<label class="btn btn-radio" for="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>"><?php echo $method->payment_name;?></label>
<span class="hikashop_checkout_payment_cost">
<?php
if(bccomp($method->payment_price,0,5) === 0) {
$price_text = JText::_('FREE_PAYMENT');
} else {
$pt = (int)$this->params->get('price_with_tax');
$price_text = JText::_('PRICE_BEGINNING');
$price_text .= '<span class="hikashop_checkout_payment_price">';
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_with_tax,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
if($this->params->get('show_original_price') && isset($method->payment_price_orig) && bccomp($method->payment_price_orig, 0, 5)) {
$price_text .= JText::_('PRICE_BEFORE_ORIG');
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig_with_tax, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
$price_text .= JText::_('PRICE_AFTER_ORIG');
}
$price_text .= '</span> ';
$price_text .= JText::_('PRICE_END');
}
echo $price_text;
?>
</span>
<span class="hikashop_checkout_payment_image">
<?php
if(!empty($method->payment_images)){
$images = explode(',',$method->payment_images);
if(!empty($images)){
foreach($images as $image){
if(!empty($this->images_payment[$image])){
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. $this->images_payment[$image];?>" alt=""/>
<?php
}
}
}
}
?>
</span>
<div class="hikashop_checkout_payment_description"><?php echo $method->payment_description;?></div>
<div class="ccinfo">
<?php
$this->method =& $method;
$this->setLayout('ccinfo');
echo $this->loadTemplate();
?>
</div>
</td>
</tr>
<?php
$odd = 1-$odd;
}
?>
</table>
</div>
<script type="text/javascript">
(function($){
$("#hikashop_payment_methods .hika-radio input:checked").each(function() {
$("label[for=" + jQuery(this).attr('id') + "]").addClass('active btn-primary');
});
$("#hikashop_payment_methods .hika-radio input").change(function() {
$(this).parents('div.hika-radio').find('label.active').removeClass('active btn-primary');
$("label[for=" + jQuery(this).attr('id') + "]").addClass('active btn-primary');
});
})(jQuery);
</script>
</div>
<?php
}
?>
</fieldset>
</div>
<?php
}
}
Please Log in or Create an account to join the conversation.
9 years 6 months ago #269797
by nicolas
Replied by nicolas on topic Payment method layout - Change Layout
Hi,
First, please note that the "payment" file of the view "checkout" is only used with the "checkout legacy" setting activated.
If you turned off that setting, then you're using the new checkout system and thus you're using the file "show_block_payment" of the "checkout" view.
So maybe that's why you do find that you think you should have there as you're maybe not editing the correct view file ?
Since you didn't provide a link to the shop I can't say.
First, please note that the "payment" file of the view "checkout" is only used with the "checkout legacy" setting activated.
If you turned off that setting, then you're using the new checkout system and thus you're using the file "show_block_payment" of the "checkout" view.
So maybe that's why you do find that you think you should have there as you're maybe not editing the correct view file ?
Since you didn't provide a link to the shop I can't say.
Please Log in or Create an account to join the conversation.
- andreasuriani
-
Topic Author
- Offline
Less
More
- Posts: 177
- Thank you received: 1
9 years 6 months ago #269833
by andreasuriani
Replied by andreasuriani on topic Payment method layout - Change Layout
Hello,
ok, i've opned the right file view but the issue still remain.
I removed all <div> content <button> ....
Website is www.andreasuriani.com/index.php/it/checkout/checkout
I send you the credential on your contact form.
A.
ok, i've opned the right file view but the issue still remain.
I removed all <div> content <button> ....
Code:
<?php
/**
* @package HikaShop for Joomla!
* @version 3.0.1
* @author hikashop.com
* @copyright (C) 2010-2017 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php if(empty($this->ajax)) { ?>
<div id="hikashop_checkout_payment_<?php echo $this->step; ?>_<?php echo $this->module_position; ?>" class="hikashop_checkout_payment">
<?php } ?>
<div class="hikashop_checkout_loading_elem"></div>
<div class="hikashop_checkout_loading_spinner"></div>
<?php
$this->checkoutHelper->displayMessages('payment');
$cart = $this->checkoutHelper->getCart();
if(!empty($cart->usable_methods->payment)) {
?>
<table style="width:100%" class="hikashop_payment_methods_table table table-bordered table-striped table-hover">
<?php
foreach($cart->usable_methods->payment as $payment) {
$input_id = 'payment_radio_'.$this->step.'_'.$this->module_position.'__'.$payment->payment_type.'_'.$payment->payment_id;
$container_id = 'hikashop_checkout_payment_'.$this->step.'_'.$this->module_position.'__'.$payment->payment_id;
$selected = (!empty($cart->payment) && $payment->payment_id == $cart->payment->payment_id);
$input_data = array(
'step' => $this->step,
'pos' => $this->module_position,
'block' => 'payment',
'type' => $payment->payment_type,
'id' => (int)$payment->payment_id,
);
?>
<tr><td>
<input class="hikashop_checkout_payment_radio" type="radio" name="checkout[payment][id]" id="<?php echo $input_id; ?>" data-hk-checkout="<?php echo $this->escape(json_encode($input_data)); ?>" onchange="window.checkout.paymentSelected(this);" value="<?php echo $payment->payment_id;?>"<?php echo ($selected ? ' checked="checked"' : ''); ?>/>
<label for="<?php echo $input_id; ?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_name"><?php echo $payment->payment_name;?></span>
</label>
<span class="hikashop_checkout_payment_cost"><?php
echo $this->checkoutHelper->getDisplayPrice($payment, 'payment', $this->options);
?></span>
<?php
if(!empty($payment->payment_images)) {
?>
<span class="hikashop_checkout_payment_images">
<?php
$images = explode(',', $payment->payment_images);
foreach($images as $image) {
$img = $this->checkoutHelper->getPluginImage($image, 'payment');
if(empty($img))
continue;
?>
<img src="<?php echo $img->url; ?>" alt=""/>
<?php
}
?>
</span>
<?php
}
?>
<?php
if(!empty($payment->payment_description)) {
?>
<div class="hikashop_checkout_payment_description"><?php
echo $payment->payment_description;
?></div>
<?php
}
?>
<?php
if(!empty($payment->ask_cc)) {
?>
<div id="<?php echo $container_id; ?>__card" class="hikashop_checkout_payment_card" style="<?php echo $selected ? '' : ' display:none;'; ?>"><?php
$cc_data = $this->checkoutHelper->getCreditCard($payment);
if(empty($cc_data))
hikashop_loadJsLib('creditcard');
?>
<dl class="hika_options large">
<?php
if(!empty($payment->ask_owner)) {
?>
<dt><?php echo JText::_('CREDIT_CARD_OWNER'); ?></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off" name="checkout[payment][card][<?php echo $payment->payment_id;?>][owner]" value="" />
<?php
} else {
?>
<span class="hikashop_checkout_payment_card_details"><?php echo $this->escape(@$cc_data->owner); ?></span>
<?php
}
?>
</dd>
<?php
}
?>
<?php
if(!empty($payment->ask_cctype)) {
?>
<dt><?php echo JText::_('CARD_TYPE'); ?></dt>
<dd><?php
if(empty($cc_data)) {
$values = array();
foreach($payment->ask_cctype as $k => $v) {
$values[] = JHTML::_('select.option', $k, $v);
}
echo JHTML::_('select.genericlist', $values, 'checkout[payment][card]['.$payment->payment_id.'][type]', '', 'value', 'text', '');
} else {
?>
<span class="hikashop_checkout_payment_card_details"><?php
if(isset($payment->ask_cctype[@$cc_data->type]))
echo $this->escape($payment->ask_cctype[@$cc_data->type]);
else
echo $this->escape(@$cc_data->type);
?></span>
<?php
}
?></dd>
<?php
}
?>
<dt><label for="hk_co_p_c_n_<?php echo $payment->payment_id; ?>"><?php echo JText::_('CREDIT_CARD_NUMBER'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off" name="checkout[payment][card][<?php echo $payment->payment_id; ?>][num]" value="" onchange="if(!hikashopCheckCreditCard(this.value)){ this.value = '';}" id="hk_co_p_c_<?php echo $payment->payment_id; ?>"/>
<?php
} else {
?>
<span class="hikashop_checkout_payment_card_details"><?php echo $this->escape(@$cc_data->num); ?></span>
<?php
}
?>
</dd>
<dt><label for="hk_co_p_c_e_<?php echo $payment->payment_id; ?>"><?php echo JText::_('EXPIRATION_DATE'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off" name="checkout[payment][card][<?php echo $payment->payment_id; ?>][mm]" class="card_expiration_date_input" maxlength="2" size="2" value="" placeholder="<?php $mm = JText::_('CC_MM'); if($mm=='CC_MM') $mm = JText::_('MM'); echo $mm;?>" id="hk_co_p_c_e_<?php echo $payment->payment_id; ?>"/>
/
<input type="text" autocomplete="off" name="checkout[payment][card][<?php echo $payment->payment_id; ?>][yy]" class="card_expiration_date_input" maxlength="2" size="2" value="" placeholder="<?php echo JText::_('YY');?>" />
<?php
} else {
?>
<span class="hikashop_checkout_payment_card_details"><?php echo $this->escape(@$cc_data->mm) . '/' . $this->escape(@$cc_data->yy); ?></span>
<?php
}
?>
</dd>
<?php
if(!empty($payment->ask_ccv)) {
hikashop_loadJsLib('tooltip');
?>
<dt><label for="hk_co_p_c_v_<?php echo $payment->payment_id; ?>" data-toggle="hk-tooltip" data-title="<?php echo htmlspecialchars('<strong>'.JText::_('CVC_TOOLTIP_TITLE').'</strong><br/>'.JText::_('CVC_TOOLTIP_TEXT'), ENT_COMPAT, 'UTF-8'); ?>"><?php echo JText::_('CARD_VALIDATION_CODE'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off" name="checkout[payment][card][<?php echo $payment->payment_id;?>][ccv]" maxlength="4" size="4" value="" id="hk_co_p_c_v_<?php echo $payment->payment_id; ?>"/>
<?php
} else {
?>
<span class="hikashop_checkout_payment_card_details"><?php echo $this->escape(@$cc_data->ccv); ?></span>
<?php
}
?>
</dd>
<?php
}
?>
</dl>
<?php
if(empty($cc_data)) {
?>
<?php
} else {
?>
<?php
}
?>
</div>
<?php
}
?>
<?php
if(!empty($payment->custom_html)) {
?>
<div id="<?php echo $container_id; ?>__custom" class="hikashop_checkout_payment_custom" style="<?php echo $selected ? '' : ' display:none;'; ?>">
<?php
echo $this->checkoutHelper->getCustomHtml($payment->custom_html, 'checkout[payment][custom]['.$payment->payment_id.']');
?>
</div>
<?php
}
?>
</td></tr>
<?php
}
?>
</table>
<?php
}
if(empty($this->ajax)) { ?>
</div>
<script type="text/javascript">
if(!window.checkout) window.checkout = {};
window.checkout.selectedPayment = <?php echo (int)$cart->payment->payment_id; ?>;
window.Oby.registerAjax(['checkout.payment.updated','cart.updated'], function(params){
if(params && (params.cart_empty || (params.resp && params.resp.empty))) return;
window.checkout.refreshPayment(<?php echo (int)$this->step; ?>, <?php echo (int)$this->module_position; ?>);
});
window.checkout.refreshPayment = function(step, id) { return window.checkout.refreshBlock('payment', step, id); };
window.checkout.submitPayment = function(step, id) { return window.checkout.submitBlock('payment', step, id); };
window.checkout.paymentSelected = function(el) {
var data = window.Oby.evalJSON(el.getAttribute('data-hk-checkout')),
prefix = 'hikashop_checkout_payment_' + data.step + '_' + data.pos + '__',
el = null, d = document;
var url = "<?php echo hikashop_completeLink('checkout&task=submitblock&blocktask=payment&cid=HIKACID&blockpos=HIKAPOS&tmpl=ajax', false, false, true); ?>".replace("HIKACID", data.step).replace("HIKAPOS", data.pos),
formData = 'selectionOnly=1&' + encodeURI('checkout[payment][id]') + '=' + encodeURIComponent(data.id) + '&' + encodeURI(window.checkout.token)+'=1';
window.Oby.xRequest(url, {mode:"POST", data: formData}, function(x,p) {
var r = window.Oby.evalJSON(x.responseText);
if(r && r.ret > 0) {
window.checkout.selectedPayment = data.id;
}
if(r && r.events)
window.checkout.processEvents(r.events);
});
if(window.checkout.selectedPayment > 0) {
var b = prefix + window.checkout.selectedPayment;
window.hikashop.setArrayDisplay([b + '__card', b + '__custom'], false);
}
var b = prefix + data.id;
window.hikashop.setArrayDisplay([b + '__card', b + '__custom'], true);
};
window.checkout.resetPayment = function(step, pos, payment_id) {
var formData = encodeURI('checkout[payment][id]') + '=' + encodeURIComponent(payment_id) + '&' + encodeURI('checkout[payment][card]['+payment_id+']') + '=reset';
return window.checkout.submitBlock('payment', step, pos, formData);
};
</script>
<?php }
Website is www.andreasuriani.com/index.php/it/checkout/checkout
I send you the credential on your contact form.
A.
Please Log in or Create an account to join the conversation.
9 years 6 months ago - 9 years 6 months ago #269843
by Philip
Replied by Philip on topic Payment method layout - Change Layout
Hello,
Step by step :
1°) Around line 37, you have this :
Remove the <label>...</label> to have this :
2°) See my screenshot, a little on below, you have to switch position, span (hikashop_checkout_payment_cost) WITH span (hikashop_checkout_payment_images).
Hope this will help you.
Regards
Step by step :
1°) Around line 37, you have this :
Code:
...
<input class="hikashop_checkout_payment_radio" type="radio" name="checkout[payment][id]" id="<?php echo $input_id; ?>" data-hk-checkout="<?php echo $this->escape(json_encode($input_data)); ?>" onchange="window.checkout.paymentSelected(this);" value="<?php echo $payment->payment_id;?>"<?php echo ($selected ? ' checked="checked"' : ''); ?>/>
<label for="<?php echo $input_id; ?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_name"><?php echo $payment->payment_name;?></span>
</label>
<span class="...
Code:
...
<input class="hikashop_checkout_payment_radio" type="radio" name="checkout[payment][id]" id="<?php echo $input_id; ?>" data-hk-checkout="<?php echo $this->escape(json_encode($input_data)); ?>" onchange="window.checkout.paymentSelected(this);" value="<?php echo $payment->payment_id;?>"<?php echo ($selected ? ' checked="checked"' : ''); ?>/>
<span class="...
Hope this will help you.
Regards
Last edit: 9 years 6 months ago by Philip.
Please Log in or Create an account to join the conversation.
- andreasuriani
-
Topic Author
- Offline
Less
More
- Posts: 177
- Thank you received: 1
9 years 6 months ago #270017
by andreasuriani
Replied by andreasuriani on topic Payment method layout - Change Layout
Hi Philip,
i'm sorry but i'm using the Checkout Legacy... so the file is checkout/payment is it right?
I've tried to look inside but i don't know where modify the strings... can you kindly help me?
Thanks in advance.
A.
i'm sorry but i'm using the Checkout Legacy... so the file is checkout/payment is it right?
I've tried to look inside but i don't know where modify the strings... can you kindly help me?
Thanks in advance.
A.
Please Log in or Create an account to join the conversation.
- andreasuriani
-
Topic Author
- Offline
Less
More
- Posts: 177
- Thank you received: 1
9 years 6 months ago #270018
by andreasuriani
Replied by andreasuriani on topic Payment method layout - Change Layout
I did it! 
Following your previus istruction....
Following your previus istruction....
Code:
<div id="titolo" class="hikashop_payment_methods">
<fieldset>
<legend><?php echo JText::_('HIKASHOP_PAYMENT_METHOD');?></legend></fieldset>
</div>
<table style="width: 100%; height: 100%;" cellpadding="20">
<tbody>
<tr>
<td style="width: 50%;"><?php
/**
* @package HikaShop for Joomla!
* @version 3.0.1
* @author hikashop.com
* @copyright (C) 2010-2017 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!empty($this->orderInfos->full_total->prices[0]) && bccomp($this->orderInfos->full_total->prices[0]->price_value_with_tax,0,5)!=0){
if(!empty($this->methods)){
?>
<div id="hikashop_payment_methods" class="hikashop_payment_methods">
<fieldset>
<?php
$done = false;
$row_index=0;
$auto_select_default = $this->config->get('auto_select_default',2);
if($auto_select_default==1 && count($this->methods)>1) $auto_select_default=0;
$odd = 0;
if(!HIKASHOP_RESPONSIVE) {
?>
<table class="hikashop_payment_methods_table">
<?php
foreach($this->methods as $method){
$checked = '';
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
$checked = 'checked="checked"';
$done = true;
}
if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
$checked.=' onclick="this.form.action=this.form.action+\'#hikashop_payment_methods\';this.form.submit(); return false;"';
}
?>
<tr class="row<?php echo $odd; ?>">
<td>
<input class="hikashop_checkout_payment_radio" id="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" type="radio" name="hikashop_payment" value="<?php echo $method->payment_type.'_'.$method->payment_id;?>" <?php echo $checked; ?> />
</td>
<td><label for="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_image">
<?php
if(!empty($method->payment_images)){
$images = explode(',',$method->payment_images);
if(!empty($images)){
foreach($images as $image){
if(!empty($this->images_payment[$image])){
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. $this->images_payment[$image];?>" alt=""/>
<?php
}
}
}
}
?>
</span>
</label>
</td>
<td><label for="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" style="cursor:pointer;">
<span class="hikashop_checkout_payment_name"><?php echo $method->payment_name;?></span></label>
<span class="hikashop_checkout_payment_cost">
<?php
if(bccomp($method->payment_price,0,5) === 0) {
$price_text = JText::_('FREE_PAYMENT');
} else {
$pt = (int)$this->params->get('price_with_tax');
$price_text = JText::_('PRICE_BEGINNING');
$price_text .= '<span class="hikashop_checkout_payment_price">';
if($pt){
$price_text .= $this->currencyHelper->format($method->payment_price_with_tax,$method->payment_params->payment_currency);
}
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
if($this->params->get('show_original_price') && isset($method->payment_price_orig) && bccomp($method->payment_price_orig, 0, 5)) {
$price_text .= JText::_('PRICE_BEFORE_ORIG');
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig_with_tax, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
$price_text .= JText::_('PRICE_AFTER_ORIG');
}
$price_text .= '</span> ';
$price_text .= JText::_('PRICE_END');
}
echo $price_text;
?>
</span>
<?php
if(!empty($method->payment_description)){
?>
<br/>
<div class="hikashop_checkout_payment_description"><?php echo $method->payment_description;?></div>
<?php
}
?>
</td>
</tr>
<tr class="hikashop_checkout_payment_ccinfo">
<td colspan="3">
<?php
$this->method =& $method;
$this->setLayout('ccinfo');
echo $this->loadTemplate();
?>
</td>
</tr>
<?php
$row_index++;
$odd = 1-$odd;
}
?>
</table>
<?php
} else {
?>
<div class="controls">
<div class="hika-radio">
<table class="hikashop_payment_methods_table table table-striped table-hover">
<?php
foreach($this->methods as $method){
$checked = '';
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
$checked = 'checked="checked"';
$done = true;
}
if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
$checked.=' onclick="this.form.action=this.form.action+\'#hikashop_payment_methods\';this.form.submit(); return false;"';
}
?>
<tr class="row<?php echo $odd; ?>">
<td>
<input class="hikashop_checkout_payment_radio" id="radio_<?php echo $method->payment_type.'_'.$method->payment_id;?>" type="radio" name="hikashop_payment" value="<?php echo $method->payment_type.'_'.$method->payment_id;?>" <?php echo $checked; ?> />
<span class="hikashop_checkout_payment_image">
<?php
if(!empty($method->payment_images)){
$images = explode(',',$method->payment_images);
if(!empty($images)){
foreach($images as $image){
if(!empty($this->images_payment[$image])){
?>
<img src="<?php echo HIKASHOP_IMAGES .'payment/'. $this->images_payment[$image];?>" alt=""/>
<?php
}
}
}
}
?>
</span>
<span class="hikashop_checkout_payment_cost">
<?php
if(bccomp($method->payment_price,0,5) === 0) {
$price_text = JText::_('FREE_PAYMENT');
} else {
$pt = (int)$this->params->get('price_with_tax');
$price_text = JText::_('PRICE_BEGINNING');
$price_text .= '<span class="hikashop_checkout_payment_price">';
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_with_tax,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price,$method->payment_params->payment_currency);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
if($this->params->get('show_original_price') && isset($method->payment_price_orig) && bccomp($method->payment_price_orig, 0, 5)) {
$price_text .= JText::_('PRICE_BEFORE_ORIG');
if($pt > 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig_with_tax, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_BEFORE_TAX');
if($pt == 2 || $pt == 0)
$price_text .= $this->currencyHelper->format($method->payment_price_orig, $method->payment_currency_orig);
if($pt == 2)
$price_text .= JText::_('PRICE_AFTER_TAX');
$price_text .= JText::_('PRICE_AFTER_ORIG');
}
$price_text .= '</span> ';
$price_text .= JText::_('PRICE_END');
}
echo $price_text;
?>
</span>
<div class="hikashop_checkout_payment_description"><?php echo $method->payment_description;?></div>
<div class="ccinfo">
<?php
$this->method =& $method;
$this->setLayout('ccinfo');
echo $this->loadTemplate();
?>
</div>
</td>
</tr>
<?php
$odd = 1-$odd;
}
?>
</table>
</div>
<script type="text/javascript">
(function($){
$("#hikashop_payment_methods .hika-radio input:checked").each(function() {
$("label[for=" + jQuery(this).attr('id') + "]").addClass('active btn-primary');
});
$("#hikashop_payment_methods .hika-radio input").change(function() {
$(this).parents('div.hika-radio').find('label.active').removeClass('active btn-primary');
$("label[for=" + jQuery(this).attr('id') + "]").addClass('active btn-primary');
});
})(jQuery);
</script>
</div>
<?php
}
?>
</fieldset>
</div>
<?php
}
}
?></td>
<td style="width: 50%;"><?php
/**
* @package HikaShop for Joomla!
* @version 3.0.1
* @author hikashop.com
* @copyright (C) 2010-2017 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><span class="hikashop_checkout_coupon" id="hikashop_checkout_coupon">
<?php
if(empty($this->coupon)){
echo JText::_('HIKASHOP_ENTER_COUPON');
?>
<input id="hikashop_checkout_coupon_input" type="text" name="coupon" value="" />
<?php
echo $this->cart->displayButton(JText::_('ADD'),'refresh',$this->params,hikashop_completeLink('checkout'),'',' onclick="return hikashopCheckCoupon(\'hikashop_checkout_coupon_input\');"');
}else{
echo JText::sprintf('HIKASHOP_COUPON_LABEL',@$this->coupon->discount_code);
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
?>
<a href="<?php echo hikashop_completeLink('checkout&task=step&step='.($this->step+1).'&previous='.$this->step.'&removecoupon=1'.'&'.hikashop_getFormToken().'=1'.$url_itemid); ?>" title="<?php echo JText::_('REMOVE_COUPON'); ?>" >
<img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" alt="<?php echo JText::_('REMOVE_COUPON'); ?>" />
</a>
<?php }?>
</span>
</td>
</tr>
</tbody>
</table>
Please Log in or Create an account to join the conversation.
Time to create page: 0.072 seconds