Jump to content
  • 0

Problem z małą modyfikacją… chyba małą.


YaboL

Question

Witam wszystkich modyfikuje sobie swój sklep na presta 1.6.0.9 i mam problem. Coś sobie wymyśliłem i siedzę nad tym cały dzień... od strony sql sobie poradziłem to nie problem. Ale php i te inne to nie do końca rozumiem  :(

W module productcomments dodałem tekst, który pokazuje się na stronie produktu i ładnie działa,

problem w tym, że chce żeby ten tekst zmieniał się dynamicznie zależnie od wskaźnika w tabeli. Jak to ugryźć?

 

W pliku ProductComment.php module productcomments w modules dodałem coś takiego



public function getKoment()
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
SELECT id_koment
FROM '._DB_PREFIX_.'koment');
}



W pliku productcomments-extra.tpl w module productcomments w themes dodałem coś takiego:

 



<div>
{if $getKoment = 1}
<p>Tekst1</p>
{else}
<p>Tekst2</p>
{/if}
</div>



ale nie działa......

 

tabela w DB utworzona tak:

 



CREATE TABLE `ps_koment` (
`id_koment` int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


 

W tabeli jest jedna kolumna z jednym wierszem, który zmienia skrypt. Wartości, które się tam znajdują to 1 lub 2.

 

 

No i zero efektów. Może ktoś mi pomóc?

 

Link to comment
Share on other sites

4 answers to this question

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...