Using VBA and VBA-JSON to access JSON data from WordPress API

The JsonConverter is returning a collection of VBA.Collections Scripting.Dictionaries, and Values. In order to understand the output you will have to test the TypeName of all the returned values. The real question is “How to navigate through a json object (or any unknown object for that matter) and access the values within. Immediate Window Using … Read more

Remove category and tag base from WordPress URLs without a plugin?

If you want to remove /category/ from the url, follow these two steps: Go to Settings >> Permalinks and select Custom and enter: /%category%/%postname%/ Next set your Category Base to . Save it and you’ll see your URL changed to this format: http://yourblog.com/quotes/ (Source: http://premium.wpmudev.org/blog/daily-tip-quick-trick-to-remove-category-from-wordpress-url/)

Replace woocommerce_add_order_item_meta hook in Woocommerce 3.4

Updated Since Woocommerce version 3, woocommerce_checkout_create_order_line_item action hook now replace outdated woocommerce_add_order_item_meta hook in a much better way using the new introduced CRUD getters and setters methods: // Save custom data to order item meta data add_action( ‘woocommerce_checkout_create_order_line_item’, ‘tshirt_order_meta_handler’, 20, 4 ); function tshirt_order_meta_handler( $item, $cart_item_key, $values, $order ) { $custom_designer = WC()->session->get( $cart_item_key.’_designer’ ); … Read more

Add a custom checkbox in WooCommerce checkout which value shows in admin edit order

You can do it in 3 steps: Adding the custom checkbox field below the Payment Methods Saving the custom checkbox field when it’s checked in the order meta Displaying the custom checkbox field when it’s checked on the order edit page Here is that code: // Add custom checkout field: woocommerce_review_order_before_submit add_action( ‘woocommerce_review_order_before_submit’, ‘my_custom_checkout_field’ ); … Read more

Dynamically changing navigation links (next and previous) in WordPress via AJAX

First, I want to note that the approach I mentionned in my question is bad according to almost tutorials talking about AJAX in wordpress. So I decided to change it based on the advice of hakre and his link : http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side. In other words, the best way for my situation is to use the built-in … Read more

Add a quantity field to Ajax add to cart button on WooCommerce shop page

Updated on 2021 For WooCommerce versions from 3.2 to 5+, Optimized jQuery code and Removed a quantity bug. Added quantity reset after add to cart. The following custom function is hooked in woocommerce_loop_add_to_cart_link filter hook and adds a quantity input field to each product on WooCommerce archives pages and other product loops. We use here … Read more