Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #749 from gburton/1.0.1.0
Browse files Browse the repository at this point in the history
1.0.1.0
  • Loading branch information
gburton authored Jul 17, 2019
2 parents febb38d + dc04435 commit 88db268
Show file tree
Hide file tree
Showing 22 changed files with 975 additions and 188 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_CHECKOUT_TITLE', 'Checkout');
define('MODULE_CONTENT_SC_CHECKOUT_DESCRIPTION', 'Show checkout button on shopping cart page');

define('MODULE_CONTENT_SC_CHECKOUT_BUTTON_CHECKOUT', 'Checkout');
define('MODULE_CONTENT_SC_CHECKOUT_ALTERNATIVE_CHECKOUT_METHODS', '- OR -');
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_NO_PRODUCTS_TITLE', 'No Products Message');
define('MODULE_CONTENT_SC_NO_PRODUCTS_DESCRIPTION', 'Show the No Products message on the shopping cart page.');

define('MODULE_CONTENT_SC_NO_PRODUCTS_TEXT_CART_EMPTY', 'Your Shopping Cart is empty!');
define('MODULE_CONTENT_SC_NO_PRODUCTS_BUTTON_CONTINUE', 'Continue');
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_ORDER_SUBTOTAL_TITLE', 'Order SubTotal');
define('MODULE_CONTENT_SC_ORDER_SUBTOTAL_DESCRIPTION', 'Show order subtotal on shopping cart page');

define('MODULE_CONTENT_SC_ORDER_SUBTOTAL_SUB_TOTAL', 'Sub-Total: <span class="cart-subtotal">%s</span>');
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_PRODUCT_LISTING_TITLE', 'Product Listing');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_DESCRIPTION', 'Show product listing on shopping cart page');

define('MODULE_CONTENT_SC_PRODUCT_LISTING_HEADING_PRODUCT', 'Product');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_HEADING_AVAILABILITY', 'Stock');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_HEADING_QUANTITY', 'Qty');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_HEADING_REMOVE', 'Remove');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_HEADING_PRICE', 'Price');

define('MODULE_CONTENT_SC_PRODUCT_LISTING_TEXT_BUTTON_UPDATE', '<i title="Update" class="fas fa-sync fa-fw"></i>');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_TEXT_BUTTON_REMOVE', '<i title="Remove" class="fas fa-times fa-fw"></i>');
define('MODULE_CONTENT_SC_PRODUCT_LISTING_TEXT_IN_STOCK', '<i class="fas fa-check fa-2x text-success"></i>');
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_STOCK_NOTICE_TITLE', 'Out of Stock Notice');
define('MODULE_CONTENT_SC_STOCK_NOTICE_DESCRIPTION', 'Show Stock Notice on the shopping cart page.');

define('MODULE_CONTENT_SC_STOCK_NOTICE_CANT_CHECKOUT', '<p class="lead">Products marked ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.</p><p>Please alter the quantity of products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ', thank you.</p>');
define('MODULE_CONTENT_SC_STOCK_NOTICE_CAN_CHECKOUT', '<p class="lead">Products marked ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.</p><p>You can buy them anyway and check the quantity we have in stock for immediate delivery in the checkout process.</p>');
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

define('MODULE_CONTENT_SC_TITLE_TITLE', 'Page Heading');
define('MODULE_CONTENT_SC_TITLE_DESCRIPTION', 'Shows the Page Heading.');

define('MODULE_CONTENT_SC_TITLE_PUBLIC_TITLE', 'What\'s In My Cart?');
21 changes: 0 additions & 21 deletions includes/languages/english/shopping_cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,3 @@
*/

define('NAVBAR_TITLE', 'Cart Contents');
define('HEADING_TITLE', 'What\'s In My Cart?');
define('TEXT_CART_EMPTY', 'Your Shopping Cart is empty!');
define('SUB_TITLE_SUB_TOTAL', 'Sub-Total:');
define('SUB_TITLE_TOTAL', 'Total:');

define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.<br />Please alter the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '). Thank you');
define('OUT_OF_STOCK_CAN_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' don\'t exist in desired quantity in our stock.<br />You can buy them anyway and check the quantity we have in stock for immediate delivery in the checkout process.');

define('TEXT_ALTERNATIVE_CHECKOUT_METHODS', '- OR -');

define('CART_BUTTON_UPDATE', '<i title="Update" class="fas fa-sync fa-fw"></i>');
define('CART_BUTTON_REMOVE', '<i title="Remove" class="fas fa-times fa-fw"></i>');

define('TABLE_SC_HEADING_PRODUCT', 'Product');
define('TABLE_SC_HEADING_AVAILABILITY', 'Stock');
define('TABLE_SC_HEADING_QUANTITY', 'Qty');
define('TABLE_SC_HEADING_REMOVE', 'Remove');
define('TABLE_SC_HEADING_PRICE', 'Price');

define('TEXT_IN_STOCK', '<i class="fas fa-check fa-2x text-success"></i>');

87 changes: 87 additions & 0 deletions includes/modules/content/shopping_cart/cm_sc_checkout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
/*
$Id$
Copyright (c) 2016:
Dan Cole - @Dan Cole
James Keebaugh - @kymation
Lambros - @Tsimi
Rainer Schmied - @raiwa
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

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, $cart;

$content_width = (int)MODULE_CONTENT_SC_CHECKOUT_CONTENT_WIDTH;

if ($cart->count_contents() > 0) {
if (!class_exists('payment')) {
include('includes/classes/payment.php');
}
$payment_modules = new payment;

$initialize_checkout_methods = $payment_modules->checkout_initialization_method();

ob_start();
include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__));
$template = ob_get_clean();

$oscTemplate->addContent($template, $this->group);
}
}

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', '150', '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');
}
}
Loading

0 comments on commit 88db268

Please sign in to comment.