Skip to content

Commit

Permalink
Fixed the problem that extratracking block can't be extended.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skirmantas Jurgaitis committed Apr 16, 2013
1 parent 739dd1c commit e6e9b61
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions oscar/templates/oscar/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@

{% block tracking %}
{# Default to using Google analytics #}
{% if google_analytics_id %}
{% include 'partials/google_analytics.html' %}
{% endif %}
{% include "partials/google_analytics.html" %}
{% endblock %}

{% comment %}
Expand Down
6 changes: 2 additions & 4 deletions oscar/templates/oscar/checkout/thank_you.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ <h2>{% trans "Tracking your order" %}</h2>
</div>
{% endblock content %}

{% block extratracking %}
{% if google_analytics_id %}
{% include 'partials/google_analytics_transaction.html' %}
{% endif %}
{% block tracking %}
{% include "partials/google_analytics_transaction.html" %}
{% endblock %}
3 changes: 2 additions & 1 deletion oscar/templates/oscar/partials/google_analytics.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if google_analytics_id %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ google_analytics_id }}']);
Expand All @@ -9,4 +10,4 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

{% endif %}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% extends "partials/google_analytics.html" %}
{% block extratracking %}
_gaq.push(['_addTrans',
'{{ order.number|escapejs }}',
'{{ shop_name|escapejs }}',
Expand All @@ -18,4 +20,4 @@
'{{ line.quantity }}']);
{% endfor %}
_gaq.push(['_trackTrans']);

{% endblock %}

0 comments on commit e6e9b61

Please sign in to comment.