This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// SQL SELECT | |
// Simple SELECT | |
$sql = 'SELECT `id_authorization_role` FROM `' . _DB_PREFIX_ . 'authorization_role` t WHERE ' . implode(' OR ', $whereClauses); | |
// Or SELECT with INNER JOIN | |
$sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'orders o | |
INNER JOIN ' . _DB_PREFIX_ . 'order_detail od | |
ON o.id_order = od.id_order | |
WHERE od.product_id = '. $var | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$module = Module::getInstanceByName('module_name'); | |
$module->functionName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The path to the /override/modules folder in your custom module | |
$module_path = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $this->name . | |
DIRECTORY_SEPARATOR . 'override' . DIRECTORY_SEPARATOR . 'modules'; | |
// The path to the PrestaShop override folder | |
$override_path = _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'override' . DIRECTORY_SEPARATOR . 'modules'; | |
// Add an entry to the array for all of the overrides that you want to be copied to the override folder: | |
$files = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function install() | |
{ | |
// Hook registration needs to go in the install function of your module | |
if ($this->registerHook('displayHeader')) { | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generic logging function | |
* | |
* @param $event | |
* @param $info | |
* @param int $level | |
* @param null $supplementary | |
* @return bool | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function install() | |
{ | |
if ($this->registerHook('actionCustomerGridDefinitionModifier') && | |
$this->registerHook('actionCustomerGridQueryBuilderModifier')) { | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add all these functions to your custom module | |
/** | |
* Function to display content for your module in the Back Office | |
* | |
* @return string | |
*/ | |
public function getContent() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function install() | |
{ | |
if ($this->registerHook('actionAdminControllerSetMedia')) { | |
return true; | |
} | |
$this->uninstall(); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.3' | |
services: | |
db: | |
build: | |
context: . | |
network: prestashop-net | |
container_name: db | |
image: mysql:5.7 | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
</IfModule> |
OlderNewer