When a vendor is added to the site, WCMp creates a shipping class of that vendor. So, that the vendor can only add their own shipping class. For example, suppose Vendor A is added in the site and WCMp creates a shipping class called ‘VendorA’. So, all the products of that vendor will have ‘VendorA’ […]
Some of our users have asked us how to remove the Vendor’s Shop page. There is no such option to remove vendor shop page, as our vendor shop page is nothing but taxonomy page, like category, tax. Hence, when a vendor will be added to the site, their shop page will be created. So, as […]
Sometimes it is needed for our users to add new tab in the “Add Product” page. This blog is to help them how to add the custom field, save the value and display that in the Single Product Page also. Custom add-ons fields The first code snippet is to add new custom tab in the […]
Setting up taxes and tax rates is one of the first tasks you want to perform when setting up a store. However, the tax calculation gets carried out by WooCommerc. This document might help you further in how WooCommerce handles the tax : Therefore, the tax will be either calculated as per admin’s location or […]
Ummm… What do I understand by queries anyway? And how do I know if I need this or not?
Let’s try and get the concept cleared.
I am hoping you are aware of the fact that all the pages, posts, users, categories or rather any soft data entered in your website are stored in your databases. Your data are not dumped in one single place, they are rather segregated into tables of a database. Queries are requests that a developer makes to a database asking it to return the values stored in its tables.
Coming down to WordPress, simple functions like get_posts(), get_post_meta(), get_user_meta(), get_terms() etc. all make queries to your database asking them to return the posts that you saved, or metadata of a post you created, categories or users and their metadata.
For a basic example, when I pass get_user_meta( 35, ‘first_name’, true), I am basically asking hey! `wp_usermeta` table from the database `my_database_name` ( whatever was set in your `wp-config.php` file ), return the first name of the user with 35 ID number.
Now, coming down to WCMp, you will know you need to modify a query when you are not really satisfied say, for example, with the way vendors are displayed or you wanna fidget around the categories/ tags provided to the vendor when they submit their products or the way WCMp widgets are displaying vendors or their product categories or something similar to that.
That is when you will need to MODIFY QUERIES and the good news is: We have Hooks and Filters for those.