do all products have to use product.html?

  • Thanks Hussein (also thanks for your help earlier - I'm slowly making progress!).

    Am I alone in thinking that this is a bit of a limitation (from a maintenance point of view) if you have lots different products with different specifications and they all have to be input via the one form template, maintaining it and also using the admin "add product" form could become unmanageble very quickly.

  • I think it's common to have a single edit form for all products on an e-commerce platform as all products would need to share the same shop-related fields (pricing, shipping, stock, etc). If we had an additional tab labelled "content" for example, it would make sense to allow the editors to choose different templates for that tab alone. The main edit form tab has to remain the same though.


    if you have lots different products with different specifications and they all have to be input via the one form template

    Different specifications in what aspects? The content you want to enter/display? Perhaps you can use field groups to group some of the content fields? Or even use Blocks so you only add those fields to the form when required?



    using the admin "add product" form could become unmanageble very quickly.

    Perch offers a number of ways to organise your edit form template and make it manageable and easy for the editor to follow including Field Groups, divider-before, divider-after, notes-before and help tags. So you can group and separate fields as well as add helpful notes to the editors.


    You can, for instance, group stock fields:


    HTML
    1. <perch:group label="Stock">
    2. <perch:shop id="stock_status" type="shop_stock_status" label="Stock status" required>
    3. <perch:shop id="stock_level" type="number" label="Stock level" size="s">
    4. <perch:shop id="stock_location" type="shop_stock_location" label="Count stock">
    5. <perch:shop id="max_in_cart" type="number" label="Max quantity in cart" size="s">
    6. </perch:group>
  • Good point about field groups.

    Just added field groups on product.html (will also add to other template) definitiely makes things more manageable (helps make the code more readable and the edit forms more compact for the admin/editors) On long forms using collapse also makes the "content" more visible. I had to make a few tweaks to styles.css to stop the <dt><dd> overlapping (in Firefox).