PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 27, 2022

[FIXED] How to get the link_rewrite field of a product in another language?

 October 27, 2022     prestashop, prestashop-1.7     No comments   

Issue

I'm using $product->getFieldByLang('link_rewrite', $id_lang). But it always returns the same link_rewrite of the current displayed language.


Solution

Might be because your $id_lang is not the good one or Product object is fully loaded with one language already. Anyway you can solve this in another way :

$product_rewrite = Db::getInstance()->getValue('SELECT link_rewrite WHERE '._DB_PREFIX_.'product_lang WHERE id_product = '.(int) $product->id.' AND id_lang = '.(int) $id_lang);


Answered By - Matt Loye
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing