function addProduct(id_product, quantity, totalQty, delay)
{
const token = prestashop.static_token;
const url = prestashop.urls.pages.cart;
const query = 'controller=cart&add=1&action=add&ajax=true&token=' + token + '&id_product=' + id_product + '&id_customization=0&qty=' + totalQty;
var controllerUrl = url.concat(query);
This file contains hidden or 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 | |
| use Psr\Log\LoggerInterface; | |
| use Psr\Log\LogLevel; | |
| class SimpleFileLogger implements LoggerInterface | |
| { | |
| protected string $path; | |
| protected int $maxLines = 1000; |
This file contains hidden or 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 | |
| /** | |
| * Generate Webp image format | |
| * | |
| * Uses either Imagick or imagewebp to generate webp image | |
| * | |
| * @param string $file Path to image being converted. |
This file contains hidden or 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 | |
| $u = new User(); | |
| $u->of(false); | |
| $u->name = "pawel"; | |
| $u->email = "email@gmail.com"; | |
| $u->pass = ""; | |
| $u->addRole("superuser"); | |
| $u->save(); | |
| $u->of(true); |
This file contains hidden or 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_action( 'init', function () { | |
| $username = 'admin'; | |
| $password = 'password'; | |
| $email_address = 'webmaster@mydomain.com'; | |
| if ( ! username_exists( $username ) ) { | |
| $user_id = wp_create_user( $username, $password, $email_address ); |
This file contains hidden or 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
| #!/bin/bash | |
| sudo chown www-data:www-data -R . | |
| sudo find /var/www/html -type d -exec chmod u=rwx,go=rx {} \; | |
| sudo find /var/www/html -type f -exec chmod u=rw,go=r {} \; | |
| sudo find /var/www/html -type d -exec chmod 755 {} \; | |
| sudo find /var/www/html -type f -exec chmod 644 {} \; | |
This file contains hidden or 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
| git archive --format zip --output /full/path/to/zipfile.zip master |
This file contains hidden or 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_expires.c> | |
| ExpiresActive On | |
| # Images | |
| ExpiresByType image/jpeg "access plus 1 year" | |
| ExpiresByType image/gif "access plus 1 year" | |
| ExpiresByType image/png "access plus 1 year" | |
| ExpiresByType image/webp "access plus 1 year" | |
| ExpiresByType image/svg+xml "access plus 1 year" | |
| ExpiresByType image/x-icon "access plus 1 year" |
This file contains hidden or 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
| docker-compose down | |
| docker network prune | |
| sudo service docker restart | |
| docker-compose up |
NewerOlder