How to use the @shopgate/engage/core.i18n.price function in @shopgate/engage

To help you get started, we’ve selected a few @shopgate/engage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / engage / filter / components / PriceSlider / components / Label / index.jsx View on Github external
if (target.value) {
      onChange([parseInt(minValue, 10) * 100, parseInt(target.value, 10) * 100]);
    }
  }

  const currencySymbol = Intl.NumberFormat('en-US', {
    style: 'currency',
    currency,
  }).format('0').replace('0.00', '');

  return (
    <div>
      <span>
        {i18n.text('price.range', {
          fromPrice: i18n.price(priceMin, currency, false),
          toPrice: i18n.price(priceMax, currency, false),
        })}
      </span>
      
        
          <span style="{{">
            
          </span>
        
        
          <span style="{{">
            
          </span>
        
      
      <span id="price-slider-currency-label" hidden="" aria-hidden="">
        {currencySymbol}</span></div>
github shopgate / pwa / libraries / common / components / I18n / components / FormatPrice / index.jsx View on Github external
FormatPrice.format = ({ price, currency, fractions }) => {
  if (!i18n.ready) {
    return price;
  }

  return i18n.price(price, currency, fractions);
};
github shopgate / pwa / libraries / engage / filter / components / PriceSlider / components / Label / index.jsx View on Github external
setMaxValue(target.value);
    if (target.value) {
      onChange([parseInt(minValue, 10) * 100, parseInt(target.value, 10) * 100]);
    }
  }

  const currencySymbol = Intl.NumberFormat('en-US', {
    style: 'currency',
    currency,
  }).format('0').replace('0.00', '');

  return (
    <div>
      <span>
        {i18n.text('price.range', {
          fromPrice: i18n.price(priceMin, currency, false),
          toPrice: i18n.price(priceMax, currency, false),
        })}
      </span>
      
        
          <span style="{{">
            
          </span>
        
        
          <span style="{{">
            
          </span>
        
      
      <span id="price-slider-currency-label" hidden="" aria-hidden=""></span></div>
github shopgate / pwa / themes / theme-gmd / components / FilterBar / components / Content / components / FilterChips / index.jsx View on Github external
Object.keys(filters).forEach((key) =&gt; {
      const filter = filters[key];

      switch (filter.type) {
        case FILTER_TYPE_RANGE: {
          /**
           * The min and max price need to be rounded before they are passed to the I18n component,
           * since it rounds to the full nearest number when fractions are deactivated.
           */
          const [minimum, maximum] = filter.value;
          const priceMin = Math.floor(minimum / 100);
          const priceMax = Math.ceil(maximum / 100);
          const fromPrice = i18n.price(priceMin, appConfig.currency, false);
          const toPrice = i18n.price(priceMax, appConfig.currency, false);
          const pricesFormatted = `${fromPrice} - ${toPrice}`;
          const labelValue = i18n.text('price.range', {
            fromPrice,
            toPrice,
          });
          const removeLabel = i18n.text('filter.remove', { filter: labelValue });
          const editLabel = i18n.text('filter.edit', { filter: labelValue });

          chips.push((
github shopgate / pwa / themes / theme-gmd / components / FilterBar / components / Content / components / FilterChips / index.jsx View on Github external
Object.keys(filters).forEach((key) =&gt; {
      const filter = filters[key];

      switch (filter.type) {
        case FILTER_TYPE_RANGE: {
          /**
           * The min and max price need to be rounded before they are passed to the I18n component,
           * since it rounds to the full nearest number when fractions are deactivated.
           */
          const [minimum, maximum] = filter.value;
          const priceMin = Math.floor(minimum / 100);
          const priceMax = Math.ceil(maximum / 100);
          const fromPrice = i18n.price(priceMin, appConfig.currency, false);
          const toPrice = i18n.price(priceMax, appConfig.currency, false);
          const pricesFormatted = `${fromPrice} - ${toPrice}`;
          const labelValue = i18n.text('price.range', {
            fromPrice,
            toPrice,
          });
          const removeLabel = i18n.text('filter.remove', { filter: labelValue });
          const editLabel = i18n.text('filter.edit', { filter: labelValue });

          chips.push((