From 5d4402e744a3c4454c09be0b9a55cb7d6da7c77e Mon Sep 17 00:00:00 2001 From: jrphilo Date: Tue, 9 Jul 2024 14:04:22 +0200 Subject: [PATCH 1/2] feat: add shipping policy details Signed-off-by: jrphilo --- components/product/delivery.tsx | 138 +++++++++++++++++++++++++++----- 1 file changed, 117 insertions(+), 21 deletions(-) diff --git a/components/product/delivery.tsx b/components/product/delivery.tsx index a76d5de53..2f8ba4b93 100644 --- a/components/product/delivery.tsx +++ b/components/product/delivery.tsx @@ -1,6 +1,6 @@ 'use client'; -import { TruckIcon } from '@heroicons/react/24/outline'; +import { InformationCircleIcon, TruckIcon } from '@heroicons/react/24/outline'; import Price from 'components/price'; import SideDialog from 'components/side-dialog'; import { DELIVERY_OPTION_KEY } from 'lib/constants'; @@ -9,6 +9,13 @@ import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import { ReactNode, useState } from 'react'; const options = ['Commercial', 'Residential'] as const; +const { STORE_PREFIX, SITE_NAME } = process.env; +const storeName = SITE_NAME; + +// Conditional price values based on STORE_PREFIX +const commercialPrice = STORE_PREFIX === 'reman-transmission' ? 299 : 0; +const residentialPrice = STORE_PREFIX === 'reman-transmission' ? 398 : 99; + type Option = (typeof options)[number]; export const deliveryOptions: Array<{ @@ -18,12 +25,12 @@ export const deliveryOptions: Array<{ }> = [ { template: Commercial, - price: 299, + price: commercialPrice, key: 'Commercial' }, { template: Residential, - price: 398, + price: residentialPrice, key: 'Residential' } ]; @@ -63,29 +70,118 @@ const Delivery = () => { onClick={() => setOpeningDialog('information')} className="text-xs text-blue-800 hover:underline lg:text-sm" > - Information + Shipping Policy setOpeningDialog(null)} open={openingDialog === 'information'} > -

Information

-
- -
- - setOpeningDialog(null)} - open={openingDialog === 'terms-conditions'} - > -

Terms & Conditions

+
+
+ {STORE_PREFIX === 'reman-transmission' ? ( + <> +

+ Flat Rate Shipping to Commercial Addresses +

+

+ We offer Flat Rate Shipping of $299.00 if you are shipping to a commercial + address. This means the address you are shipping to is in a commercially zoned + location. +

+

+ Home businesses do not count as a commercial address. Please ship directly to + your repair shop or dealership performing repairs to utilize our Flat Rate + Shipping to Commercial Addresses option. +

+ + ) : ( + <> +

+ Free Shipping to Commercial Addresses +

+

+ We offer Free Shipping if you are shipping to a commercial address. This means + the address you are shipping to is in a commercially zoned location. +

+

+ Home businesses do not count as a commercial address. Please ship directly to + your repair shop or dealership performing repairs to utilize our Free Shipping + to Commercial Addresses option. +

+ + )} +
+ +
+

Residential Address / Liftgate Fee

+

+ If you are shipping to a residential address, there will be a surcharge of $99.00 + to accomodate the need for a liftgate- based delivery. +

+

+ Please make sure your address location is capable of receiving freight without the + need of prior notification or appointment setup and capability of unloading with + forklift from the delivery truck. +

+

+ Please note, certain locations (remote areas) as well as certain locations in CO, + UT, MT, NY, OR, CA may result in additional delivery fees. +

+
+ +
+

Delivery Times

+

+ Under normal circumstances you will receive your order within 7-14 Business Days + (excluding weekends and holidays). However, due to increased order volumes, + weather conditions, or circumstances beyond our control, we will ship your order + out as soon as possible. Please note all shipping times are estimates and not + guarantees. We will not be responsible for any additional fees that the carrier + may charge due to re-delivery or storage. +

+
+ +
+

Damaged Parts

+

+ All engines are inspected before shipping to purchaser. However, damage may occur + during shipping. We request that customers inspect all engines and transmissions + at the time of delivery for any damage. Report damaged, wrong, or missing parts + before signing any shipping documents. Damaged, wrong, or missing parts should be + reported by the purchaser at the time of delivery. Failure to report damages + before signing shipping documents, places responsibility on purchaser (receiver). + Purchaser refers to any representative of the company designated to sign for + delivery. +

+
+ +
+
+
+
+
+
+

+ Have questions? Speak to a specialist now: +

+ +
+
+
+
+
From c8a627d4548c421bf37fc4d837010f6b1cfb4a7d Mon Sep 17 00:00:00 2001 From: jrphilo Date: Tue, 9 Jul 2024 14:05:51 +0200 Subject: [PATCH 2/2] feat: try to add dynamic store name Signed-off-by: jrphilo --- components/product/delivery.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/product/delivery.tsx b/components/product/delivery.tsx index 2f8ba4b93..32ad1d680 100644 --- a/components/product/delivery.tsx +++ b/components/product/delivery.tsx @@ -10,7 +10,6 @@ import { ReactNode, useState } from 'react'; const options = ['Commercial', 'Residential'] as const; const { STORE_PREFIX, SITE_NAME } = process.env; -const storeName = SITE_NAME; // Conditional price values based on STORE_PREFIX const commercialPrice = STORE_PREFIX === 'reman-transmission' ? 299 : 0; @@ -137,8 +136,8 @@ const Delivery = () => { (excluding weekends and holidays). However, due to increased order volumes, weather conditions, or circumstances beyond our control, we will ship your order out as soon as possible. Please note all shipping times are estimates and not - guarantees. We will not be responsible for any additional fees that the carrier - may charge due to re-delivery or storage. + guarantees. {SITE_NAME} will not be responsible for any additional fees that the + carrier may charge due to re-delivery or storage.