Reading http://docs.drupalcommerce.org/v2/product/purchasable-entities.html I tough I can create my own product type. But if I want to use the cart I'm obligated to enable the product module.

Would be nice to have a little example for creating a purchasable entity to make things clearer.

Comments

gagarine created an issue. See original summary.

gagarine’s picture

Title: Why drupal cart is depent of product? » Why drupal cart depend of product?
gagarine’s picture

Title: Why drupal cart depend of product? » Why cart module depend of product module?
bojanz’s picture

Title: Why cart module depend of product module? » Cart should not depend on Product
Component: Documentation » Cart

That's a mistake introduced at some point. Order don't depend on Product, so neither should Cart.

vasike’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

Bojanz suggestions

we need to
1) remove commerce_product from the cart dependencies
2) move any config that depends on commerce_order from config/install to config/optional
3) get the tests to pass

not sure about 2 config that depends on commerce_order

And here is a patch.

Note: maybe the config moved to optional should be on product module optional

vasike’s picture

StatusFileSize
new1.78 KB

it seems the previous was incomplete (didn't delete the file made optional)
Here is an updated one.

However, it seems there are some issues installing the cart module.
Exception: No entity type for field quantity on view commerce_cart_block in Drupal\views\Plugin\views\HandlerBase->getEntityType() (line 697 of /d8/web/core/modules/views/src/Plugin/views/HandlerBase.php).
This seems more like other issue - Views issues for order items.

vasike’s picture

There is a new PR on this
https://github.com/drupalcommerce/commerce/pull/704
with some extra updates on Checkout and some Tests

vasike’s picture

PR "reroll"

mglaman’s picture

StatusFileSize
new4.65 KB

Reroll from last reroll.

Status: Needs review » Needs work

The last submitted patch, 9: 2853280-9.patch, failed testing. View results

jsacksick’s picture

Status: Needs work » Closed (duplicate)