WooCommerce return 404 on category pages
Under Custom Base where you have used /shop/%product_cat% needs to be replaced with /shop/%product-category% Please see screenshot below:
Under Custom Base where you have used /shop/%product_cat% needs to be replaced with /shop/%product-category% Please see screenshot below:
The problem is that WC_Cart get_shipping_packages() method gives an array of shipping packages and the function wc_get_shipping_zone( $package ) expect to have as argument a unique package. So you need to get only one package, using for example php reset() function like: // Get cart shipping packages $shipping_packages = WC()->cart->get_shipping_packages(); // Get the WC_Shipping_Zones instance … Read more
That worked great! Just added this: ‘meta_query’ => array( array( ‘key’ => ‘_stock_status’, ‘value’ => ‘instock’, ‘compare’ => ‘=’, ) ) Thanks!
If you don’t want to fix this every time WooCommerce updates, just create a filter in your child-theme: function overrule_webhook_disable_limit( $number ) { return 999999999999; //very high number hopefully you’ll never reach. } add_filter( ‘woocommerce_max_webhook_delivery_failures’, ‘overrule_webhook_disable_limit’ );
Try something like this global $product; if ( ! $product->managing_stock() && ! $product->is_in_stock() ) echo ‘<p>This product is out of stock. It can be purchased by custom made order.</p>’;
Here’s my code for creating a subscription — it took a lot of trial and error to figure it all out. Best of luck! function create_test_sub() { $email=”[email protected]”; $start_date=”2015-01-01 00:00:00″; $address = array( ‘first_name’ => ‘Jeremy’, ‘last_name’ => ‘Test’, ‘company’ => ”, ’email’ => $email, ‘phone’ => ‘777-777-777-777’, ‘address_1′ => ’31 Main Street’, ‘address_2’ => … Read more
WP/WooCommerce REST API cart/checkout/order [closed]
Using the [woocommerce_my_account] shortcode, a user will see their account details if they’re logged in and if they’re not logged in, they’ll see a login and registration form. Using the same page title “My Account” for these different users isn’t ideal because a user that has never created an account won’t naturally navigate to a … Read more
Have did some customization. This will help you show parent and child category images. You can later customize this code as per your requirements. $taxonomyName = “product_cat”; //This gets top layer terms only. This is done by setting parent to 0. $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; … Read more
Add this to your functions.php add_action( ‘woocommerce_single_product_summary’, ‘dev_designs_show_sku’, 5 ); function dev_designs_show_sku(){ global $product; echo ‘SKU: ‘ . $product->get_sku(); } This will output the product SKU below the product title. See image below. The product SKU is VERTEX-SLVR.