Score:0

How can I choose an attribute?

us flag

A product has Size and Pickup Location as attributes; Size can be S, M, L, and XL, while Pickup Location gives 10 choices.

The Pickup Location value does not affect the product price; that is only influenced by Inventory and Size.

When a product is created, I have to create 40 variations, even though the price changes only when Size has a different value. The Pickup Location value is just shown as reference in Add to cart.

How can I choose the Pickup Location attribute?

I am using Drupal 10 and Commerce 8.x-2.36.

Product detail

Create the Pickup Location attribute

Add the attribute to the product variation type

Add the product variation type to the product types

Add the variation to the Product

Score:0
it flag

We typically only recommend using product attributes for those aspects of a family of product variations that differentiate one from another. Size is a reasonable attribute, because logically you would group together the various size variations as a single product. However, pickup location is more of a fulfillment detail - I wouldn't use product attributes for this.

What you do instead really depends on your business requirements. For example, if all products have the same potential pickup locations, it would be as simple as adding a List (text) field to your order item instead and displaying it on the Add to Cart form mode. If your options vary based on product and / or location inventory, then you'll need to pair that with custom code to filter the options as needed. (Alternately, if it's one pickup location for an entire order, you also could make this a field on the order itself, but again, really depends on your business requirements.)

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.