Category : woocommerce

Good afternoon, please tell me, I’m deducing prices from an arbitrary field and other signatures appear in the right place, I don’t understand the error, thank you in advance Create add_action( ‘woocommerce_product_options_general_product_data’, ‘my_btb_product_fields’); function my_btb_product_fields() { $args = [ ‘id’ => ‘b2b_price’, ‘label’ => __(‘b2b (от 30к)’, ‘plugin-name’ ), ‘type’ => ‘number’ ]; woocommerce_wp_text_input( $args ..

Read more

That my code which i write in function.php add_action(‘transition_post_status’, ‘send_new_post’, 9876543210, 3); function send_new_post($new_status, $old_status, $post) { if(‘publish’ === $new_status && ‘publish’ !== $old_status && $post->post_type === ‘product’) { global $wpdb; $current_product_id = $post->ID; if(isset($current_product_id)) { $post_id = $current_product_id; } else { $post_id = ‘131’; } $sql = “SELECT post_id as id, (SELECT post_title FROM ..

Read more

add_action(‘transition_post_status’, ‘send_new_post’, 9876543210, 3); function send_new_post($new_status, $old_status, $post) { if(‘publish’ === $new_status && ‘publish’ !== $old_status && $post->post_type === ‘product’) { global $wpdb; $current_product_id = $post->ID; if(isset($current_product_id)) { $post_id = $current_product_id; } else { $post_id = ‘131’; } $sql = "SELECT post_id as id, (SELECT post_title FROM wp_posts WHERE id = pm.post_id) AS title, (SELECT ..

Read more