John Davidson

php - is there anyway to create link for specific products in shop page wordpress woocommerce?

0 comments
Message:


I am trying to find a way to create a link to my shop page in woo commerce WordPress


for example, let's say I have 10 products


target products: 1, 3


and I want to send my friend a link that has two products (1,3) I want to show him.
so is there any way to create a link like that



www.mywebiste/shop/product-1,product-2



if that idea doesn't work, can you share with me some opinions that would help me?



My Answer:
Yes, you can create a link to specific products in your WooCommerce shop page by using the product IDs in the URL. Here's how you can do it:

1. Find the product IDs of the products you want to link to. You can find the product ID by going to your WordPress dashboard, navigating to Products > All Products, and hovering over the product title. The product ID will appear in the URL at the bottom of your browser.

2. Once you have the product IDs, you can create a link to your shop page with the specific products by adding the product IDs to the URL. For example, if the product IDs are 1 and 3, your link would look like this:
www.mywebsite/shop/?add-to-cart=1,3

3. When your friend clicks on this link, they will be taken to your shop page with the specified products added to their cart.

Alternatively, you can create a custom link to a specific product page by using the permalink of the product. You can find the permalink of a product by going to Products > All Products, clicking on the product title, and copying the URL from the address bar.

I hope this helps! Let me know if you have any other questions.

Rate this post

4 of 5 based on 9418 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us