Jump to content

Recommended Posts

Modular Shopping Cart BS
Version 1.0

 

Developer Team:
Dan Cole - @@Dan Cole
James Keebaugh - @@kymation
Lambros - @@Tsimi
Rainer Schmied - @raiwa

Testers:
Steve Kleiner - @@altoid
Juanma - @@piernas

Suggestions - Survey:
Gary Burton - @@burt


This is a modular re-design of the existing shopping cart that is used in the responsive version of osCommerce.
It replaces the existing shopping cart with content modules so that you can control the order and placement of the various components that appear on the shopping cart page.

The modular design will allow you to easily add and set up additional modules that have and will be developed by the community.  
Current modules that are available include the ship in cart estimator, discount coupon codes and an X-sell module.  

In time additional product listing formats and other enhancements are expected.

Included Modules:
- Product Listing
- Order SubTotal
- Checkout
- Alternative Checkout
- Out of Stock Notice
- Empty Cart Message

English, Spanish and German language files included.

Download:
http://addons.oscommerce.com/info/9466

Compatibility:
OsCommerce 2.3.4 Bootstrap

PHP 7.0 tested
 

Edited by raiwa

Share this post


Link to post
Share on other sites

Just installed this contribution, nice!

 

I have two issues:

- If I place the Out of Stock Notice module before Product Listing it doesn't show.

- Alternative Checkout module does nothing in my test shop. What's the use of this module?

Share this post


Link to post
Share on other sites

@@piernas  Hi Juanma...let me see if I can answer your questions.

 

1. The out of stock notice won't work if it is placed before the product listing...as it is written it needs to run though the list of products contained in the product listing to know whether anything is out of stock or not.

 

2. The Alternative Checkout module is used with payment modules offering an alternative checkout option....PayPal Express is the only one I'm aware of but there maybe others.

 

Dan

Share this post


Link to post
Share on other sites

Not sure if this is a change in EDGE since you released this or not but there appears to ne filenames.php file in the new edge i downloaded from github and none of the files included in the package refer to FILENAME_XXX as they have always done in OSC.

Is this an oversight on your part or has whoever updated the new EDGE to no longer use filenames.php (which it appears to be the case).

Share this post


Link to post
Share on other sites

@@ShaGGy   Hi Les...

 

The use of the defines contained in the php file "filenames" has been depreciated in the EDGE version.  The actual filenames are now being specified in the core code directly and addons should be modified in that way as well.    

 

Dan

Share this post


Link to post
Share on other sites

Hi,

Is there a compatible version available for oscommerce 2.3.4 standard also....

Your help on the same will be deeply appreciated...

 

Regds;

Radhavallabh

Share this post


Link to post
Share on other sites

@@radhavallabh I'm pretty later in responding...I saw your post earlier and thought someone else might jump in but to answer your question the Modular Shopping Cart is for the BS or Responsive version only. 

 

Dan 

Share this post


Link to post
Share on other sites

Dear @raiwa

I do not know if this is the right place to ask the next question.

I'm trying to install the contribution Clear Cart Button In Shopping Cart , but one of the steps that I have to follow is:

3. Add this line to /shopping_cart.php
======================================

Around line #136 Find:
---------------------

  <div class="buttonSet">
    <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div>
  </div>

Right before it add this line:
-----------------------------

  <div class="buttonSet row">
    <div class="col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_CLEAR_CART, 'fa fa-trash', tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'NOSSL'), 'secondary', array('params' => 'onclick="return confirm(\'' . CLEAR_CART . '\');"')); ?></div>
    <div class="col-xs-6 text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div>
  </div>

The problem is, I have installed Modular Shopping Cart BS , and I can not find the code above.

Any idea what I have to do?

Best Regards.

Valqui

 

 


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

Hello Valquiria @valquiria23,

You'll find this code now in the module: "includes/modules/shopping_cart/cm_sc_checkout.php"

	    	$sc_checkout = '<div class="buttonSet">' . 
      									  tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success') . 
      								 '</div>';

But you have to concatenate the new code to the existing variable (the additional dot ".=" in the second line is important!)

	    	$sc_checkout = 'your new code here';
	    	$sc_checkout .= '<div class="buttonSet">' . 
      									  tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success') . 
      								 '</div>';

Another, better possibility would be to duplicate the module and rename it for example to something like: "cm_sc_clear_cart.php" (the class name and configuration constants need to be renamed too) and also the template and language files need to be duplicated and renamed.

In the following line you need to rename the template to the new template name (for example: "clear_cart.php):

      	include('includes/modules/content/' . $this->group . '/templates/checkout.php');

Then replace the button code with your new code.

If you could get this to be done, it would be great to public the module in the add-on/apps area for other users.

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello @raiwa 

I do not understand anything about programming :(

Can you explain a little more how I should do?

Make a module would be great, maybe @PiLLaO know how to do it? 

besos

Valqui

 


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

Hello Valquiria @valquiria23,

Then just apply the code change I gave to the existing "includes/modules/shopping_cart/cm_sc_checkout.php" module:

On 1/8/2017 at 8:52 AM, raiwa said:

But you have to concatenate the new code to the existing variable (the additional dot ".=" in the second line is important!)


	    	$sc_checkout = 'your new code here';
	    	$sc_checkout .= '<div class="buttonSet">' . 
      									  tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success') . 
      								 '</div>';

 

Just replace 'your new code here' by the code you have to add.

And replace the opening and closing php tag by concatenations.

It should look then like this:

$sc_checkout = '<div class="buttonSet row">
    <div class="col-xs-6">' . tep_draw_button(IMAGE_BUTTON_CLEAR_CART, 'fa fa-trash', tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'NOSSL'), 'secondary', array('params' => 'onclick="return confirm(\'' . CLEAR_CART . '\');"')) . '</div>
    <div class="col-xs-6 text-right">' . tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success') . '</div>
  </div>';
$sc_checkout .= '<div c...................

Please compare this with your original code snippet. You should learn to do these simple things.

rgds

Rainer

rgds

Rainer

Share this post


Link to post
Share on other sites

Dear @raiwa

I just apply the code change but it gives me the following error:

Error!

Unable to determine connection method on a link!

Known methods: NONSSL SSL


Could you look at it, please? The new file code includes/modules/content/shopping_cart/cm_sc_checkout.php is:

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2016 osCommerce

  Released under the GNU General Public License
*/

  class cm_sc_checkout {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function __construct() {
      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = MODULE_CONTENT_SC_CHECKOUT_TITLE;
      $this->description = MODULE_CONTENT_SC_CHECKOUT_DESCRIPTION;

      if ( defined('MODULE_CONTENT_SC_CHECKOUT_STATUS') ) {
        $this->sort_order = MODULE_CONTENT_SC_CHECKOUT_SORT_ORDER;
        $this->enabled = (MODULE_CONTENT_SC_CHECKOUT_STATUS == 'True');
      }
    }

    function execute() {
      global $oscTemplate, $payment_modules, $any_out_of_stock, $cart;

      $content_width = (int)MODULE_CONTENT_SC_CHECKOUT_CONTENT_WIDTH;
      
        if ($cart->count_contents() > 0) {
            
       $sc_checkout = '<div class="buttonSet row">
    <div class="col-xs-6">' . tep_draw_button(IMAGE_BUTTON_CLEAR_CART, 'fa fa-trash', tep_href_link(FILENAME_SHOPPING_CART, 'action=clear_cart', 'NOSSL'), 'secondary', array('params' => 'onclick="return confirm(\'' . CLEAR_CART . '\');"')) . '</div>
    <div class="col-xs-6 text-right">' . tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary', NULL, 'btn-success') . '</div>
  </div>';

 
            $sc_checkout = '<div class="buttonSet">' .
                                            tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success') .
                                       '</div>';
          
          ob_start();
          include('includes/modules/content/' . $this->group . '/templates/checkout.php');
          $template = ob_get_clean();

          $oscTemplate->addContent($template, $this->group);
      } // end if $cart->count_contents() > 0
    }

    function  isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_CONTENT_SC_CHECKOUT_STATUS');
    }

    function install() {
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Shopping Cart Checkout Button', 'MODULE_CONTENT_SC_CHECKOUT_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");    
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_SC_CHECKOUT_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_SC_CHECKOUT_SORT_ORDER', '300', 'Sort order of display. Lowest is displayed first.', '6', '3', now())");
    }

    function remove() {
      tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_CONTENT_SC_CHECKOUT_STATUS', 'MODULE_CONTENT_SC_CHECKOUT_CONTENT_WIDTH', 'MODULE_CONTENT_SC_CHECKOUT_SORT_ORDER');
    }
  }
?>

Best regards.

Valqui

 


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

@valquiria23,

 

If you have a look on the error message it says: Known methods: NONSSL SSL 

In your code it is misspelled: NOSSL 

Meanwhile it would be better to use the variable: "$request_type" instead.

You'll need to add it also to the global list.

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hi @raiwa
Many thanks for your constant help but the truth I have no idea of programming jejeje.

I hope some good soul someday will make the module for this addon as it seems an excellent idea.

I offer to help with the tests.

Kiss

Valqui


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

Hi @raiwa,

I was trying to add a continue shopping button to the checkout module but this

<?php
          $back = sizeof($navigation->path)-2;
          if (isset($navigation->path[$back])) {
            echo tep_draw_button(IMAGE_BUTTON_CONTINUE_SHOPPING, 'glyphicon-chevron-left', tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']), 'primary', NULL, 'btn-success') . " " ;
          }
?>

doesn't work anymore (for me). It seems to me that sizeof is always 0. Any clues?

Best regards

Christoph

Share this post


Link to post
Share on other sites

Hello Christoph @beerbee,

You probably missed to add "$navigation" to the globals list.

Also it would be better to create a separate module for this.

Best regards

Rainer

 

Share this post


Link to post
Share on other sites

Hi again Rainer @raiwa,

already tried putting $navigation as global into function execute() of cm_sc_checkout (wrong place?), for testing i put

$sc_checkout = '<div class="row">' . sizeof($navigation->path); It stays zero.

But this seems to be all over the site, regardless (index, product_info) of where I put it: always zero.

Best regards

Christoph

Share this post


Link to post
Share on other sites

@beerbee,

Give this a try and let me know. Maybe I'll pack it into an add-on:

 

Continue_shopping.zip

Share this post


Link to post
Share on other sites

@raiwa,

works like a charm, thanks!  I think others might like it too.

Best regards

Christoph

Share this post


Link to post
Share on other sites

Thanks, I'll pack it and publish when I'll find some time. :smile:

Share this post


Link to post
Share on other sites

Maybe I've missed something...it has most certainly happened before.

@raiwa I have a bunch of addons you have either created or updated - and they are great and your work is much appreciated!

This one seems to have me stumped...maybe it's supposed to be this way but it doesn't make sense to me.

When you are at the cart (shopping_cart.php)...the estimated shipping and order-totals works perfect.  Now here is where I am confused - when you click the "Checkout" button it wants to go to "checkout_shipping.php" instead of "checkout_payment".  At this point, we have the products, shipping address, shipping quote, and order-total.  Why is mine not skipping directly to choosing a payment method - it is redundant to take the customer to the shipping page.

If it's my fault - don't be afraid to bash me for it :)  (Just help me solve it first lol).

Take care and thank you again for another great contrib!

Share this post


Link to post
Share on other sites
On 11/29/2017 at 9:22 AM, raiwa said:

@beerbee,

Give this a try and let me know. Maybe I'll pack it into an add-on:

 

Continue_shopping.zip

Hmmm, I uploaded everything, went to admin and set it to true, refreshed browser, tried different browsers, and no errors, but no Continue Shopping button shows up, just the Checkout button like normal on shopping_cart.php.......I wonder what I forgot? Probably something obvious.....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×