Skip to content

Commit

Permalink
fix: accommodate breaking changes 03/25 (#60)
Browse files Browse the repository at this point in the history
* fix: product -> item

https://square.github.io/custom-sites-docs/breaking-changes/product-to-item

* chore: update sdk to alpha.16

necessary to support breaking changes
  • Loading branch information
bashunaimiroy authored Apr 25, 2024
1 parent cb009c9 commit 0c11e50
Show file tree
Hide file tree
Showing 8 changed files with 530 additions and 284 deletions.
4 changes: 2 additions & 2 deletions theme/assets/js/components/store/item/banners.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ document.addEventListener('alpine:init', () => {
async init() {
Utils.loadJsonDataIntoComponent.call(this, dataId);

const excludeProductIds = this.discount.exclude_square_online_product_ids;
const includeProductIds = this.discount.match_square_online_product_ids;
const excludeProductIds = this.discount.exclude_square_online_item_ids;
const includeProductIds = this.discount.match_square_online_item_ids;
const details = this.discount.display_strings?.details;
const expirationDetail = this.discount.expiration_detail;
const recurringDetails = this.discount.recurring_details;
Expand Down
4 changes: 2 additions & 2 deletions theme/assets/js/templates/store/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ document.addEventListener('alpine:init', () => {

const itemPrice = this.$el.querySelector('#itemPrice');
if (itemPrice) {
const caloriesText = this.product.product_type_details?.calorie_count
? this.translations.caloriesLabel.replace('{{calories}}', this.product.product_type_details.calorie_count)
const caloriesText = this.product.item_type_details?.calorie_count
? this.translations.caloriesLabel.replace('{{calories}}', this.product.item_type_details.calorie_count)
: '';
await Utils.refreshTemplate({
template: 'partials/ui/price',
Expand Down
Loading

0 comments on commit 0c11e50

Please sign in to comment.