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.
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
Changing the layout of product-cards
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Changing the layout of product-cards
You do not have the required permissions to view the files attached to this post.
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
- burt
- Core Team
- Posts: 4547
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Changing the layout of product-cards
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
I don't have time to test it out now, but will try to find time in the coming week
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
Omar_one
- Senior Contributor
- Posts: 676
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing the layout of product-cards
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 .
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 .
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Changing the layout of product-cards
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
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
-
Omar_one
- Senior Contributor
- Posts: 676
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing the layout of product-cards
I noticed that also its effects on the boxes like (What's New?, Reviews box).
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Changing the layout of product-cards
Alright, further we move!
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
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
You do not have the required permissions to view the files attached to this post.
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide
-
Omar_one
- Senior Contributor
- Posts: 676
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing the layout of product-cards
nice,, I don't think it's important to have more then one template,, just editing the default one and that's it ,
-
Omar_one
- Senior Contributor
- Posts: 676
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: Changing the layout of product-cards
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
template active
- Kofod95
- Senior Contributor
- Posts: 748
- Joined: Sat Feb 06, 2021 7:38 pm
- Phoenix Version: 1.0.8.20
- Has thanked: 99 times
- Been thanked: 179 times
Re: Changing the layout of product-cards
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
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Here are a lot of corns: Phoenix user guide