douglaswalker Posted July 1, 2015 Share Posted July 1, 2015 Hi GuysI am on Bootstrap and i am trying to workout the best way to exclude certain boxes on the checkout pages. For instance I don't need to show the review box on checkout_shipping, checkout_payment etc. Just trying to reduce customers getting distracted when they are down to the business of paying. This is code i have in the reviews box template with the code (thanks to this forum) to exclude it on index.php but not product listing. How could i amend this to exclude checkout pages. Or another idea Exclude the whole left column on checkout pages to keep distraction to a minimum. Example code <?php if ( (!strpos($_SERVER['PHP_SELF'], 'index.php')) || (strpos($_SERVER['PHP_SELF'], 'index.php') && isset($_GET['manufacturers_id']) || isset($_GET['cPath']) ) ) { ?> <div class="panel panel-custom"> <div class="panel-heading panel-heading-custom"><a href="<?php echo tep_href_link('reviews.php'); ?>"><?php echo MODULE_BOXES_REVIEWS_BOX_TITLE; ?></a></div> <div class="panel-body"><?php echo $reviews_box_contents; ?></div> </div> <?php } ?> All help appreciated Doug Link to comment Share on other sites More sharing options...
burt Posted July 1, 2015 Share Posted July 1, 2015 Doug take a look at how it is done in (eg) the currencies box ... Link to comment Share on other sites More sharing options...
douglaswalker Posted July 1, 2015 Author Share Posted July 1, 2015 Ok will check it out Link to comment Share on other sites More sharing options...
douglaswalker Posted July 1, 2015 Author Share Posted July 1, 2015 Ok so this is what I did and it appears to have worked.. @@burt thanks for the treasure hunt clue. This is my bm_specials box altered to not appear on any file_name which has the word checkout. How does this look to you guys... function execute() { global $PHP_SELF, $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { ob_start(); include(DIR_WS_MODULES . 'boxes/templates/specials.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } } So I added $PHP_SELF, to function execute() {global $PHP_SELF, $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate; and then if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { then added a closing } All seems to work fine. I will experiment with other boxes. This is all in an effort to clear away unneeded boxes etc during checkout. Link to comment Share on other sites More sharing options...
auzStar Posted July 1, 2015 Share Posted July 1, 2015 @@douglaswalker That looks correct Doug :thumbsup: just need to tidy it up function execute() { global $PHP_SELF, $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { ob_start(); include(DIR_WS_MODULES . 'boxes/templates/specials.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } } My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
♥raiwa Posted July 1, 2015 Share Posted July 1, 2015 @@douglaswalker, There is a more generic and easier approach which has been already posted somewhere else. It also works for any content module: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) == 'checkout') { $this->enabled = false; } else { return $this->enabled; } } About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
douglaswalker Posted July 1, 2015 Author Share Posted July 1, 2015 Many thanks guys So which is the most efficient do you think? Was just testing and @@raiwa your version is certainly easier to drop in. Easier to not miss a brace. Thanks so much Doug :thumbsup: Link to comment Share on other sites More sharing options...
tgely Posted July 1, 2015 Share Posted July 1, 2015 http://addons.oscommerce.com/info/7691/v,23 osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
auzStar Posted July 2, 2015 Share Posted July 2, 2015 @@douglaswalker, There is a more generic and easier approach which has been already posted somewhere else. It also works for any content module: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) == 'checkout') { $this->enabled = false; } else { return $this->enabled; } } Yes, this is another way but $this->enabled is being returned in the above statement when the condition is true should be: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) == 'checkout') { $this->enabled = false; } return $this->enabled; } My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
douglaswalker Posted July 2, 2015 Author Share Posted July 2, 2015 so the else is un-needed? Link to comment Share on other sites More sharing options...
auzStar Posted July 2, 2015 Share Posted July 2, 2015 so the else is un-needed? correct the value of $this->enabled is being changed then returned My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
douglaswalker Posted July 3, 2015 Author Share Posted July 3, 2015 So I suppose this is the way to have the box only appear on the checkout pages. Please correct if this is wrong. :blush: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) == 'checkout') { return $this->enabled; } } Link to comment Share on other sites More sharing options...
auzStar Posted July 3, 2015 Share Posted July 3, 2015 So I suppose this is the way to have the box only appear on the checkout pages. Please correct if this is wrong. :blush: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) == 'checkout') { return $this->enabled; } } Hi Doug, to show only in checkout pages: function isEnabled() { global $PHP_SELF; if(substr($PHP_SELF, 0, 8) != 'checkout') { $this->enabled = false; } return $this->enabled; } so if it's not at the checkout, the box gets disabled (only shows during checkout, assuming the box is enabled in admin) cheers My Add-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code Link to comment Share on other sites More sharing options...
douglaswalker Posted July 4, 2015 Author Share Posted July 4, 2015 Thank-you once again. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.