diff --git a/language/en-GB/en-GB.mod_wtjshoppingcart.sys.ini b/language/en-GB/en-GB.mod_wtjshoppingcart.sys.ini index 3b00c8e..3fa76ce 100644 --- a/language/en-GB/en-GB.mod_wtjshoppingcart.sys.ini +++ b/language/en-GB/en-GB.mod_wtjshoppingcart.sys.ini @@ -4,4 +4,4 @@ MOD_WTJSHOPPINGCART_AFTER_INSTALL = "Thank you for intalling extension" MOD_WTJSHOPPINGCART_AFTER_DISCOVER_INSTALL = "Thank you for intalling extension" MOD_WTJSHOPPINGCART_AFTER_UPDATE = "Thank you for updating extension" MOD_WTJSHOPPINGCART_MAYBE_INTERESTING="

It might be interesting

" -MOD_WTJSHOPPINGCART_WHATS_NEW="

v.1.0.2 What's new?

" +MOD_WTJSHOPPINGCART_WHATS_NEW="

v.1.0.3 What's new?

Changing links in module layouts

In the module layouts (located in the tmpl folder), the links to checkout and shopping cart have been changed. The view parameter has been replaced with controller. I recommend making menu items for ordering and shopping cart and hiding them in the menu item settings.

" diff --git a/language/ru-RU/ru-RU.mod_wtjshoppingcart.sys.ini b/language/ru-RU/ru-RU.mod_wtjshoppingcart.sys.ini index 1a3f35d..04884f0 100644 --- a/language/ru-RU/ru-RU.mod_wtjshoppingcart.sys.ini +++ b/language/ru-RU/ru-RU.mod_wtjshoppingcart.sys.ini @@ -4,4 +4,4 @@ MOD_WTJSHOPPINGCART_AFTER_INSTALL = "Спасибо за установку ра MOD_WTJSHOPPINGCART_AFTER_DISCOVER_INSTALL = "Спасибо за установку расширения" MOD_WTJSHOPPINGCART_AFTER_UPDATE = "Спасибо за обновление расширения" MOD_WTJSHOPPINGCART_MAYBE_INTERESTING="

Может быть интересно

" -MOD_WTJSHOPPINGCART_WHATS_NEW="

v.1.0.2 Что нового?

" +MOD_WTJSHOPPINGCART_WHATS_NEW="

v.1.0.3 Что нового?

Изменение ссылок в макетах

В макетах модуля (находятся в папке tmpl) изменены ссылки на оформление заказа и корзину. Параметр view заменён на controller. Рекомендую сделать пункты меню для оформления заказа и корзины и скрыть их в настройках пункта меню.

" diff --git a/mod_wtjshoppingcart.xml b/mod_wtjshoppingcart.xml index 90c1987..c99d856 100644 --- a/mod_wtjshoppingcart.xml +++ b/mod_wtjshoppingcart.xml @@ -1,13 +1,13 @@ MOD_WTJSHOPPINGCART - 18/09/2022 + August 2023 Sergey Tolkachyov infop@web-tolk.ru https://web-tolk.ru Sergey Tokachyov Open Source License, GNU GPL - 1.0.2 + 1.0.3 Displays a JoomShopping cart Joomla\Module\Wtjshoppingcart script.php diff --git a/script.php b/script.php index 02f2c67..0865505 100644 --- a/script.php +++ b/script.php @@ -8,26 +8,6 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Version; -/** - * Script file of HelloWorld component. - * - * The name of this class is dependent on the component being installed. - * The class name should have the component's name, directly followed by - * the text InstallerScript (ex:. com_helloWorldInstallerScript). - * - * This class will be called by Joomla!'s installer, if specified in your component's - * manifest file, and is used for custom automation actions in its installation process. - * - * In order to use this automation script, you should reference it in your component's - * manifest file as follows: - * script.php - * - * @package Joomla.Administrator - * @subpackage com_helloworld - * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ class mod_wtjshoppingcartInstallerScript { /** diff --git a/services/provider.php b/services/provider.php index da7f24b..d5f7aa3 100644 --- a/services/provider.php +++ b/services/provider.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die; diff --git a/src/Dispatcher/Dispatcher.php b/src/Dispatcher/Dispatcher.php index ee2e3a7..f20eebb 100644 --- a/src/Dispatcher/Dispatcher.php +++ b/src/Dispatcher/Dispatcher.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html * @link https://web-tolk.ru - * @license GNU General Public License version 2 or later */ namespace Joomla\Module\Wtjshoppingcart\Site\Dispatcher; @@ -66,6 +67,8 @@ protected function getLayoutData() : array $data['jshopConfig'] = \JSFactory::getConfig(); $data['cart'] = WtjshoppingcartHelper::getCart($data['params'], $this->getApplication()); + $data['checkout_url'] = WtjshoppingcartHelper::getCheckoutUrl($data['params'], $this->getApplication()); + $data['checkout_url'] = $data['params']->get(''); return $data; } diff --git a/src/Fields/ModuleinfoField.php b/src/Fields/ModuleinfoField.php index 9826293..70d3fbb 100644 --- a/src/Fields/ModuleinfoField.php +++ b/src/Fields/ModuleinfoField.php @@ -1,11 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ namespace Joomla\Module\Wtjshoppingcart\Site\Fields; defined('_JEXEC') or die; diff --git a/src/Helper/WtjshoppingcartHelper.php b/src/Helper/WtjshoppingcartHelper.php index 13bbcd0..7baa3c3 100644 --- a/src/Helper/WtjshoppingcartHelper.php +++ b/src/Helper/WtjshoppingcartHelper.php @@ -1,9 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ namespace Joomla\Module\Wtjshoppingcart\Site\Helper; @@ -53,6 +55,24 @@ public static function getCart(Registry &$params, CMSApplicationInterface $app) return $cart; } + + /** + * Get a JoomShopping checkout url + * + * @param Registry &$params object holding the models parameters + * + * @return object jshopCart + */ + public static function getCheckoutUrl (Registry &$params, CMSApplicationInterface $app) + { + $cart = self::getCart($params, $app); + $cartpreview = \JSFactory::getModel('cartPreview', 'jshop'); + $cartpreview->setCart($cart); + $cartpreview->setCheckoutStep(0); + $checkout_url = $cartpreview->getUrlCheckout(); + var_dump($checkout_url); + return $checkout_url; + } } ?> \ No newline at end of file diff --git a/tmpl/bootstrap5-icon-and-text.php b/tmpl/bootstrap5-icon-and-text.php index c201570..4066775 100644 --- a/tmpl/bootstrap5-icon-and-text.php +++ b/tmpl/bootstrap5-icon-and-text.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); @@ -45,7 +46,7 @@ */ ?> - + count_product;?> diff --git a/tmpl/bootstrap5-icon-btn.php b/tmpl/bootstrap5-icon-btn.php index 9e71e70..2863b7e 100644 --- a/tmpl/bootstrap5-icon-btn.php +++ b/tmpl/bootstrap5-icon-btn.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); diff --git a/tmpl/bootstrap5-icon.php b/tmpl/bootstrap5-icon.php index cd31332..355091c 100644 --- a/tmpl/bootstrap5-icon.php +++ b/tmpl/bootstrap5-icon.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); @@ -47,7 +48,7 @@ diff --git a/tmpl/bootstrap5-list-group.php b/tmpl/bootstrap5-list-group.php index b9c774b..2c56227 100644 --- a/tmpl/bootstrap5-list-group.php +++ b/tmpl/bootstrap5-list-group.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); @@ -89,11 +90,11 @@
diff --git a/tmpl/bootstrap5-offcanvas.php b/tmpl/bootstrap5-offcanvas.php index 6724d0f..0ef923e 100644 --- a/tmpl/bootstrap5-offcanvas.php +++ b/tmpl/bootstrap5-offcanvas.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); @@ -107,11 +108,11 @@
diff --git a/tmpl/default.php b/tmpl/default.php index d2a8382..b25b63c 100644 --- a/tmpl/default.php +++ b/tmpl/default.php @@ -1,10 +1,11 @@ + * @сopyright (c) 2022 - August 2023 Sergey Tolkachyov. All rights reserved. + * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html + * @link https://web-tolk.ru */ defined('_JEXEC') or die('Restricted access'); @@ -58,7 +59,7 @@ - +