- {#
- This file is part of Refine
- Copyright(c) 2023 Refine Co.,Ltd. All Rights Reserved.
- https://www.re-fine.jp/
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
- #}
- <script>
-     $(function () {
-         const beforeSalesProductInfo = JSON.parse('{{ beforeSalesProductInfo | json_encode | raw }}')
-         const beforeMessage = '{{ 'product.refine_before_sales'|trans }}'
-         const endOfSalesProductIds = JSON.parse('{{ endOfSalesProductIds | json_encode | raw }}')
-         const endOfMessage = '{{ 'product.refine_end_of_sales'|trans }}'
-         // 販売前
-         $.each(beforeSalesProductInfo, function (index, product) {
-             const message = beforeMessage.replace('%s', product.dateTime)
-             $('.add-cart').text(message).attr('disabled', true)
-         })
-         // 販売終了
-         $.each(endOfSalesProductIds, function (index, value) {
-             $('.add-cart').text(endOfMessage).attr('disabled', true)
-         })
-     })
- </script>