Page 1 of 2
List view instead of grid view
Posted: Wed Aug 18, 2021 7:15 am
by amaische
Hello,
I have installed Phoenix 1.0.7.7 and I want the product listing to be shown in list view, not in grid view.
The user of the shop should not be able to choose between list or grid, the admin should make the adjustment.
Is there an addon or have i overlooked something in the standard phoenix ?
Thank you in advance, best regards amaische
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 7:19 am
by heatherbell
amaische wrote: ↑Wed Aug 18, 2021 7:15 amwant the product listing to be shown in list view,
Change the settings in Admin>Configuration>Product Listing>Products per Row
You can change it so only 1 product per row will show, that is a list view.
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 7:33 am
by amaische
Hello,
thank you for the fast reply. If I do so, the image is really large (card-img=100%). If I change it to e.g. 50% it is better, but the text (containing products_model, products_name, products_price,etc) is still beneath the image and not besides the image in the same row.
How can I change this ?
best regards amaische
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 8:12 am
by ecartz
There is an example with the product listing as a list in
app.php/addons/supporters_code/s05e06_t ... ,_theming/
I forget how old that example is; it may or may not work with 1.0.7.7 without changes. It would work in 1.0.8.0.
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 9:44 am
by amaische
Unfortunately in the addon is no example how the list looks like.
Therefore I have found a solution
1. As mentioned above change the setting in admin: products-per-row=row row-cols-1 row-cols-sm-1 row-cols-md-1
2. Change product_listing.php (templates-default-includes-components) (the following changes are hard coded):
find:
Code: Select all
"$prod_list_contents .= '<div class="card h-100 is-product" data-is-special="' . (int)$listing['is_special'] . '" data-product-price="' . $currencies->display_raw($listing['final_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '" data-product-manufacturer="' . max(0, (int)$listing['manufacturers_id']) . '" >' . PHP_EOL;"
Code: Select all
$prod_list_contents .= '<div class="card h-100 is-product" data-is-special="' . (int)$listing['is_special'] . '" data-product-price="' . $currencies->display_raw($listing['final_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '" data-product-manufacturer="' . max(0, (int)$listing['manufacturers_id']) . '" style="border:none;-ms-flex-direction: row;flex-direction: row;">' . PHP_EOL;
find:
Code: Select all
$prod_list_contents .= '<a href="' . tep_href_link('product_info.php', 'manufacturers_id=' . (int)$_GET['manufacturers_id'] . '&products_id=' . (int)$listing['products_id']) . '">' . tep_image('images/' . $listing['products_image'], htmlspecialchars($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', true, 'card-img-top') . '</a>' . PHP_EOL;
and add after the </a> an </span>
Do the same two lines beneath.
find:
Code: Select all
$prod_list_contents .= '<h5 class="card-title">';
and change it to
Code: Select all
$prod_list_contents .= '<span style="display: inline-block; width: 70%;"><h5 class="card-title">';
find:
Code: Select all
$prod_list_contents .= '</div>' . PHP_EOL;
(the first one at the end of the while-loop) and change it to
Code: Select all
$prod_list_contents .= '</span></div>' . PHP_EOL;
find:
Code: Select all
$prod_list_contents .= '</div>' . PHP_EOL;
(the last one in the while-loop) and change it to
Code: Select all
$prod_list_contents .= '</div><hr>' . PHP_EOL;
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 10:50 am
by Kofod95
Please copy that file into templates/override/includes/components - then it's a no-core change
//Daniel
Re: List view instead of grid view
Posted: Wed Aug 18, 2021 3:59 pm
by Omar_one
check this add-on by
@zipurman
app.php/addons/paid_addon/zipur_product_manager/
its included a hook for Product List Columns 1,2,4,6..
it's not just that , there is a lot.. its product manager for back-end and front-end
Re: List view instead of grid view
Posted: Mon Jun 30, 2025 4:38 pm
by ArtcoInc
(reviving an old thread)
I, too, need to know how to display in list view, not grid view.
1) Phoenix, v 1.0.3.0 (please don't judge)
2) There is no Product Listing > Product Per Row option in 1.0.3.0
3) The edits posted by the OP are not applicable in v 1.0.3.0
4) Zipurman's add-on is no longer available
I am not adverse to editing 'core' files (again, please don't judge). I did this on a site I built years ago on Phoenix 1.0.1.4 (and in pre-frozen versions of oSC-CE), but those changes aren't applicable to 1.0.3.0.
TIA
Malcolm
Re: List view instead of grid view
Posted: Mon Jun 30, 2025 4:50 pm
by burt
I -think- old versions included a header tag module for grid/list.
Does your have such a module ? If yes, paste the contents here, in code tags.
Re: List view instead of grid view
Posted: Mon Jun 30, 2025 5:04 pm
by ArtcoInc
@burt I'm sorry, but I don't see that header tag ...
Malcolm