Woocommerce Permalinks - php

I am trying to achieve the following Woocommerce permalink structure:
Shop Base:
"www.domain.com/shop"
Product Base:
"www.domain.com/shop/%product_cat%/%product%"
Category Base:
"www.domain.com/shop/%product_cat%"
However, for example, when I navigate to "www.domain.com/shop/tshirts", WordPress redirects me to a url "www.domain.com/tshirts" instead of "www.domain.com/shop/tshirts".
(Take note: I do have a page at the url "www.domain.com/tshirts" giving information on all of the different types offered, materials, designs, etc. However, the product category should not redirect here, it should be "www.domain.com/shop/tshirts" where the customer can see all "tshirts" in the category "tshirts" for sale.)
Am I doing anything wrong, or is this permalink structure prohibited by Woocommerce and WordPress?
Thank you.

Based on this you cannot set both product and categories permalinks to the same structure. The last note is:
Please note: The product custom base should not conflict with the taxonomy permalink bases. If you set the product base to ‘shop’ for example, you should not set the product category base to ‘shop’ too as this will not be unique and will conflict. WordPress requires something unique so it can distinguish categories from products.

Visit "General" -> "Permalinks" section in your admin panel, There you can see the shop based permalink below.

Related

Woocommerce single product

I am making an e-commerce website with wordpress and there are a few things that are stressing me. I would like to have a custom single page for each product category. How do I do that?
You can create a new page on Wordpress, and add a shortcode there:
[product_category category="category-slug"] - just replace the "category-slug" with the category slug of yours. You can view the slug at Product > Categories in the admin menu.
This shortcode will display all products in a specified category. You can repeat this and create as many pages for as many categories as you want.

Alternative URL for shop in WooCommerce

I am having an eCommerce shop based on wooCommerce Platform for WordPress. If I access the shop page like http://mysiteurl/shop then it shows the available product list.
My requirement is to have an alternative URL of shop for sponsors like http://mysiteurl/shop/sponsor/sponsorname. I need this link to track which order is sponsored by which sponsor, so that I can give appropriate commission to my sponsors.
I don't have too much knowledge of php/wordpress/woocommerce but after doing some R&D I am able to create alternative URL for shop as required by URL rewriting. For URL rewriting I have done following code in functions.php under theme folder.
add_action('init', 'custom_shop_sponsor');
function custom_shop_sponsor() {
add_rewrite_tag('%sponsor%','([^&]+)');
add_rewrite_rule('^shop/sponsor/([^/]+)/?$','index.php?
pagename=shop&sponsor=$matches[1]','top');
}
After doing above code I am able to access the shop page with desired URL like http://mysiteurl/shop/sponsor/sponsorname but on this page no product list is coming. It is just showing text "Showing The Single Result"
Why are products not coming? Also please suggest any if any other solution exist for my requirement.

WordPress Custom URL with Permalinks

now i want to use standard url Like http://localhost/websitename/categoryname/
while passing value in href, in wordpress
Hi i have two table one is category and another is product in admin panel
i insert category and sub category and insert product according to category.
in front-end i displaying subcategory under category and now want when anyone click
on subcategory it will redirect in to next page such as
http://localhost/websitename/categoryname
in this page display all product under particular category.
Right now using ?id=125 and aacording to this particlar category id product are
displaying
how can i cahnge url
Go to settings-> Permalinks and then custom, paste this:
/%postname%/

Woocommerce: Showing Categories on every page

I am using the woocommerce plugin for a wordpress site. The categories of the shop should be listed on the left part of the page and the categories on the right side.
When the shop page first loads, it is displayed as above. Which is good. When I click on the category it only shows the products and not the categories.
Is there an easy way to get the categories on every page?
You can edit your category and set Display type to Both.
Default setting can be set in Settings page under Catalog tab.

wordpress woocommerce, showing a single specific product and its options on homepage

For a reference of the website i am developing you can view it here: http://prettyloxx.netii.net/
I am creating a ecommerce website using wordpress and woocommerce together in a theme
that i added the woocommerce support to. it would's great but however i am a little stuck.
What i would like to do is to place a single specific product on the bottom of the homepage with its options.
So ideally, i would for example like to add a single product such as http://prettyloxx.netii.net/?product=wefts on the homepage after the homepage content, howevere without the product's description. So on the hompage the user would see the attributes and options as well as the product image at the bottom of the page, select them and then click on the checkout button directly from the homepage.
Thank you in advance,
You can add [product id="99"] or [product sku="FOO"] Shortcode for specific product to add your homepage. Or if you want feature products then woocommerce gives the shortcode [featured_products per_page="12" columns="4"] for that. Hope those will help you.
Here we can use Id of single woocoomerce product ,
[product id="42632 "]
and for sku
[product sku="examplesku"]
and we can show products of a specific category
[products columns="3" category="solar-lantern"]
In above shortcode just pass the slug of the category and products are shown of this specific category

Categories