Skip to content

Commit

Permalink
#630 Move an order phone in favor of shop phone. (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov committed Nov 25, 2018
1 parent 7fa8b6a commit bd70bc7
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion shopelectro/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def shop(request):
return {
'shop': settings.SHOP,
'DEBUG': settings.DEBUG,
'BASE_URL': settings.BASE_URL
'BASE_URL': settings.BASE_URL,
}
1 change: 1 addition & 0 deletions shopelectro/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
'success_url': BASE_URL + '/shop/order-success/',
'fail_url': BASE_URL + '/',
'cps_phone': '+78124163200',
'cps_formatted_phone': '416-32-00',
'cps_email': 'info@shopelectro.ru',
'local_delivery_cost': 300,
'local_delivery_cost_threshold': 5000,
Expand Down
9 changes: 6 additions & 3 deletions shopelectro/views/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ def load_more(request, category_slug, offset=0, limit=0, sorting=0, tags=None):
category = get_object_or_404(models.CategoryPage, slug=category_slug).model
sorting_option = context.SortingOption(index=int(sorting))

all_products = models.Product.objects.active().get_category_descendants(
category, ordering=(sorting_option.directed_field,)
all_products = (
models.Product.objects
.active()
.get_category_descendants(category)
.order_by(sorting_option.directed_field)
)

if tags:
Expand All @@ -225,7 +228,7 @@ def load_more(request, category_slug, offset=0, limit=0, sorting=0, tags=None):
.filter(tags__in=tag_entities)
# Use distinct because filtering by QuerySet tags,
# that related with products by many-to-many relation.
.distinct(sorting_option.field)
.distinct()
)

paginated = context.PaginatorLinks(
Expand Down
2 changes: 1 addition & 1 deletion templates/ecommerce/order/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<span style="float:right;font-size:16px;color:#767A7B">
<small style="position:relative;top:-.2em">(812)</small>
<span style="color:#C00;font-size:25px" class="ya-opt-phone">
<a href="tel:+78124163200">416-32-00</a>
<a href="tel:{{ shop.cps_phone }}">{{ shop.cps_formatted_phone }}</a>
</span>
</span>

Expand Down
4 changes: 1 addition & 3 deletions templates/ecommerce/order/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ <h1>Заказ принят</h1>
data-total-revenue="{{ total_revenue }}">
<p>Номер вашего заказа {{ order.fake_order_number }}</p>
<p>{% time_to_call %}</p>
{% if order.phone %}
<p>Контактный телефон: {{ order.phone }}</p>
{% endif %}
<p>Телефон магазина: <a href="tel:{{ shop.cps_phone }}">8 (812) {{ shop.cps_formatted_phone }}</a></p>

{% if order.email %}
<p>Электронная почта: {{ order.email }}</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/ecommerce/yandex_feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span class="wmi-callto">
<small style="position: relative; top: -0.2em;">(812)</small>
<span style="color: #CC0000; font-size:25px;" class="ya-opt-phone">
<a href="tel:+78124163200">416-32-00</a>
<a href="tel:{{ shop.cps_phone }}">{{ shop.cps_formatted_phone }}</a>
</span>
</span>
</span>
Expand Down
4 changes: 2 additions & 2 deletions templates/layout/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
<div class="footer-phone">
<div class="footer-number">
<span class="footer-cifre js-copy-phone">
<a class="footer-phone-link substitute-phone-link" href="tel:+78124163200">
<span>+7 (812)</span> <span class="substitute-phone">416-32-00</span>
<a class="footer-phone-link substitute-phone-link" href="tel:{{ shop.cps_phone }}">
<span>+7 (812)</span> <span class="substitute-phone">{{ shop.cps_formatted_phone }}</span>
</a>
</span>
<p class="mail-wrapper js-copy-mail">
Expand Down
6 changes: 3 additions & 3 deletions templates/layout/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<a class="header-logo" href="/" title="На главную" itemprop="logo"></a>
<p class="hidden" itemprop="name">ShopElectro</p>
<p class="hidden" itemprop="address">Санкт-Петербург, пр-т Елизарова 38А, офис 312</p>
<p class="hidden" itemprop="telephone">8 (812) 416-32-00</p>
<p class="hidden" itemprop="telephone">8 (812) {{ shop.cps_formatted_phone }}</p>
</div>

<div class="col-sm-4 col-md-4 header-info">
<div class="header-phone js-copy-phone">
<a class="header-phone-link substitute-phone-link" href="tel:+78124163200">
<a class="header-phone-link substitute-phone-link" href="tel:{{ shop.cps_phone }}">
<i class="fa fa-phone"></i>
<span class="header-phone-code header-phone-precode">8</span>
<span class="header-phone-code">812</span>
<span class="header-phone-body substitute-phone">416-32-00</span>
<span class="header-phone-body substitute-phone">{{ shop.cps_formatted_phone }}</span>
</a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion templates/layout/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<meta property="og:postal_code" content="192148">
<meta property="og:country_name" content="Russia">
<meta property="og:email" content="info@shopelectro.ru">
<meta property="og:phone_number" content="+7(812)416-32-00">
<meta property="og:phone_number" content="+7(812){{ shop.cps_formatted_phone }}">
<meta property="copyright" content="ShopElectro">
<meta property="author" content="ShopElectro">
{# seo guys desired this tag: http://prntscr.com/gt5jh1 #}
Expand Down

0 comments on commit bd70bc7

Please sign in to comment.