2

I'm trying to automate the output of SKU's into the page's title for all my product pages for SEO reasons however I'm struggling on how to go about this.

I'm using SEO lite for outputting page titles and tried the following code:

<title>{title} {if store_product_sku}{store_product_sku}{/if} {site_name}</title>

Which doesn't appear to work as I'm assuming I need a channel:entries tag or store:product tag, however having tried various combinations of these none of these work either, would appreciate any ideas, here's the other code I've tried:

<title>{title}{exp:channel:entries}{exp:store:product}{if store_product_sku}{store_product_sku}{/if}{/exp:store:product}{/exp:channel:entries} {site_name}</title>
1
  • 1
    For the first line you can change store_product_sku to {product_details:store_product_sku} For the second line if {title} works then IMO you are already in the exp:channel:entries so you are already duplicated it. Other way it looks fine. Feb 11, 2014 at 15:10

1 Answer 1

3

I'm going to put my comment as an answer.

For the first line you can change store_product_sku to {product_details:store_product_sku}

For the second line if {title} works then IMO you are already in the exp:channel:entries so you have duplicated it that is why may not work correctly. Other way it looks fine.

Also you can use short tag {sku} so you need to change store_product_sku to sku

1
  • Thanks, I was having the same issue as Nick. I ended up having to use the short tag {sku} as {product_details:store_product_sku} and {store_product_sku} didn't work for me. Jul 10, 2017 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.