Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove border from infobox in main


Guest

Recommended Posts

I have borders added in the stylesheet for the infobox class, but I need to remove the border for individual boxes. Is it possible to edit the code in the individual files, where the boxes are called? Or do I need to add a new class? :roll: It seems such a lot of work for a tiny change! lol

Link to comment
Share on other sites

you need seperate classes to use different styles for your infoboxes. here's what i did:

 

FIRST, define your new styles in your stylesheet...

.informBox { 

 background: #990000; 

 } 

.cartBox { 

 background: #006600; 

 }

 

NEXT, in catalog/includes/classes/boxes.php

change this:

class infoBox extends tableBox { 

   function infoBox($contents) { 

     $info_box_contents = array(); 

     $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); 

     $this->table_cellpadding = '1'; 

     $this->table_parameters = 'class="infoBox"'; 

     $this->tableBox($info_box_contents, true); 

   }

 

to this....

(ADD THE $class='' parameter and the SWITCH statement, remembering to change the 'case's for your style)....

class infoBox extends tableBox { 

   function infoBox($contents, $class='') {

    $info_box_contents = array(); 

     $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); 

     $this->table_cellpadding = '1'; 



    switch ($class) { 

       case 'informBox': 

          $this->table_parameters = 'class="informBox"'; 

        break; 

       case 'cartBox': 

          $this->table_parameters = 'class="cartBox"'; 

        break; 

       default: 

          $this->table_parameters = 'class="infoBox"'; 

    }      

$this->tableBox($info_box_contents, true); 

   }

 

THEN, when you create the new infobox (usually in the /includes/boxes directory), just call it with your style...

new infoBox($info_box_contents, 'informBox');

 

this same technique to switch styles can be done for infoBoxHeading, infoBoxContents, etc....

you can see an example of different borders here:

http://www.austinbeads.com

 
Link to comment
Share on other sites

I tried the code you suggested Josheli, but it didn't work & the featured products disappeared from the box.

 

Since the unmodified featured.php calls 'contentBox', I also tried adding that to the stylesheet, without success.

 

Not sure what to try now. Any suggestions please, anyone?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...