Send Order Confirmation automatically to customer’s mobile number

This is an e-commerce plugin called Woocommerce, you need to read up on their hooks, such as woocommerce_new_order here. The code you pasted would usually go inside the active theme’s functions.php. All the themes are located in wp-content/themes, you can easily check which theme is active in the admin dashboard under Appearance -> Themes in … Read more

Zoho subscription API to WordPress [closed]

If you believe that there won’t be frequent changes to the plans and addons, you can hard code the HTML pages displaying the plans and addons for your customer to select. Once the customer selects the plans and addons, you can use the Plan Specific URL in to embed the Zoho Subscriptions’ checkout page. https://subscriptions.zoho.com/subscribe/{{encryptedID}}/{{plan_code}} … Read more

Rest API does not work after changing WordPress Theme

I manage to solved it by adding this code (at the bottom) to the YOUR BLOG THEMES my path : wp-content/themes/MYWPTHEME/function.php function ws_register_images_field() { register_rest_field( ‘post’, ‘images’, array( ‘get_callback’ => ‘ws_get_images_urls’, ‘update_callback’ => null, ‘schema’ => null, ) ); } add_action( ‘rest_api_init’, ‘ws_register_images_field’ ); function ws_get_images_urls( $object, $field_name, $request ) { $medium = wp_get_attachment_image_src( get_post_thumbnail_id( … Read more

How-To: Get meta data from the users last order in woocommerce

First thing is to grab the last order ID, you can do it with a simple WP_Query $args = array(‘post_type’=>’product’, ‘posts_per_page’=>1, ‘orderby’=>’ID’, ‘orderby’=>’DESC’); $query= WP_Query($args); As this will only give only one result, you don’t need to loop the result, $order_id= $query->posts[0]->ID; Now, you can reach the order data, $order = WC_Order($order_id); You can use … Read more

Get value of a key from a Plugin Serialized array

Just found about plugin_api and using it, the above can be achieved with just below code: /** If plugins_api isn’t available, load the file that holds the function */ if ( ! function_exists( ‘plugins_api’ ) ) require_once( ABSPATH . ‘wp-admin/includes/plugin-install.php’ ); /** Prepare our query */ $call_api = plugins_api( ‘plugin_information’, array( ‘slug’ => ‘i-recommend-this’ ) … Read more

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