veltors Posted September 29, 2020 Share Posted September 29, 2020 Hello. After changed the product price meta title prices remain same i mean when you give a link or on the page Meta Title the prices are different. Isnt there any way to change it automaticly? Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 This is complete nonsense. This is not the right solution. Leave the meta title in the product administration without price and add the product price to the tpl template in the head meta. Link to comment Share on other sites More sharing options...
veltors Posted September 29, 2020 Author Share Posted September 29, 2020 Yep . Thank you too much. This is no slutuion anyway can make this manualy. 😞 Via whatsap asking price when you give link it seems automaticly wiyhout going to link. Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 Glad to help. But first in about 4 hours. Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 Hi, meta title = product name ? Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 (edited) Add price to page (open graph protocol) meta title: ./themes/classic/templates/catalog/product.tpl (change classic to your theme) 1. find <meta property="og:title" content="{$page.meta.title}"> 2. replace to (price with tax) <meta property="og:title" content="{$page.meta.title}{if $product.show_price} - {$product.price_amount} {$currency.iso_code}{/if}"> or 2. replace to (price without tax) <meta property="og:title" content="{$page.meta.title}{if $product.show_price} - {$product.price_tax_exc} {$currency.iso_code}{/if}"> =================================================== If you want the meta title to be automatically generated from the product name, edit the codes as follows: 1. find <meta property="og:title" content="{$page.meta.title}"> 2. replace to (price with tax) <meta property="og:title" content="{$product.name}{if $product.show_price} - {$product.price_amount} {$currency.iso_code}{/if}"> or 2. replace to (price without tax) <meta property="og:title" content="{$product.name}{if $product.show_price} - {$product.price_tax_exc} {$currency.iso_code}{/if}"> Edited September 29, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 (edited) Add price to page meta title: ./themes/classic/templates/catalog/product.tpl (change classic to your theme) 1. find <link rel="canonical" href="{$product.canonical_url}"> 2. add after (price with tax) <title>{$page.meta.title}{if $product.show_price} - {$product.price_amount} {$currency.iso_code}{/if}</title> or 2. add after (price without tax) <title>{$page.meta.title}{if $product.show_price} - {$product.price_tax_exc} {$currency.iso_code}{/if}</title> =================================================== If you want the meta title to be automatically generated from the product name, edit the codes as follows: 1. find <link rel="canonical" href="{$product.canonical_url}"> 2. add after (price with tax) <title>{$product.name}{if $product.show_price} - {$product.price_amount} {$currency.iso_code}{/if}</title> or 2. add after (price without tax) <title>{$product.name}{if $product.show_price} - {$product.price_tax_exc} {$currency.iso_code}{/if}</title> ======================================================== or another Add price to page meta title: ./themes/classic/templates/_partials/head.tpl (change classic to your theme) 1. find <title>{block name='head_seo_title'}{$page.meta.title}{/block}</title> 2. replace to (price with tax + product name) <title>{block name='head_seo_title'}{if $page.page_name == 'product'}{$product.name}{if $product.show_price} - {$product.price_amount} {$currency.iso_code}{else}{$page.meta.title}{/if}{/block}</title> or 2. replace to (price without tax + product name) <title>{block name='head_seo_title'}{if $page.page_name == 'product'}{$product.name}{if $product.show_price} - {$product.price_tax_exc} {$currency.iso_code}{else}{$page.meta.title}{/if}{/block}</title> Edited September 29, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 When you use {$product.name} in your code, you don't have to change the meta title in the product detail or in the database! If you want to change the name of the meta title in the database for all products, just write a small script, save it in the root of the prestashop and run it from the URL. (file name = update-product-meta-title.php) = URL https://your-domain.com/update-product-meta-title.php Change your-domain.com to your domain !!! <?php require_once(dirname(__FILE__).'/config/config.inc.php'); $get_products = Db::getInstance()->executeS('select id_product, id_shop, id_lang, name FROM '._DB_PREFIX_.'product_lang ORDER BY id_product'); foreach ($get_products as $data) { Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'product_lang set meta_title = '."'".$data['name']."'".' WHERE id_product = '.$data['id_product'].' AND id_shop = '.$data['id_shop'].' AND id_lang = '.$data['id_lang']); } update-product-meta-title.php Link to comment Share on other sites More sharing options...
Guest Posted September 29, 2020 Share Posted September 29, 2020 result: Link to comment Share on other sites More sharing options...
veltors Posted September 30, 2020 Author Share Posted September 30, 2020 Thank you too much will try it and wait about 4 hours. Link to comment Share on other sites More sharing options...
veltors Posted October 3, 2020 Author Share Posted October 3, 2020 Acually there is no problem on computer. The problem wit links i mean on whatsap etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now