Victorious Posted March 4, 2019 Share Hello, I would have information in the footer. I had looked the different module inside the marketplace but I don't know what I want. Could you tell me how to make that? Quote Link to post
Drack Posted March 4, 2019 Share Hello @Victorious, What do you want to make exactly ? It's dynamic content or just static content ? Quote Link to post
Mariana Posted March 4, 2019 Share Is it a menu, in this case, you can use the page manager inside the application to make that ? Quote Link to post
Victorious Posted March 4, 2019 Author Share (edited) No, it's not a menu. I think a dynamic could better because if I need to change something, it will be easier. Edited March 4, 2019 by Victorious Quote Link to post
Drack Posted March 4, 2019 Share In this case, I think you can createa page inside the page manager (you will have an fix id) and inside yoru file you can call the id. This option allow to use the multilanguage and change when you want.. The second option is to call the language file. But in this case you must every time to edit your language and change the content. You can also make by the administration but if you reset your language, your lost your content. Quote Link to post
Ronaldo Posted March 4, 2019 Share @Drack, What do you mean : You can also make by the administration but if you reset your language, your lost your content. Quote Link to post
Drack Posted March 4, 2019 Share @Ronaldo, Inside your administration / tools menu, you can edit a language definition and change all that you want. It's easy. The inconvenient, the language is saved in the mysql database and if you reset the language, it take all the default language file. You lost all that you have inside the db. Quote Link to post
Julie Posted March 4, 2019 Share (edited) @Victorious, I will help you, it's very simple to make a new file. You mus create 6 files modules_footer/fo_footer_my_template.php modules_footer/content/fo_footer_my_template.php language/english/modules/modules_footer/fo_footer_my_template.php language/french/modules/modules_footer/fo_footer_my_template.php css/english/modules/modules_footer/fo_footer_my_template.php css/french/modules/modules_footer/fo_footer_my_template.php (if it used) Below an example, make that quickly, it can have litle error inside the files. The most important files (after you can make the other) modules_footer/fo_footer_my_template.php <?php /** * * @copyright 2008 - https://www.clicshopping.org * @Brand : ClicShopping(Tm) at Inpi all right Reserved * @Licence GPL 2 & MIT * @licence MIT - Portion of osCommerce 2.4 * @Info : https://www.clicshopping.org/forum/trademark/ * */ use ClicShopping\OM\Registry; use ClicShopping\OM\CLICSHOPPING; class fo_footer_my_template { public $code; public $group; public $title; public $description; public $sort_order; public $enabled = false; public $pages; protected $rewriteUrl; public function __construct() { $this->code = get_class($this); $this->group = basename(__DIR__); $this->title = CLICSHOPPING::getDef('module_footer_my_template_title'); $this->description = CLICSHOPPING::getDef('module_footer_my_template_description'); $this->rewriteUrl = Registry::get('RewriteUrl'); if ( defined('MODULES_FOOTER_MY_TEMPLATE_STATUS') ) { $this->sort_order = MODULES_FOOTER_MY_TEMPLATE_SORT_ORDER; $this->enabled = (MODULES_FOOTER_MY_TEMPLATE_STATUS == 'True'); $this->pages = MODULE_FOOTER_MY_TEMPLATE_DISPLAY_PAGES; } } public function execute() { $CLICSHOPPING_Template = Registry::get('Template'); $CLICSHOPPING_Customer = Registry::get('Customer'); $CLICSHOPPING_PageManagerShop = Registry::get('PageManagerShop'); $CLICSHOPPING_Db = Registry::get('Db'); if ( MODE_VENTE_PRIVEE == 'false' || (MODE_VENTE_PRIVEE == 'true' && $CLICSHOPPING_Customer->isLoggedOn() )) { // change pages_id = 55 by your id $Qpages = $CLICSHOPPING_Db->prepare('select pd.pages_title, p.links_target from :table_pages_manager p, :table_pages_manager_description pd where p.status = 1 and ( p.customers_group_id = :customers_group_id or p.customers_group_id = 99) and p.pages_id = pd.pages_id and p.pages_id = 55 '); $Qpages->bindInt(':customers_group_id', (int)$CLICSHOPPING_Customer->getCustomersGroupID() ); $Qpages->execute(); $content = HTML::link($this->rewriteUrl->getPageManagerContentUrl($Qpages->valueInt('pages_id')), $Qpages->value('pages_title'), 'target="' . $Qpages->value('links_target') . '"') $content_width = (int)MODULE_FOOTER_MY_TEMPLATE_CONTENT_WIDTH; $my_template_footer = '<!-- footer page manager start -->' . "\n"; ob_start(); require($CLICSHOPPING_Template->getTemplateModules($this->group . '/content/footer_my_template')); $my_template_footer .= ob_get_clean(); $my_template_footer .='<!-- footer page manager end -->' . "\n"; $CLICSHOPPING_Template->addBlock($my_template_footer, $this->group); } } public function isEnabled() { return $this->enabled; } public function check() { return defined('MODULES_FOOTER_MY_TEMPLATE_STATUS'); } public function install() { $CLICSHOPPING_Db = Registry::get('Db'); $CLICSHOPPING_Db->save('configuration', [ 'configuration_title' => 'Do you want activate this module ?', 'configuration_key' => 'MODULES_FOOTER_MY_TEMPLATE_STATUS', 'configuration_value' => 'True', 'configuration_description' => 'Do you want activate this module in your shop ?', 'configuration_group_id' => '6', 'sort_order' => '1', 'set_function' => 'clic_cfg_set_boolean_value(array(\'True\', \'False\'))', 'date_added' => 'now()' ] ); $CLICSHOPPING_Db->save('configuration', [ 'configuration_title' => 'Please select the width of the module', 'configuration_key' => 'MODULE_FOOTER_MY_TEMPLATE_CONTENT_WIDTH', 'configuration_value' => '12', 'configuration_description' => 'Select a number between 1 and 12', 'configuration_group_id' => '6', 'sort_order' => '1', 'set_function' => 'clic_cfg_set_content_module_width_pull_down', 'date_added' => 'now()' ] ); $CLICSHOPPING_Db->save('configuration', [ 'configuration_title' => 'Sort order', 'configuration_key' => 'MODULES_FOOTER_MY_TEMPLATE_SORT_ORDER', 'configuration_value' => '10', 'configuration_description' => 'Sort order of display. Lowest is displayed first', 'configuration_group_id' => '6', 'sort_order' => '4', 'set_function' => '', 'date_added' => 'now()' ] ); $CLICSHOPPING_Db->save('configuration', [ 'configuration_title' => 'Indicate the page where the module is displayed', 'configuration_key' => 'MODULE_FOOTER_MY_TEMPLATE_DISPLAY_PAGES', 'configuration_value' => 'all', 'configuration_description' => 'Select the page where the module is displayed.', 'configuration_group_id' => '6', 'sort_order' => '5', 'set_function' => 'clic_cfg_set_select_pages_list', 'date_added' => 'now()' ] ); } public function remove() { return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")'); } public function keys() { return ['MODULES_FOOTER_MY_TEMPLATE_STATUS', 'MODULE_FOOTER_MY_TEMPLATE_CONTENT_WIDTH', 'MODULES_FOOTER_MY_TEMPLATE_SORT_ORDER', 'MODULE_FOOTER_MY_TEMPLATE_DISPLAY_PAGES' ]; } } modules_footer/content/footer_my_template.php <div class="col-md-<?php echo $content_width; ?> moduleFooterMyTemplater"> <span class="moduleFooterMyTemplate"> <span class="footerMyTemplate"><?php echo $content; ?></span> </span> </div> Edited March 4, 2019 by Julie 5 Quote Link to post
Patrick Posted March 4, 2019 Share Just for your information you can look the class includes/Apps/Communication/PageManager/Classes/Shop/PageManagerShop you will some code you can use. 1 Quote Link to post
Victorious Posted March 4, 2019 Author Share @Julie Thank you for your example and explanation. Quote Link to post
BertrandD Posted March 8, 2019 Share @Julie, Thank you for the details of your example and how to make a module. Note : the language and css are not included, but it's easy to do that. Quote Link to post
Julie Posted March 10, 2019 Share @BertrandD, Yes I am not include this files, but it's easy to create it. The most important problem is the module. 1 Quote Link to post
JKaz Posted March 11, 2019 Share @Julie, Nice work, thank you for your explanation 1 Quote Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.