[ECOMMERCE-379] Investigation. Hard to use category and product chooser in a content type Created: 30/Mar/21  Updated: 26/Aug/22

Status: Open
Project: E-commerce
Component/s: None
Affects Version/s: 1.2.3
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Commerce Improvements 1.3.x
Story Points: 5
Team: AuthorX

 Description   

As a developer I want to add a product or category item to my content app by using contentTypes feature.

Since there is no contenttype property for ecomm product or categories, as a developer I must resort to "overlaying" the app definition which is quite complicated. 

As a developer I would hope to be able to just use a "product" or "productCategory" property type in my contenttype definition. Ideally I dont need to do anything in the app definition.

Notes

Here is an example of the workaround which must currently be employed. This does not look too bad, but it gets quite complicated when using multi-field setups. (Look at productId)

Content Type Definition

datasource:  
  workspace: inspirations 

model:  
nodeType: inspiration  
properties:
  productId:          
    label: Product        
  productDesc:          
    label: Product description

App Definition

!content-type:inspiration
name: inspiration-app
label: Inspirations

subApps:  
  detail:    
    label: Inspiration    
    form:      
      properties:
        productId:                      
          $type: categoryChooserField                      
          selectProduct: true

 

Here is what I would want to be able to do:

 

Content Type Definition

(See type: Product)

datasource:  
  workspace: inspirations 

model:  
nodeType: inspiration  
properties:
  productId:          
    label: Product
    type: Product # or 'ExternalProduct' or something like that.        
  productDesc:          
    label: Product description

No special App definition overrides are necessary: 

 

App Definition

!content-type:inspiration
name: inspiration-app
label: Inspirations

 

 



 Comments   
Comment by Christopher Zimmermann [ 13/Jul/21 ]

There should then be a followup ticket to add a GraphQL type for the "Product" property type, so that I can get referenced products in my GraphQL queries.

Generated at Mon Feb 12 01:43:30 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.