我想在结帐的步骤5中添加支付方式徽标
问题描述:
我在opencart 2.0.0.1上工作 我有两种付款方式COD和一种支付网关,我想在结帐的步骤5:付款方式中添加支付网关标识和COD图像。我想在结帐的步骤5中添加支付方式徽标
我想在结账添加图像编码/ payment_method.tpl这里是代码..
<?php if ($payment_methods) { ?>
<p><?php echo $text_payment_method; ?></p>
<?php foreach ($payment_methods as $payment_method) { ?>
<div class="radio">
<label>
<?php if ($payment_method['code'] == $code || !$code)
\t { ?>
<?php $code = $payment_method['code']; ?>
\t \t <input type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" checked="checked" />
<?php
\t } else
\t { ?>
<input type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" />
<?php
\t } ?>
\t
<?php echo $payment_method['title']; ?>
<?php if ($payment_method['terms']) { ?>
(<?php echo $payment_method['terms']; ?>)
<?php } ?>
</label>
</div>
<?php } ?>
<?php } ?>
答
我有一个溶液
可以手动检查付款方法代码和在结帐/ PAYMENTMETHOD控制器增加图象
if ($method)
\t \t \t \t \t {
\t \t \t \t \t \t if($method['code']=="cod")
\t \t \t \t \t \t {
\t \t \t \t \t \t \t $method['image'] = "<img src='image/COD.jpg' style='width:200px; height:100px'/>";
\t \t \t \t \t \t }
\t \t \t \t \t \t else if($method['code']=="cheque")
\t \t \t \t \t \t {
\t \t \t \t \t \t \t $method['image'] = "<img src='image/payumoney.jpg' style='width:200px; height:100px'/>";
\t \t \t \t \t \t }
\t \t \t \t \t \t if ($recurring) {
\t \t \t \t \t \t \t if (method_exists($this->{'model_payment_' . $result['code']}, 'recurringPayments') && $this->{'model_payment_' . $result['code']}->recurringPayments()) {
\t \t \t \t \t \t \t \t $method_data[$result['code']] = $method;
\t \t \t \t \t \t \t }
\t \t \t \t \t \t } else {
\t \t \t \t \t \t \t $method_data[$result['code']] = $method;
\t \t \t \t \t \t }
\t \t \t \t \t \t
\t \t \t \t \t \t //$method_data[$result['image']] = "<img src='image/payumoney.jpg' style='width:50px; height:50px'/>";
\t \t \t \t \t }
和观点也改变
<div class="radio payment_style" id="parent<?=$counter?>" for="radio<?=$counter?>">
\t \t <label>
\t \t \t <?php if ($payment_method['code'] == $code || !$code)
\t \t \t { ?>
\t \t \t <?php $code = $payment_method['code']; ?>
\t \t \t \t <input id="radio<?=$counter?>" type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" checked="checked" class="hide payment_radio" onclick="change_payment_method('<?=$counter?>')"/>
\t \t \t <?php
\t \t \t } else
\t \t \t { ?>
\t \t \t \t <input type="radio" id="radio<?=$counter?>" class="hide payment_radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" onclick="change_payment_method('<?=$counter?>')" />
\t \t \t <?php
\t \t \t } ?>
\t \t \t
\t \t \t <div class="radimg"><?php echo $payment_method['image']; ?> </div>
\t \t \t <?php /* echo $payment_method['title']; */?>
\t \t \t <?php if ($payment_method['terms']) { ?>
\t \t \t (<?php echo $payment_method['terms']; ?>)
\t \t \t <?php } ?>
\t \t </label>
\t \t </div>
答
我刚下2.1.0.2至极测试的基本相同的结构。 首先导航到/catalog/model/payment/cheque.php发现:
'title' => $this->language->get('text_title'),
,取而代之的是:
'title' => $this->language->get('img_title') . $this->language->get('text_title'),
然后导航到/语言/英文/支付/检查。 PHP 这增加了底部:
$_['img_title'] = '<img src="' . HTTPS_SERVER . 'image/check.jpg" alt="Check" title="Check" /></a>';
更改名称/升您希望在上面的代码中的“和”之间使用图像。并将alt =“”和title =“”更改为您在前工作时的当前付款。 ALT = “COD” 或ALT = “贝宝” ......
这适用于您添加或在Opencart的默认(鳕鱼,贝宝,银行电汇,ECT)
不要任何报酬不要忘了让图像变成你想要的尺寸。希望这可以帮助。
成品结果
我希望每次付款方式的形象或标志在这段代码 – amisha