Template
Hide the synthetic Default Title option on single-SKU products
Shopify gives every single-variant product one option named Title with the lone value Default Title. It isn't a real choice, so filter it out of the product detail options, the cart line summaries, and the payload the store assistant sees. Variant matching still reads the raw selectedOptions, so single-SKU products keep resolving their variant. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EuRVxuyMUTzWKXW8P5Tn8A
This commit is contained in:
co-authored by
Claude Opus 5
parent
c88613de03
commit
b139b30273
@@ -25,6 +25,7 @@ import {
|
||||
EmptyDescription,
|
||||
EmptyContent,
|
||||
} from '@/components/ui/empty';
|
||||
import { isDefaultTitleSelection } from '@/services/shopify/catalog';
|
||||
|
||||
const CartDrawer: React.FC = () => {
|
||||
const isOpen = useCartStore((s) => s.isOpen);
|
||||
@@ -102,7 +103,10 @@ const CartDrawer: React.FC = () => {
|
||||
};
|
||||
|
||||
const getSelectedOptions = (item: (typeof items)[0]) => {
|
||||
return item.merchandise.selectedOptions ?? [];
|
||||
// Single-SKU items carry a synthetic `Title: Default Title` — not worth a line.
|
||||
return (item.merchandise.selectedOptions ?? []).filter(
|
||||
(option) => !isDefaultTitleSelection(option)
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user