@runwell/shopify-toolkit 0.24.0 → 0.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runwell-bundle-system",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "category": "catalog",
5
5
  "source": "runwell",
6
6
  "base": "bundle-system",
@@ -170,6 +170,16 @@
170
170
  {%- if t.popular -%}{%- assign has_popular = true -%}{%- endif -%}
171
171
  {%- endfor -%}
172
172
 
173
+ {%- comment -%}
174
+ Tier discount_pct is applied to compareAtPrice when present
175
+ (the MSRP), so storefronts already running a base-price sale
176
+ still yield correct bundle math. Falls back to product.price.
177
+ {%- endcomment -%}
178
+ {%- assign tier_base_price = product.selected_or_first_available_variant.compare_at_price | default: product.price -%}
179
+ {%- if tier_base_price == 0 or tier_base_price == blank -%}
180
+ {%- assign tier_base_price = product.price -%}
181
+ {%- endif -%}
182
+
173
183
  <form
174
184
  action="{{ routes.cart_add_url }}"
175
185
  method="post"
@@ -196,10 +206,16 @@
196
206
  {%- capture tier_label -%}{{ t.qty }}x {{ product.title }}{%- endcapture -%}
197
207
  {%- endif -%}
198
208
 
199
- {%- assign discount_amount = product.price | times: t.discount_pct | divided_by: 100 -%}
200
- {%- assign per_unit_price = product.price | minus: discount_amount -%}
209
+ {%- comment -%}
210
+ Compute per_unit as base * (100 - pct) / 100 directly,
211
+ rather than base - (base * pct / 100). The direct form
212
+ avoids a half-cent rounding step that would otherwise
213
+ push, e.g., 50% off $49.99 from $24.99 up to $25.00.
214
+ {%- endcomment -%}
215
+ {%- assign keep_pct = 100 | minus: t.discount_pct -%}
216
+ {%- assign per_unit_price = tier_base_price | times: keep_pct | divided_by: 100 -%}
201
217
  {%- assign total_price = per_unit_price | times: t.qty -%}
202
- {%- assign full_price = product.price | times: t.qty -%}
218
+ {%- assign full_price = tier_base_price | times: t.qty -%}
203
219
  {%- assign savings = full_price | minus: total_price -%}
204
220
 
205
221
  <label
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runwell/shopify-toolkit",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "Reusable Shopify theme modules from Runwell. Replaces typically app-driven features (reviews, wishlist, urgency, FAQ, post-purchase upsell, exit popups, free-ship progress, sticky ATC, testimonials, badges, bundles) with native Liquid + JS + CSS that ship across multiple client themes via a config-driven sync CLI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",