Thursday, March 30, 2017

Tip: using PrestaShop's SQL Manager to export detailed orders - Configuring and using PrestaShop - PrestaShop

Tip: using PrestaShop's SQL Manager to export detailed orders - Configuring and using PrestaShop - PrestaShop



I use it to write a similar sql, in spanish and group only by d.id_order.
In this form don´t duplicate and don´t erase any product. if you need to see all the products and all the orders, you can get it with a code like this:
SELECT d.id_order, os.name AS estado, o.date_upd AS fecha, d.product_name AS producto, d.product_reference AS ref_ReleMat, d.product_supplier_reference AS ref_proveedor, d.product_quantity AS uds,  d.product_price, s.quantity AS en_stock, o.payment,  CONCAT_WS(  ' ', g.firstname, g.lastname ) AS cliente,  CONCAT_WS(' ', ad.address1, ad.address2, ad.postcode, ad.city, ad.other, ad.phone, ad.phone_mobile) AS envio, CONCAT_WS(' ', ai.address1, ai.address2,  ai.postcode, ai.city, ai.other, ai.phone, ai.phone_mobile) AS facturacion, g.email, gl.name AS grupo
FROM ps_order_detail d
LEFT JOIN ps_orders o ON ( d.id_order = o.id_order ) 
LEFT JOIN ps_customer g ON ( o.id_customer = g.id_customer ) 
LEFT JOIN ps_stock_available s ON (d.product_id = s.id_product)
LEFT JOIN ps_address ad ON (o.id_address_delivery = ad.id_address)
LEFT JOIN ps_address ai ON (o.id_address_invoice = ai.id_address)
LEFT JOIN ps_group_lang gl ON ( g.id_default_group = gl.id_group ) 
LEFT JOIN ps_order_state_lang os ON ( o.current_state = os.id_order_state ) 
WHERE os.id_lang =1
GROUP BY d.id_order, d.product_name
ORDER BY d.id_order DESC
I use it in PS1.5 and it´s ok.

Rsyc push and pull over ssh | Sany's Linux and Open Source Blog

Rsyc push and pull over ssh | Sany's Linux and Open Source Blog





Using rsync is the best way copy large size files from/to remote servers.
Since scp command won’t support sync/continue option it’s better to use rsync.
Instead of downloading whole file again after our network got disconnected rsync will download only missing part.
Pull with rsync (copying from remote server):
$ rsync -av --partial --progress --rsh="ssh" user@hostname:<remote_directory/file> <destionation_path>
Push with rsync (copying to remote server):
$ rsync -av --partial --progress --rsh="ssh" <source file/directory> user@hostname:<destionation_path>
or
$ rsync -v -e ssh <source file/directory> user@hostname:<destionation_path>
If you are using any other port for ssh use –rsh=”ssh -p <port_number>”
Eg: --rsh="ssh -p 12345" where 12345 is port number.

angularjs - How can I fade in and then fade out text inside a
- Stack Overflow

angularjs - How can I fade in and then fade out text inside a <div> - Stack Overflow



Add the ngShow directive to your div:
<div ng-model="message" ng-show="showMessage" class="message fadein fadeout">{{message}}</div>
When saving begins set showMessage = true and the message you want to display. When saving is done set showMessage = false. To show the message a while longer after the saving is done you can use $timeout:
// Loadind done here - Show message for 3 more seconds.
$timeout(function() {
    $scope.showMessage = false;
}, 3000);
The animation part depends on what version of AngularJS you are using.
Here is an example using 1.2: http://plnkr.co/edit/jBukeP?p=preview

angularjs - Angular js Div show only for 3 seconds - Stack Overflow

angularjs - Angular js Div show only for 3 seconds - Stack Overflow



Inject the $timeout service in the controller and use it to unset loginAlertMessage.
  app.controller('MyController', function ($scope, $timeout) {
    $scope.loginAlertMessage = true;

    $scope.forgotPassword = function () {
         $scope.loginAlertMessage=false; 
         $timeout(function () { $scope.loginAlertMessage = true; }, 3000);   
    };

    // ...
  }