Post by AndersA » Fri Nov 14, 2014 5:27 am

Hi guys

I have a problem i hope one of you could help me with, as the topic says:

How is the default product view changed from grid to list in 2.0?
Tried searching the category.tpl for a place to change it, but no luck.

Thanks in advance!

Anders

Newbie

Posts

Joined
Wed Sep 12, 2012 3:37 am

Post by gangsar.swapurba » Fri Nov 14, 2014 3:54 pm

Hi,

Just change 'grid' from

Code: Select all

localStorage.setItem('display', 'grid');
to

Code: Select all

localStorage.setItem('display', 'list');
at /catalog/view/javascript/common.js:114.

Do not forget to 'super' refresh your browser by hitting CTRL + F5 or CTRL + Shift + R.

Let me know if it doesn't works.

Hope helps.

Blog Manager 2 - The Only Advanced Blog Extension for OpenCart 2.0 has coming!!!
Image


Blog Manager - The Only Advanced Blog Extension for OpenCart
Image


OpenCart Tips and Tutorials
Image


User avatar
Active Member

Posts

Joined
Tue Mar 20, 2012 8:39 am
Location - Indonesia

Post by stclare » Thu Jan 29, 2015 1:39 am

How would one make this change in a way that it would not get overwritten during a upgrade?

St. Clare Audio Still in it's newborn stage, a major work in progress..

St. Clare Heirloom Seeds Our original business, our current "bread and butter". Learned HTML, CSS, and a little PHP to develop it from scratch ourselves, having never done coding before. Then we discovered the awesomeness of Shopping Carts. :-)


New member

Posts

Joined
Mon Aug 18, 2014 9:12 pm

Post by viethemes » Thu Jan 29, 2015 10:57 am

stclare wrote:How would one make this change in a way that it would not get overwritten during a upgrade?
You can use my extension Custom JavaScript and add the code below:

Code: Select all

<script>
if (!localStorage.getItem('display')) {
localStorage.setItem('display', 'list');
}
</script>
It will be not lost when upgrade OpenCart.
See it in action here: http://demo.viethemes.com/opencart2/ind ... ry&path=20

http://www.viethemes.com - OpenCart turtorials, news, tips and stricks, extension

Our extensions:
Visual Theme Editor - Powerful tool for customizing style of any theme visually
Live Theme Editor - Customize layout, colors, backgrounds, fonts of the default theme
Theme Animation - Animation Editor for any theme

Extra Positions PRO, Custom JavaScript, Custom CSS and others


User avatar
Active Member

Posts

Joined
Thu Jan 08, 2015 12:17 pm


Post by Lime Dezign » Mon Mar 16, 2015 1:37 pm

A thousand thanks! :D

Newbie

Posts

Joined
Mon Mar 16, 2015 1:34 pm
Who is online

Users browsing this forum: No registered users and 107 guests