Custom Post Type to replace Woocommerce products – page not found error

I haven’t tried this myself yet – and I would probably always prefer to go with the default ‘products’ for compatibility reasons… However it should be very well possible to add your own CPT to WooCommerce and then “move” all products to that new CPT. First you’ll have to add a CPT to your WordPress installation that … Read more

Apply a custom WooCommerce order status based on user role

You can use folloeing code to register you custm status and change it when specific user ordered the product: function register_awaiting_shipment_order_status() { register_post_status( ‘wc-pendingwholesale’, array( ‘label’ => ‘Awaiting shipment’, ‘public’ => true, ‘exclude_from_search’ => false, ‘show_in_admin_all_list’ => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop( ‘Awaiting shipment <span class=”count”>(%s)</span>’, ‘Awaiting shipment <span class=”count”>(%s)</span>’ ), ) ); … Read more

Sell access to form [closed]

Probably going to be a custom meta type on the users. During the sign up process to your website use the add_user_meta() function and declare the value as 0. Then as people buy from your shop you’re going to have to find a hook somewhere in WooCommerce (Maybe on the order complete page?) to update … Read more

dynamically create callback functions inside a for loop

Probably you can do it with args: ‘callback’ => benz_new_product_tab_content, ‘args’ => ‘_tabs_content_’ . $y And your function: function benz_new_product_tab_content($param, $args) { global $post; $table = end($args); $benz_tab_content = get_post_meta( $post->ID, $table, true ); if (strlen($benz_tab_content) > 0) { echo $benz_tab_content; } } One alternative is to create anonymous function like this: ‘callback’ => function() … Read more