Skip to content

Commit 24e4397

Browse files
committed
Fetch on_sale from Algolia
1 parent 3194cdb commit 24e4397

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

components/Search/SearchResults.component.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
* @param {Object} props
44
*/
55
const SearchResults = ({
6-
hit: { product_image, product_name, regular_price, sale_price },
6+
hit: { product_image, product_name, regular_price, sale_price, on_sale },
77
}) => {
8-
9-
console.log("Search: ");
10-
console.log(sale_price);
118
return (
129
<article className="hit">
1310
<div className="flex p-6 bg-white">
@@ -23,13 +20,17 @@ const SearchResults = ({
2320
<span class="text-lg font-bold">{product_name}</span>
2421
)}
2522
<br />
26-
{sale_price && (
23+
{on_sale && (
2724
<>
28-
<span className="m-2 text-base line-through">kr {regular_price}</span>
25+
<span className="m-2 text-base line-through">
26+
kr {regular_price}
27+
</span>
2928
<span className="m-2 text-base">{sale_price}</span>
3029
</>
3130
)}
32-
{!sale_price && <span className="m-2 text-base">kr {regular_price}</span>}
31+
{!on_sale && (
32+
<span className="m-2 text-base">kr {regular_price}</span>
33+
)}
3334
</div>
3435
</div>
3536
</article>

0 commit comments

Comments
 (0)