Forum

Thread tagged as: Question, Shop

Have Dividers Set to Collapsed by Default

Been looking into Perch Shop, as there is only one product.html master template for specifying product options this makes selling multiple types of products tricky due to the various properties exclusive to certain product types.

E.g. Jeans have different size properties to trainers.

As a workaround, would it be possible to group the types of data together using divider-before, but have the dividers set to collapse by default.

The user then only shows what they need, rather see all options for all product types.

Tony Astley

Tony Astley 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd do this by creating different options for jeans and trainers. Perhaps one called Waist Size and one called Shoe Size. You'd add the former to products sold by waist sizes and the latter to products sold by shoe size.

Thanks Drew,

However my question was can I collapse the divider groups by default. So when the admin is adding a product the product input screen has most of the option groups collapsed, then the user expands the ones relevant they are adding..

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

René Banus created an addon that auto-collapses dividers. You can find it on GitHub.

Thanks Hussein, I'll take a look at that.

Drew McLellan

Drew McLellan 2638 points
Perch Support

However my question was can I collapse the divider groups by default. So when the admin is adding a product the product input screen has most of the option groups collapsed, then the user expands the ones relevant they are adding..

Why would you add option groups that don't apply to a product?

I might be misunderstanding the process but there is only one product.html template used when adding products through the shop products manager?

I can't find any supporting information for product option groups in the docs (or Googling it):

https://docs.grabaperch.com/functions/shop/products/perch-shop-product/

Is there a resource where I can ;earn more about this approach?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hi Tony,

Here is the documentation for Products: https://docs.grabaperch.com/addons/shop/products/

The relevant section is under the heading "Product Options, Variants and Variant SKU Codes".

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can read about product options here: https://docs.grabaperch.com/addons/shop/products/

You shouldn't be adding individual option fields to the product.html template. You create sets of product options (size, colour etc) and then assign them to the product. From that you generate your product variants.