I apologize as I’m a newer developer, but one thing that’s always confused me, is how button labels are defined and whether it’s possible to expand this somehow. For example, I know that {{ products.product.add_to_cart | t }}
will return a string that says “Add to cart” and I know that similarly {{ products.product.sold_out | t }}
will return “Sold out,” but I’m curious if these returned strings can be modified in any way, or if it’s possible to assign new definitions without metafields – i.e. creating definitions for products.product.item_requires_id
for something like alcohol or products.product.additional_confirmation
if an item needs additional action by the user before adding to cart.
Main reason I’m interested is because I have two different reasons for products requiring additional confirmation on a test store I’m working on – either the product is marked as a preorder (assigned via a metafield with a month and year), or the selected variant is B-Stock inventory (a separate variant of a given product. The conditional logic for this is easy enough, but if I could just have a globally-defined variable to handle that for me and spit the same string back every time, it’d be convenient.