Jump to content

ClicShopping

Administrators
  • Posts

    404
  • Joined

  • Last visited

  • Days Won

    109

Everything posted by ClicShopping

  1. Many merchants may face a problem of optimal product management, inventory, billing rates ... which gradually with the development of their business will put more stress. At one point in the development of the company's business, a matter of improving the flow management will arise and even become crucial. Should I develop an interface between my solution to e-commerce (osCommerce, ClicShopping, PrestaShop, Magento ...) with an ERP or is it to develop my ecommerce solution taking into account my own business needs? This strategic issue is difficult to resolve because the costs of development, integration can be diffcult see significant quantifiable excluding pass in the organizational environment of the company. Here is some considerations on our part to help. - Ecommerce solutions, including open source, can easily evolve and incorporate many features to enhance business management. Furthermore the integration of new features to meet the needs of business not too complicated can be easily implemented. - The introduction of synchronous or asynchronous links, using current technologies, can help pair your e-commerce solution for ERP. The question is, should it my solution ecommerce pilot partially my ERP or my ERPsolution pilotpartially my Ecommerce sofware or the two solutions that are synchronized if a action is made on one or the other. There is no specific answer, it must fit with your business needs and abilities of management information between the ERP and Ecommerce platform or vice versa but also in terms of growing your business, the needs of business and organizational envrionment. A small business, a medium enterprise or a large have needs that are completely different. Case of development of a major business or organizational environment already structured. In this case, the choice of the implementation of ERP systems such as steering information is clear because it is beyond this article and creates a complete business management envrionment taking into account accounting, human resources, projects ... Ecommerce platform was only a element of the commercial sales force that reflects the product catalog for customers to the company. All activity related to product management is managed by the ERP that will drive the ecommerce site. If the ERP does not include its own ecommerce platform, then it will put in place a very rigorous technical link between the ERP and ecommerce solution. A project that will require a lot of technical analysis and be faced with many constraints. Avantages : - Seamless integration of information systems - No duplication of information between technical platforms - Native link with accounting (which is a limit of ecommerce platforms) - link with other channels sales force of the company Disadvantages : - The architecture to implement is not simple and requires a good understanding of business processes - Timing information can be problematic if a break occurs - High cost generally. For a development in a non structured, small company or launching a ecommerce business In case the activity is to offer products on the internet without a strong coupling of the enterprise information platform and ecommerce system, the choice of the establishment of an ERP may arise but can be helpful. Useful because even if the link between the two platforms is not entirely successful, it will allow the company to develop an organizational environment, business minima structured and save time in managing its daily business. Not useful for the implementation of an ERP system is related to relatively high stresses, see too evolved for acttivté company in the field of ecommerce and its pilot everyday tool. In this case the ecommera§ant prefer to have a greater agility in its inventory, rates and customer relations (sales) ... Avantages : - Scalability of the system depending on the degree of evolution of the business environment - Product management and business relationship integrated ecommerce platform - Nonessential synchronization with ERP platform, but not with very low cost and scalable thereafter - Lighter Architecture Disadvantages : - does not cover a spectrum ERP can - Duality of information produced can include the product sheet, inventory management ... - The analytical analysis is more limited fortiori - The consideration of compatibility can be a problem Conclusion : There is no single solution, everything is related to the degree of formalization of the organizational environment, the evolution of the company's business and strategy development. But the possibilities for e-retailers are present and allow it time to choose the degree of coupling of information systems enabling it to improve its daily management to better respond to changes in its activity. Currently, Odoo, ex OpenERP is a interesting solution for the little or medium company. Note : ClicShopping integrate natively coupling with openSource Odoo (eg OpenERP),. This will allow the merchant to have flexibility on their ecommerce platform in the daily management but also in providing a reliable tool for structuring activity. Moreover, as the whole is in open source, the cost is greatly reduced. The client, based on its needs and the evolution of its business, will have the option to enable or not the link between ClicShopping and Odoo to see and subsequently invest to have a sharper coupling. More
  2. Websites are by nature high-risk elements of the information system. Security is of great importance, and this for several reasons. The most known threats on websites are disfigurements and denial of service. Disfigurement is an attack in which an attacker modifies the site to replace the legitimate content with content they choose, for example relaying a political message to denigrate the site owner or simply to assert his attack as evidence expertise. A denial of service for its object to make the site unavailable to its attack legitimate users. In both cases, the impact on the site owner is obviously a poor images and, in the case of a site for supporting a lucrative business, a shortfall. To reduce the most common attacks ... Here are a few recommendations that you can apply. Step 1 : Your administrators Register an Administrator: Your nickname: We recommend you to alias a complex that is not current or use your email. Password: a complex password with * / - + - () necessarily complicate a hacker who wants to enter your online store ClicShopping. Step 2 : The Security Module In the menu menu Configuration /Action recorder, please edit the different modules to change the security. For example, the default Administration module contains two types of value: - Please specify the time waiting for a connection error in the administration part: This value indicates the time that a director must wait before attempting to reconnect Note : More the time is long, more it's better. - Please specify the number of allowed login to log in as admin: This value indicates the number of attempts allowed a connection. If this value is exceeded, it will be impossible to connect. Note : More the value is small, more it's better (take a marge if you make a mistake). In addition, each attempt failed connection, you will receive an email telling you that someone has tried to log in to your administration when there is an error. In the menu Tools / Securities, server information, you will find a summary of the analysis of the principal organs of our server Inside this menu, you have more options than you can look and eventually can help you to update your configuration You can also install in your dashoarb some modules can help or remind you some action to make inside your application. Step 3 : Configuration files and access to your ClicShoppingAdmin Theoretically, if you have followed the Installation Manual, it is not useful to speak on this item. However, we recall that the rights on the file configure.php file must be read-only mode is chmod 444. - One for security reason. - Second for an update or upgrade. Please make sure that these rights are correct. The main important element are located : /ClicShopping/Sites/ClicShoppingAdmin/conf.php /ClicShopping/Sites/Shop/conf.php /ClicShopping/Sites/conf/ Step 4 : Access to your administration You can also change the directory ClicShoppingAdmin to improve the security tool. However, you must perform several operations on this - /ClicShopping/Sites/ClicShoppingAdmin/conf.php - Modify ClicShoppingAdmin directory by your new directory You can add an htaccess and htpasswd, if you want. Etape 5 : Your Store - The images directory About this directory, it is best is to let the server to manage that. But for the best use, the images directories and sub-directories must be in CHMOD 755 and files 644 modes. Generally, the default settings provided by the Apache server. However, there may be a warning at the notifying administration ClicShopping it can not save the file. In this case, we recommend you to directories and files in 777 mode . ClicShopping records for setting up the product images file chmod 644. If you create other directories, we advise you to put an empty index.html or index.php file types, you can create it directly from the images editor that is offered in ClicShopping. In addition, this directory (but others too) are protected by a .htaccess file preventing them from access these directories via your browser. Conclusion If you apply these best practices, you will improve the security of your online store. Do not forget to install the antispam App : https://www.clicshopping.org/forum/files/file/112-apps-configuration-antispam/
  3. From 1 January 2015, telecommunications, broadcasting and electronic services will always be taxed in the country where the customer belongs* This new rules has an impact on the ecommerce company sell services. In this case, the rules to apply taxes has change. Og course, ClicShopping is compatible avec these new rules. If your are question about thaht, don't hesitate to post a comment or a question on our forum. There a summary information concerning these new rules. – regardless of whether the customer is a business or consumer – regardless of whether the supplier based in the EU or outside * For a business (taxable person) = either the country where it is registered or the country where it has fixed premises receiving the service. * For a consumer (non-taxable person) = the country where they are registered, have their permanent address or usually live. For the definition of ‘electronic services see the Explanatory Notes below, in particular under points 1.3; 2.3.3; and 2.4.3. The effects of this are as follows: EU BUSINESSES supplying: 1. Business in another EU country No VAT charged. Customer must account for the tax (reverse-charge mechanism). 2. Consumer in another EU country Must charge VAT in the EU country where the customer belongs (not where the business is based). 3. Business or consumer outside the EU No EU VAT charged. But if the service is effectively used & enjoyed in an EU country, that country can decide to levy VAT. NON-EU BUSINESSES supplying: 1. Business in the EU No VAT charged. Customer must account for the tax (reverse-charge mechanism). 2. Consumer in the EU (telecoms, broadcasting or electronic services) Must charge VAT in the EU country where the customer belongs.
  4. ClicShopping 3.X allow you to use use hooks inside your App to increase the functionalities in others App. To use this element you can have different choice depends with the app than you want to use Use the Hooks In hooks you have 2 choices : output to display an information call to use a function. $CLICSHOPPING_Hooks->call('Orders','Update'); $CLICSHOPPING_Hooks->ouput('Orders','ContentTracking', null 'display); To use the hook with call you can have different choices depending of the Hooks : The best is to look this directory inside the original hook where you want to include anew functionalities : ClicShopping/Apps/Products/ExtraFields/Modules/Hooks/ClicShoppingAdmin/ExtraFields $CLICSHOPPING_Hooks->call('Products','Insert'); $CLICSHOPPING_Hooks->call('Products','Update'); $CLICSHOPPING_Hooks->call('Products','Delete'); $CLICSHOPPING_Hooks->call('Products','Save'); At end, don't forget to insert in the clicshopping.json the new hook Display a Hooks About to display a hooks inside the page you can you something like that <div id="ContentTabQuantityDiscount"> in the original files you want to modify inside the hooks you can use this element to display the information. it could a new tab or inside a tab a content. For a Tab $dejardins_button = HTML::button('button_name'); $content = '<div> Desjardi</div>; $output = <<<EOD <div class="tab-pane" id="section_CMCICApp_content"> <div class="mainTitle"></div> <div class="adminformTitle"> <div class="separator"></div> {$dejardins_button} {$content} </div> </div> <script> $('#section_CMCICApp_content').appendTo('#orderTabs .tab-content'); $('#orderTabs .nav-tabs').append(' <li class="nav-item"><a data-target="#section_CMCICApp_content" role="tab" data-toggle="tab" class="nav-link">{$tab_title}</a></li>'); </script> EOD; For a content you can use append or prepend $content = '<div>mycontent</div>'; $output = <<<EOD <!-- ######################## --> <!-- Start SpecialsApp --> <!-- ######################## --> <script> $('#tab9Content').prepend( '{$content}' ); </script> <!-- ######################## --> <!-- End SpecialsApp --> <!-- ######################## --> EOD; For more informations, see the Hooks documentation
  5. The default template doesn't contain all informations that you can display in the template. If you need more informations, you must create a new template and use this syntax. Of course, if you want more options to display or not, you can create a new module and insert new option than you can manage in the back office. There the main information you can use. $products_name : Display the product name $products_stock : Display the product stock (image or text) $products_short_description : Display a short product description $products_flash_discount : Display the flash discount about a product $min_order_quantity_products_display : Display the min order than you accept for one order $product_price : display the product price $submit_button_view : display a message in function the customers group $submit_button : add button to take an order $products_quantity_unit : display the quantity of the unit to take an order $products_weight : display the product weight $button_small_view_details : Display the button to go in the product description $products_image : display the product image $ticker : display the ticker $products_model : display the product model $products_manufacturers : display the product manufacturer/ brand $products_date_available : display the product availabity $products_only_shop : display if the product is only available on the shop $products_only_web : display if the product is only available on the web $products_packaging : display the product packaging $products_shipping_delay : display the shipping delay $products_tag : display the product tag $products_volume : display the product volume $avg_reviews : display reviews Average with star $jsonLtd : display product Json Meta data
  6. Hooks ClicShopping\OM\Hooks Introduction Hooks allow action callouts to be thrown during an event to execute additional functionality. Hooks are not modules in the traditional sense of being able to be installed and configured; they are simply modular functions waiting to be executed on demand with no configuration or administration whatsoever. For security reasons, hooks must be defined in their Apps metadata file otherwise they will not be made available for the framework to use. Hooks are initialized by creating an instance of ClicShopping\OM\Hooks and specifying the Site to call the hook action from. If no Site is passed, the Site that initialized the framework is used as default. use ClicShopping\OM\Hooks; $CLICSHOPPING_Hooks = new Hooks(); Hooks() is automatically initialized on each page request and is available in the Registry as Hooks. Action Callout Throwing out an action callout is performed by specifying the group the action belongs to, the actual action name, and optionally a specific function to execute. There are two types of callouts that can be peformed: Type Description call() Executes the hooks and can return an array of results depending on the action. output() Executes the hooks and returns the output as a string. Hooks::call() // no output expected $CLICSHOPPING_Hooks->call('Account', 'Logout'); Parameters Hooks::call($group, $hook, $parameters, $action) Parameter Value $group The group the action call belongs to. $hook The name of the action to call. $parameters Any parameters to pass to the hooks. $action The name of the hook function to execute. Default: execute Hooks::output() // concatenated string output of all hooks executed echo $CLICSHOPPING_Hooks->output('Orders', 'Page', null, 'display') Parameters Hooks::output($group, $hook, $parameters, $action) The output() method shares the same function parameters as the call() class method. A list of hook action callouts is available on the List of Hook Callouts page. Runtime Watches Runtime watches can be defined that execute when the hook is called. This differs from hooks defined in App metadata files as they are defined in-line and execute either an existing function or are defined with an anonymous function to execute: use ClicShopping\OM\Registry; $CLICSHOPPING_Hooks = Registry::get('Hooks'); $CLICSHOPPING_Hooks->watch('Session', 'Recreated', 'execute', function($parameters) { .... });
  7. Registry ClicShopping\OM\Registry Introduction The registry is an object storage container strictly used to store object instances and access them by reference. It does not allow registered objects to be overwritten unless manually specified to do so. Adding to the Registry Objects can be added to the registry using Registry::set(). use ClicShopping\OM\Db; use ClicShopping\OM\Registry; $CLICSHOPPING_Db = Db::initialize(); Registry::set('Db', $CLICSHOPPING_Db); Parameters Registry::set($key, $value, $force) Parameter Value $key The name of the object to reference in the registry. $value The object to store in the registry. $force If this is enabled, overwrite an existing object with a new value. Default: false Accessing the Registry An object can be accessed in the registry using Registry::get(). use ClicShopping\OM\Registry; $CLICSHOPPING_Db = Registry::get('Db'); Parameters Registry::get($key) Parameter Value $key The name of the object to access in the registry. Checking the Registry An existing object can be checked for in the registry using Registry::exists(). use ClicShopping\OM\Db; use ClicShopping\OM\Registry; if (Registry::exists('Db')) { $CLICSHOPPING_Db = Registry::get('Db'); } else { $CLICSHOPPING_Db = Db::initialize(); Registry::set('Db', $CLICSHOPPING_Db); } Parameters Registry::exists($key) Parameter Value $key The name of the object to check in the registry for.
  8. Database ClicShopping\OM\Db Introduction The Db class manages the connection to the database server and executes sql queries. It extends the native PHP PDO class with custom functionality optimized to the framework. The class executes sql queries safely and securely by binding parameter values to the query via placeholders rather then having the values being injected into the sql query itself. Connections Db::initialize() opens a new connection to the database server. All parameters of the function are optional where the installation configuration values are used as default values. use ClicShopping\OM\Db; $CLICSHOPPING_Db = Db::initialize(); Parameters Db::initialize($server, $username, $password, $database, $port, array $driver_options) Parameter Value $server The address of the database server. Default: db_server $username The username to connect to the database server with. Default: db_server_username $password The password of the user account. Default: db_server_password $database The name of the database. Default: db_database $port The port number of the database server. Default: null $driver_options Additional driver options to use for the database connection. Defaults: PDO::ATTR_ERRMODE PDO::ERRMODE_WARNING PDO::ATTR_DEFAULT_FETCH_MODE PDO::FETCH_ASSOC PDO::ATTR_STATEMENT_CLASS ClicShopping\OM\DbStatement PDO::MYSQL_ATTR_INIT_COMMAND set session sql_mode="STRICT_ALL_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" A database connection is created on each page request and is available in the Registry as Db. Queries Prepared Statements Queries are performed with Db::prepare() which securely binds values to the query using placeholders. $seach = 'chocolate'; $category_id = 1; $price = '4.99'; $Qproducts = $CLICSHOPPING_Db->prepare('select title from :table_products where description like :description and category_id = :category_id and status = :status and price < :price order by title'); $Qproducts->bindValue(':description', '%' . $chocolate . '%'); $Qproducts->bindInt(':category_id', $category_id); $Qproducts->bindBool(':status', true); $Qproducts->bindDecimal(':price', $price); $Qproducts->execute(); while ($Qproducts->fetch()) { echo $Qproducts->value('title'); } Binding Parameters Parameters can be binded to the query using the following functions: Value Type Function String bindValue Integer bindInt Boolean bindBool Decimal bindDecimal Null bindNull [code] Table names prefixed with [b]:table_[/b] are binded and prefixed automatically with db_table_prefix. [b]Single Function Calls[/b] [b]Select Queries[/b] Simple select queries that do not need parameters to be binded can be executed with Db::query(). This functions returns a normal result set. [code] $Qstates = $CLICSHOPPING_Db->query('select id, title from :table_states where country_id = 1 order by title'); while ($Qstates->fetch()) { echo $Qstates->value('title'); } Update/Delete Queries Simple update/delete queries that do not need parameters to be binded can be executed with Db::exec(). This functions returns the number of rows affected. $result = $CLICSHOPPING_Db->exec('delete from :table_states where country_id = 1'); echo 'Affected rows: ' . $result; [code] [b]Results[/b] Results can be returned as a single result set, a multiple result set, and as an array containing all rows or columns. Fetching [b]Single Result Set[/b] Returning a single result set is performed as: [code] $Qstate = $CLICSHOPPING_Db->prepare('select title from :table_states where id = :id'); $Qstate->bindInt(':id', 1); $Qstate->execute(); if ($Qstate->fetch() !== false) { echo 'State: ' . $Qstate->value('title'); } Multiple Result Set Returning a multiple result set is performed as: $Qstates = $CLICSHOPPING_Db->prepare('select id, title from :table_states where country_id = :country_id'); $Qstates->bindInt(':country_id', 1); $Qstates->execute(); while ($Qstates->fetch()) { echo 'State: ' . $Qstates->value('title'); } Array Result Set An array can be retrieved containing either all rows of the result set or all columns of the current row: $Qstates = $CLICSHOPPING_Db->prepare('select id, title from :table_states where country_id = :country_id'); $Qstates->bindInt(':country_id', 1); $Qstates->execute(); $states_all = $Qstates->fetchAll(); $current_state = $Qstates->toArray(); Result Exists Checking to see if a result exists is performed as: $Qstates = $CLICSHOPPING_Db->prepare('select id, title from :table_states where country_id = :country_id'); $Qstates->bindInt(':country_id', 1); $Qstates->execute(); if ($Qstates->fetch() !== false) { echo 'States:'; do { echo $Qstates->value('title'); } while ($Qstates->fetch()); } else { echo 'No states exist.'; } Please note that the following will not work: $Qstates = $CLICSHOPPING_Db->prepare('select id, title from :table_states where country_id = :country_id'); $Qstates->bindInt(':country_id', 1); $Qstates->execute(); if ($Qstates->fetch() !== false) { echo 'States:'; while ($Qstates->fetch()) { echo $Qstates->value('title'); } } as calling fetch() in the if statement to check if a row exists and looping through the results again in the while statement will skip the first row of the result set due to the first call to fetch(). The do { .. } while ( .. ) method shown above is the correct way. Type Hinting Columns can be returned as a specific variable type using the following functions: Value Type Function String value HTML Safe String valueProtected Integer valueInt Decimal valueDecimal $Qproducts = $CLICSHOPPING_Db->prepare('select id, title, code, price from :table_products where description like :description order by title'); $Qproducts->bindValue(':description', '%chocolate%'); $Qproducts->execute(); if ($Qproducts->fetch() !== false) { do { echo $Qproducts->valueInt('id') . ': ' . $Qproducts->valueProtected('title') . ' (' . $Qproducts->value('code') . ') = ' . $Qproducts->valueDecimal('price'); } while ($Qproducts->fetch()); } [code] [b]Affected Rows[/b] The number of rows affected by an insert, update, or delete query can be returned as: [code] $Qupdate = $CLICSHOPPING_Db->prepare('update :table_states set title = :title where id = :id'); $Qupdate->bindValue(':title', 'Beverly Hills'); $Qupdate->bindInt(':id', 1); $Qupdate->execute; echo 'Affected rows: ' . $Qupdate->rowCount(); Please do not use rowCount() for select queries as this is not supported by PDO. Total Rows Retrieving the total rows of a query can be performed as: $Qtotal = $CLICSHOPPING_Db->prepare('select SQL_CALC_FOUND_ROWS id from :table_orders where status = :status'); $Qtotal->bindBool(':status', true); $Qtotal->execute(); echo 'Total rows: ' . $Qtotal->getPageSetTotalRows(); getPageSetTotalRows() requires SQL_CALC_FOUND_ROWS to exist in the query and automatically retrieves the total rows using select found_rows() after the query has been executed. It is also possible to use fetchAll() however this method uses more server resources and is not recommended: $Qorders = $CLICSHOPPING_Db->prepare('select id from :table_orders where status = :status'); $Qorders->bindBool(':status', true); $Qorders->execute(); echo 'Total rows: ' . count($Qtotal->fetchAll()); Page Sets Returning a page set result is performed as: $Qorders = $CLICSHOPPING_Db->prepare('select SQL_CALC_FOUND_ROWS order_number, total_price From :table_orders where customer_id = :customer_id and status = :status order by id desc limit :page_set_offset, :page_set_max_results'); $Qorders->bindInt(':customer_id', 1); $Qorders->bindBool(':status', true); $Qorders->setPageSet(15); $Qorders->execute(); if ($Qorders->getPageSetTotalRows() > 0) { echo 'Orders'; while ($Qorders->fetch()) { echo 'Order #' . $Qorders->valueInt('order_number') . ': ' . $Qorders->valueDecimal('total_price'); } echo $Qorders->getPageSetLabel('Displaying <strong>{{listing_from}}</strong> to <strong>{{listing_to}}</strong> (of <strong>{{listing_total}}</strong> orders)'); echo $Qorders->getPageSetLinks(); } Parameters setPageSet($max_results, $page_set_keyword, $placeholder_offset, $placeholder_max_results) Parameter Value $max_results The number of results to show per page. $page_set_keyword The name of the parameter holding the current page value. Default: page $placeholder_offset The name of the binding placeholder used as the limit offset in the sql query. Default: page_set_offset $placeholder_max_results The name of the binding placeholder used as the limit row number in the sql query. Default: page_set_max_results The parameter name of the current page value is passed as the second parameter. The default value is page and the value is retrieved from $_GET['page'] if it exists. Caching Caching of select query result sets improves performance by storing the result of the query in a cache file and subsequently reading the cached data until the cache expiration time is reached. As soon as the cache expiration time is reached, the database is queried again and the cached information is refreshed with the new result set. $Qcfg = $CLICSHOPPING_Db->prepare('select key, value from :configuration'); $Qcfg->setCache('configuration'); $Qcfg->execute(); while ($Qcfg->fetch()) { echo $Qcfg->value('key') . ': ' . $Qcfg->value('value'); } Parameters setCache($key, $expire, $cache_empty_results) Parameter Value $key The name of the cache block to retrieve or save. $expire The time in minutes the cached data should be saved for. A value of 0 keeps the cached data indefinitly until it has been manually cleared. Default: 0 $cache_empty_results A boolean value to cache or not cache empty result sets. Default: false Shortcuts Shortcut functions wrap Db::prepare() into a simpler interface to help write code faster for simpler queries. Db::get() Db::get() can be used to retrieve rows from a simple query. $Qstates = $CLICSHOPPING_Db->get('states', [ 'id', 'title' ], [ 'country_id' => 1 ], 'title' ); while ($Qstates->fetch()) { echo $Qstates->value('title'); } Parameters Db::get($table, $fields, array $where, $order, $limit, $cache, array $options) Parameter Value $table One (string) or more tables (array) to retrieve the rows from. Aliases may be used as: ['countries as c', 'states as s'] Table names are automatically prefixed unless the prefix_tables option is set as false (see the $options parameter). $fields One (string) or more fields (array) to retrieve. Aliases may be used as: ['c.countries_id as id', 'c.countries_title as title'] $where Array containing keys and values matching the column name to the condition: ['id' => 1] $order One (string) or more fields (array) to sort by: ['title', 'c.date_added'] $limit An integer value to limit the number of rows to, or an array containing two integer values to limit the number of rows (second value) with an offset (first value): [1, 15] $cache An array consisting of the parameters (in order) sent to setCache(). $options An array containing the following options: ['prefix_tables' => true] A more complex multi-relationship query example can be performed as: $Qproducts = $CLICSHOPPING_Db->get([ 'products p', 'products_to_categories p2c' ], [ 'count(*) as total' ], [ 'p.products_id' => [ 'rel' => 'p2c.products_id' ], 'p.products_status' => '1', 'p2c.categories_id' => '1' ] ); $products_count = $Qproducts->valueInt('total'); Db::save() Db::save() can be used to insert or update data in a table. $result = $CLICSHOPPING_Db->save('states', [ 'title' => 'California' ], [ 'id' => 1 ] ); echo 'Affected rows: ' . $result; Parameters Db::save($table, array $data, array $where_condition, array $options) Parameter Value $table The table to save the data to. $data An associative key=>value array containing the data to save in the table. The array keys must match the table field names the array value should be saved in. $where_condition If no condition is passed, the data is inserted into the table as a new record. If an associative $key=>$value array is passed, it is used as the where condition of the query to update the data of an existing record. $options An array containing the following options: ['prefix_tables' => true] Db::delete() Db::delete() can be used to delete a single, multiple, or all records from a table. $result = $CLICSHOPPING_Db->delete('states', ['id' => 1 ]); echo 'Affected rows: ' . $result; Parameters Db::delete($table, array $where_condition, array $options) Parameter Value $table The table to delete the records from. $where_condition If no condition is passed, all records in the table are deleted. If an associative $key=>$value array is passed, it is used as the where condition of the query to delete the matching records. The array keys must match the table field names the array value is matched against. $options An array containing the following options: ['prefix_tables' => true] use Cache $Qcfg = $CLICSHOPPING_Db->prepare('select key, value from :configuration'); $Qcfg->setCache('configuration'); $Qcfg->execute(); while ($Qcfg->fetch()) { echo $Qcfg->value('key') . ': ' . $Qcfg->value('value'); } get information from Db $Qstates = $CLICSHOPPING_Db->get('states', [ 'id', 'title' ], [ 'country_id' => 1 ], 'title' ); while ($Qstates->fetch()) { echo $Qstates->value('title'); } $Qcfg = $CLICSHOPPING_Db->prepare('select key, value from :configuration'); $Qcfg->setCache('configuration'); $Qcfg->execute(); while ($Qcfg->fetch()) { echo $Qcfg->value('key') . ': ' . $Qcfg->value('value'); }
  9. Configuration Introduction The main installation configuration parameters are stored in the following locations: Type Location Global includes/ClicShopping/Conf/global.php Shop includes/ClicShopping/Sites/Shop/site_conf.php Shop includes/ClicShopping/Sites/ClicShoppingAdmin/site_conf.php The global configuration file and all site configuration files are automatically loaded into their own groups when the framework is initialized. The global configuration file is loaded into a 'global' group, and the site configuration files are loaded into their own Site group (eg, 'ClicShoppingAdmin', and 'Shop'). Reading a configuration value is first attempted at the Site level, and if the configuration key does not exist, the global value is returned. A Site level configuration parameter has priority over a global level parameter if a global level configuration parameter is also defined. Custom Configuration Files It's possible to create custom configuration files that have priority over the values from the core configuration files. Custom configuration files can be stored in the following locations: Type Location Global includes/ClicShopping/Custom/Conf/global.php Per-Site includes/ClicShopping/Custom/Sites/SITE/site_conf.php Configuration File Format The format of the configuration parameters are stored in a "ini" style format in a PHP file that is assigned to a $ini PHP variable. This style of configuration was chosen over a plain text .ini file to prevent configuration parameters being read in cases of the configuration files being publicly accessible through the web server. An example format for the global configuration file is: <?php $ini = <<<EOD db_server = "localhost" db_server_username = "dbuser" db_server_password = "dbpass" db_database = "my_db_name" db_table_prefix = "clic_" store_sessions = "MySQL" time_zone = "Europe/Berlin" EOD; An example of a Site configuration file is: <?php $ini = <<<EOD dir_root = "/www/html/" http_server = "https://demo.shop" http_path = "/" http_images_path = "images/" http_cookie_domain = ".clicshopping.shop" http_cookie_path = "/" EOD; External Configuration Files External configuration files can be loaded using the following code: use ClicShopping\OM\CLICSHOPPING; CLICSHOPPING::loadConfigFile($path_of_file, 'ext_group'); This would load the configuration parameters of $path_of_file to the 'ext_group' configuration group. It is important that the ini format is stored as a string to the $ini PHP variable otherwise the configuration parameters can not be parsed. Retrieving Configuration Parameters Configuration parameters can be retrieved using CLICSHOPPING::getConfig(): use ClicShopping\OM\CLICSHOPPING; $value = CLICSHOPPING::getConfig('cfg_name'); In this example, the cfg_name configuration parameter from the current Site group is returned. If the current Site group does not contain the configuration parameter, the global group value is returned. It's possible to define which group the configuration parameter should be loaded from by defining the group name: use ClicShopping\OM\CLICSHOPPING; $value = CLICSHOPPING::getConfig('cfg_name', 'ext_group'); This would load the cfg_name configuration parameter from the ext_group group. The following can be used to first see if a configuration parameter exists: use ClicShopping\OM\CLICSHOPPING; if (CLICSHOPPING::configExists('cfg_name')) { .... } This will check if cfg_name exists in the current Site group or the global group. Checking to see if a configuration parameter exists in a specific group is performed as follows: use ClicShopping\OM\CLICSHOPPING; if (CLICSHOPPING::configExists('cfg_name', 'ext_group')) { .... } Please note that if the configuration parameter does not exist in the specified group, a check is also performed in the global group. Setting Configuration Parameters Runtime configuration parameters can be set as follows: use ClicShopping\OM\CLICSHOPPING; $value = true; CLICSHOPPING::setConfig('is_true', $value, 'ext_group'); If no group is specified in the third parameter, the configuration parameter would be set in the global group. This function does not save the configuration parameter to the configuration file - it only sets a runtime configuration parameter value.
  10. ClicShopping\OM is a framework utilizing new features in PHP to improve the performance, security, and modularity of the codebase. Taking advantage of namespaces and autoloading, it is now even easier to add new features and extend existing features without the need to edit core source code files. The base framework is located in the includes/ClicShopping directory: Framework Namespace Location Core ClicShopping\OM includes/ClicShopping/OM Sites ClicShopping\Sites includes/ClicShopping/Sites Apps ClicShopping\Apps includes/ClicShopping/Apps Custom ClicShopping\Custom includes/ClicShopping/Custom Namespaces/Autoloader The framework is built utilizing the PSR-4 standard for autoloading classes from matching namespaces and file paths. Classes are automatically loaded on demand and don't need to be included/required manually. The base namespace the autoloader watches for is ClicShopping\ and loads the class files located in the includes/ClicShopping/ directory. Examples Class File Location ClicShopping\OM\CLICSHOPPING includes/ClicShopping/OM/CLICSHOPPING.php ClicShopping\OM\Db includes/ClicShopping/OM/Db.php ClicShopping\OM\Registry includes/ClicShopping/OM/Registry.php ClicShopping\Sites\Shop\Shop includes/ClicShopping/Sites/Shop/Shop.php ClicShopping\Apps\VENDOR\APP\APP includes/ClicShopping/Apps/VENDOR/APP/APP.php Classes in the framework must declare their namespace as the first PHP code in the file. Examples namespace CLICSHOPPING\OM; class NewClass { .... } The full namespace to the above example would be: ClicShopping\OM\NewClass and the location of the file would be: includes/ClicShopping/OM/NewClass.php For another class to be able to load ClicShopping\OM\NewClass automatically, it needs to be declared with PHP's use keyword after the namespace of the class and before any other PHP code. Examples namespace ClicShopping\OM; use ClicShopping\OM\NewClass; class AnotherNewClass { public function __construct() { $NewClass = new NewClass(); } } The framework autoloader (ClicShopping\OM\CLICSHOPPING::autoload()) is registered as an autoloader in includes/application_top.php and is automatically initialized in all main PHP files that include the application_top.php file. Template files do not need to have a namespace set, but still need to reference framework classes that it uses: Examples use ClicShopping\OM\HTML; echo HTML::outputProtected('Hello World!'); More information about namespaces can be found at the PHP Namespace documentation page. Sites Sites are registered in the framework to initialize and apply environment parameters specific to that site. The available sites in the core are: Site Controller Shop (default) ClicShopping\Sites\Shop\Shop Admin ClicShopping\Sites\ClicShoppingAdmin\Admin Sites are registered and retrieved as follows: use ClicShopping\OM\CLICSHOPPING; CLICSHOPPING::initialize(); CLICSHOPPING::loadSite('Shop'); $site = CLICSHOPPING::getSite(); Custom Directory To customize a core source file, copy it to this directory matching the directory structure of the original file. For example, - to make custom changes to ClicShopping/OM/Session/File.php - copy the complete file to ClicShopping/Custom/Session/File.php and perform your changes to this new file. Notes Although the custom class is copied to a Custom directory, it must retain the original Core namespace. Due to this, copied classes cannot extend the original class in the Core namespace. ClicShopping\Custom\Conf Configuration setting ClicShopping\Custom\Sites\Shop (default) Shop classes ClicShopping\Custom\OM OM classes ClicShopping\Custom\Schema Database file installation Apps Apps are self-contained packages that add new or extend existing features through modules and hooks. Apps reside in their own directory and do not need to edit core source code files. Apps are located in the following directory: Namespace Location ClicShopping\Apps\VENDOR\APP includes/ClicShopping/Apps/VENDOR/APP Apps also have a public directory for public accessible files such as stylesheets, javascript, and images, located at: public/Apps/VENDOR/APP More information is available in the Apps chapter. Service Services are portions of the online store that do not directly relate to the customer purchasing a product, but can be helpful in setting up the store. Services are available in Shop and ClicShoppingAdmin. it can use everywhere inside the site. Example Service for the mail namespace ClicShopping\Service\Shop; use ClicShopping\OM\Registry; use ClicShopping\OM\Mail as MailClass; class Mail implements \ClicShopping\OM\ServiceInterface { public static function start() { if (is_file(CLICSHOPPING_BASE_DIR . 'OM/Mail.php')) { Registry::set('Mail', new MailClass()); return true; } else { return false; } } public static function stop() { return true; } } How to call inside a file : $CLICSHOPPING_Mail = Registry::get('Mail');
  11. Change theme is easy, first you must install a new theme in the template directory and after in administration, you can change the theme in you Design configuration
  12. No, it not the best pratice, you you want to customize ClicShopping, it's better to have you own template. The process is simple, 1 - inside default template direcotry, copy the files 2 - recreate the architecture of the directory and copy the files ClicShopping, override the default files by the new files. Default template can be use when there is an upgrade, that's why it's not a best pratice to change something inside the directory
  13. A few people here asked that we have a thread on Adwords, so I'll start it. I've used Adwords since 2003 when you could do a nickel a click. Then, it became a dime and the race was off. Over time I've learned a lot and had a love/hate relationship. This year Adwords account managers have helped me in updating and learning new features. Currently, my ROI is the best it's been in at least a very long time, so I’ll try to share some ideas. For me, a big key is getting a repeat customer, but I also get some good sales from it. First, you need to tie in Analytics, which is now part of Adwords. Analytics can show you what sales you are getting through different ads and you can get the actual order id. This helps in adjusting ads or even stopping those that don't pay off. I look a lot at last 7 days and 30 days. The 7 day view is good because you can see how small bid adjustments can cost a lot. This can be done in the Adwords screens too. https://adwords.google.com/analytics/ And using a Google Feeder like Jack's, you need to set up with Google Shopping. I was slow to get this going, but it's really working well on some items I sell. This gets you the ad boxes you see with pics at the top of Google as well as Google Shopping. https://merchants.google.com/ That covers the basics but AdWords and Analytics have a lot of features. The biggest thing with AdWords is the better your ad is, the less you have to pay and still rank high. So, take advantage of all the little extras like extended links and callouts. Use all the characters you can but keep substance. Once you create a base ad, you can copy and edit to make versions to test. I added "Fully Secure Website" to one of my ads and it get 4 times the click through than any of my others in that ad group. I did this based on switching to all SSL all the time. Adwords also serves it higher, so it likes it. You can also tailor you bids based on areas like states (Texas for instance). Adjust based on days of the week or time of the day. Adjust up or down for phones with browsers. I bid that down because my biggest competitor on this isn't responsive in their site design. Remarketing was a huge fail for me that burned up cash with no ROI. Small bid adjustments that make you rank higher can cost way more than expected, so the 7 day running view is key. The other key is look at it every day. There is some trial and error, but this can get you sales you are otherwise missing. A lot probably depends on your margin, but for me I'll give 200 to sell 1600 especially since some will repeat. There's a lot more to this and I'm not sure how much this helps, but hopefully others have something to add.
  14. If it can help you to understand google : look theses link A lot of good stuff https://www.thinkwithgoogle.com/
  15. Mobile Friendly Good for checking if site is Mobile Friendly https://search.google.com/search-console/mobile-friendly?utm_source=mft&utm_medium=redirect&utm_campaign=mft-redirect Microdata Testing Tools Good for Schema. https://search.google.com/structured-data/testing-tool Facebook Link Good for Opengraph. https://developers.facebook.com/tools/debug/ Twitter Card Validator https://cards-dev.twitter.com/validator SSL https://www.ssllabs.com/ssltest/index.html"] https://www.ssllabs.com/ssltest/index.html Performs a deep analysis of the configuration of any SSL web server. Page Speed Tools https://gtmetrix.com GTmetrix is a free tool that analyzes your page's speed performance.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use