Jump to content

cyberdoc

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by cyberdoc

  1. ive upgraded my prestashop but after that preview images are not showing up for many of the products.. i noticed that the file tm_home_default is missing for all of these.. on trying to generate these files using regenerate thumbnails i get "Original image is corrupt (public_html/img/p/8/8/8/5/8885.jpg) for product ID 4701 " error Is there any way how i can fix this... bcoz there are more than 1000 products and it'll be very difficult to do anything manually..
  2. ive upgraded my prestashop but after that preview images are not showing up for many of the products.. i noticed that the file tm_home_default is missing for all of these.. on trying to generate these files using regenerate thumbnails i get "Original image is corrupt (public_html/img/p/8/8/8/5/8885.jpg) for product ID 4701 " error Is there any way how i can fix this... bcoz there are more than 1000 products and it'll be very difficult to do anything manually..
  3. Hi guys, im trying to develop a custom payment gateway module for bitcoin payments on presta. The process goes as under. ive listed it as a gateway. when the user chooses it, i redirect him to a page on my gateway server where he's shown a barcode. He scans the barcode and make the bitcoin payment. Then ive another page on my server which tells presta the status of the user activitiy. (its called listening.aspx) and it returns a JSON response (PAID: if user has paid/EXPIRED: Timeout/ AWAITING : waiting for user activity) So what i need is after i redirect user to my server for showing barcode for payment, my prestashop should check this status every 10 seconds and if it has changed to paid or expired update the order respectively.. I've come up with the following code for this, (am a newbie and excuse me if its lame...) Hope to get some help soon on how to proceed. $order_id = $this->module->currentOrder; if (!$order_id) { Tools::redirect($this->context->link->getPageLink('history'), true); } $price = (float)$cart->getOrderTotal(true, Cart::BOTH); //Get url of payment and listening page for the transaction $json = file_get_contents('http://old.kbourbaki.com/xapiserverprestashop.aspx?servicio=rfp&keyapi=abc1234efg&importe=248,64&orden=uvw234xyz'); $obj = json_decode($json); $paypage = $obj->paymentpage; Tools::redirect($paypage); while($endloop==0) // till a response is received { $json = file_get_contents('http://old.kbourbaki.com/xlisteningpageprestashop.aspx?yyyyyyy'); $obj = json_decode($json); $result=$obj->response; //response of server listening page echo($result); if ($result=='paid') { return 1; // paid, update presta $end=1; }elseif ($result=='expired' ) { return -1; // timeout, redirect to home $end=1; Tools::redirect('http://www.ahmspro.com/presta'); } else{ return 0; // awaiting response sleep(10); // wait for 10 seconds } } any help would be highly appreciated
  4. Hi guys, am new here and excuse me if this is too basic. Basically what i want is 2 combinations for a product. ill explain with an example. Ive a mobile hardware store. So it has a product(Ex. iPhone 6), with an attribute country (US, UK etc) to select which country the user belongs and depending on the country there are operators to be available(2nd attribute- Vodafone for US, ATT & Verizon for UK, Airtel & Idea for India). How do i make sure, the user sees only the respective operators when he selects a particular country from the attribute dropdown... Waiting for reply, Thanks in advance
  5. How do i determine if the user belings to a particular customer group and then only show him a module block??
  6. Hi Paul, thanks for replying. yes i did see that module bt actually i want some customizations as mentioned so i'm more into favour of customizing the official wishlist block, instead of buying this and then again modifying it.
  7. I guys i'll explain the functionality i'm trying to achieve. I will have two types of users on my site. The students and parents. I want that if the user is a student, he creates a wishlist (using the wishlist module) and send to parent etc. Now if the user is a parent , he has a option to select a pre-created wishlist directly(Books for Grade 5) etc.. Any suggestions on how to proceed would be great.. Also one question does the wishlist module of presta have the ability to autodetect once a wishlist item is bought??
  8. trying via phpmyadmin na? did it that works na i said above..
  9. hi thanks for ur reply. i tried the directly phpmyadmin way already and it works nicely. its only when im using these variables. and the stramge this is if i echo sub_total before executing the sql code , it also outputs proper value just in the statement its not being passed. cant figure whats wrong in the syntax..
  10. Hi guys, sorry for such a silly php query but tried too much and not working. Am missing something silly. $sub_total = $result['textarea']; $newpro=$result['mainid']; echo ($sub_total); $result = Db::getInstance()->Execute('UPDATE `'. _DB_PREFIX_ .'product` SET `price` = ' .$sub_total. ' WHERE `id_product` = 9'); i use this query to update the product table. now the echo sub_total gives the correct value(10) but the sql is not run with the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `id_product` = 9' at line 1 UPDATE `ps_product` SET `price` = WHERE `id_product` = 9 now from this it seems no values is being passed for sub_total but how and why this could happen
  11. Hi, guys can any1 guide me on the hook i need to use to run a piece of code everytime any modifications in the products of cart is done(addition/deletion of product/increase of quantitiy). i tried hookactionCartSave but it seems thats not the correct one. Im using 1.6
  12. i think a way would be to write a module, which generates a form with a textbox for comment on each product. and hook it to displayshoppingcart to show it. then when the user enters comments, save them to the custom field you create in the orders table.. just one way to go..
  13. Ok for anyone curious, i solved it. basically to update in the cart you need to update values both in the Ps_prduct and ps_product_shop table... Silly mistake but yeah someone may also miss it like i did!
  14. You can do this by updating the order-opc.tpl file (edit the code to place shipping as you want). for autofilling the form and all you will need to code a little..
  15. But, the strange thing is it has something to do with the products.js file. if i again replace the original products.js(without the fix) the menus is restored back!! so currently am stuck between choosing the menu or correct product prices..
  16. yes and marked as solved too!!
  17. fixed it... Here is the code!! if(isset($_POST['install'])=='on') { echo($_POST['install']); $params['cart']->updateQty(1, 9); $params['cart']->update(); header('Location: '. $_SERVER['PHP_SELF']); exit(); } return $this->display(__FILE__, 'views/frontend/sample.tpl'); }
  18. any help guys? i've checked that when the previous value in the db is 10 and the code updates it to 15, then also in the cart its shown as 0....
  19. basically i change the product price as per the other items in the cart.. so ive added a hook at displayshopping cart and get the products list from there, calculate the price as per that then update the price of my product via sql query. finally i add this product to cart using updateqty.. below is the code.. $cookie = $this->context->cookie; $sub_total=0; $products = $params['cart']->getProducts(true); // print_r($products); // print_r($cookie); foreach ($products as $product) { $result = Db::getInstance()->getRow('SELECT textarea FROM `'._DB_PREFIX_.'belvg_samplemodule` sample WHERE sample.`id_product` = '.$product['id_product']); // print_r($product['id_product']); $sub_total = $sub_total + $result['textarea']; } $result =DB::getInstance()->Execute('UPDATE `'. _DB_PREFIX_ .'product` SET `price` = ' .$sub_total. ' WHERE `id_product` = 9'); $params['cart']->updateQty(1, 9); $params['cart']->update(); 9 is the product id of my product..
  20. just noticed it was the echo!! so i did the changes and it comes back to its position but POST not working correctly now it seems...
  21. Nice idea.. one approach could be to use two hooks , when the admin opens a product to edit and when he updates it. save the last value in a variable and if a change is there, add into the table accordingly.. Just a suggestion of my approach
  22. Hi, i need to change the price of a product at runtime according to a complex calculation..now i update it successfully in the Ps_product table. but after the addition to cart it still shows 0(old price). Any idea why? is there another place i need to update this?? PS : ive checked in the db the changes are occuring
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More