diff --git a/packages/peregrine/lib/talons/Gallery/useAddToCartButton.js b/packages/peregrine/lib/talons/Gallery/useAddToCartButton.js index 5666dddc6c..62cd40a40a 100644 --- a/packages/peregrine/lib/talons/Gallery/useAddToCartButton.js +++ b/packages/peregrine/lib/talons/Gallery/useAddToCartButton.js @@ -4,6 +4,7 @@ import { useHistory } from 'react-router-dom'; import { useCartContext } from '../../context/cart'; import { useEventingContext } from '../../context/eventing'; +import resourceUrl from '../../util/makeUrl'; import operations from './addToCart.gql'; /** @@ -91,7 +92,11 @@ export const useAddToCartButton = props => { setIsLoading(false); } else if (productType === 'ConfigurableProduct') { - history.push(`/${item.url_key}${urlSuffix || ''}`); + const productLink = resourceUrl( + `/${item.url_key}${urlSuffix || ''}` + ); + + history.push(productLink); } else { console.warn('Unsupported product type unable to handle.'); }