Skip to content

Commit

Permalink
fix: product id query fail and review rating✨
Browse files Browse the repository at this point in the history
  • Loading branch information
hossainchisty committed Nov 22, 2021
1 parent edbbc9c commit 6a88b7a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion core/templates/core/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
new Autocomplete('#autocomplete', {

search: input => {
console.log(input)
const url = `/search?query=${input}`
return new Promise(resolve => {
fetch(url)
Expand Down
2 changes: 1 addition & 1 deletion core/templates/core/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{% endif %}
{% for product in results %}
<div class="w-full md:w-1/3 xl:w-1/4 p-6 flex flex-col">
<a href="{% url 'product_detail' product.category.slug product.slug %}">
<a href="{% url 'product_detail' product.category.slug product.slug product.id %}">
{% if product.image %}
<img class="hover:grow hover:shadow-lg" src="{{ product.image.url }}">
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion customers/templates/customer/sign_in.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2>New to our Shop?</h2>
<div class="login_part_form_iner">
<h3>Welcome Back ! <br>
Please Sign in now</h3>
<form class="row contact_form" action="#" method="post" novalidate="novalidate">
<form class="row contact_form" action="#" method="post">
{% csrf_token %}
{{ form|crispy }}
<div class="col-md-12 form-group">
Expand Down
2 changes: 1 addition & 1 deletion order/templates/order/order_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1 class="py-6 border-b-2 text-xl text-gray-600 px-8">Order Summary</h1>
</div>
<div class="flex flex-col col-span-3 pt-2">
<span class="text-gray-600 text-md font-semi-bold">
<a href="{% url 'product_detail' order.product.category.slug order.product.slug %}">{{ order.product.title }}</a></span>
<a href="{% url 'product_detail' order.product.category.slug order.product.slug order.product.id %}">{{ order.product.title }}</a></span>

</div>
<div class="col-span-2 pt-3">
Expand Down
5 changes: 4 additions & 1 deletion product/templates/product/single_product.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
<h1 class="capitalize text-4xl font-extrabold">{{ products.title }}</h1>
<div class="flex">
<span class="flex items-center">
<svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 text-red-500" viewBox="0 0 24 24">

{% if products.rating %}
<svg fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 text-red-500" viewBox="0 0 24 24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z">
</path>
</svg>
Expand All @@ -56,6 +58,7 @@ <h1 class="capitalize text-4xl font-extrabold">{{ products.title }}</h1>

</svg>
<span class="text-gray-600 ml-3">{{ products.rating }} Reviews</span>
{% endif %}
</span>
<span class="flex ml-3 pl-3 py-2 border-l-2 border-gray-200">
<a class="text-gray-500">
Expand Down
2 changes: 1 addition & 1 deletion wishlist/templates/wishlist/product_wishlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{% endif %}
{% for product in products %}
<div class="w-full md:w-1/3 xl:w-1/4 p-6 flex flex-col">
<a href="{% url 'product_detail' product.category.slug product.slug %}">
<a href="{% url 'product_detail' product.category.slug product.slug product.id %}">
{% if product.image %}
<img class="hover:grow hover:shadow-lg" src="{{ product.image.url }}">
{% else %}
Expand Down

0 comments on commit 6a88b7a

Please sign in to comment.