πŸ‡¨πŸ‡¦Canada @trevorkjorlien

Account created on 10 November 2008, about 16 years ago
  • Front End Web Developer and Trainer at Evolving WebΒ  …
#

Recent comments

πŸ‡¨πŸ‡¦Canada trevorkjorlien

@duaelfr, I have used your patch on the latest version of Token. But I'm not seeing the changes as expected.

I've tried multiple ways, trying to use a token as an argument for a View. Basically, showing a View and using a commerce order ID to get an order's details:

[views:embed:event_registration_order:[commerce_order:order_id]]

[views:embed:event_registration_order:commerce_order:order_id]

[views:embed:event_registration_order::[commerce_order:order_id]

[views:embed:event_registration_order::commerce_order:order_id]

I've had the View display before without an argument. But with this, it's not appearing, or it just shows the order ID. Am I using this incorrectly? Thanks!

πŸ‡¨πŸ‡¦Canada trevorkjorlien

@jsacksick: OK, I have re-configured my products so that they use just one Order Type. Now event and physical products can be in the same cart.

I don't want to hijack this issue, but I'll bring it up here: the Commerce documentation makes it sound as if you should make different Order Types for different product types (https://docs.drupalcommerce.org/v2/developer-guide/orders/getting-starte...):

Orders have a specific workflow that defines what states and transitions the order can move in. Each order type can have its own workflow.

This means your default order type, which has shippable products, can use the Fulfillment workflow. Meanwhile, your digital goods order type can have the more simplistic Default workflow.

and:

You can use a different checkout flow for each order type. In this case you would have a physical order use a multiple step checkout flow that requires shipping information. A digital order could have a more simplified checkout flow that has one step (i.e.: payment.)

This makes it sound like if I have a physical product, I should have one Order Type. And if I have a digital product, I should make a separate Order Type. Here's another example of somebody also being confused: https://www.drupal.org/project/commerce_combine_carts/issues/3023601#com... πŸ› Is there something extra I need to do combine carts? Active

I think the documentation should make it more clear that if you have multiple Order Types, this will create two carts/orders. I'll be honest: this was super opaque, confusing, and frustrating.

πŸ‡¨πŸ‡¦Canada trevorkjorlien

I’ll give what I think is a completely normal use case that requires the customer to do something totally abnormal:

I have two products. One is a an event signup and the other is a physical print.

Each of these products use a different Item Order Type. One needs some attendee info and the other needs some shipping. The way Commerce is currently set up, if the customer adds both of these products, it creates two separate carts.

This means, you need to tell the customer to check out 2 times (!!) in order to sell them an event ticket and a shippable product.

That’s… nuts. This seems very user hostile and not what any customer should be expected to do.

This is outlined here in better detail: https://drupal.stackexchange.com/a/298996/109556

πŸ‡¨πŸ‡¦Canada trevorkjorlien

I’m also confused by this. I have only anonymous checkout on my site, and multiple carts are being shown on /cart.

πŸ‡¨πŸ‡¦Canada trevorkjorlien

Needing this functionality myself. I ran the branch and can fill out and save the new form field.

But when I load up a product page, the {{product.variations}} field doesn't appear, which loads the add to cart form. I also get this error:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\Core\Render\Element::children(): Argument #1 ($elements) must be of type array, null given, called in /Users/trevorkjorlien/Documents/Plateau Astro/Web/pa-drupal-2019/web/modules/contrib/commerce_stock/modules/enforcement/commerce_stock_enforcement.module on line 489 in Drupal\Core\Render\Element::children() (line 72 of core/lib/Drupal/Core/Render/Element.php).
Drupal\Core\Render\Element::children(NULL) (Line: 489)
commerce_stock_enforcement_form_commerce_order_item_add_to_cart_form_alter(Array, Object, 'commerce_order_item_add_to_cart_form_commerce_product_20') (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'commerce_order_item_add_to_cart_form_commerce_product_20') (Line: 840)
Drupal\Core\Form\FormBuilder->prepareForm('commerce_order_item_add_to_cart_form_commerce_product_20', Array, Object) (Line: 284)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 97)
Drupal\commerce_product\ProductLazyBuilders->addToCartForm('20', 'full', 1, 'en')
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #lazy_builder callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#lazy_builder', Array, Array) (Line: 353)
Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, 1) (Line: 160)
Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 159)
Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 175)
Drupal\Core\Render\Renderer->renderPlaceholder('callback=commerce_product.lazy_builders%3AaddToCartForm&args%5B0%5D=20&args%5B1%5D=full&args%5B2%5D=1&args%5B3%5D=en&token=FT-D0BG4z9OAbw_Xou5fuAUgPUogXOigYpvmDRhFbjc', Array) (Line: 693)
Drupal\big_pipe\Render\BigPipe->renderPlaceholder('callback=commerce_product.lazy_builders%3AaddToCartForm&args%5B0%5D=20&args%5B1%5D=full&args%5B2%5D=1&args%5B3%5D=en&token=FT-D0BG4z9OAbw_Xou5fuAUgPUogXOigYpvmDRhFbjc', Array) (Line: 547)
Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object) (Line: 305)
Drupal\big_pipe\Render\BigPipe->sendContent(Object) (Line: 112)
Drupal\big_pipe\Render\BigPipeResponse->sendContent() (Line: 381)
Symfony\Component\HttpFoundation\Response->send() (Line: 20)
Production build 0.71.5 2024