Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Left Column hidden only at Home Page


Guest

Recommended Posts

Hi all,

 

I actually had already hidden left column in the homepage but it ended up affected categories page as well.

 

When I had finally found a way to only hide it at home page, I forgot where the file I had edited.

 

Anyone know where is the file??

Link to comment
Share on other sites

@@14steve14

 

Thank you for your reply.

 

Ah yes, I do understand that point but I hope to know if there's anyone who know the file that has the left column code as that's the highest possibility where I had edited.

 

Regards,

FT

Link to comment
Share on other sites

that depends on the version of osC you used first of all

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

you probably edited the osc_template class file where you have calls to determine if a left or right column is present.

that is what I did at least when I first updated my existing site to the 2.3 series

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

but the grid content blocks are calculated in template_top , and that differs if there is a column left or not ...

 

I modified the hasBlocks function in includes/classes/osc_template.php to not have a left column on these 4 pages

function hasBlocks($group) {
 global $PHP_SELF;
 if ($group == 'boxes_column_left') {
 if (($PHP_SELF !== 'product_info.php')
	 and ($PHP_SELF !== 'products_new.php')
	 and ($PHP_SELF !== 'folder.php')
	 and ($PHP_SELF !== 'comparison.php') ) {
	 return (isset($this->_blocks[$group]) && !empty($this->_blocks[$group]));
 } else {
	 return 0;
 }
 } else {
	 return (isset($this->_blocks[$group]) && !empty($this->_blocks[$group]));
}

 

If I remember wel, standard home page can be detected by $category_depth = 'top'

 

so I think the code should be something like this:

function hasBlocks($group) {
 global $PHP_SELF, $category_depth;
 if (($group == 'boxes_column_left') and ($PHP_SELF == 'index.php') and ($category_depth == 'top') ) {
	 return 0;
 } else {
	 return (isset($this->_blocks[$group]) && !empty($this->_blocks[$group]));
 }
}

 

I have some code that enforces the basename in $PHP_SELF, perhaps it should be

basename($PHP_SELF) == 'index.php'

in your case, not sure if that is standard or not in your version

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

OP's question was about "the file that has the left column", it's of course not correct to manipulate anything there

 

It's also not necessary to change anything includes/classes/osc_template.php . Since there is no column if there are no boxes and since all boxes are classes, you can filter their "execution"

Link to comment
Share on other sites

so you are saying to implement this logic in each and every box that might be used on the index.php page (in categories or product listings) - this is what I did for certain boxes too for the home page

 

I agree with you in theory, but I personally prefer my personal hack, as it is a straight forward translation of his question into osc code.

He didn't ask to hide certain boxes, he requested to remove the whole left column on the home page.

 

Would you create a new class for this and overwrite the hasBlocks for this, as the more elegant solution, or do you see a better way ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

@@bruyndoncx @@multimixer

 

Thank you for the help but I still don't really understand the logic here.

 

As for the "basename($PHP_SELF) == 'index.php'", it actually hides the left and right column for categories page too. E.g. /index.php?cPath=22

However, I only wish to make it hidden at homepage.

Link to comment
Share on other sites

I didn't suggest to modify includes/template_bottom.php, I just answered to your question about where the columns are getting included, you were looking originally about a line of code that you added to somewhere

Link to comment
Share on other sites

  • 9 months later...

I have a similar issue. I would like to remove the left column from my product listing / category listing pages. I have been able to remove it from my index page and my product_info pages, but I can't for the life of me get it removed from my product listing / category listing pages. I tried deleting the code completely from the template_bottom.php file, but that didn't work either. Anyone have any ideas?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...