Page 1 of 1

Changing the layout of product-cards

Posted: Fri Sep 17, 2021 12:51 pm
by Kofod95
Due to various confusing reasons, I'm messing around with something to change the card-layout on products.
At the moment, it's quite basic, and at a very early state, but I thought I would share it here, in case someone could see the fun in contributing to it.
Note that it will only change the layout of the cards in the boxes on versions prior to 1.0.8.5.
card_layout.zip
The concept is a PI-style card-layout, but in a very basic way.
The goal is to make it able to change behaviour according to several factors; basicly allowing different card-layouts in each category, or according a products "class of goods" (which is something that will come later) - This is not possible yet, but it will come. For now, it just allows you to go in the database, and change the width and sort-order of the components. An admin-tool for that will come, but I'm still trying to decide on the general structure, and thus keeping it as simple as possible so far.
It will create a new table called card_layout, that is where you can mess around with things.

Inputs, feedback, suggestions, critique and much more is very welcome!

//Daniel

Re: Changing the layout of product-cards

Posted: Fri Sep 17, 2021 1:36 pm
by burt
A super idea and concept.

I don't have time to test it out now, but will try to find time in the coming week

Re: Changing the layout of product-cards

Posted: Fri Sep 17, 2021 5:22 pm
by Omar_one
Well done @Kofod95
I just try it and it's working as it should
good idea. if it will become as a PI-style so it will easy to add new things in products list maybe modules as PI and Customer Data modules .

Re: Changing the layout of product-cards

Posted: Sat Sep 18, 2021 10:48 am
by Kofod95
Omar_one wrote: Fri Sep 17, 2021 5:22 pm if it will become as a PI-style so it will easy to add new things in products list maybe modules as PI and Customer Data modules .
That is exactly the plan!
For now I have just played around with the possibilities, and challenged my limited coding skills, but I do plan on making a module-ish system for it, to allow adding as much info as wanted (also giving the opportunity to have something like the old "list"-view), and to switch say the image-module for one that shows of options/attributes-images as well.
Because of my wish to allow several layouts which are all active at once, I want to keep it in its own table instead of adding to table.configuration, and that is why I call it "module-ish".
We'll see how far we come - hopefully quite far!

//Daniel

Re: Changing the layout of product-cards

Posted: Tue Sep 21, 2021 4:54 pm
by Omar_one
Kofod95 wrote: Fri Sep 17, 2021 12:51 pm Inputs, feedback, suggestions, critique and much more is very welcome!
I noticed that also its effects on the boxes like (What's New?, Reviews box).

Re: Changing the layout of product-cards

Posted: Wed Sep 29, 2021 10:19 am
by Kofod95
Alright, further we move!
card_layout.zip
Now I've added an admin-page to change the layout and offer the opportunity to create new "template"-layouts to fertilize the option for varying product_cards in the future. For now it will only show the "default" template.

I'm looking at a way to make the layout better, if kept as default.
Next update will hopefully bring the varying templates, and a way to assign products to templates either one at a time, or by categories, as well as a better default layout. The next step is to modularize the content, to allow custom fields and more flexibility.
Afterwards it's time for cleaning up the code - suggestions are welcome! Please break the system and tell me what's broken. Open the files and have a good long laugh at my bad coding - if you know better ways to do some of the things I want to do, I'm all ears - That is why it is shared here, and not just kept to myself until release - and of course to allow suggestions of things to include/leave out!

//Daniel

Re: Changing the layout of product-cards

Posted: Wed Sep 29, 2021 4:44 pm
by Omar_one
Kofod95 wrote: Wed Sep 29, 2021 10:19 am Now I've added an admin-page to change the layout and offer the opportunity to create new "template"-layouts to fertilize the option for varying product_cards in the future. For now it will only show the "default" template.
nice,, I don't think it's important to have more then one template,, just editing the default one and that's it ,

Re: Changing the layout of product-cards

Posted: Wed Sep 29, 2021 4:50 pm
by Omar_one
or you can add Card Template status and if it's active it will show on the product_card.php and its should be just one
template active

Re: Changing the layout of product-cards

Posted: Wed Sep 29, 2021 6:27 pm
by Kofod95
Omar_one wrote: Wed Sep 29, 2021 4:44 pm I don't think it's important to have more then one template
You are probably right, at least for most people.
However, the whole reason I began diving into this, was to allow various card-layouts to comply with Danish laws forbidding images on some types of products - While at it, I figured; why not try to expand the usability and turn the annoyance of the law into something that might be useful in other situations as well ;)

//Daniel