# Changelog

All notable changes to Tipser Elements project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[3.3.32] - 2022-12-20

### Changed
- Introduced a distinction in communication with the user for purchases from merchants who run their own customer support and from merchants whose customer support is run by Tipser.

### Added
- Billing address to Confirmation Page

### Fixed
- Minor errors on Confirmation Page and Checkout Page

[3.3.31] - 2022-11-30

### Changed
- Minor translations updates

[3.3.30] - 2022-11-24

### Changed
- Introduce Payment Receipt page as replacement for order confirmation page for merchants, that own customer support.
- Minor changes to views and texts, related to introduction of customer support handled by merchants.

## [3.3.29]

### Fixed

- Quick fix for wrong logic that controls visibility of US Duty Warning on Cart Page - the warning hidden temporarily.

## [3.3.28]

### Fixed

- Fixed buy buttons sometimes being disabled when interacting with variants on the product view page

## [3.3.27] - 2022-09-07

### Changed
- Hide Out Of Stock items from variants selector when there are in total more than 30

## [3.3.26] - 2022-08-06

### Changed

- Update visa logo

## [3.3.17] - 2022-06-06

### Changed

- `goToProduct()` function returns a `Promise` so it is now detectable if it's failing

## [3.3.16] - 2022-05-19

### Changed

- class `te-error` is appended to form input’s wrapper element with validation errors (and additionally `te-error-required` if the validation error is caused by missing required field)

## [3.3.15] - 2022-05-12

### Added

- exported `CartPromoCode` component

## [3.3.14] - 2022-05-05

### Fixed

- `TipserElementsProvider` `config` prop can be updated dynamically
- added to cart popup appears after each add to cart action (earlier it appeared every second add to cart)

## [3.3.13] - 2022-04-14

### Added

- Replaced the old Tipser logo in the footer with the new "Tipser by Bolt logo"

### Changed

- `tipserTokenAnonymous` cookie removed

### Fixed

- product tile HTML structure
- minor stylistic fixes in the checkout component

## [3.3.12] - 2022-04-05

### Fixed

- full area of product tile is now clickable (before only the image and the button were clickable)

## [3.3.11] - 2022-03-30

### Added

- Possibility to pass `sessionId` in config

### Fixed

- minor styling fixes

## [3.3.10] - 2022-03-07

### Fixed

- Added new event for AB tests measurements

## [3.3.9] - 2022-03-01

### Added

- "Notify me when back in stock" section on product details (experimental)

### Changed

- Different way of presenting payment method icons in the footer

### Fixed

- Fixed Google Pay and Apple Pay icons loading delay on checkout
- Correctly including sale prices in price summary on the cart page
- [Tipser Script] Enforcing unmounting components when the route is changed (known problem for our Angular users)

## [3.3.8] - 2022-01-27

### Fixed

- total value on cart popup includes currently active campaign

## [3.3.7] - 2022-01-25

### Deprecated

- `eventsHandlers` config property has been renamed to `eventHandlers`

### Fixed

- subtotal value on checkout page is now correct
- product availability section styling
- freeze of modal view on ios devices
- always full list of items is visible on cart page (including not available items)
- cart is empty if there are no items (earlier cart was empty if there are no available items)

## [3.3.6] - 2022-01-21

### Fixed

- no duplicated purchase events in case of PayPal on Klarna market
- applying empty checkout page when all the products in the checkout are OoS or removed from inventory

## [3.3.5] - 2022-01-18

### Changed

- `DropdownContextProvider` and `useDropdownContext` has been removed.

## [3.3.4] - 2022-01-18

### Fixed

- Context availability for modular dropdown component

## [3.3.3] - 2022-01-17

### Changed

- new version of product availability section
- native select dropdown for product variants (iPhone)
- new default `CheckoutPayment` component with enabled alternative payment options

### Fixed

- optimized import for global styles
- product dialog main image on iphone 11
- modular `CheckoutCustomerAddressBilling` and `CheckoutCustomerAddressDelivery` style fixes

## [3.3.2] - 2022-01-04

### Fixed

- updated support links in the footer
- added missing translations in `Footer` and `CartExpressPayment`

## [3.3.1] - 2021-12-30

### Changed

- new version of product availability section (as A/B test)
- new version of the modal footer

## [3.3.0] - 2021-12-23

### Changed

- new `CheckoutPage` and `CartPage` implementation and design
- new structure and styles for `CheckoutCustomerAddressDelivery` Modular Checkout component

## [3.2.3] - 2021-12-16

### Fixed

- fixed the broken styles for disabled buttons
- fixed z-indexes on the "sold by merchant" explanation popup in the product dialog
- removed `window` usage from global scope for the basic SSR support
- supported payment methods icon are now being displayed on the cart page even if there is no express payment options available

## [3.2.2] - 2021-12-10

### Fixed

- category field in analytics events

## [3.2.1] - 2021-11-25

### Added

- added `onAnalyticsEvent` event to `eventsHandlers` section of the configuration as a replacement to `document.addEventListener('tw-track', analyticsHandler);` way of subscribing to analytics events

### Changed

- Change in HTML/CSS structure of Collection/Store underlying `ProductTile` element
- legal consent text and payment logos are no longer being displayed on the cart page when there is no express payment methods available
- using image urls with _img.tipser.com_ prefix instead of _res.cloudinary.com/tipser_

### Deprecated

- Deprecated `document.addEventListener('tw-track', analyticsHandler);` way of subscribing to analytics events

### Removed

- `PaypalExpressButton` and `PaymentRequestButton` are no longer exported. `CartExpressPayment` and `CheckoutPaymentMethodSelector` components should be used instead.

## [3.2.0] - 2021-11-04

### Changed

- `directToCheckoutMode: true` causes the user to see the cart page instead of the checkout page after "add to cart" button
	on the `ProductListing` / `ProductPage` component is clicked. The only exception is when `customCartUrl` is not defined but `customCheckoutUrl` is defined.
	In such a case the user is presented with a checkout page.
- checkout page can no longer be editable (the `editable` prop has been removed from the `CheckoutProductList` component)
- error popups are now being hidden after 10 seconds instead of staying visible forever

## [3.1.13] - 2021-10-27

### Added

- promo code component introduced on the cart page

### Fixed

- missing payment method in purchase analytics event
- delivery address is properly submitted after checkout page refresh

## [3.1.12] - 2021-10-25

### Added

- Support for Norwegian language
- Support for Norway market

### Fixed

- Scroll blocking implementation for iOS Safari when the modal dialog is open

## [3.1.11] - 2021-10-22

### Fixed

- Fixed Klarna logo which was truncated on the cart view in modal

## [3.1.10] - 2021-10-21

### Added

- Support for modalUi.hideCartIcon config option
- Support for eventHandlers.onModalClose config option

### Fixed

- Stripe script is not loaded when there is no API key (not causing warning)

## [3.1.9] - 2021-10-13

### Changes

- added informational popup when availablity or price of the cart products changed during express checkout session
- prompting using variant selector from the user on mobile when add to cart is clicked without variant selected
- removed the second billing address form from checkout page
- correctly displaying payment method on the checkout confirmation page

### Fixed

- Fixes in corner cases handling on cart page (out of stock products, price changes)
- Displaying the error about incorrect shipping country immediately instead of after loading time
- Fixed z-indexes of popups on cart and checkout so that they are always appearing on top
- Fixed occasional infinite loop on the checkout page

## [3.1.8] - 2021-10-01

### Fixed

- quick fix for translations problem in the payment selector that occurs on Preact

## [3.1.7] - 2021-10-01

### Fixed

- fixed missing confirmation view for express payments when confirmation page is on the same page as checkout

## [3.1.6] - 2021-09-30

### Changed

- better presentation of error messages on the credit card form

### Fixed

- "add to cart" button is now disabled for the duration of the add to cart request
- fixed the modular cart crash when the `onPendingChange` callback is not provided

## [3.1.5] - 2021-09-28

### Changed

- Activated express payments and payment method selector components on the default implementations of cart and checkout pages (on the supporting markets)

### Fixed

- Removed the unsupported `data-name` attributes from the payment method SVG icons
- "PayPal" payment method is being properly displayed to the user in the confirmation page instead of blank space

## [3.1.4] - 2021-09-24

### Changed

- Added more payment option icons in the cart phase

### Fixed

- Solved the problem with PayPal not appearing on production

## [3.1.3] - 2021-09-22

### Added

- Support for `data-tipser-modular-cart-express-payment` and `data-tipser-modular-checkout-payment` components in the HTML syntax

## [3.1.2] - 2021-09-21

### Changed

- Merchant logos are now in rounded shape
- Improved behavior and styles for the "Pay" button on the Stripe payment module
- `getCartItems` function returns cached results is no cart changes occured as a result of the user action

## [3.1.1] - 2021-09-15

### Fixed

- Icons on cart page have correct sizes

## [3.1.0] - 2021-09-15

### Added

- `CartExpressPayment` available in ModularCart
- `CartExpressPayment` available on `CartPage` when flag `enableExpressPaymentsOnCartPage = true` is in config
- `CartGoToCheckoutButton` available in ModularCart
- `CheckoutPaymentMethodSelector` available in ModularCheckout
- `CheckoutPaymentMethodSelector` available on `CheckoutPage` when `enablePaymentSelectorOnCheckoutPage = true` flag is in config

### Changed

- Native variant selector contains stock counts next to the variants

### Fixed

- Added missing `className` prop on part of the components
- Long variant names are cut with ellipsis, and they do not break the layout down

## [3.0.26] - 2021-08-12

### Fixed

- Fixed the problem with incorrect layout of checkout
- Fixed object-fit setting

## [3.0.25] - 2021-08-10

### Added

- Introduced a pilot version of PayPal payments for the US market
- Displaying merchant logos (if available) next to the package header in the CartPage and CheckoutPage components

### Fixed

- Incorrect behavior of product thumbnails on the `ProductListing` and `ProductPage` components (they were not occupying the full available space)
- The month name on the confirmation page is now using the proper locale

### Changed

- Changed the icons on the order confirmation page to cleaner versions
- Introduced a better way to present the package details (the section that is expanding after clicking on a package header) on the `CartPage` and `CheckoutPage` components

## [3.0.24] - 2021-07-27

### Changed

- Increased the speed of animation of extending / collapsing description in the product listing component

## [3.0.23] - 2021-07-27

### Fixed

- The support links in the checkout confirmation page are now localised

## [3.0.22] - 2021-07-26

### Added

- Added delivery notification info to the standard checkout on the Swedish market

### Changed

- Changed the way that the product description is presented on the product listing component
- Responsive layout of the icons at the bottom of the confirmation page

## [3.0.21] - 2021-07-23

### Changed

- POS terms in `CheckoutLegal` component are now rendered as HTML (it's now possible to use anchors and other HTML syntax)
- `ProductListing` component is now displaying expandable description section instead of description overlay

## [3.0.20] - 2021-07-20

### Added

- included merchant name in several places on the shopping UX
- exported `useCartContext` hook for accessing the cart context inside `ModularCart` component
- introduced `disableEmptyCartRecommendations` prop to the `CheckoutPage` component

### Fixed

- cart size indicator animation on the `CartIcon` component is triggered every time a product is added to the cart (not only the first time)

## [3.0.19] - 2021-07-16

### Fixed

- Fixed a problem with confirmation page not appearing for embedded checkout with Klarna
- Products list on the confirmation page is no longer editable
- Fixed the tax value on the checkout confirmation page after refreshing the page

## [3.0.18] - 2021-07-15

### Changed

- TipserScript: styles are appended to the `head` elements instead of `body`
- UX: items number is no longer displayed in the "summary" section of the standard checkout (there was no need to display it twice)

## [3.0.17] - 2021-07-13

### Added

- introduced `updatePosData()` internal function
- default styles to the cart phase of Tipser dialog (unless `inheritStyles: true` option is used)

### Changed

- Changed the position and translation of the "Edit cart" button in the cart phasse

### Fixed

- Fixed an occasional problem with incorrect products appearing in the color relation section

## [3.0.16] - 2021-07-09

### Fixed

- Validation of the state field in the delivery form works correctly after refreshing the checkout page
- Fixed Stripe checkout form occasionally crashing when the browser window is resized

## [3.0.15] - 2021-07-07

### Added

- `trackProductImpression` internal function to track product impressions manually

### Fixed

- fixed product tile styles
- product tile and product listing components are now sending impression events correctly

## [3.0.14] - 2021-06-28

### Added

- better validation of the phone number in the checkout address form

## [3.0.13] - 2021-06-18

### Added

- Possibility to disable the click action on product item in `ModularCart` component by `disableProductClickAction` prop (Elements) and `data-tipser-modular-cart-disable-product-click-action` attribute (Script)

## [3.0.12] - 2021-06-17

### Fixed

- Gotham font import for `inheritStyles: false` option
- Updating cart view after adding item to cart from internal function

### Changed

- Increased default z-indexes for the Tipser Dialog so that it's always closable

## [3.0.11] - 2021-06-14

### Fixed

- Variant dropdown auto-opening issue on React 17

## [3.0.10] - 2021-06-11

### Fixed

- Solved the issue with submitting delivery address on checkout introduced by 3.0.9
- Checkout address form submit issue introduced in 3.0.9

## [3.0.9] - 2021-06-11

### Fixed

- Tipser Script: Dynamic adding of modular product child components works correctly
- Removed US payment provider logos from the EU checkout pages
- Restored the "edit cart" button on the checkout page
- Fixed `CartIcon` button not reacting to click after Tipser modal was open for a specific customer environment

## [3.0.8] - 2021-06-03

### Fixed

- Using `CheckoutCustomerAddressDelivery` and `CheckoutPaymentRequestButton` together doesn't cause problems with selecting shipping address on payment request window

## [3.0.7] - 2021-05-31

### Fixed

- Customer data is available on confirmation page after payment using CheckoutPaymentRequestButton component
- Tax calculation works correctly in case of combining external address form and CheckoutPaymentRequestButton

## [3.0.6] - 2021-05-26

### Added

- `lang` config option impacts Klarna Checkout language
- `variantId` field added to checkout-related `tw-track` events
- support for "preowned" label in product-related components
- `CartPage` component: syncing cart between browser tabs

### Fixed

- CheckoutPaymentRequestButton no longer crashes with useStandaloneAddressForm=true prop
- `Purchase` `tw-track` event is now being correctly send in Checkout 2.0 after successful transaction

## [3.0.5] - 2021-05-19

### Added

- CheckoutPaymentRequestButton component (to be used in ModularCheckout context) displaying ApplePay or GooglePay payment option, depending on the environment
- label for pre-owned products in `ProductPage`

## [3.0.4] - 2021-05-19

### Fixed

- fixed odd rendering of HTML product descriptions in some cases
- fixed handling of customUrl.checkoutConfirmationUrl when custom `history` implementation from react-router 5 is provided

## [3.0.3] - 2021-05-12

### Added

- new Element components: `ProductTile`, `ProductListing`, `Carousel`, `ModularCart`
- new Script tags: `data-tipser-product-tile`, `data-tipser-product-listing`, `data-tipser-modular-cart-page`
- config property `modalUi: {inheritStyles: true}` removing fixed styles from product and checkout dialog for more convenient application of custom CSS
- Script: added support for attribute
- added cart summary step before checkout step in the dialog
- prefixed with `te-` the generic class names like `label`, `value`, `uppercase`, `sales`, `regular`, colliding with Bootstrap standard class names
- added `te-promo-code-toggle` css class
- added `showBackToCartButton` prop to `CheckoutProductList` component

### Changed

- renamed `Checkout` to `CheckoutPage` (Elements) and `data-tipser-checkout` to `data-tipser-checkout-page` (Script)
- renamed `readOnly` prop of `CheckoutProductList` component (defaults to `true`) with `editable` (defaults to `false`) with inverse logic

### Fixed

- fixed the problem with promo code not updating Klarna price in Checkout V1
- renamed generic classnames colliding with bootstrap-styled pages
- fixed oversized buy button in checkout
- promo code functionality in checkout is now working correctly
- fixed the problem with wrong product images on the product details page
- fixed `useCheckoutContext()` hook (now works correctly with both with Klarna and Stripe)
- fixed subtotal price field in checkout

## [3.0.2] - 2021-04-19

### Fixed

- using the correct version of the CSS file by Tipser Script
- fixed the problem with infinite redirect cycle that may happen on the confirmation page when using `enableCheckoutV2: true` flag with Tipser Widget and `customUrls.confirmationUrl`

### Changed

- displaying `0.00` as prices on empty checkout

## [3.0.1] - 2021-04-15

### Fixed

- promo code savings information in `CheckoutSummary` (`data-tipser-modular-checkout-summary`) component is now displaying price ex. tax, as expected, after the delivery address is specifed
- fixed a bug with promo code application error not appearing to the user

### Changed

- product variant separator has been changed from "x" to "-" in a various places of the UI, e.g. "S x White" variant name will be now displayed as "S - White"

## [3.0.0] - 2021-04-15

### Changed

- this is the first version 3.x with a set of backwards-incompatible changes that are described in detail on the [Tipser Script 3.x Migration Guide](https://tipser.dev/docs/v3/script/#migration-guide) and [Elements 3.x Migration Guide](https://tipser.dev/docs/v3/elements/#migration-guide) pages
