Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Excluding Boxes On Checkout Pages


Recommended Posts

Hi Guys
I 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

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

@@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-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

@@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;
    	}
    }
Link to comment
Share on other sites

:blink:
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

 

@@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-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

so the else is un-needed?

 

correct

 

the value of $this->enabled is being changed then returned

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

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

 

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-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...