WooCommerce add_to_cart url not working [closed]

So I ended up making a workaround because I still have no clue what’s happening. I changed the url to point to the product page and I’m using ol’good PHP to get the values and add the product with WooCommerce API. Here’s my code: if(isset($_GET[‘order’]) && $_GET[‘order’] == ‘true’) { $typo = isset($_GET[‘attribute_pa_typographie’]) ? $_GET[‘attribute_pa_typographie’] … Read more

Woocommerce custom taxonomies page

After digging all over the place, it really was as simple as adding theme support. Go figure, just add the following: //Adding theme support function mytheme_add_woocommerce_support() { add_theme_support( ‘woocommerce’ ); add_theme_support( ‘wc-product-gallery-zoom’ ); //Only if want woocommerce built in add_theme_support( ‘wc-product-gallery-lightbox’ );//Only if want woocommerce built in add_theme_support( ‘wc-product-gallery-slider’ );//Only if want woocommerce built in … Read more

WooCommerce Shop Page Not Found 404

What you’ve done here is changing slug for products. For example : http://localhost:8080/shop/product-category/sample-product as explained in WP, but not your Woocommerce home. Change the base to base default in permalinks settings. Then read after 🙂 If you want to change your “Shop Homepage” go to http://localhost:8080/wp-admin/admin.php?page=wc-settings&tab=products&section=display That’s the good way to do it !

WooCommerce change price in cart [closed]

So the answer to this is instead of placing the code in your functions.php, you create a “woocommerce” folder in your theme folder, and place the “cart” folder and the “cart.php” template file from the woocommerce plugin inside of that. Then you place the same code as in the “woocommerce_before_calculate_totals” action inside the loop of … Read more

change billing and shipping address 1 and 2 field placeholders [closed]

Prior to the address fields being passed through the woocommerce_checkout_fields hook, they are retrieved by WC_Countries::get_address_fields(), and inside that function there is a comment before its filter that reads: Important note on this filter: Changes to address fields can and will be overridden by the woocommerce_default_address_fields. The locales/default locales apply on top based on country … Read more

Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]

The following hooked functions will allow you to make everything purchasable: // Change all products stock statuses to ‘instock’ add_filter( ‘woocommerce_product_get_stock_status’, ‘filter_get_stock_status_callback’, 10, 2 ); add_filter( ‘woocommerce_product_variation_get_stock_status’, ‘filter_get_stock_status_callback’, 10, 2 ); function filter_get_stock_status_callback( $stock_status, $product ){ return is_admin() ? $stock_status : ‘instock’; } // Enable backorders on all products add_filter( ‘woocommerce_product_get_backorders’, ‘filter_get_backorders_callback’, 10, 2 ); … Read more

Append a term to WooCommerce product existing product category terms

You just need to add a missing boolean argument in wp_set_object_terms() function like: wp_set_object_terms($post->ID, $term->term_id, ‘product_cat’, true); This time the term will be appended and not replaced. You should check that the term doesn’t exist yet on the product, before appending it like: add_action( ‘transition_post_status’, ‘new_product_add’, 10, 3 ); function new_product_add( $new_status, $old_status, $post ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)