Post by sampras » Fri Jul 06, 2012 12:53 am

So i have searched the length and breadth of the forum, and read all methods to solve this view problem, but it turns out as my template turns out to be custom made, the "category.tpl" is different.

Code: Select all

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><div id="innercontent"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <?php if ($thumb || $description) { ?>
  <div class="category-info">
    <?php if ($thumb) { ?>
    <div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div>
    <?php } ?>
    <?php if ($description) { ?>
    <?php echo $description; ?>
    <?php } ?>
  </div>
  <?php } ?>
  <?php if ($categories) { ?>
  <h3><?php echo $text_refine; ?></h3>
  <div class="category-list">
    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>">
        <div class="cat_img">
          <?php if ($category['pic']) { ?>
          <img src="<?php echo $category['pic']; ?>" title="<?php echo $category['name']; ?>" alt="<?php echo $category['name']; ?>" style="margin-bottom: 3px;" />
          <?php } else { ?>
          <img src="catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/image/not_found.jpg" title="<?php echo $category['name']; ?>" alt="<?php echo $category['name']; ?>" style="margin-bottom: 3px;" />
          
          <?php } ?>
        </div>
        <?php echo $category['name']; ?></a>
      </li>
      <?php } ?>
    </ul>
  </div>
  <?php } ?>
  <?php if ($products) { ?>
  <div class="product-filter">
    <div class="display_buttons"><b><?php echo $text_display; ?></b><a class="switch_thumb" href="#">Switch Thumb</a></div>
    <div class="product-compare"><a href="<?php echo $compare; ?>" id="compare_total"><?php echo $text_compare; ?></a></div>
    <div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
    <div class="sort"><b><?php echo $text_sort; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($sorts as $sorts) { ?>
        <?php if ($sorts['value'] == $sort . '-' . $order) { ?>
        <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  </div>
  <ul class="display">
    <?php foreach ($products as $product) { ?>
    <li>
    <div class="content_block">
      <?php if ($product['thumb']) { ?>
      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>
      <?php } ?>
      <h3><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h3>
      <div class="description"><?php echo $product['description']; ?></div>
      <?php if ($product['price']) { ?>
      <span class="big_label">
      <b><?php echo $text_price; ?></b><br />
        <?php if (!$product['special']) { ?>
        <span class="main_price"><?php echo $product['price']; ?></span>
        <?php } else { ?>
        <span class="old_price"><?php echo $product['price']; ?></span><br /> <span class="main_price2"><?php echo $product['special']; ?></span>
        <?php } ?>
      </span>
      <?php } ?>
      <?php if ($product['rating']) { ?>
      <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div>
      <?php } ?>
      <div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" title="<?php echo $button_cart; ?>"><?php echo $button_cart; ?></a></div>
      <div class="wishlist"><a onclick="addToWishList('<?php echo $product['product_id']; ?>');" title="<?php echo $button_wishlist; ?>"><?php echo $button_wishlist; ?></a></div>
      <div class="compare"><a onclick="addToCompare('<?php echo $product['product_id']; ?>');" title="<?php echo $button_compare; ?>"><?php echo $button_compare; ?></a></div>
    </div>
    </li>
    <?php } ?>
  </ul>
  <div class="pagination"><?php echo $pagination; ?></div>
  <?php } ?>
  <?php if (!$categories && !$products) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
    <div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
  </div>
  <?php } ?>
  <?php echo $content_bottom; ?></div></div>
<script type="text/javascript"><!--
$(document).ready(function(){

    $("a.switch_thumb").toggle(function(){
        $(this).addClass("swap");
        $("ul.display").fadeOut("fast", function() {
            $(this).fadeIn("fast").addClass("thumb_view");
        });
    }, function () {
        $(this).removeClass("swap");
        $("ul.display").fadeOut("fast", function() {
            $(this).fadeIn("fast").removeClass("thumb_view");
        });
    });

});
//--></script> 
<?php echo $footer; ?>
I need to change the default view to GRID. or if its complicated, then i am willing to remove the "LIST" view completely! PLEASE HELP !

Newbie

Posts

Joined
Fri Jul 06, 2012 12:28 am

Post by OSWorX » Fri Jul 06, 2012 1:37 am

No problem ..
You should have inside the catogory.tpl near at the end this:

Code: Select all

if (view) {
	display(view);
} else {
	display('list');
}
Change that to:

Code: Select all

if (view) {
	display(view);
} else {
	display('grid');
}
and you have as standard the 'grid' view.

In your case I would look into the css and see what is defined at: switch_thumb

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by sampras » Fri Jul 06, 2012 2:16 am

No, thats not the solution. I have tried all the mthods listed in this forum, but it wont help bcoz this is a different code.


When i contacted the author he just dismissed me by saying

"you would need to add class “swap” to the switch link – class .switch_thumb
Also you would need to add class .thumb_view to the ul with class .display
And finally you would need to rewrite the JS function controlling the switching on the bottom of the category.tpl
"


I dont have good skills in php (or jquery) , so if anyone could explain in steps what all to do based on his reply, i would be thankful.

I would just like to erase the default LIST view completely, a solution to do that would be the best!!


Thanks

Newbie

Posts

Joined
Fri Jul 06, 2012 12:28 am

Post by OSWorX » Fri Jul 06, 2012 4:09 am

sampras wrote:No, thats not the solution. I have tried all the mthods listed in this forum, but it wont help bcoz this is a different code.


When i contacted the author he just dismissed me by saying

"you would need to add class “swap” to the switch link – class .switch_thumb
Also you would need to add class .thumb_view to the ul with class .display
And finally you would need to rewrite the JS function controlling the switching on the bottom of the category.tpl
"


I dont have good skills in php (or jquery) , so if anyone could explain in steps what all to do based on his reply, i would be thankful.

I would just like to erase the default LIST view completely, a solution to do that would be the best!!


Thanks
Basically I would like to say: poor developer and very poor service!
You should publish the name - to prevent others wasting their money.

If you like, you could get in contct wih me (PM or email).
Will have a look at this.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by dweiser » Thu Oct 18, 2012 11:17 pm

OSWorX wrote:No problem ..
You should have inside the catogory.tpl near at the end this:

Code: Select all

if (view) {
	display(view);
} else {
	display('list');
}
Change that to:

Code: Select all

if (view) {
	display(view);
} else {
	display('grid');
}
and you have as standard the 'grid' view.

In your case I would look into the css and see what is defined at: switch_thumb
I had the opposite requirement, I wanted the default to be LIST. Thanks to this post, I was able to easily resolve my issue. Thank you so much!!

-dave

Newbie

Posts

Joined
Tue Nov 15, 2011 11:36 pm

Post by seid02 » Tue Mar 17, 2015 10:43 pm

i did it my 2.0.1.1 v.

it is simple
in category.tpl find

Code: Select all

  <div class="btn-group hidden-xs">
		<button type="button" id="list-view" class="btn btn-default" data-toggle="tooltip" title="<?php echo $button_list; ?>"><i class="fa fa-th-list"></i></button>
       <button type="button" id="grid-view" class="btn btn-default" data-toggle="tooltip" title="<?php echo $button_grid; ?>"><i class="fa fa-th"></i></button>    
 		</div>
and change to

Code: Select all

<div class="btn-group hidden-xs">
		<button type="button" id="grid-view" class="btn btn-default" data-toggle="tooltip" title="<?php echo $button_grid; ?>"><i class="fa fa-th"></i></button>
        <button type="button" id="list-view" class="btn btn-default" data-toggle="tooltip" title="<?php echo $button_list; ?>"><i class="fa fa-th-list"></i></button>
             </div>

http://www.keramikaoutlet.si/
Pralne plenice
TV Prodaja


New member

Posts

Joined
Wed Mar 11, 2015 10:43 pm

Who is online

Users browsing this forum: No registered users and 23 guests