WEB SYSTEMS PRO
E-commerce platform
€19.80

* Net price, 23% VAT must be added

SKU:WSP-190-PL
License
Web Systems Pro
Version
3.10.0.2.wsp
Update
10/02/2024
SEO-optimization — advanced module for optimizing an online store for search engines
LicenseWeb Systems Pro
Version3.10.0.2.wsp
UpdateOctober 2, 2024


Examples of variables and constructs for plugin templates.

1. Outputting product tags

{($product.tags|default:[]|sep:', ')}


2. Outputting features

General template:

{$product.features['CHARACTERISTIC_CODE']}

Where 'FEATURE_CODE' is the feature ID (e.g. brand).

Works only for the following feature types:

  • Value selection from list (select): Text;
  • Any ranges.

Display features without HTML tags (relevant for feature type "Color"):

{implode(', ', $product.features['CHARACTERISTIC_CODE']|default:[])|strip_tags}

Display features with HTML tags:

{implode(', ', $product.features['CHARACTERISTIC_CODE']|default:[])|strip_tags}

Product color list:

{foreach $product.features['color'] as $color}
    {$color|strip_tags|strip}
{/foreach}


3. Links to websites

{$wa_app_url}


4. Links to categories

{$wa->shop->categoryUrl($category)}


5. Custom separator during enumeration

For example, you can use a comma or space as a separator. To do this, use the modifier «|sep:' '», you need to register «|sep:', '». Example:

{($product.tags|default:[]|sep:' ')}

All tags will be separated by a space.


6. Link to parent category

{$wa->shop->categoryUrl($root_category)}


7. Category one level higher than {$category}

{$parent_category = $categories[count($categories) - 2]|default:null}


8. Parameters of the category to which the product is linked (product template)

{$category = $wa->shop->category($category.id)}
{$category.params.sample} 


9. Maximum product price

{$category.max_price}


10. Variable prices without the "PLN" prefix

Minimum product price in category:

{$category.min_price_without_currency} 

Maximum product price in category:

{$category.max_price_without_currency}

Current product price:

{$product.price}


11. Checking product type

By ID:

{if $product.type_id == 1} Title dla towaru o typie z ID 1{/if}

By type name:

{if $product.type.name == 'Type name'} Title for products with the “Type name” type{/if}


12. Custom meta tags for categories and products

{$product.meta_keywords} - product keywords
{$product.meta_description} - product description
{$product.meta_title} - product title
{$category.meta_keywords} - category keywords
{$category.meta_description} - category description
{$category.meta_title} - category title


13. Names of all product categories

The variable {$category.name} displays only one category to which the product is linked.

{$product_categories_names = []}
{foreach $product.categories as $product_category}
   {$product_categories_names[] = $product_category.name}
{/foreach}
{$product_categories_names|sep:' '}


14. If there are no products in the category, do not display zero

{if $category.products_count == 0}
    {$products_count = 0}
{else}
    {$products_count = $category.products_count}
{/if}
{$products_count}


15. Sum up product count from subcategories

Paste the following code at the beginning of the SEO template:

{if $category.products_count == 0} 
    {$products_count = 0} 
    {foreach $category.subcategories as $c} 
        {$products_count = $products_count + $wa->shop->productsCount("category/`$c.id`")} 
    {/foreach} 
{else} 
    {$products_count = $category.products_count} 
{/if}

And use the variable {$products_count}. May increase category page loading time.


16. Unique Title tags for first, second, third, and subsequent pages

{if $page_number == 1}
     Szablon Title dla pierwszej strony 
{elseif $page_number == 2}
     Szablon Title dla drugiej strony 
{elseif $page_number == 3}
     Szablon Title dla trzeciej strony 
{else}
     Szablon Title dla kolejnych stron - {$page_number}
{/if}


17. Nested categories

Specify individual levels:

{$parent_categories[POZIOM KATEGORII]['seo_name']}

Full path:

{$parent_category_seo_names = []}
{foreach $parent_categories as $i => $_category}
     {$parent_category_seo_names[$i] = $_category['seo_name']}
{/foreach}
{$parent_category_seo_names|sep:' '}


18. Random value from an array

 {['one', 'two', 'three']|random}


Examples of variables and constructs for design theme templates

1. Display "SEO-name"

{$product = shopSeoViewHelper::extendProduct($item.product)} 
{$product.seo_name}

or

{$product = shopSeoViewHelper::extendProduct($wa->shop->product($item.product.id))} 
{$product.seo_name}


2. Display values of fields {$category.fields[1].value}

{$category = shopSeoViewHelper::extendCategory($category)}
{$category.fields[2].value}    
{$category.fields[3].value}


3. Display original category name

For example, for breadcrumbs (so that plugin does not modify it).

{$category.original_name}


4. Hide additional category description on filter pages

{if $is_seofilter|default:false || count(shopSeofilterFilterFeatureValuesHelper::normalizeParams($smarty.get) == 0)}
    {$category.additional_description|default:''}
{/if}