• We have designed a new site to replace an existing one. The previous site used URLs containing the product ID to link to specific products. For example, /shop/GUFC56912.

    I am creating URL Rewrite rules so that the old URLs will still resolve, but the new site (WordPress 3.5.2 w/WooCommerce) uses slugs based on the product title, not the product ID. It will require many more rules in .htaccess if I have to translate product IDs into product titles.

    What I need to know is if there is a way to display a WooCommerce product by its sku so that I can do a permanent redirect to the new product page. If I can load a product page on the new site by its product ID I will only have to create a single rule in .htaccess.

    Is it possible to link to a WooCommerce product by its sku? Any examples? ??

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter rwkiii

    (@rwkiii)

    As a side thought, if it isn’t possible to specify a product sku in the URL directly, possibly I can refer to a page template with the sku specified in the querystring, like:

    /product-by-sku.php/?sku=ABC1234

    Then the template could determine the correct slug based on the sku?

    If it isn’t possible to specify the sku in the URL directly can anyone give me an idea on how to get the slug by sku using PHP?

    Btw, the sku will be for variations.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Possible to link to product detail by sku?’ is closed to new replies.