[IMP] website_sale: checkout + action return
bzr revid: chm@openerp.com-20130723133923-umjm1uqk8y5xalf6
This commit is contained in:
commit
840f1923a6
|
@ -7,6 +7,7 @@ from openerp.addons.web.http import request
|
|||
|
||||
def template_values():
|
||||
script = "\n".join(['<script type="text/javascript" src="%s"></script>' % i for i in manifest_list('js', db=request.db)])
|
||||
css = "\n".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list('css', db=request.db))
|
||||
try:
|
||||
request.session.check_security()
|
||||
loggued = True
|
||||
|
@ -21,7 +22,8 @@ def template_values():
|
|||
'registry': request.registry,
|
||||
'cr': request.cr,
|
||||
'uid': uid,
|
||||
'script' : script,
|
||||
'script': script,
|
||||
'css': css,
|
||||
}
|
||||
return values
|
||||
|
||||
|
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
@ -182,4 +182,14 @@ $(function(){
|
|||
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Client action to go back in global history.
|
||||
* If can't go back in history stack, will go back to home.
|
||||
*/
|
||||
instance.web.ActionGoBack = function(parent, action) {
|
||||
window.history.back();
|
||||
};
|
||||
instance.web.client_actions.add("goback", "instance.web.ActionGoBack");
|
||||
|
||||
};
|
|
@ -53,38 +53,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title t-raw="title"><t t-esc="res_company.name"/></title>
|
||||
<link rel="stylesheet" href="/web/webclient/css"/>
|
||||
<link rel='stylesheet' href='https://www.openerp.com/saas_master/static/site_new/fonts/lato/stylesheet.css'/>
|
||||
<link href='//fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'/>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700' rel='stylesheet' type='text/css'/>
|
||||
<t t-raw="script"/>
|
||||
<t t-if="editable">
|
||||
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" rel="stylesheet" type="text/css" />
|
||||
<script>
|
||||
openerp.$ = jQuery;
|
||||
delete window.jQuery;
|
||||
delete window.$;
|
||||
<t t-raw="head">
|
||||
<title t-raw="title"><t t-esc="res_company.name"/></title>
|
||||
<t t-raw="css"/>
|
||||
<link rel='stylesheet' href='https://www.openerp.com/saas_master/static/site_new/fonts/lato/stylesheet.css'/>
|
||||
<link href='//fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'/>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700' rel='stylesheet' type='text/css'/>
|
||||
<t t-raw="script"/>
|
||||
<t t-if="editable">
|
||||
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" rel="stylesheet" type="text/css" />
|
||||
<script>
|
||||
openerp.$ = jQuery;
|
||||
delete window.jQuery;
|
||||
delete window.$;
|
||||
|
||||
Aloha = {}
|
||||
Aloha.settings = {sidebar: {disabled: true}};
|
||||
</script>
|
||||
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
|
||||
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.2.js"></script>
|
||||
<!--
|
||||
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link, common/highlighteditables"></script>
|
||||
-->
|
||||
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link"></script>
|
||||
<script>
|
||||
Aloha.ready(function() {
|
||||
window.$ = openerp.$;
|
||||
window.jQuery = openerp.$;
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website_bootstrap.js"></script>
|
||||
Aloha = {}
|
||||
Aloha.settings = {sidebar: {disabled: true}};
|
||||
</script>
|
||||
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
|
||||
<script type="text/javascript" src="http://cdn.aloha-editor.org/latest/lib/vendor/jquery-1.7.2.js"></script>
|
||||
<!--
|
||||
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link, common/highlighteditables"></script>
|
||||
-->
|
||||
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link"></script>
|
||||
<script>
|
||||
Aloha.ready(function() {
|
||||
window.$ = openerp.$;
|
||||
window.jQuery = openerp.$;
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="/website/static/src/js/website_bootstrap.js"></script>
|
||||
</t>
|
||||
</t>
|
||||
</head>
|
||||
<body class="oe_website oe_styling_v8">
|
||||
<body class="oe_website">
|
||||
|
||||
<header class="oe_website_header">
|
||||
<t t-call="website.header"/>
|
||||
|
@ -183,9 +185,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</template>
|
||||
|
|
|
@ -206,29 +206,66 @@ class Ecommerce(http.Controller):
|
|||
|
||||
return request.registry.get("ir.ui.view").render(cr, uid, "website_sale.checkout", values)
|
||||
|
||||
@http.route(['/shop/confirm_cart'], type='http', auth="admin")
|
||||
def confirm_cart(self, *arg, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
values = self.get_values()
|
||||
partner_obj = request.registry.get('res.partner')
|
||||
|
||||
values['partner'] = False
|
||||
if post:
|
||||
post['country_id'] = (request.registry.get('res.country').search(cr, uid, [('name', 'ilike', post.pop('country'))]) + [None])[0]
|
||||
post['state_id'] = (request.registry.get('res.country.state').search(cr, uid, [('name', 'ilike', post.pop('state'))]) + [None])[0]
|
||||
|
||||
if partner_id:
|
||||
partner_obj.write(cr, uid, [partner_id], post)
|
||||
else:
|
||||
partner_id = partner_obj.create(cr, uid, post)
|
||||
values['order'].write({'partner_id': partner_id})
|
||||
request.httprequest.session['ecommerce_partner_id'] = partner_id
|
||||
|
||||
values['partner'] = partner_obj.browse(cr, uid, partner_id)
|
||||
return request.registry.get("ir.ui.view").render(cr, uid, "website_sale.order", values)
|
||||
|
||||
@http.route(['/shop/confirm_order'], type='http', auth="admin")
|
||||
def confirm_order(self, *arg, **post):
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
partner_obj = request.registry.get('res.partner')
|
||||
obj_data = request.registry.get('ir.model.data')
|
||||
|
||||
# check values
|
||||
json = {'error': []}
|
||||
required_field = ['tel', 'zip', 'email', 'state', 'street', 'city', 'name']
|
||||
for key in required_field:
|
||||
if not post[key]:
|
||||
json['error'].append(key)
|
||||
if 'shipping_name' in post and key != 'email' and not post["shipping_%s" % key]:
|
||||
json['error'].append("shipping_%s" % key)
|
||||
if json['error']:
|
||||
return simplejson.dumps(json)
|
||||
|
||||
# search or create company
|
||||
if post['company']:
|
||||
pass
|
||||
if 'shipping_company' in post and post['shipping_company']:
|
||||
pass
|
||||
|
||||
partner_value = {
|
||||
'fax': post['fax'],
|
||||
'tel': post['tel'],
|
||||
'zip': post['zip'],
|
||||
'email': post['email'],
|
||||
'state': post['state'],
|
||||
'street': post['street'],
|
||||
'city': post['city'],
|
||||
'name': post['name'],
|
||||
}
|
||||
if partner_id:
|
||||
partner_obj.write(cr, uid, [partner_id], partner_value)
|
||||
else:
|
||||
partner_id = partner_obj.create(cr, uid, partner_value)
|
||||
|
||||
if 'shipping_name' in post:
|
||||
shipping_value = {
|
||||
'fax': post['shipping_fax'],
|
||||
'tel': post['shipping_tel'],
|
||||
'zip': post['shipping_zip'],
|
||||
'state': post['shipping_state'],
|
||||
'street': post['shipping_street'],
|
||||
'city': post['shipping_city'],
|
||||
'name': post['shipping_name'],
|
||||
'parent_id': partner_id,
|
||||
'category_id': (4, shipping_category_id)
|
||||
}
|
||||
shipping_category_id = obj_data.get_object_reference(cr, uid, 'website_sale', 'shipping_address')[1]
|
||||
shipping_ids = partner_obj.search(cr, uid, [("parent_id", "=", partner_id), ("category_id", "=", shipping_category_id)])
|
||||
shipping_id = shipping_ids and shipping_ids[0] or None
|
||||
if shipping_id:
|
||||
partner_obj.write(cr, uid, [shipping_id], shipping_value)
|
||||
else:
|
||||
partner_obj.create(cr, uid, shipping_value)
|
||||
|
||||
return simplejson.dumps(json)
|
||||
|
||||
cr, uid, partner_id = self.get_cr_uid()
|
||||
if uid == 1:
|
||||
return customer()
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
.oe_ecommerce .oe_total {
|
||||
font-size: 13px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.oe_ecommerce .oe_total td {
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.oe_ecommerce .oe_total table {
|
||||
width: auto;
|
||||
}
|
||||
.oe_ecommerce .oe_products .oe_product {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
|
@ -143,11 +147,17 @@
|
|||
max-width: 64px;
|
||||
max-height: 64px;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout .css_required input {
|
||||
background-color: #d2d2ff !important;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout h4 {
|
||||
border-bottom: 1px solid #dddddd;
|
||||
margin-right: 30px;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout input:not([type="radio"]):not([type="checkbox"]) {
|
||||
.oe_ecommerce .oe_checkout input:not([type="radio"]):not([type="checkbox"]):not([type="image"]) {
|
||||
height: 20px;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout input[type="image"] {
|
||||
height: 30px;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout label > input:not([type="radio"]):not([type="checkbox"]), .oe_ecommerce .oe_checkout label > div {
|
||||
|
@ -160,14 +170,22 @@
|
|||
.oe_ecommerce .oe_checkout label > div > input {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout .oe_payment {
|
||||
position: relative;
|
||||
.oe_ecommerce .oe_checkout .css_payments {
|
||||
clear: both;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout .oe_payment .oe_error_payment {
|
||||
.oe_ecommerce .oe_checkout .css_payments .css_payment {
|
||||
position: relative;
|
||||
width: 80px;
|
||||
overflow: hidden;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
.oe_ecommerce .oe_checkout .css_payments .css_error_payment {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: +O;
|
||||
left: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
.oe_ecommerce
|
||||
.oe_total
|
||||
font-size: 13px
|
||||
margin-top: 10px
|
||||
td
|
||||
padding: 5px 10px
|
||||
|
@ -109,10 +110,15 @@
|
|||
max-width: 64px
|
||||
max-height: 64px
|
||||
.oe_checkout
|
||||
.css_required
|
||||
input
|
||||
background-color: #d2d2ff !important
|
||||
h4
|
||||
border-bottom: 1px solid #ddd
|
||||
margin-right: 30px
|
||||
input:not([type="radio"]):not([type="checkbox"])
|
||||
input:not([type="radio"]):not([type="checkbox"]):not([type="image"])
|
||||
height: 20px
|
||||
input[type="image"]
|
||||
height: 30px
|
||||
label
|
||||
> input:not([type="radio"]):not([type="checkbox"]), > div
|
||||
|
@ -122,9 +128,16 @@
|
|||
margin-top: 3px
|
||||
> div > input
|
||||
margin-bottom: 0
|
||||
.oe_payment
|
||||
position: relative
|
||||
.oe_error_payment
|
||||
.css_payments
|
||||
clear: both
|
||||
.css_payment
|
||||
position: relative
|
||||
width: 80px
|
||||
overflow: hidden
|
||||
height: 30px
|
||||
text-align: center
|
||||
padding: 10px 10px 0 0
|
||||
.css_error_payment
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: absolute
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
$(document).ready(function () {
|
||||
$('.oe_ecommerce').on('click', '.oe_product .btn, .oe_product_detail .btn', function (e) {
|
||||
var $button = $(e.currentTarget);
|
||||
var $product = $button.parents('.oe_product:first, .oe_product_detail:first');
|
||||
var link = $button.hasClass('btn-inverse') ? '/shop/remove_cart' : '/shop/add_cart';
|
||||
var $add = $product.find('.btn-success,.btn-primary');
|
||||
var $remove = $product.find('.btn-inverse');
|
||||
|
||||
$.get(link, {'product_id': $button.data('id')}, function (result) {
|
||||
var result = JSON.parse(result);
|
||||
var quantity = parseInt(result.quantity);
|
||||
$add.find('.oe_quantity')
|
||||
.html(quantity);
|
||||
$add.toggleClass('btn-primary', !quantity)
|
||||
.toggleClass('btn-success', !!quantity);
|
||||
$remove.toggleClass('oe_hidden', !quantity);
|
||||
if ($('.oe_mycart').size() && !quantity) {
|
||||
$product.remove()
|
||||
}
|
||||
$('.oe_ecommerce .oe_total').replaceWith(''+result.totalHTML);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var $checkout = $(".oe_ecommerce .oe_checkout");
|
||||
$(".oe_ecommerce input[name='shipping_different']").change(function() {
|
||||
$(".oe_ecommerce .js_shipping").toggle();
|
||||
});
|
||||
$(".oe_ecommerce .js_error_payment").click(function(e) {
|
||||
var values = {};
|
||||
$checkout.find(".js_inputs:not(:hidden) input:not(:checkbox), .js_signin_modal input").each(function() {
|
||||
values[$(this).attr("name")] = $(this).val();
|
||||
});
|
||||
$checkout.find("input").css("border", "");
|
||||
$.post('/shop/confirm_order', values, function (result) {
|
||||
var result = JSON.parse(result);
|
||||
if (result.error.length) {
|
||||
$inputs = $checkout.find("input[name='" + result.error.join("'], input[name='") + "']");
|
||||
$inputs.css("border", "1px solid #dd0000");
|
||||
$inputs.first().focus();
|
||||
} else {
|
||||
var $form = $(e.currentTarget).parent().find("input[name='submit']").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,6 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="website_sale.shipping_address" model="res.partner.category">
|
||||
<field name="name">Shipping Address</field>
|
||||
</record>
|
||||
|
||||
<!-- Layout add nav and footer -->
|
||||
|
||||
<record id="header_ecommerce" model="ir.ui.view">
|
||||
|
@ -22,6 +27,7 @@
|
|||
<t t-call="website.layout">
|
||||
<t t-set="title">Shop - <t t-raw="title">Categories</t></t>
|
||||
<div class="container oe_ecommerce">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/ecommerce.js"></script>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<ul class="nav nav-list">
|
||||
|
@ -89,29 +95,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('.oe_ecommerce').on('click', '.oe_product .btn', function (e) {
|
||||
var $button = $(e.currentTarget);
|
||||
var $product = $button.parents('.oe_product:first');
|
||||
var link = $button.hasClass('btn-inverse') ? '/shop/remove_cart' : '/shop/add_cart';
|
||||
var $add = $product.find('.btn-success,.btn-primary');
|
||||
var $remove = $product.find('.btn-inverse');
|
||||
|
||||
$.get(link, {'product_id': $button.data('id')}, function (result) {
|
||||
var result = JSON.parse(result);
|
||||
var quantity = parseInt(result.quantity);
|
||||
$add.find('.oe_quantity')
|
||||
.html(quantity);
|
||||
$add.toggleClass('btn-primary', !quantity)
|
||||
.toggleClass('btn-success', !!quantity);
|
||||
$remove.toggleClass('oe_hidden', !quantity);
|
||||
if ($('.oe_mycart').size() && !quantity) {
|
||||
$product.remove()
|
||||
}
|
||||
$('.oe_ecommerce .oe_total').replaceWith(''+result.totalHTML);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</template>
|
||||
|
||||
<template id="product_recommended">
|
||||
|
@ -193,6 +176,7 @@
|
|||
<t t-call="website.layout">
|
||||
<t t-set="title">Shop - Checkout</t>
|
||||
<div class="container oe_ecommerce">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/ecommerce.js"></script>
|
||||
<div class="row">
|
||||
<div class="span4 oe_total">
|
||||
<table class="table table-condensed" t-if="order.order_line">
|
||||
|
@ -211,89 +195,52 @@
|
|||
</table>
|
||||
</div>
|
||||
<div class="span8 oe_checkout">
|
||||
<div>
|
||||
<div class="js_inputs">
|
||||
<a href="/admin#action=goback" class="btn btn-primary">Log me, I have an account</a>
|
||||
<h3 class="span8">Billing Information</h3>
|
||||
<button class="btn btn-success">Log me, I have an account</button>
|
||||
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
|
||||
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
|
||||
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
|
||||
<label class="span8 css_required">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
|
||||
<label class="span4 css_required">Telephone<input type="tel" name="tel" placeholder="Telephone"/></label>
|
||||
<label class="span4">Fax<input type="tel" name="fax" placeholder="Fax"/></label>
|
||||
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
|
||||
<label class="span4">Email address<input type="email" name="email" placeholder="Email address"/></label>
|
||||
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
|
||||
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
|
||||
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
|
||||
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
|
||||
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
|
||||
<label class="span4 css_required">Email address<input type="email" name="email" placeholder="Email address"/></label>
|
||||
<label class="span8 css_required">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
|
||||
<label class="span4 css_required">City<input type="text" name="city" placeholder="City"/></label>
|
||||
<label class="span4 css_required">State / Province<input type="text" name="state" placeholder="State/Province"/></label>
|
||||
<label class="span4 css_required">Zip / Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
|
||||
<label class="span4 css_required">Country<input type="text" name="state" placeholder="Country"/></label>
|
||||
<label class="checkbox">Ship to different address<input type="checkbox" name="shipping_different"/></label>
|
||||
</div>
|
||||
<div class="oe_shipping" style="display:none">
|
||||
<div class="js_inputs js_shipping" style="display:none">
|
||||
<h3 class="span8 oe_shipping" style="display:none">Shipping Information</h3>
|
||||
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
|
||||
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
|
||||
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
|
||||
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
|
||||
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
|
||||
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
|
||||
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
|
||||
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
|
||||
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
|
||||
<label class="span8 css_required">Name and firstname<input class="span7" type="text" name="shipping_name" placeholder="Name and firstname"/></label>
|
||||
<label class="span4 css_required">Telephone<input type="tel" name="shipping_tel" placeholder="Telephone"/></label>
|
||||
<label class="span4">Fax<input type="tel" name="shipping_fax" placeholder="Fax"/></label>
|
||||
<label class="span4">Company<input type="text" name="shipping_company" placeholder="Company"/></label>
|
||||
<label class="span8 css_required">Street<input class="span7" type="text" name="shipping_street" placeholder="Street address"/></label>
|
||||
<label class="span4 css_required">City<input type="text" name="shipping_city" placeholder="City"/></label>
|
||||
<label class="span4 css_required">State / Province<input type="text" name="shipping_state" placeholder="State/Province"/></label>
|
||||
<label class="span4 css_required">Zip / Postal Code<input type="text" name="shipping_zip" placeholder="Zip/Postal Code"/></label>
|
||||
<label class="span4 css_required">Country<input type="text" name="shipping_state" placeholder="Country"/></label>
|
||||
</div>
|
||||
<div class="oe_payment">
|
||||
<div class="oe_error_payment"></div>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
||||
<input type="hidden" name="cmd" value="_xclick"/>
|
||||
<input type="hidden" name="business" value="${object.company_id.paypal_account}"/>
|
||||
<input type="hidden" name="item_name" value="${object.company_id.name} ${kind.title()} ${reference}"/>
|
||||
<input type="hidden" name="amount" value="${amount}"/>
|
||||
<input type="hidden" name="currency_code" value="${currency.name}"/>
|
||||
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
|
||||
</form>
|
||||
<div class="js_payments css_payments">
|
||||
<div class="css_payment">
|
||||
<div class="js_error_payment css_error_payment"> </div>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
||||
<input type="hidden" name="cmd" value="_xclick"/>
|
||||
<input type="hidden" name="business" value="${object.company_id.paypal_account}"/>
|
||||
<input type="hidden" name="item_name" value="${object.company_id.name} ${kind.title()} ${reference}"/>
|
||||
<input type="hidden" name="amount" value="${amount}"/>
|
||||
<input type="hidden" name="currency_code" value="${currency.name}"/>
|
||||
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(".oe_ecommerce input[name='shipping_different']").change(function() {
|
||||
$(".oe_ecommerce .oe_shipping").toggle();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
<template id="order">
|
||||
<t t-call="website_sale.page">
|
||||
<t t-set="title">Order</t>
|
||||
<t t-set="shop_content">
|
||||
<t t-foreach="order.order_line or []" t-as="line">
|
||||
<t t-set="product" t-value="line.product_id"/>
|
||||
<t t-set="quantity" t-value="int(line.product_uom_qty)"/>
|
||||
<div class="media oe_product">
|
||||
<div class="pull-left" style="width:64px; height:64px;">
|
||||
<img style="max-width:64px; max-height:64px; margin:auto;" class="media-object" t-att-src="'data:image/png;base64,' + product.image"/>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<a t-att-href="'/shop/product/%%s' %% product.id"><h4 class="media-heading"><t t-esc="product.name"/></h4></a>
|
||||
<t t-esc="product.description_sale"/>
|
||||
<div><t t-esc="product.list_price"/> €</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<div class="media well">
|
||||
<t t-esc="partner.name"/><br/>
|
||||
<t t-esc="partner.phone"/><br/>
|
||||
<t t-esc="partner.email"/><br/>
|
||||
<address>
|
||||
<t t-esc="partner.street"/><br/>
|
||||
<t t-esc="partner.zip"/>,
|
||||
<t t-esc="partner.city"/><br/>
|
||||
<t t-esc="partner.country_id and partner.country_id.name_get()[0][1] or ''"/>,
|
||||
<t t-esc="partner.state_id and partner.state_id.name_get()[0][1] or ''"/><br/>
|
||||
</address>
|
||||
</div>
|
||||
<t t-call="website_sale.total"/>
|
||||
<a t-if="order.order_line" href="/shop/confirm_order"><button class="btn btn-success">Confirm order</button></a>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="thanks">
|
||||
<t t-call="website_sale.page">
|
||||
<t t-set="title">Order</t>
|
||||
|
|
Loading…
Reference in New Issue