Jump to content

Raullara

Members
  • Posts

    11
  • Joined

  • Last visited

1 Follower

Profile Information

  • Location
    Spain
  • Activity
    Web development agency

Raullara's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Seems like it was a option problem, i change the option to shop traffic and is working fine now.
  2. Hello everyone, I installed the module called CronTab, i want to execute my custom BO module to import products via xml. The basic config of this module brings an option to test the cron run. I cannot even execute successfully the test and i don't know how to solve this. See the photo attached. All i did was click on server contrab, activate the test job and wait.
  3. Hello again! like every day, one new problem. This time it is a products visualization problem, my module has to modify the active product state if the stocks goes to 0. I'm watching the ps_product table, and the active field change to 0 when i click this option. But the problem is something else change, and i don't know where. view attached photos. sumary.... My module change the active field to 0 when the stock is 0, but the active button on the CSM do not change. So i have to modify not only this active field on ps_product table. Thanks in advance. Okay solved - the table ps_product_shop also have the active field and need to be changed
  4. Hi everyone again, Now i have a simple question, im trying to organize my code in my module, and i want to do my own functions, but no matter how i create and call the functions, is not working. public function __construct() { public function install() { public function unistall() { public function displayForm() { public function myTest() { $output = null; $output .= $this->displayError($this->l('test')); } public function getContent() { $output = null; if (Tools::isSubmit('submit' . $this->name)) { $this->myTest(); $output .= $this->displayError($this->l('test')); ETC ETC. As you can see, i have the normal methods, and my own method called myTets(). In the getContent method, i have the call to my method, folowed by the same line i have in my method. One is showing, the other not. I think i'm not doing anything wrong, just calling the function. Thanks in advance as always!
  5. Okay, with the help of this console ( i wasn't using it , sorry about that, im pretty new on developing on prestashop) its okay The problem was just the query, the name of the table was ps_ps_name, were 2 WHERE clauses etc. now works fine.
  6. Hi Everyone, Im trying to do an update on ps_stock_available table, i'm doing it this way. The first i do is read the xml file where i have the data i need foreach ($xml->children() as $products) { foreach ($products->children() as $product => $data) { $id_product = $data->id_product; $id_product_attribute = $data->id_product_subcategory; $stock = $data->stock; // STOCK DISPLAYS CORRECTLY $output .= $this->displayConfirmation($this->l($stock)); // DATA DISPLAYS CORRECTLY // $output .= $this->displayConfirmation($this->l($id_product)); // $output .= $this->displayConfirmation($this->l($id_product_attribute)); // $output .= $this->displayConfirmation($this->l($stock)); // IS THE UPDATE EXECUTED CORRECTLY? my module do not crash Db::getInstance()->update('ps_stock_available', array( 'quantity' => (int)$stock, ). 'WHERE id_product = ' . $id_product . 'AND id_product_attribute = ' . $id_product_attribute); } } Thanks a lot in advance
  7. Solved, the problem was the files are created in the admin folder, the path was set on root, next to the php file, but prestashop execute the module from there. so i set an absolute path.
  8. Hi again and thanks in advance. I'm trying to write an xml file with information of my shop's products from my custom module. I was trying a simple code to write an xml, but is not working. After that i tried to do it on the index.php in my local folder and it works. maybe my local prestashop has no permissions to write? i did the chmod 777 to the whole folder here's the code.... $xml = new DOMDocument("1.0"); $root = $xml->createElement("data"); $xml->appendChild($root); $id = $xml->createElement("id"); $idText = $xml->createTextNode('1'); $id->appendChild($idText); $title = $xml->createElement("title"); $titleText = $xml->createTextNode('"PHP Undercover"'); $title->appendChild($titleText); $book = $xml->createElement("book"); $book->appendChild($id); $book->appendChild($title); $root->appendChild($book); $xml->formatOutput = true; $xml->save("mybooks.xml") or die("Error");
  9. Hello everybody again, I'm trying to get the data from the product table and i'm having this problem. I'M NEW ON PRESTASHOP DEVELOPING!!!. well, this is my code. $sql = 'SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'product'; $totalShop = Db::getInstance()->getValue($sql); $output .= $this->displayConfirmation($this->l("print sql ". "((($sql)))" . "number of products (" . $totalShop) . ")"); Well, im doing a simple count and im getting 7, this is okay, but now i want to get the data, i change the SQL by $sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'product'; (it works fine on phpmyadmin) How can i get the data from the SQL? Using getvalue also? or this just will return the number of rows? Thanks for your time. I solved the problem using the executeS function.
  10. Hello everyone, i have a few questions i couldn't answer myself reading prestashop official documentation. Im trying to add a new back-office tab to use my custom module, my problems are basically where do i have to put the files, and what files do i have to use. I'm gonna explain myself.... My actual module is really simple, just an example to check if works or not. I could install it, so i think it works correctly. My module will "I suppose.." update products on a shop via XMl files. I'm really new on prestashop development, and i'm kinda lost. I did something like this on JAVA development but obviously is not the same hehe. i've been 2 days reading and reading prestashop documentation. Any advice? Thanks very much and sorry if anything of my english is wrong. BTW, i was following this guide http://doc.prestashop.com/display/PS14/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-Creatingthemodule'sback-officetab,anditsclass Now im getting a full screen blank page when i click the new menu tab.
×
×
  • Create New...