Jump to content

luthfifr

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • First Name
    Luthfi
  • Last Name
    Rahman

luthfifr's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I also have a problem with execute() function. I have a query that looks like this: $sql_addr = "SELECT a.id_address FROM pspf_address a JOIN pspf_customer b ON a.id_customer=b.id_customer WHERE b.email=".$_POST['customer_id']; if($results = Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute($sql_addr)){ $addrID = $results; } else { $addrID = "0"; That SELECT query should return a result with 1 column and 1 row with value of 5 (I tried the query in phpmyadmin). But when it is executed in my php file, it returns value of 1. What did I do wrong? Thank you.
  2. Oh I see, that's why the onchange function always disappear. I already edited my js file as you suggested but still, it's not working. I tried 2 ways to include it in CMS page, via cmscontroller.php and cms.tpl, none of them make my js works in my CMS page. I just want to make a simple function, show a div if value of an input >50 and hide the div if it's <50. Why does such a simple function be a pain in the a** in prestashop Do you have any other idea? I will try it as soon as I already done with this js problem. Thank you for your suggestion
  3. Finally, there 2 people who want to help me thank you so much, guys. Yes, what I mean by custom page is CMS page. I already put the css file and js file in correct directory. Yes, where should I put the php file? I already test it in pure html file, it's working, and the javascript is included. I also already put $('document').ready(function(){} in my js file. What make me confuse is, the "onChange='()'" function is disappear everytime I save the CMS page. How to make it not disappear from the CMS page?
  4. nobody cant help me in this forum? I thought this forum was active.
  5. Hi, I'm a newbie in prestashop. I use prestashop 1.6. I want to make a form in custom page that within the form there will be a hidden/shown field depends on another field value. To make it clear, here is the example: I want to hide or show the "upload image" div depends on "Masukan jumlah yang ingin dipesan" field (quantity field). If it is less than 50, the "upload image" div will be hidden, otherwise, if it is more than 50 the "upload image" div will be shown. I know how to do this by using "onchange" event listener. The strange thing is, I already typed "onchange" event listener in my source code block, and then when I save the custom page, it is gone. As if prestashop don't want to save my "onchange" event listener. I already searched the topic in this forum, but I cant find any similar topic. Is there anyone here who can help me? Note: I already put the javascript file that contains the function that will be executed in "onchange" event listener on themes/mytheme/js/autoload, and I put the css file for the hidden/shown class rules on theme/mytheme/css/autoload.
×
×
  • Create New...