Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Slim Checkout for BS


raiwa

Recommended Posts

6 minutes ago, raiwa said:

I would say, even contact us is not needed during checkout

What if the customer have a question during checkout? Not trying to challenge your logic. I hope you don't take it that way.

The main reason I'm asking questions is sometimes I monitor Real Time activity in Google Analytics and I see customers enter the checkout process and bounce around from page to page. Many drop off altogether. So there's something grabbing their attention.  I believe your addon will help with that. 

Also, I'm very excited about this addon and expect positive results. @frankl, @burt and @Tsimi what are your assessment to this particular reply?

Link to comment
Share on other sites

4 minutes ago, raiwa said:

Agree, each shopowner can choose, I'll add login to the addressable pages.

It would be quite an interesting coding task to make a matrix;

page (choosed by the shopowner) across the top

modules down the side;  you'd likely only need header, footer, footer suffix, boxes

Link to comment
Share on other sites

1 minute ago, discxpress said:

What if the customer have a question during checkout? Not trying to challenge your logic. I hope you don't take it that way.

The main reason I'm asking questions is sometimes I monitor Real Time activity in Google Analytics and I see customers enter the checkout process and bounce around from page to page. Many drop off altogether. So there's something grabbing their attention.  I believe your addon will help with that. 

Also, I'm very excited about this addon and expect positive results. @frankl, @burt and @Tsimi what are your assessment to this particular reply?

If the modules are choosable...have one that stays that is a contact us. 

Potentials:
a box that only shows XS at the top of left column
a floating content module or HT module
a stuck to the bottom navbar

It's up to the shopowner to make things work his way...

Link to comment
Share on other sites

1 hour ago, burt said:

It would be quite an interesting coding task to make a matrix;

page (choosed by the shopowner) across the top

modules down the side;  you'd likely only need header, footer, footer suffix, boxes

page list for each module group:

Option B

 

Link to comment
Share on other sites

Reading this with interest - really short of time at the moment but hope to get a chance to install and have a play soon...

Conceptually it sounds like a winner - exactly the sort of easy configurability that's needed.

Anything that helps people using checkout on mobiles to focus on what's important and properly read the choices they are making has got to be a good thing.

I agree that in a store with only one shipping or payment module the relevant page doesn't serve any purpose to the consumer but I guess in order to skip them you'd need to pick up the module handling elsewhere.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

11 hours ago, burt said:

If the modules are choosable...have one that stays that is a contact us. 

Potentials:
a box that only shows XS at the top of left column
a floating content module or HT module
a stuck to the bottom navbar

It's up to the shopowner to make things work his way...

I'm looking at things from a user experience viewpoint. I wouldn't want my customers to feel trapped in the checkout funnel.

@burt floating modules would be great. It would be great to implement floating content modules 

 

Link to comment
Share on other sites

8 hours ago, discxpress said:

I'm looking at things from a user experience viewpoint. I wouldn't want my customers to feel trapped in the checkout funnel.

@discxpress, it's not all or nothing. Just hide the side columns and footer and leave the navbar and/or header area showinr => no one gets stucked in the checkout.

Link to comment
Share on other sites

@burt,

I have this developed like an add-on, that's why I prefer to use a Header Tag.

If there is a real interest to convert it to core, I would be happy to ucreate a fork and use a separate new admin page instead of the Header Tag and apply the extension class modifications to the parent class.

Another possibility which would require core changes:

If we would like to controle each individual module like @wHiTeHaT suggested, we could do this:

  • Add a configuration constant to "My store" holding the list of controlled pages: "CHECKOUT_PAGES".
  • Add the "edit_pages" and "show pages" functions to all modules
  •     function get_default_pages() {
          return explode(',', CHECKOUT_PAGES);
        }

     

        function __construct() {
    
          ...........
    
          $check_flag = false;
          foreach (explode(';', MODULE_...._PAGES) as $page) {
            $page = trim($page);
    
            if (!empty($page)) {
              $pages_array[] = $page;
            }
    
            if (in_array(basename($PHP_SELF), $pages_array)) {
              $check_flag = true;
            }
          }
          if ($check_flag == false) {
            $this->enabled = false;
          }
        }

    This allows full flexibility to control any page without the need to show a long list of irrelevant pages in each module. Even third party (add-on) pages can be easy added.

  • But requires core changes in each box, content, and navbar module.

Edited by raiwa
Link to comment
Share on other sites

Sorry there is a bug, I meant instead of:

    function get_default_pages() {
      return explode(',', CHECKOUT_PAGES);
    }

this:
 

  function get_pages() {
    $pages_array = explode(',', CHECKOUT_PAGES);
        
    // check if pages exist
    for ($i=0, $n=sizeof($pages_array); $i<$n; $i++) {
      if ( !file_exists(DIR_FS_CATALOG . $pages_array[$i]) ) unset($pages_array[$i]);
    }
    return $pages_array;
  }

And then:

  function module_..._edit_pages($values, $key) {
    global $PHP_SELF;

    $values_array = get_pages();

    $output = '';
    foreach ($files_array as $file) {
      $output .= tep_draw_checkbox_field('ht_datepicker_jquery_file[]', $file, in_array($file, $values_array)) . ' ' . tep_output_string($file) . '<br />';
    }

    if (!empty($output)) {
      $output = '<br />' . substr($output, 0, -6);
    }

	.....................

 

Edited by raiwa
Link to comment
Share on other sites

You mean to do it in the template class (extension)? And how to control additional add-on modules? MODULE_BOXES_INSTALLED, MODULE_CONTENT_INSTALLED etc?

Link to comment
Share on other sites

I do not see how to apply the group/module to page matrix only using this function

Edited by raiwa
Link to comment
Share on other sites

Thank you, but I still feel that it is overengineered to control each module individually. I continue with the purpose to slim up the checkout process by areas/group`s. Anyway you of course have given great ideas to me to do it in a better and easier way. :smile:

Edited by raiwa
Link to comment
Share on other sites

OK, but in your example you go for $module, I go for $group (navbar, header...)

Link to comment
Share on other sites

OK I'll have a deeper look. I'm right now working on the settings and pass them into hide array (groups/pages).

Link to comment
Share on other sites

new version updated in git hub:

  • module hide list for each checkout page
  • class extension moved into ht module
  • class extension clean up in direction Henry pointed out (still much more to do, I'll go for it tomorrow.)

Update: uninstall ht, replace ht, install ht, remove class extension.

Once this is clean and well working, I'll try to go for a separate admin page with control over each module and any page.

Link to comment
Share on other sites

@wHiTeHaT,

I got it to work so far modifying the parent class. If I try to create the extension and leave the parent class unmodified, the modules work, but the blocks do not.

If I just comment out within the buildBlocks function:

                //  $mb->execute();

the side columns still show.

this is my template class extension ( do not watch my checkPages function, it will be simplified):

  if (class_exists('oscTemplate')) {
    class oscTemplateExt extends oscTemplate {
    public $_blocks = array();
    public $_content = array();
    public $_grid_container_width = 12;
    public $_grid_content_width = BOOTSTRAP_CONTENT;
    public $_grid_column_width = 0; // deprecated
    public $_data = array();
    public $_hide_column = false;
    public $_pages = array();

      function __construct() {
        global $PHP_SELF, $oscTemplate;
        $this->_blocks = $oscTemplate->_blocks;
        $this->_content = $oscTemplate->_content;
        $this->_grid_container_width = $oscTemplate->_grid_container_width;
        $this->_grid_column_width = $oscTemplate->_grid_column_width;
          
        
      }

    function getGridContentWidth() {
      if ( $this->_hide_column == true ) {
        return MODULE_HEADER_TAGS_SLIM_CHECKOUT_CONTENT_WIDTH;
      } else {
        return $this->_grid_content_width;
      }
    }

    function buildBlocks() {
      global $PHP_SELF, $language;
        
      
      if ( defined('TEMPLATE_BLOCK_GROUPS') && tep_not_null(TEMPLATE_BLOCK_GROUPS) ) {
        $tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS);
        foreach ($tbgroups_array as $group) {
          $module_key = 'MODULE_' . strtoupper($group) . '_INSTALLED';

          if ( defined($module_key) && tep_not_null(constant($module_key)) ) {
            $modules_array = explode(';', constant($module_key));

            foreach ( $modules_array as $module ) {
              $class = basename($module, '.php');
              if ( !class_exists($class) ) {
                if ( file_exists('includes/languages/' . $language . '/modules/' . $group . '/' . $module) ) {
                  include('includes/languages/' . $language . '/modules/' . $group . '/' . $module);
                }

                if ( file_exists('includes/modules/' . $group . '/' . $module) ) {
                  include('includes/modules/' . $group . '/' . $module);
                }
              }
              if ( class_exists($class) ) {
                $mb = new $class();
//echo '<br><br>$class' . $class;
                if ( $mb->isEnabled() && !in_array(basename($PHP_SELF), $this->checkPages($class))) {
                  $mb->execute();
                }
              }
              
            }
          }
        }
      }
    }


    function getContent($group) {
      global $PHP_SELF, $language;

      if ( !class_exists('tp_' . $group) && file_exists('includes/modules/pages/tp_' . $group . '.php') ) {
        include('includes/modules/pages/tp_' . $group . '.php');
      }

      if ( class_exists('tp_' . $group) ) {
        $template_page_class = 'tp_' . $group;
        $template_page = new $template_page_class();
        $template_page->prepare();
      }

      foreach ( $this->getContentModules($group) as $module ) {
        if ( !class_exists($module) ) {
          if ( file_exists('includes/modules/content/' . $group . '/' . $module . '.php') ) {
            if ( file_exists('includes/languages/' . $language . '/modules/content/' . $group . '/' . $module . '.php') ) {
              include('includes/languages/' . $language . '/modules/content/' . $group . '/' . $module . '.php');
            }

            include('includes/modules/content/' . $group . '/' . $module . '.php');
          }
        }

        if ( class_exists($module) ) {
          $mb = new $module();
//echo '<br><br>$module' . $module;
//echo '<br><br>$module' . print_r($this->checkPages($module));

           if ( $mb->isEnabled() && !in_array(basename($PHP_SELF), $this->checkPages($module))) {
            $mb->execute();
          }
        }
      }

      if ( class_exists('tp_' . $group) ) {
        $template_page->build();
      }

      if ($this->hasContent($group)) {
        return implode("\n", $this->_content[$group]);
      }
    }

    
    function checkPages($class){ //$class what is called in the buildblocks and content modules ($module) 
      global $PHP_SELF;
        if (strtok($class, '_') == 'bm') {
          $module_group_prefix = strtok($class, '_');
        } elseif (strtok($class, '_') == 'cm') {
          $module_group_prefix = (strtok($class, '_'.strtok($class, '_')));
        }          
        $hide_array[$module_group_prefix] = array();
        $hide_pages = array('login.php', 'shopping_cart.php' , 'checkout_shipping.php', 'checkout_payment.php', 'checkout_confirmation.php', 'checkout_success.php');
        $hide_array['navbar'] =  explode(',', MODULE_HEADER_TAGS_SLIM_CHECKOUT_NAVBAR);
        $hide_array['header'] =  explode(',', MODULE_HEADER_TAGS_SLIM_CHECKOUT_HEADER);
        $hide_array['bm'] =  explode(',', MODULE_HEADER_TAGS_SLIM_CHECKOUT_BOXES);
        $hide_array['footer'] =  explode(',', MODULE_HEADER_TAGS_SLIM_CHECKOUT_FOOTER);
        $hide_array['footer_suffix'] =  explode(',', MODULE_HEADER_TAGS_SLIM_CHECKOUT_FOOTER_SUFFIX);
        for ($i=0; $i<sizeof($hide_pages); $i++) {
          if ($hide_array['navbar'][$i] == 0) {
            $hide_array['navbar'][$i] = $hide_pages[$i];
          } else {
            unset($hide_array['navbar'][$i]);            
          }
          if ($hide_array['header'][$i] == 0) {
            $hide_array['header'][$i] = $hide_pages[$i];
          } else {
            unset($hide_array['header'][$i]);            
          }
          if ($hide_array['bm'][$i] == 0) {
            $hide_array['bm'][$i] = $hide_pages[$i];
          } else {
            unset($hide_array['bm'][$i]);            
          }
          if ($hide_array['footer'][$i] == 0) {
            $hide_array['footer'][$i] = $hide_pages[$i];
          } else {
            unset($hide_array['footer'][$i]);            
          }
          if ($hide_array['footer_suffix'][$i] == 0) {
            $hide_array['footer_suffix'][$i] = $hide_pages[$i];
          } else {
            unset($hide_array['footer_suffix'][$i]);            
          }
        }
//    echo '<br><br>$hide_array[navbar]' . print_r($hide_array['navbar']);
//    echo '<br><br>$hide_array[header]' . print_r($hide_array['header']);
//    echo '<br><br>$hide_array[bm]' . print_r($hide_array['bm']);
//    echo '<br><br>$hide_array[footer]' . print_r($hide_array['footer']);
//    echo '<br><br>$hide_array[footer_suffix]' . print_r($hide_array['footer_suffix']);
        
      if (in_array(basename($PHP_SELF), $hide_array['bm'])) $this->_hide_column = true;
//    echo '<br><br>$class' . $class;
//    echo '<br><br>$hide_array[header' . print_r($hide_array['header']);
/*     $pages_array = array();
     if ( isset($hide_array[$module_group_prefix]) ) {    
      foreach ($hide_array[$module_group_prefix] as $page) {
        $page = trim($page);
  
        if (!empty($page)) {
          $pages_array[] = $page;
        }
      }
    }
*/    
    return $hide_array[$module_group_prefix];
    }

    }
  }

Thank You

Link to comment
Share on other sites

pushed update with the following changes:

  • optional hide on checkout pages (login.php, checkout_shipping.php, checkout_payment.phpheckout_confirmation.php and checkout_success)
  • select on which pages to hide each area by page-checkbox list
  • select each group to hide (navbar, header area, boxes, footer and footer suffix
  • define content width if side columns are hidden. Allows to control if main content gets stretched or keeps space for side columns
  • optional keep showing store logo if header area is hidden.
  • general clean up of class extension following Henry's example where possible.
Link to comment
Share on other sites

@wHiTeHaT,

Thank You. I tried it, but without success.

My class extension looks like this:

// Begin template class extension
  if (class_exists('oscTemplate')) {
    class oscTemplateExt extends oscTemplate {
      public $_blocks = array();
      public $_hide_column = false;

      function __construct() {
        global $oscTemplate;
        $this->_blocks = $oscTemplate->_blocks;
      }

....................

      function getBlocks($group) {
...........
          return implode("\n", $this->_blocks[$group]);

removed the constructor and tried to use

parent::_blocks;

and get error message " Undefined class constant '_blocks' ".

Tried several variants, no success.

 

Another subject:

I'm using now for the module exclusion list your fixed tep_cfg_textarea function from this post (renamed to use locally in the ht module):

https://www.oscommerce.com/forums/topic/410497-tep_cfg_textarea-problem/?do=findComment&comment=1762634

It works, just the text shows quite big when editing. Not very important, just looks strange.

 

Edited by raiwa
Link to comment
Share on other sites

2 hours ago, wHiTeHaT said:

For the big text in the text-area... not sure for that, perhaps it is your css?

It's a clean vanila develop store, not any css mod.

Link to comment
Share on other sites

@wHiTeHaT,

Got the blocks to show, but if I remove the constructor, the side column shift doesn't work any more. If I have the constructor then I need to define "_blocks"

 

12 minutes ago, wHiTeHaT said:

What is big?

"cm_header_logo" shows much bigger than other text:

 

 

big_text_area.jpg

Edited by raiwa
Link to comment
Share on other sites

2 minutes ago, wHiTeHaT said:

I think that is an oscommerce issue for the text, and it is not that big.

As already stated, not really important, Maybe also browser related? I'll check again.

 

2 minutes ago, wHiTeHaT said:

Perhaps cause oscommerce uses var for properties. might help if set them to public.

I have a tried a lot of variations. I'll keep what I have got working correct. I really do not wish to change the parent class.

Link to comment
Share on other sites

Just now, wHiTeHaT said:

you should ............ to learn.

change it back after.

Thats what I meant, I did all initial changes and testing on the parent class, Then I passed the modifications to the extension. If I say this:

2 minutes ago, raiwa said:

I really do not wish to change the parent class.

I refer for the final version of the add-on.

Link to comment
Share on other sites

I consider the actual Git Hub version final. Resume of the last updates:

  • optional hide on checkout pages (login.php, checkout_shipping.php, checkout_payment.phpheckout_confirmation.php and checkout_success)
  • select on which pages to hide each area by checkbox list
  • select each group to hide (navbar, header area, boxes, footer and footer suffix
  • define content width if side columns are hidden, allows to control if main content gets stretched or keeps withe space for side columns
  • optional customized list of header modules to keep showing if header area is hidden.

Update from previous versions: uninstall ht module, replace ht module, reinstall ht module.

I'll keep it for around one week without touching. Please try and let me know any issues.

Then it will be published.

 

If I find time Ill try to go for the version to control each individual module.

 

Link to comment
Share on other sites

Can test but currently traveling. Couple of weeks...

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...