Jump to content

Variations: Pro Module for (Product) Variations & Attributes


kongondo
 Share

Recommended Posts

Variations

Released 29 May 2017

Variations is a simple yet powerful commercial ProcessWire module that allows website editors to create attributes and their values and from those generate variations of any entity, most notably products.

The module consists of  FieldtypeVariations and InputfieldVariations as well as a ProcessVariations for managing variations configurations and attributes.
 
Setting up the field is quite easy.
 
First, create a field of type Variations. Define some custom inputs that will need to be directly edited on the page containing the field, for instance a product price, SKU, etc.
 
Secondly, via the Inputfield, create a couple of attributes.
 
Thirdly, create a variations configuration and add the attributes and values you want in the configuration. Link that variations configuration to your page and the module will automatically generate all possible combinations (variations) of the attribute values in that configuration. These, together with the custom inputs you created when setting up the field will be displayed on the page (e.g. a product page), ready for editing. This makes this module quite unique; variations are defined at the page-level rather than at the field level. This presents lots of possibilities such as infinitely reusable attributes and variations configurations. 
 
For those using Padloper, integration with the e-commerce platform is quite simple as demonstrated in this tutorial. 

The module consists of 4 modules

  1. ProcessVariations
  2. FieldtypeVariations
  3. InputfieldVariations
  4. VariationsCustomTableManager (autoload module, working behind the scenes)

Video Demohttps://youtu.be/T93nn96UL8o

Documentationhttps://variations.kongondo.com/

Shophttps://processwireshop.pw/plugins/variations/

Requires: ProcessWire 2.5 or newer

Features

  • Easily create variations of anything, including products for e-commerce websites, etc
  • Create an attribute once, use it everywhere, multiple times, picking and choosing all or only the attribute values you want
  • Bulk editing of variations configurations and attributes
  • Reusable variations configurations
  • Works with Padloper out-of-the-box with minimal coding
  • User-friendly, intuitive and easy to set up
  • Like 13
Link to comment
Share on other sites

  • 2 weeks later...

I’m bulding a small webshop with Padloper where i will have around 500 products, each with a lot of variations. These are digital products for download. Setting up the variations with PageTable is quite a mess. That’s why i’m considering using Variations for that. 

@kongondo in this post you mentioned:

Quote

Please note that, in respect of these subfields, there are no plans to include anything as near exhaustive as what Table does. Meaning, these will likely be limited to TEXT, INT, FLOAT, etc fields, but not complicated Fieldtypes such as Page fields, Repeaters, etc.

Does that mean that the download field can not be included?

Thanks,
Jan

Link to comment
Share on other sites

On 2017-6-15 at 7:46 PM, Jan Fromm said:

I’m bulding a small webshop with Padloper where i will have around 500 products, each with a lot of variations. These are digital products for download. Setting up the variations with PageTable is quite a mess. That’s why i’m considering using Variations for that. 

@kongondo in this post you mentioned:

Does that mean that the download field can not be included?

Thanks,
Jan

Any word on this @kongondo

Link to comment
Share on other sites

  • 1 month later...
On 15/06/2017 at 7:46 PM, Jan Fromm said:

Does that mean that the download field can not be included?

Sorry did not get back to you earlier Jan. It seems as well that I misunderstood your question. Please clarify. Are you looking to have a dropdown select or asmSelect or similar for each variation from which you can select and specify a download or downloads for that variation? How are you defining your digital downloads? Is each download a ProcessWire page or are they physical files stored on the server?

Link to comment
Share on other sites

Renewals and Resend Links

Hi,

Renewal and resend links pages for Variations have been added. Use renewals if you wish to renew a Variations order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
  • 4 weeks later...
On 7/31/2019 at 4:25 PM, elabx said:

Hi! Is this module working with recent versions of ProcessWire? Is it compatible with UIKit theme? 

 

On 8/8/2019 at 11:33 AM, eydun said:

I just bought this module. Any chance to make it compatible with UIKit?

Hi all. Just a quick update. I have been working on updating the module to make it ProcessWire 3.x compatible + add some improvements. Most of the work is done. I hope to release by next week. Thanks.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Variations 002  (released 16/09/2019)

Happy to announce the latest release of Variations.

Changelog

  1. ProcessWire 3.x support only.
  2. New GUI to match AdminThemeUiKit
  3. Save and exit or save and add more variations configuration or attributes (in modal)
  4. More granular control of custom column types and definitions: DECIMAL, FLOAT, DOUBLE, TINYINT, INT, VARCHAR, TEXT, DATETIME, TIMESTAMP, BOOLEAN, etc
  5. Decimal type better suited for price data compared to Float/Double
  6. Boolean type, useful for Yes/No type data, e.g. for sell out of stock? yes/no
  7. Datetime/Timestamp fields if required.
  8.  Column definitions: null, precision, scale, length, default value, etc.
  9. Required fields: if column is not nullable and no default provided, it becomes a required field. E.g. can set price not to be null.
  10. Default fields: For uses such as prefixing SKU-

Apologies that this has taken a while to update.

Upgrading

If upgrading from version 001, ProcessWire's Filecompiler will fight you. You might get errors such as Class ProcessVariations not found in file..... If you get such errors, first, try to clear your cache and compiled files several times. As a last resort, if clearing cache doesn't work (and I don't like this workaround), temporarily change the code in the offending file, e.g. in VariationsRender.php, where it says class VariationsRender extends ProcessVariations, change that to class VariationsRender extends WireData. Refresh the modules page until the errors disappear, then revert back to the original text (class VariationsRender extends ProcessVariations). I hate to ask you to do this but I've had it with the Filecompiler.

Documentation

Documentation can be found here. However, it still needs updating to reflect latest changes outlined above. For now, please note that we've added an extra setting for setting the default date and time formats for datetime/timestamp custom columns/subfields. This is available in the Input Tab of the field.

Screenshots

variations-version-002-001.thumb.png.2bfdc6a468adc1fd4a783d6443ceeacb.png

variations-version-002-002.thumb.png.150d86d25901a615bcc32d75bf23558a.png

variations-version-002-003.thumb.png.879c64aca5d5192c1941b32b58a28446.png

variations-version-002-004.thumb.png.0a4a7c36f4d8656782d9415fa9bc6552.png

variations-version-002-005.thumb.png.16fefa8dbfbbe38a3a2c082e5daddcb9.png

variations-version-002-006.thumb.png.2ef684af1466bc30326c866f60bc9901.png

variations-version-002-007.thumb.png.ddb24c8dc5a1189628a7b662111a89bc.png

variations-version-002-008.thumb.png.c1f10ce1314d9c37caaf4a2616aee027.png

 

Thanks!

  • Like 2
Link to comment
Share on other sites

  • 2 years later...

Hey @kongondo just purchased this as I need to produce a kind of catalogue website for clothes and this seems to make life easier than adding lots of product-variation pages.

A couple of questions though. Due to the fact that nearly every product has different combinations of sizes or colours, does that mean I have to create a new variation configuration for each item?

Also I'm using ProFields: Table on order pages where the user can pick a product. Would there be any way of pulling in the product sizes into a field on the PageTable/have you ever tried anything similar. As there is (obviously) not a field type for Variations with ProFields Table, I guess perhaps a hook could work?

Many Thanks

Link to comment
Share on other sites

@kongondo I've got a work around, or solution the way I see it. Add a column called available and then just have all colours and sizes added and then just set "available" to false on the ones that aren't applicable. Would there be any performance impact with this. I can't seem to think of a better way other than having a lot of variation configurations.

Link to comment
Share on other sites

21 hours ago, alexm said:

Hey @kongondo just purchased this as I need to produce a kind of catalogue website for clothes

Hi @alexm. Many thanks for the purchase.

21 hours ago, alexm said:

Due to the fact that nearly every product has different combinations of sizes or colours, does that mean I have to create a new variation configuration for each item?

No, you don't. You can (as you have found out) use the same Variation configuration multiple times. For example, a 'Catalogue' variation configurations made up of colours (black, red, green) x sizes (small, large, tall). However, currently, Variations does not allow you to remove / hide unavailable combinations (e.g. small / red). 

16 hours ago, alexm said:

Add a column called available and then just have all colours and sizes added and then just set "available" to false on the ones that aren't applicable.

That is the way to do it. I'll have a think about how this can be improved. For instance, for some products, the seller would know that some combinations would never exists for that product, e.g. green x large is (silly example, maybe) never available for this product. In such a case, they may want to delete the combination altogether. On the other hand, it is better in many cases to readily see what is and what is not available. In some cases, unavailable might become available in the future. Hence, making it available is easier if the combination is still visible in the UI. 

Incidentally, in Padloper 2, variations are inbuilt and allow you much more control. You are not tied to one configuration and can either delete or disable a variant. 

16 hours ago, alexm said:

Would there be any performance impact with this.

There shouldn't be. How many colours / sizes combinations are you generating?

21 hours ago, alexm said:

Also I'm using ProFields: Table on order pages where the user can pick a product. Would there be any way of pulling in the product sizes into a field on the PageTable/have you ever tried anything similar. As there is (obviously) not a field type for Variations with ProFields Table, I guess perhaps a hook could work?

I haven't tested with Table. Are you talking about Table or PageTable, by the way, given that they are different modules? I am not sure I follow the question as well. Please clarify the field on the PageTable.

Docs, just in case you didn't see them.

Thanks.

Edited by kongondo
  • Like 1
Link to comment
Share on other sites

@kongondo thank you for that. That means my set up is the best setup based on the way it works! Great work by the way!! ?

3 hours ago, kongondo said:

Incidentally, in Padloper 2, variations are inbuilt and allow you much more control. You are not tied to one configuration and can either delete or disable a variant. 

19 hours ago, alexm said:

I saw this in the product video demo way back! Great job again. Looking forward to hopefully testing alpha, if you approve and supporting the amazing task you've undertaken as and when purchasing is available.

3 hours ago, kongondo said:

There shouldn't be. How many colours / sizes combinations are you generating?

On 11/20/2021 at 3:21 PM, alexm said:

e.g. One has 396 variations

 

3 hours ago, kongondo said:

I haven't tested with Table. Are you talking about Table or PageTable, by the way, given that they are different modules? I am not sure I follow the question as well. Please clarify the field on the PageTable.

 

Table not PageTable. Effectively I'm using it to create a kind of invoice page and the table acts as the items to invoice. I have a PageReference field which grabs a product. It would be awesome to be able to either, grab the product variation (though they aren't I understand that they aren't pages, so that is ruled out), then I could grab the associated information such as sizes and colours available.
Then I thought that perhaps another way would be to grab the available variations for a Referenced page in the PageField and then output a dropdown of options to make it easy to pick.

To be honest though, it's not a whole lot of effort to just type XL and Blue in 2 text fields failing there being a solution that you can see. 

  • Like 1
Link to comment
Share on other sites

@kongondo I'll end up scrapping this setup once PadLoper is ready in the long run as I know it doesn't use pages now. So this is only a bridge really and there is no need to part with too much of your time considering this if it simply isn't straight forward. Thank you for your time.

  • Like 1
Link to comment
Share on other sites

51 minutes ago, alexm said:

Looking forward to hopefully testing alpha, if you approve

Just checking that you expressed an interest?

53 minutes ago, alexm said:

e.g. One has 396 variations

Wow! From performance side of things, that's still fine as each individual combination (variant) is not a page in itself. From a UI/UX point of view though...that can be a nightmare. I wonder if some sort of grouping is possible? i.e. creating configs for similar products. Maybe not worth the effort though as you can use the inbuilt pagination and search on the variations table.

1 hour ago, alexm said:

I have a PageReference field which grabs a product. It would be awesome to be able to either, grab the product variation (though they aren't I understand that they aren't pages, so that is ruled out), then I could grab the associated information such as sizes and colours available.

You should still be able to. However, I am not sure how your setup looks like. This confuses me:

1 hour ago, alexm said:

It would be awesome to be able to either, grab the product variation

Usually, a single product would have more than one variation, e.g. Red Small, Black Large, etc. However, it is also possible for a product to have one variation/variant only. The key thing here is that a one-to-many relationship is still assumed. The usual setup would be like this:

Product A
   variant 1: Red Small
   variant 2: Black Small
   variant 3: Black Large

In your Invoice Page, if you have Product A selected, you have access to all its variants (1, 2 and 3). Assuming you have a variations field inside Product A called catalogue, then you can access Product A variations like so:

<?php

namespace ProcessWire;

$productA = $pages->get(1234);
/** @var VariationsArray WireData $productAVariants */
// VariationsArray -> WireArray
$productAVariants = $productA->catalogue;

Since $productAVariants is a WireArray, you can use get() and find() on it like any other WireArray.

E.g. 

<?php

namespace ProcessWire;

// find variants in Product A whose colour is 'Black'
$productABlacks = $productAVariants->find("colour=Black");

// find variants in Product A whose colour is 'Blue' and 'Price' > 5
$productABlues = $productAVariants->find("colour=Blue,price>5");

Again, I don't fully understand your setup so I may be way off base here, but happy to help if I can see an illustration, screenshot, etc.

1 hour ago, alexm said:

PadLoper is ready in the long run as I know it doesn't use pages now.

Ahem... It has been a minute and a number of things had to change. This will be explained in due course but I can only say that we have the best of several worlds with the about to be released Padloper 2 Alpha/Early Beta ?. All will be revealed in due course ?

  • Like 1
Link to comment
Share on other sites

3 hours ago, kongondo said:

Just checking that you expressed an interest?

I have indeed expressed interest! ?

4 hours ago, kongondo said:

Wow! From performance side of things, that's still fine as each individual combination (variant) is not a page in itself. From a UI/UX point of view though...that can be a nightmare. I wonder if some sort of grouping is possible? i.e. creating configs for similar products. Maybe not worth the effort though as you can use the inbuilt pagination and search on the variations table.

Yup! Haha, mad. I've uploaded an example of the amount of colours for one T-shirt and the various sizes available, for your enjoyment ha. Insane. So those have all been added.

4 hours ago, kongondo said:

Again, I don't fully understand your setup so I may be way off base here, but happy to help if I can see an illustration, screenshot, etc.

5 hours ago, alexm said:

Yeah so, I've not made it clear that I meant when editing the page like a donut. See screenshot with red arrows. I have added hook so that when the page is saved and a quantity has been entered for that row it grabs the price from the related product (col 1) and then adds it to the price field and calculated the line total. It would be awesome if there were a way to either output the available variant sizes and colours as separate selects say, or as one join column called variations.

4 hours ago, kongondo said:

Ahem... It has been a minute and a number of things had to change. This will be explained in due course but I can only say that we have the best of several worlds with the about to be released Padloper 2 Alpha/Early Beta ?. All will be revealed in due course ?.

I applaud your efforts, patience and skill! It looks and sounds phenomenal based on the ongoing discussion in the PadLoper thread. Imagine if you drop it on Christmas... We could call you Santa? ?

Screenshot 2021-11-21 at 21.11.20.png

Screenshot 2021-11-21 at 21.11.28.png

Screenshot 2021-11-21 at 21.15.49.png

  • Like 1
Link to comment
Share on other sites

19 hours ago, alexm said:

See screenshot with red arrows. I have added hook so that when the page is saved and a quantity has been entered for that row it grabs the price from the related product (col 1) and then adds it to the price field and calculated the line total. It would be awesome if there were a way to either output the available variant sizes and colours as separate selects say, or as one join column called variations

OK, we are getting warmer. A few questions:

  1. Pro RTX Pro Pique Polo Shirt: is that a product or a product variant? I guess the former though.
  2. If it is product, I am assuming it has variants?
  3. If it has variants, what do you want to display in the columns Size and Colour? Should they not display a single size and colour (e.g., Small and Lilac) respectively?
  • Like 1
Link to comment
Share on other sites

SORRY! Missed your reply. My bad.

1. It is the product itself.
2. It does.

On 11/22/2021 at 5:19 PM, kongondo said:

Should they not display a single size and colour (e.g., Small and Lilac) respectively?

3. Yes, that would also be fine as it's a combination of 2 attributes. So it could just be Small Lilac like you say all in one column.

Link to comment
Share on other sites

19 minutes ago, alexm said:

1. It is the product itself.

OK. If the table is an invoice table, I presume then that you know which of the variants of this product was bought. For instance, Pro RTX Pro Pique Polo Shirt comes in several variants, Small x Lilac, Medium x Brown. In your first line then, you should know if it was Small x Lilac that was bought of Medium x Brown. All variants have IDs. This is the bit I don't get. In your Hook, you can autofill Size and Colour by grabbing the product variant using its ID. Is there a reason you cannot do that? Unless, these invoices are being created manually maybe off a phone order, in which case, the editor has no idea what the variant ID is :-). Sorry if I am taking you round in circles. Alternatively, I could have a quick look if a discrete temporary login to your site is possible. 

  • Like 1
Link to comment
Share on other sites

50 minutes ago, kongondo said:

Unless, these invoices are being created manually maybe off a phone order, in which case, the editor has no idea what the variant ID is :-). Sorry if I am taking you round in circles. Alternatively, I could have a quick look if a discrete temporary login to your site is possible.

This! So it's not going to function as a front end store in the short term. Why would one do such a thing when I could wait and use something as delicious as PadLoper. Haha.
It will be simply so invoices can be created quickly from the relevant stock items.

It's my fault for not explaining in more detail. By all means, jump in and take a look. I'll fire over details once I've uploaded it in a mo ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...