LMD Posted February 23 Share Posted February 23 Hi Bernhard - I purchased RockCommerce a couple of days ago to test out. I have done the quick start tutorial in the docs and it went well. However, I need product variations, but the docs aren't ready yet! The variations I need are for specialist shoes (ballet dancers) and fairly complex - the prices also change depending on the shoe size! Colour Pink White ...etc Size 1 1.5 2 2.5 ... 12 Is there anything I can read/a demo anywhere to get me started? Thanks 1 Link to comment Share on other sites More sharing options...
bernhard Posted February 23 Share Posted February 23 Hey @LMD thx for your question and of course thx for your purchase 🙂 On 2/23/2025 at 10:16 AM, LMD said: I have done the quick start tutorial in the docs and it went well. Expand Great! 🙂 On 2/23/2025 at 10:16 AM, LMD said: However, I need product variations, but the docs aren't ready yet! The variations I need are for specialist shoes (ballet dancers) and fairly complex - the prices also change depending on the shoe size! Expand Yeah sorry for that! But I'm always around to help as good as I can 🙂 If prices only change based on shoe size it does not sound complex 🙂 If prices change depending on colour and shoe size than it's a different story 🙈 Adding variations from the backend should be straightforward! You click on "new variation" in the shop tab of your product and get something like this: Then you hit save and you get back to the shop tab. There you can filter all existing variations, so you can type "size" and get this: Then you enter the prices for each size and - important - select all variations that should be displayed on the frontend: To select/deselect variations you have two options: Select all or select a single item. When clicking on the "variation" column you select all, when clicking on the "option" column you can select individual rows: The selected variations should then show up on your frontend: Does that help? Not sure where exactly you are struggling 😉 Link to comment Share on other sites More sharing options...
LMD Posted February 23 Author Share Posted February 23 Thanks for the help... I have encountered some technical issues. When I tried to "Enable Product Variations" in RockCommerce settings, I got this error when I tried to "Save": Modules: Failed to init module: RockCommerce - SQLSTATE[42000]: Syntax error or access violation: 3152 JSON column 'data' supports indexing only via generated columns on a specified JSON path. The error disappeared when I reloaded the module page and the box was checked. So I continued... I added "Shoe Size" and "Colour" variations in the "Shop" -> "Variations" tab. Added the rockcommerce_variations field to the product template. Went to my test product page and created a variation for Shoe Size, added the required sizes and prices. Then hit "Save" and got the following Exception errors: PagesEditor: Error saving field "Variation" — SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dotnpw.field_rockcommerce_variation' doesn't exist FieldtypeRockGrid: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dotnpw.field_rockcommerce_variation' doesn't exist Futhermore the selected variation and prices did not get saved. Sure enough, when I looked in the DB the field_rockcommerce_variation table does not exist. I notice in the modules there are three modules that have not been auto-enabled, and nowhere (I noticed) did it mentioned they are needed? FieldtypeReVariations InputfieldRcVariations InputfieldRcPricing FYI using Laragon: PHP ver. 8.3.15 MySQL: 8.0.30 (used MyISAM when I installed PW) Thanks. Link to comment Share on other sites More sharing options...
bernhard Posted February 24 Share Posted February 24 Hey @LMD I can not reproduce the issue. This is what I did: created a new ddev project installed RockShell (to quickly install pw via commandline) installed pw (current dev, blank profile) clicked "install" for all modules (bottom - up) Enabled product variations and it correctly showed the warning: But I have improved that so that it shows the checkbox only if RockGrid is installed: Once RockGrid was installed i checked the box and got this (success, no errors): This is what I get when I view Setup > RockGrid: To add the Variations GUI to your products do this (I'll add this to the docs later): Add fields "rockcommerce_net" and "rockcommerce_variations" to your product template Then edit one of your products and you should see something like this: Then click on "+ new variation" at the top left corner of your variations repeater item: Save that and maybe reload the page to see the variations in the grid. Then you can select variations as mentioned above: Each variation has a price. You can either use "0" as base price and enter the variation price for each variation (eg, 10€ / 20€ / 30€) or sometimes you might want to set a total price. To save you or your clients from the hassle of calculating all price differences there is the "total" column that you can use and RockCommerce will calculate the difference for you: On 2/23/2025 at 6:01 PM, LMD said: FYI using Laragon: PHP ver. 8.3.15 MySQL: 8.0.30 (used MyISAM when I installed PW) Expand I can't recommend DDEV enough. I've been using Laragon for several years, but trust me, DDEV is so much better so it's really worth trying it out. Installation might be a little harder than with Laragon, but once installed DDEV just runs and runs and it has so many great features that Laragon does not have. And last but not least it makes it easier for me to help you with any issues because we have the same environment. Let me know how it goes. Link to comment Share on other sites More sharing options...
LMD Posted February 25 Author Share Posted February 25 I tried a completely fresh install and get a database error -- so I now think it is not a problem with RockCommerce specifically, but with PW and MySQL in general. The error message is complaining about indexing the JSON 'data' column. I shall return here with either a "hurrah" or a "boo-hoo" at a later date! Thanks for the help. And you are right, I should learn DDEV, I've always been put-off being on a Widnows machine. Link to comment Share on other sites More sharing options...
bernhard Posted February 25 Share Posted February 25 On 2/25/2025 at 10:34 AM, LMD said: Thanks for the help. And you are right, I should learn DDEV, I've always been put-off being on a Widnows machine. Expand I think being on windows is one more reason to look into ddev. You can use it in a WSL linux machine, so your local environment will be linux and your production environment will be as well (most likely). That avoids lot's of issues that you have to deal with when using laragon. For example I've been working on a PDF project and on linux it's easy to just use "poppler-utils" to create JPG from PDF. Not possible with laragon like this, so you need to either hack things together on your production environment or you have to find a way to get it working on your local dev, which means additional work and additional headache. Another example is my current multisite project. In DDEV all you have to do is add "additional_hostnames" to your config and you can access all your local sites via foo.ddev.site and bar.ddev.site and baz.ddev.site and all will be routed to the same ddev/pw project 🚀 I don't think that these two things would be possible with laragon. But I don't know. Oh and switching php versions is as simple as changing the config and running "ddev restart". In laragon it was also not that hard, but I can remember it was also not that easy... 1 Link to comment Share on other sites More sharing options...
LMD Posted February 25 Author Share Posted February 25 Ok, I've got it to work! Upgrading to MySQL ver. 9.2.0 did not work, changing from MyISAM to InnoDB did not work, but switching from MySQL to MariaDB (ver. 11.7.2) did work. I do not know enough about the technicalities of databases to know why, but I suspect it is that indexing issue from the previously mentioned error message. Thanks again for the help, it's all working as you describe now. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now