Ditutup

Create a txt file as Woocommerce order status is cancelled

Hi,

I need to generate a text file when an order is cancelled on Woocommerce.

This text file should be named [url removed, login to view] and placed in a folder at the root of the website

I created a function in my [url removed, login to view] file but it doesn't seem to work.

Here is the code:

add_action( ‘woocommerce_order_status_cancelled’, ‘imagevo_cancelled’);

function imagevo_cancelled($order_id) {

$order = new WC_Order( $order_id );

$myuser_id = (int)$order->user_id;

$user_info = get_userdata($myuser_id);

$items = $order->get_items();

$filename = get_template_directory().'commandes/'.$order_id.'.txt'; //should not be in the theme folder but at the root

foreach ($items as $item) {

if ($item['product_id']==82) {

$myfile = fopen($filename, "w"); }

}

return $myfile;

}

For information:

the destination folder is: [url removed, login to view]

I set permissions to 777

I need someone to help me debug this function or create a new one that would work fine.

Keahlian PHP, WooCommerce, WordPress

Lihat lebih lanjut: emu8086 create txt file, create linked list given txt file java, java create binary tree txt file, excel create txt file, create write txt file windows application asp net, create txt file cell excel macro, create txt file perl, create txt file html javascript, excel macro create txt file, parse txt file php

Tentang Pemberi kerja:
( 1 ulasan ) Albi, France

ID Proyek: #7942256

16 freelancer menawar pada rata-rata $15/jam untuk pekerjaan ini

toinnisfree

I have read your project details, and I am interested in offering my services. I provide 100% satisfaction guaranteed on all my work. Milestone is required to begin; to be released when the job has been satisfactor Lagi

$30 USD / jam
(683 Ulasan)
8.2
seekdeveloper

Hi, I have read your post and understood your requirement. I have great experience in handling /Magento/WooCommerce/Shopify/Prestashop/VirtueMart/Joomla/OpenCart/Volusion/HTML5/CSS3/PHP/Drupal/Yii framework/Javas Lagi

$25 USD / jam
(82 Ulasan)
8.0
mituld

Hi I work towards providing reliable, relevant and robust IT solutions at most competitive prices to my customers. I ensure 100% customer satisfaction so lets start Thanks

$8 USD / jam
(213 Ulasan)
7.5
gopalvora

Hi I have gone through the details of your project and we find it well within our capabilities. I offer a wide range of services, including Web design, PHP/MySQL web application development, Open sources like Joo Lagi

$8 USD / jam
(337 Ulasan)
7.8
evgendob

Hello there. Wordpress dev expert ready to help you with txt creation functionality. I have more 200 good reviews in dev projects, so all will be done on highest level. Please, do not award project until we will clear Lagi

$12 USD / jam
(326 Ulasan)
7.5
prashushinde9

I want to discuss this project with you further, let me know the best suitable time for you to schedule the meeting, Feel free to message me at any time, i used to be online 14 hrs in a day on this website so probably Lagi

$15 USD / jam
(42 Ulasan)
6.3
RITESHBATHWAL

Hello Sir, I can do this job in few hours but I will need payment for 1 hour 29$ . There are few things missing in your code which I can see clearly. I will write the proper code to do this job and create the file. I Lagi

$29 USD / jam
(99 Ulasan)
6.0
danagnostos

Hello, I’d like to be considered for your project. I am a senior developer with over 20 years of experience in software development, using mainly open source technologies (PHP, Zend Framework, CodeIgniter, Apache, Lagi

$15 USD / jam
(31 Ulasan)
6.1
mmadi

Hi, Iam interested in your project and I will be happy to do that for you. I have experienced with these skills. I can send some previous work similar to yours please check our company portofolio here http://flowgica Lagi

$10 USD / jam
(37 Ulasan)
6.2
saadrashad

are you getting any errors? please provide details of errors. switching directory is no problem just need to know if u r getting the file generated or not as what is understand is the file is also not generating

$11 USD / jam
(74 Ulasan)
5.5
forcitCample

Hi there, Hope you are doing  great today !!  I hope, your search for right contractor end here. I have recorded a quick video for  you : [url removed, login to view] Working with " woo commerce”  is definitely Lagi

$12 USD / jam
(31 Ulasan)
5.3
subratawsk

Hi There, Hope you are doing well. Thanks for the requirement. We have gone through your description and we are confident to deliver you best solution. Your Goal of the project and your requirement is very clear to Lagi

$12 USD / jam
(18 Ulasan)
4.4
ifluxsolution

Hi there, I have read your requirement about DEBUGGING and have more than 4 years of experience with WORDPRESS | WOOCOMMERCE WEBSITE DESIGN | DEBUGGING. :: WEBSITE DESIGNED | DEBUGGING IN WORDPRESS :: htt Lagi

$12 USD / jam
(9 Ulasan)
4.1
bonapps

Hello Mate! I am interested in the project you posted. Their are lot of interested people here and they have lot of different things so i dont know you will reply me or not or even read my post or not but i wa Lagi

$20 USD / jam
(5 Ulasan)
3.6
OrlandoSolution

Hello Sir, Thank you for taking the time to review our bid!. I am having strong hands over Java, PHP, HTML, Jsp, CSS, Bootstrap, JavaScript, JQuery, Mysql and other related technologies. I am a Creative Graphics Desig Lagi

$8 USD / jam
(3 Ulasan)
1.5
vrajesh85

Hello, I'm keenly considering your job post. I have 5 years excellent experience in WordPress.Woocommerce. It is most user friendly cms .Gives option to create and publish pages , posts , images with admin login. Lagi

$11 USD / jam
(0 Ulasan)
0.0