[IMP] website_payment: add payment method in footer
(optionnal and desactivate by defaut) Add all acquirers published in the automatic footer
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import models
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import website
|
||||
@@ -0,0 +1,9 @@
|
||||
from openerp import api, models
|
||||
|
||||
|
||||
class Website(models.Model):
|
||||
_inherit = "website"
|
||||
|
||||
@api.model
|
||||
def payment_acquirers(self):
|
||||
return list(self.env['payment.acquirer'].sudo().search([('website_published', '=', True)]))
|
||||
@@ -51,3 +51,8 @@ div.visa {
|
||||
input#cc_number:active, input#cc_number:focus {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
ul.payment_method_list img.img-rounded {
|
||||
max-width: 100px;
|
||||
max-height: 40px;
|
||||
}
|
||||
|
||||
@@ -1,31 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<!-- Page -->
|
||||
<data>
|
||||
<template id="cc_form" name="Paypal (Test)" page="True">
|
||||
<div class="row">
|
||||
<h3>Paypal payment: server 2 server</h3>
|
||||
<form class="form-horizontal col-sm-4 oe_cc" role="form">
|
||||
<div class="form-group col-sm-8">
|
||||
<label class="control-label" for="cc_number">Card number</label>
|
||||
<input type="tel" id="cc_number" class="form-control"/>
|
||||
<div class="card_placeholder"></div>
|
||||
<div class="visa"></div>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<label class="control-label" for="cc_cvc">Card code</label>
|
||||
<input type="text" id="cc_cvc" class="form-control" maxlength="4" palceholder="CVC"/>
|
||||
</div>
|
||||
<div class="form-group col-sm-7">
|
||||
<label class="control-label" for="cc_holder_name">Holder Name</label>
|
||||
<input type="text" id="cc_hoder_name" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group col-sm-5">
|
||||
<label class="control-label" for="cc_expires_mm">Expires</label>
|
||||
<input type="text" id="cc_expiry" class="form-control" maxlength="7" placeholder="MM / YY"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
</data>
|
||||
<data>
|
||||
<template id="header_footer_custom_payment" inherit_id="website.footer_default" customize_show="True" active="False" name="Payment Methods">
|
||||
<xpath expr="//div[@id='info']" position="inside">
|
||||
<h4 class="payment_method_title">Payment Method</h4>
|
||||
<ul class="payment_method_list list-inline">
|
||||
<t t-foreach="request.website.payment_acquirers()" t-as="acquirer">
|
||||
<li><img class="img-rounded" t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.provider, acquirer.provider)"/></li>
|
||||
</t>
|
||||
</ul>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Payment Frontend assets">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" href="/website_payment/static/src/css/website_payment.css"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user