| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | use FluentCart\Api\StoreSettings; |
| 9 | 9 | use FluentCart\App\Helpers\AddressHelper; |
| 10 | 10 | use FluentCart\App\Modules\Tax\TaxModule; |
| 11 | 11 | use FluentCart\App\Services\DateTime\DateTime; |
| 12 | +use FluentCart\App\Services\DateTime\DateFormatter; | |
| 12 | 13 | |
| 13 | 14 | class ReceiptRenderer |
| 14 | 15 | { |
| 15 | 16 | protected $config = null; |
| @@ -242,12 +243,14 @@ | ||
| 242 | 243 | <?php echo esc_html__('Order At', 'fluent-cart'); ?> |
| 243 | 244 | </p> |
| 244 | 245 | <p style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;"> |
| 245 | 246 | <?php |
| 246 | - $date = wp_date( | |
| 247 | - get_option('date_format'), | |
| 247 | + // Through DateFormatter so the store's format and timezone settings | |
| 248 | + // reach this too; orderTz is only consulted on the Browser source. | |
| 249 | + $date = DateFormatter::format( | |
| 248 | 250 | DateTime::anyTimeToGmt($order->created_at)->getTimestamp(), |
| 249 | - new \DateTimeZone($this->orderTz) | |
| 251 | + false, | |
| 252 | + $this->orderTz | |
| 250 | 253 | ); |
| 251 | 254 | echo esc_html(Helper::translateNumber($date)); |
| 252 | 255 | ?> |
| 253 | 256 | </p> |
| @@ -667,12 +670,18 @@ | ||
| 667 | 670 | if ($rcAdj > 0) { |
| 668 | 671 | $displayShipping = max(0, $displayShipping - $rcAdj); |
| 669 | 672 | } |
| 670 | 673 | } |
| 674 | + $shippingMethodTitle = (string) Arr::get($order->config, 'shipping_method_title', ''); | |
| 671 | 675 | ?> |
| 672 | 676 | <tr> |
| 673 | 677 | <td style="padding: 8px 20px 8px 0;text-align: right;border: none;"> |
| 674 | 678 | <?php echo esc_html__('Shipping', 'fluent-cart'); ?> |
| 679 | + <?php if ($shippingMethodTitle): ?> | |
| 680 | + <span style="display:block;font-size:12px;color:rgb(107,114,128);line-height:18px;"> | |
| 681 | + <?php echo esc_html($shippingMethodTitle); ?> | |
| 682 | + </span> | |
| 683 | + <?php endif; ?> | |
| 675 | 684 | </td> |
| 676 | 685 | <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;"> |
| 677 | 686 | <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($displayShipping)); ?> |
| 678 | 687 | </td> |
| @@ -803,12 +812,14 @@ | ||
| 803 | 812 | <?php echo esc_html($transaction->getPaymentMethodText()); ?> |
| 804 | 813 | </td> |
| 805 | 814 | <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: center;"> |
| 806 | 815 | <?php |
| 807 | - $date = wp_date( | |
| 808 | - get_option('date_format'), | |
| 816 | + // Same route as the Order At header above, or | |
| 817 | + // one receipt renders two different formats. | |
| 818 | + $date = DateFormatter::format( | |
| 809 | 819 | DateTime::anyTimeToGmt($transaction->created_at)->getTimestamp(), |
| 810 | - new \DateTimeZone($this->orderTz) | |
| 820 | + false, | |
| 821 | + $this->orderTz | |
| 811 | 822 | ); |
| 812 | 823 | echo esc_html(Helper::translateNumber($date)); |
| 813 | 824 | ?> |
| 814 | 825 | </td> |