How to find the selected currency id in woo-commerce.I want this id to show on my WordPress page.Is there is any function in woo-commerce through which i can find the id.
woocommerce store his currency in wp_options table.
SELECT *
FROM `wp_options`
WHERE `option_name` = 'woocommerce_currency'
this will show you the currency symbol like USD, you can get it with get_option('woocommerce_currency'). I am sure that is what you want.
OR
take a look on this documentation http://docs.woothemes.com/wc-apidocs/function-get_woocommerce_currencies.html
Related
I simply want to raise the price of all products and product variations in the category "T-Shirts" by 10%.
I have seen this question Woocommerce MySQL to update price of products in specific category
But therefore I need to find out the term_taxonomy_id of the category.
How do I achieve that?
Wordpress/Wocommerce DB structure is a mess.
I am working on a Woocoomerce site with many categories.
I have to add some text at the end of the categories (suffix) slug. Like "klm".
How to change product category slug in bulk in Woocommerce?
For example,
Furniture > Kitchen Furniture
The permalink for the category is as follows:
"kitchen-furniture"
What I want to do is add a new text (suffix) to the end of all (main category or subcategories).
For example,
"kitchen-furniture-klm"
Yes, this can be done from wp-admin>Products>Categories. However, as I said at the beginning, there are many categories.
There are 22 pages of entries for categories on Stackoverflow. I've looked at almost all of them. However, I couldn't find what I was looking for. I would appreciate if someone could guide me where to start.
Note: Please take database backup before execute following update query
You can do this in database, using following query
UPDATE wp_terms SET slug = CONCAT(slug, '-klm') WHERE term_id IN(SELECT term_id FROM wp_term_taxonomy WHERE taxonomy = 'product_cat')
I am new to Wordpress.
I am studying an already made site which has WooCommerce plugin.
Well, please see this image which shows a product list:
I have spent some hours trying to find where products and categorÃes are stored. There is not a product table neither category table neither a database table with similar names.
I have also exported the whole database in SQL format and then trying to find the product name or category name, but I could not find them.
Any one can point me to the right direction?
Thanks
Jaime
Woocommerce products are stored in wp_posts table with post_type column value as "product" and "product_variation".
Any additional product data will be stored in the wp_postmeta table.
The product categories and tags both are stored in the wp_terms table and can be identified as a category or tag based on its data in the wp_term_taxonomy table where it stores the product_cat value in the "taxonomy" column.
I have more than one category name in the post and I want to change specific primary category name to be normal category and then normal category to be primary category.
Let's say I have sponsored category and fashion category. So, I want to switch fashion category to be primary category because I do not want to show /sponsored/ in the URL.
Take Note: I have thousand of posts and I cannot switch the category name manually.
Using SQL and PHP you can run a foreach loop with all posts id that need to be updated.
A good starting point is an Excel file with all posts and its category ids that will be set as primary, so convert the spreadsheet to a json file to use in the PHP loop.
Below is the SQL query to do this:
UPDATE wp_postmeta SET meta_value = $new_primary_id WHERE post_id = $post_id AND meta_key = '_yoast_wpseo_primary_category';
Where $new_primary_id is the id of the category that will be set as primary, and $post_id
is the post id that will be updated.
If you using Yoast SEO Plugin there is the solution for you check here.
https://wordpress.org/support/topic/bulk-change-primary-category/
I'd like to set a specific Tax on each product.
I see i can create tax classes, but i'm going to have many different taxes, one per product, on more than 300 products.
Is it possible to set the tax % on the product page when i create it ?
Do you know a plugin for that ?
What want to do is to calculate Tax Based On SKU and not shipping address.
So i need to have a field on product page where i can enter a TVA number, manually.
Do you think it's possible ?
OR an other way maybe :
- have one taxe class
- in the tax class add many taxes rates with all the same country code, and no zip code
- create a field in the product page to assign the right tax rate for the product (instead of assign a class rate)
What do you think about that ?