Saturday, December 17, 2022
HomeWordPress DevelopmentMethods to import WooCommerce tax charges utilizing a PHP script?

Methods to import WooCommerce tax charges utilizing a PHP script?


I’ve created a CSV file with WooCommerce tax charges and need to import it with a PHP script. How can I do that?

I wrote this code:

<?php

// path to the file on my system
require "../wp-content/plugins/woocommerce/woocommerce.php";
$wc_importer = new WooCommerceAdminImportersWC_Tax_Rate_Importer();
$wc_importer->import('take a look at.csv');

however after I run it like this:

$ php -d display_errors=1 -f import.php

nothing occurs. There isn’t any output to the console. Thank in your assist.

PS: I perceive this website doesn’t welcome WooCommerce questions however I imagine this query is extra about PHP programming than WooCommerce therefore attempting to submit it right here.

I believe there may very well be couple of points right here:

  1. Methods to import the bundle accurately
  2. Methods to direct messages to console
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments