product page: owner sees "offers enabled" indicator instead of nothing

Per fox: "i only see add to cart not offer" — viewing their own
offer-mode (3/4) product as the shop owner showed just Add To Cart
with no sign that offers were active. The Make-an-offer form is
correctly hidden for owners (can't offer on your own product, same
as auctions), but that left owners with no feedback.

Now when product.offers_allowed and the viewer is a shop owner,
the page shows:
  ✓ Offers enabled — buyers see a "Make an offer" button here.
    You can't offer on your own product.

Buyers (non-owner, logged in) still see the expandable offer form.
Anon visitors still see "Log in to make an offer".

Updated test_make_offer_hidden_for_seller: owner now asserts no
Submit Offer button + no "Log in to make an offer" CTA, but DOES
see "Offers enabled" indicator.
This commit is contained in:
russell@unturf.com 2026-05-11 07:27:55 -04:00
parent d56c49f3ee
commit d593062e6b
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -259,6 +259,11 @@
Log in to make an offer
</a>
</p>
{% elif product.offers_allowed and request.user and request.user in product.shop.owners %}
<p style="margin-top: var(--space-3); color: var(--color-text-muted, #888); font-size: 0.9em;">
&#10003; Offers enabled &mdash; buyers see a "Make an offer" button here.
You can't offer on your own product.
</p>
{% endif %}
<br/>

View file

@ -6219,7 +6219,12 @@ class TestPricingModeFormSection(_AuthenticatedBase):
res = self.testapp.get(
f"/p/{product_id}/{product_slug}", status=200,
)
self.assertNotIn(b"Make an offer", res.body)
# The owner does NOT see the offer form (no Submit Offer button)
# nor the "Log in to make an offer" CTA.
self.assertNotIn(b"Submit Offer", res.body)
self.assertNotIn(b"Log in to make an offer", res.body)
# But they DO see the owner indicator confirming offers are on.
self.assertIn(b"Offers enabled", res.body)
class TestAuctionCheckout(_AuthenticatedBase):