yum install php-pecl-apcu
Which gave me the error
Error: php56u-common conflicts with php-common-5.4.16-36.1.el7_2.1.x86_64
So I searched yum
sudo yum list \*apcu\*
...and came up with a command that worked....
sudo yum install php56u-pecl-apcu
yum install php-pecl-apcu
Error: php56u-common conflicts with php-common-5.4.16-36.1.el7_2.1.x86_64
sudo yum list \*apcu\*
sudo yum install php56u-pecl-apcu
Ever want to add a totally new front page to PrestaShop, but found that a CMS page was not enough? I needed to create a totally new page, with a form that could submit to itself, and I did not find info about how to do this in PrestaShop 1.6.
AdWords has added the ability to add parameters to all your URLs via Shared Library -> URL
"Because API v3.0 recently reached feature parity [emphasis mine] with previous versions, we haven't been able to set up any resources to promoting wrappers API 3.0. With said, our developers are working on improving our API 3.0 experience for our users, and if you'd like to check in on any feature updates or news relating to 3.0, please be sure to head to our Road map page below and sign up to receive our API announcements.
Note to self: Although MySQL does not have a split / explode type function, it DOES have a built SUBSTRING_INDEX function that can be used in some circumstances. E.g. if you have a field with value '12345-right', you can get the left part with SUBSTRING_INDEX(value, '-', 1), and the right part with SUBSTRING_INDEX(value, '-', -1).<?php $resource = Db::getInstance()->query( "select * frommmmmmmmmmm ps_orders"); while ($data_row = Db::getInstance()->nextRow($resource)) { //Do Important Stuff }
<?php require(_PS_ROOT_DIR_ . '{location of your autoload file}/autoload.php'); use PHPMailer\PHPMailer\PHPMailer; function getConfiguredPHPMailer() { $configuration = Configuration::getMultiple(array ( 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_MAIL_SMTP_ENCRYPTION', 'PS_MAIL_SMTP_PORT' ), null, null, Context::getContext()->shop->id); // Returns immediatly if emails are deactivated if ($configuration['PS_MAIL_METHOD'] == 3) { return null; } else { if ($configuration['PS_MAIL_METHOD'] != 2) { @mail('you@yoursite.com', 'ERROR: Code only configured for SMTP', 'Code only works with PrestaShop configured for SMTP (with PS_MAIL_METHOD == 2)'); return null; } } $mail = new PHPMailer; $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = $configuration['PS_MAIL_SERVER']; // Specify SMTP server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = $configuration['PS_MAIL_USER'];// SMTP username $mail->Password = $configuration['PS_MAIL_PASSWD'];// SMTP password $mail->SMTPSecure = $configuration['PS_MAIL_SMTP_ENCRYPTION'];// Enable encryption $mail->Port = $configuration['PS_MAIL_SMTP_PORT'];// TCP port to connect to return $mail; }
¡¡LentillasSi ya está aquí!!
Yesterday, I needed a Composer component for use in my PrestaShop application (I could have used sFTP in PHP in a number of different ways, but after reading the excellent book Modern PHP, I of course wanted a Composer solution to my problem). From reading the PrestaShop Developer's Blog, I knew that version 1.7.x will have Composer integrated into the program, so I needed to set it up in such a way as to avoid future problems.{ "require": { } }
Kim from Colillas Branding (whose English was so good that I was surprised to see he was Spanish) asked today how to get PayPal to return directly to the website instead of first showing a "confirm payment" page. Returning to the site insures that you have a chance to show your tracking code, as the extra step that PayPal puts in can keep that from happening.CREATE TABLE `customer_extra_info` ( `id_customer` int(10) unsigned NOT NULL, `datetime_password_request` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `token_password_request` varchar(32) NOT NULL DEFAULT '-1', PRIMARY KEY (`id_customer`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ps_cart_product_sorting` ( `id_cart` int(10) unsigned NOT NULL, `id_product` int(10) unsigned NOT NULL, `original_date_add` datetime NOT NULL, UNIQUE KEY `ix_cart_product` (`id_cart`,`id_product`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
<?php function summary_compare (array $one, array $two) { return strcmp ($one['original_date_add'], $two['original_date_add']); } class Cart extends CartCore { //---------------------------------------------------------------------------- public function getSummaryDetails($id_lang = null, $refresh = false) { $summary_details = parent::getSummaryDetails($id_lang, $refresh); if (isset ($summary_details['products'])) { for ($jj = 0; $jj < count($summary_details['products']); $jj++) { $summary_details['products'][$jj]['original_date_add'] = $this->getOriginalDateAdd( $summary_details['products'][$jj]['id_product'], $summary_details['products'][$jj]['date_add']); } //Rather than letting prestashop sort by last modified (which moves things //around in the cart when changing qty there), sort by the original add_date. //Note that prestashop modifies cart_products::date_add every time the qty // changes, setting it to currente time. uasort($summary_details['products'], 'summary_compare'); } return $summary_details; } //---------------------------------------------------------------------------- protected function getOriginalDateAdd($id_product, $date_add) { $original_date_add = Db::getInstance()->getValue(" select original_date_add from ps_cart_product_sorting where id_cart = {$this->id} and id_product = $id_product"); if (!$original_date_add) { $original_date_add = $date_add; Db::getInstance()->insert('ps_cart_product_sorting', array ( 'id_cart' => $this->id, 'id_product' => $id_product, 'original_date_add' => $original_date_add )); } return $original_date_add; } }
<?php function summary_compare (array $one, array $two) { return strcmp ($one['original_date_add'], $two['original_date_add']); }
aws s3 sync /var/www/html/img s3://my_prestashop_bucket/img
Just added my WordPress code to a Bitbucket Git repository. As always when I want to init a new project, I first head over to gitignore.io to quickly get a decent .gitignore file. If you use the service, and your starting from Linux, the tutorial video is worth watching before you start.sudo git init
sudo git add .
sudo git commit -m 'initial commit'
After that, create a new empty repository in Bitbucket, select the "I have an existing project" link, and follow the instructions to your new repository on Linux added to the empty repository on Bitbucket.
MySQL logging is a lifesaver when trying to understand applications at a low level. However, since I use it infrequently, I always have to consult the Google doc I have with the details on how to toggle the setting, and where to find the output.@echo off set /p state="Set MySQL Logging state ON or OFF: " c:\xampp\mysql\bin\mysql -u "root" -e "SET GLOBAL general_log = '%state%'; %SystemRoot%\explorer.exe "C:\whatever"
@echo off set /p state="Set MySQL Logging state ON or OFF: " c:\xampp\mysql\bin\mysql -u "root" -e "SET GLOBAL general_log = '%state%';
select event_time, convert(argument using utf8) from general_log gl left join general_log_ignores gli on gl.argument = gli.argument_to_ignore where gli.argument_to_ignore is null order by gl.event_time;
Due to problems with VirtualBox and Vagrant on Windows 10, I've temporarily moved back to XAMPP for local development. While restoring the backed up databases to my local MySQL, I hit a cURL error 60.[curl] curl.cainfo="C:\xampp\php\extras\ssl\cacert.pem"
<?php ob_start(); phpinfo(); $phpinfo = ob_get_contents();