csv 파일에서 woocoommerce 약 1,000 쿠폰 코드를 가져 오기 위해 노력하고있어
에서 woocommerce 벌크 쿠폰을 가져올 수 있지만
이 코드 수를 작동하지 않습니다
당신이, 내가 오늘 솔루션을 필요로하시기 바랍니다 나에게 도움이 될
내가 CSV 파일의 각 행에 대해이 기능을 수행 할 필요$coupon_code = 'UNIQUECODE'; // Code
$amount = '10'; // Amount
$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product
$coupon = array(
'post_title' => $coupon_code,
'post_content' => '',
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'shop_coupon'
);
$new_coupon_id = wp_insert_post($coupon);
// Add meta
update_post_meta($new_coupon_id, 'discount_type', $discount_type);
update_post_meta($new_coupon_id, 'coupon_amount', $amount);
update_post_meta($new_coupon_id, 'individual_use', 'no');
update_post_meta($new_coupon_id, 'product_ids', '');
update_post_meta($new_coupon_id, 'exclude_product_ids', '');
update_post_meta($new_coupon_id, 'usage_limit', '');
update_post_meta($new_coupon_id, 'expiry_date', '');
update_post_meta($new_coupon_id, 'apply_before_tax', 'yes');
update_post_meta($new_coupon_id, 'free_shipping', 'no');
: programmly 1 개 쿠폰을 생성합니다.
에 의존 않습니다 - 어떻게 그렇다면? – Sol