Post by jennifer333 » Mon Dec 29, 2014 4:00 am

opencart 2x uses slick module structure by default with each module having white border and box shadow.
I want to get rid of that border from a module, lets say featured products module. Where that border styling is comming from and how to erase it? ??? :o

Newbie

Posts

Joined
Mon Dec 29, 2014 3:54 am

Post by opencarthow.com » Mon Dec 29, 2014 8:02 pm

jennifer333 wrote:opencart 2x uses slick module structure by default with each module having white border and box shadow.
I want to get rid of that border from a module, lets say featured products module. Where that border styling is comming from and how to erase it? ??? :o
You can go to the file catalog/view/theme/default/stylesheet/stylesheet.css and add the below CSS to end of the file:

Code: Select all

.product-thumb {
border: none;
}
Or you can try with Theme Customizer or Color Customizer. Those extensions are useful when you upgading OpenCart, your changes will not be lost.

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by jennifer333 » Tue Dec 30, 2014 2:53 pm

@opencarthow.com,
Thank you for the reply,
border-thumb:none; erases the border of the individual product. What i want is to erase the container border/box shadow of the featured products module. Modules come with the default box structure. I want to get rid of that box style.

Newbie

Posts

Joined
Mon Dec 29, 2014 3:54 am

Post by opencarthow.com » Tue Dec 30, 2014 4:52 pm

jennifer333 wrote:@opencarthow.com,
Thank you for the reply,
border-thumb:none; erases the border of the individual product. What i want is to erase the container border/box shadow of the featured products module. Modules come with the default box structure. I want to get rid of that box style.
Hi,
Do you want to remove the box shadow of module in admin?

Attachments

module_box_shadow.png

module_box_shadow.png (23.73 KiB) Viewed 5256 times


Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by jennifer333 » Wed Dec 31, 2014 2:26 am

@opencarthow.com, thank you for the reply.
Sorry for the confusion and misunderstanding. I am talking about front end/catalog featured.tpl. By default opencart 2.0.0.1 uses no border/box shadow, but i'm using owl-carousel to make the featured products slide, which is makig the border. I had to get rid of default bootstrap setting for individual products in featured.tpl(

Code: Select all

<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
), otherwise each product showing as a thin and long pieces. and to get rid of the owl carousel border i surrounded the foreach loop with div of

Code: Select all

id="featured"
and in stylesheet.css i added

Code: Select all

#featured > .owl-carousel{
	margin: 0 0 60px; 
	background: #fff; 
	border:none;
	box-shadow: none;
	overflow: hidden;
}
The problem is now there is no gap between items and if i do

Code: Select all

#featured .item{
  margin-right: 10px;
}
the fourth item is comming off the edge.
I am setting more than 4 items, and showing only 4 visible items at once.
The code i'm using for featured.tpl is as below

Code: Select all

<h3>
  <?php echo $heading_title; ?>
  <span class="customNavigation">
    <a class="btn prev">Previous</a>
    <a class="btn next">Next</a>
    <a class="btn play">Autoplay</a>
    <a class="btn stop">Stop</a>
  </span>
</h3>

<div id="featured">
  <div id="owl-demo" class="owl-carousel"   >
  <?php foreach ($products as $product) { ?>
  
  <div class="item">
  <div class="product-thumb transition" > 

      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
      <div class="caption">
        <h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
        <p><?php echo $product['description']; ?></p>
        <?php if ($product['rating']) { ?>
        <div class="rating">
          <?php for ($i = 1; $i <= 5; $i++) { ?>
          <?php if ($product['rating'] < $i) { ?>
          <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
          <?php } else { ?>
          <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
          <?php } ?>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($product['price']) { ?>
        <p class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
          <?php } ?>
          <?php if ($product['tax']) { ?>
          <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
          <?php } ?>
        </p>
        <?php } ?>
      </div>
      <div class="button-group">
        <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
        <button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i></button>
        <button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i></button>
      </div>
    </div>
  </div>
  <?php } ?>
</div>
</div>


<script>
  $(document).ready(function() {
 
  var owl = $("#owl-demo");
 
  owl.owlCarousel({
      items : 4, 
      autoPlay:3000,
      stopOnHover:true
  });
 
  // Custom Navigation Events
  $(".next").click(function(){
    owl.trigger('owl.next');
  })
  $(".prev").click(function(){
    owl.trigger('owl.prev');
  })
  $(".play").click(function(){
    owl.trigger('owl.play',1000); 
  })
  $(".stop").click(function(){
    owl.trigger('owl.stop');
  })
 
});
</script>
How to fix it? so that first and fourth items stay at the edge and gaps only between inside items ?

Newbie

Posts

Joined
Mon Dec 29, 2014 3:54 am

Post by opencarthow.com » Wed Dec 31, 2014 8:00 pm

jennifer333 wrote:@opencarthow.com, thank you for the reply.
Sorry for the confusion and misunderstanding. I am talking about front end/catalog featured.tpl. By default opencart 2.0.0.1 uses no border/box shadow, but i'm using owl-carousel to make the featured products slide, which is makig the border. I had to get rid of default bootstrap setting for individual products in featured.tpl(

Code: Select all

<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
), otherwise each product showing as a thin and long pieces. and to get rid of the owl carousel border i surrounded the foreach loop with div of

Code: Select all

id="featured"
and in stylesheet.css i added

Code: Select all

#featured > .owl-carousel{
	margin: 0 0 60px; 
	background: #fff; 
	border:none;
	box-shadow: none;
	overflow: hidden;
}
The problem is now there is no gap between items and if i do

Code: Select all

#featured .item{
  margin-right: 10px;
}
the fourth item is comming off the edge.
I am setting more than 4 items, and showing only 4 visible items at once.
The code i'm using for featured.tpl is as below

Code: Select all

<h3>
  <?php echo $heading_title; ?>
  <span class="customNavigation">
    <a class="btn prev">Previous</a>
    <a class="btn next">Next</a>
    <a class="btn play">Autoplay</a>
    <a class="btn stop">Stop</a>
  </span>
</h3>

<div id="featured">
  <div id="owl-demo" class="owl-carousel"   >
  <?php foreach ($products as $product) { ?>
  
  <div class="item">
  <div class="product-thumb transition" > 

      <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
      <div class="caption">
        <h4><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
        <p><?php echo $product['description']; ?></p>
        <?php if ($product['rating']) { ?>
        <div class="rating">
          <?php for ($i = 1; $i <= 5; $i++) { ?>
          <?php if ($product['rating'] < $i) { ?>
          <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
          <?php } else { ?>
          <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
          <?php } ?>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($product['price']) { ?>
        <p class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
          <?php } ?>
          <?php if ($product['tax']) { ?>
          <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
          <?php } ?>
        </p>
        <?php } ?>
      </div>
      <div class="button-group">
        <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
        <button type="button" data-toggle="tooltip" title="<?php echo $button_wishlist; ?>" onclick="wishlist.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-heart"></i></button>
        <button type="button" data-toggle="tooltip" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-exchange"></i></button>
      </div>
    </div>
  </div>
  <?php } ?>
</div>
</div>


<script>
  $(document).ready(function() {
 
  var owl = $("#owl-demo");
 
  owl.owlCarousel({
      items : 4, 
      autoPlay:3000,
      stopOnHover:true
  });
 
  // Custom Navigation Events
  $(".next").click(function(){
    owl.trigger('owl.next');
  })
  $(".prev").click(function(){
    owl.trigger('owl.prev');
  })
  $(".play").click(function(){
    owl.trigger('owl.play',1000); 
  })
  $(".stop").click(function(){
    owl.trigger('owl.stop');
  })
 
});
</script>
How to fix it? so that first and fourth items stay at the edge and gaps only between inside items ?
Could you provide your site url, so I can take a look at this problem closer?

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by jennifer333 » Thu Jan 01, 2015 1:10 am

@opencarthow.com, thank you for the reply,
I am still on localhost, so can't provide site link at the moment.
What i'm trying to achieve is in opencart 2.0.1.1 i want exact same structure as it comes by default for the featured product module( except 4 buttons which are "previous", "next", "autoplay", "stop" beside the text "featured" and only 4 visible items) and owl-carousel added, so that if i click next , next featured product will slide in from the left if there are more than 4 featured products set. The other buttons use are self explanatory. This can be achieved using owl-carousel.

To activate owl-carousel with featured module in opencart 2.0.1.1 we need to add owl-carousel's css and js using the below code in the featured module's controller.

Code: Select all

$this->document->addStyle('catalog/view/javascript/jquery/owl-carousel/owl.carousel.css');
$this->document->addScript('catalog/view/javascript/jquery/owl-carousel/owl.carousel.min.js');
Now if you copy the featured.tpl which i have provided( i just added buttons and added a container class as owl-carousel and gave each product a class name item and added jquery at the buttom, i also surrounded the product with a div whose id is featured to erase owl-carousel's border/box shadow) and paste over the default featured.tpl you will see each product is touching other product with no gaps between them. how to make gaps between them?

Newbie

Posts

Joined
Mon Dec 29, 2014 3:54 am

Post by opencarthow.com » Sat Jan 03, 2015 11:09 am

Hi,
I will try to copy your modification to my local OpenCart and take a look at your problem.

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am

Who is online

Users browsing this forum: Amazon [Bot] and 8 guests