Guest Posted April 17, 2013 Posted April 17, 2013 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??
♥14steve14 Posted April 17, 2013 Posted April 17, 2013 You are the only one who kbows which file you edited. We could all guess. REMEMBER BACKUP, BACKUP AND BACKUP
Guest Posted April 22, 2013 Posted April 22, 2013 @@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
♥bruyndoncx Posted April 22, 2013 Posted April 22, 2013 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
Guest Posted April 22, 2013 Posted April 22, 2013 @@bruyndoncx Thank you for your reply; I am currently using v2.3.3.
♥bruyndoncx Posted April 22, 2013 Posted April 22, 2013 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
Guest Posted April 23, 2013 Posted April 23, 2013 @@bruyndoncx Template class file? I am using the default template of oscommerce. I tried searching over template_top and header for left column but to no avail.
multimixer Posted April 23, 2013 Posted April 23, 2013 Both columns, left and right, are added to the layout in file catalog/includes/template_bottom.php My community profile | Template system for osCommerce - New: Responsive | Feedback channel
♥bruyndoncx Posted April 23, 2013 Posted April 23, 2013 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
multimixer Posted April 23, 2013 Posted April 23, 2013 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" My community profile | Template system for osCommerce - New: Responsive | Feedback channel
♥bruyndoncx Posted April 23, 2013 Posted April 23, 2013 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
Guest Posted April 27, 2013 Posted April 27, 2013 @@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.
♥14steve14 Posted April 27, 2013 Posted April 27, 2013 By now you could have used a compare program and checked your files against an original copy of oscommerce and found the changes. Just a suggestion. REMEMBER BACKUP, BACKUP AND BACKUP
Guest Posted April 27, 2013 Posted April 27, 2013 Thank you. I managed to find the code thanks to @@multimixer; it seems I added those lines at template_bottom.php. Thank you everyone for the help!
multimixer Posted April 27, 2013 Posted April 27, 2013 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 My community profile | Template system for osCommerce - New: Responsive | Feedback channel
bandmans Posted February 17, 2014 Posted February 17, 2014 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?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.