Replies: 1 comment
-
Hi @AlexJuzto Don't use commas in your indexed array. Also quotes are unnecessary.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to change order status put all orders ID in array, then I iterate each element with my woocommerce cli command; but there's not working ( the first element of the array, but the last id in the array work ) how I can solve this?
bash script
declare -a ordenes=( "408434", "408433" )
for i in "${ordenes[@]}";
do
wp wc shop_order update $i --status=checkout-draft --user=12395
echo $i;
done
Command line response
Error: No se ha encontrado ninguna ruta que coincida con la URL y el método de la solicitud. {"status":404}
408434,
Success: Actualizado shop_order 408433. ( the last item in the array works, change the order status )
408433
WP CLI info
Shell: /bin/bash
PHP binary: /usr/bin/php7.4
PHP version: 7.4.28
php.ini used: /etc/php/7.4/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 14.14 Distrib 5.7.41, for Linux (x86_64) using EditLine wrapper
SQL modes:
Beta Was this translation helpful? Give feedback.
All reactions