Hi,
There is a bug on line 19 of
satchmo-trunk/satchmo/apps/payment/listeners.py
which effects display of the optional Terms and Conditions check box.
line 19 is:
link = u'<a target="_blank" href="%s"></a>' % ugettext('terms and
conditions')
it should be:
link = u'<a target="_blank" href="%s">%s</a>' % (url,ugettext('terms
and conditions'))
Example of use:
docstring = """Adds a 'do you accept the terms and conditions'
checkbox to the form"""
#1
Add to:
/project-name/localsite/urls.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
urlpatterns += patterns('',
url(r'^shop_terms/$', 'project-name.localsite.views.shop_terms',
name="shop_terms"),
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#2
Add to:
/project-name/localsite/views.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from django.shortcuts import render_to_response
from django.template import RequestContext
def shop_terms(request):
ctx = RequestContext(request, {})
return render_to_response('localsite/shop-terms.html',
context_instance=ctx)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#3
Copy
satchmo-trunk/satchmo/apps/payment/templates/shop/checkout/
pay_ship.html
to
/project-name/templates/shop/checkout/pay_ship.html
Add:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{{ form.terms }} {{ form.terms.label|safe }}
{% if form.terms.error %}<br/>**{{ form.terms.error }}{% endif %}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#4
Add to
/project-name/localsite/models.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from payment.forms import SimplePayShipForm
from payment.listeners import form_terms_listener
from signals_ahoy.signals import form_init
form_init.connect(form_terms_listener, sender=SimplePayShipForm)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#5
Create
/project-name/templates/localsite/shop-terms.html
Add your terms and conditions of sale.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.