Jump to content


  • Posts

  • Joined

  • Last visited

andries's Achievements


Newbie (1/14)



  1. hi thanks for the reply It is indeed this function where I am talking about. I just need to know where it is called from. This is the issue I have: when I click on another currency, only the display of the sign changes, and the price is still displayed in the old currency. However when I proceed to the order, the prices are displayed (and converted) correctly at that moment. I have been looking around, but as you mention in product.php, the function displayPrice is called, but the function displayPrice don't call for the function convertPrice. I tried to add this call, and prices were displayed correctly, but when proceeding to the order, it guess it is called again, and the conversion takes place twice. If i echo next to the price the conversion rate, or a var_dump of the $currency object, everything is really as it has to be... I have the feeling that somehow this function convertPrice is no longer called... So I would like to check my code, and see if I didn't remove it anywhere. But I was hoping that someone from PrestaShop or another developer could point me out where the function converPrice should be called...
  2. Hi to all I am really not understanding how the currencies and the conversion of prices are working. From which file/other function is the function "convertPrice", from tools.php called? I don't find it anywhere... Kind regards Andries
  3. I am helping Billy27 on this project. As far as I can see is it only the price display that is incorrect, and not the price itself. When finishing the order, the prices are correct in the backoffice in the correct currency. So I thought I need to change the function displayPrice in tools.php. However when I added the following line: $price = self::convertPrice($price, $currency); ... the prices are shown correctly all over the site, but they are "double" converted when they arrive in the order stage. So I concluded that it might be one of the two following situations: - this line is indeed needed in Tools.php, and I need to adapt the conversion between cart and order - it is only the display that is incorrect, and I need to adapt a function, but apparently not displayPrice(). I hope someone can give us a clue...
  4. Hi I actually found the solution... and it was easy :-) I completely misunderstood how PrestaShop is working (or MVC in general :-)). I just needed to add this line of code into my php script and it does exactly what I want! $cart->addTextFieldToProduct($id_product, $index, $textValue); nice nice...
  5. nobody...? I am really in pain finding a solution, and it is the last part i need to fix...
  6. sorry for all the posts, but I try to clarify some things... To clarify a little more, see the image linked to this post. What we want to achieve is to automate the process of saving a customization field by filling in a unique code, created by Flash, and save it... At this moment we have the following process. The Flash File generates raw image data, and calls a php script. This script does the following steps: 1. Saves the Image to the correct folder (with the unique code as filename) 2. Creates an item for the cart 3. Shows a small summary of the product added Problem is that we need to know which cart item is linked to which image. I hoped to achieve this by adding a customization field, that I could populate and save during the php script ( so I guess between step 1 and 2 ). As I mentioned above, I think I will need to use the product.php script to do this, but I don't see how or which parameters I have to set, or which variables I have to declare...
  7. When I simply add a customization field to a normal product, PrestaShops add a form to save the customization. This is the HTML code: <form method="post" action="/product.php?id_product=1&group_1=16&group_2=14&group_1=16&group_2=14" enctype="multipart/form-data" id="customizationForm"> After saving your customized product, do not forget to add it to your cart. Texts TestField<input type="text" name="textField4" id="textField0" value="aaaa" class="customization_block_input" /> <input type="hidden" name="quantityBackup" id="quantityBackup" value="" /> <input type="hidden" name="submitCustomizedDatas" value="1" /> <input type="button" class="button" value="Save"> </form> * required fields So I assume that saving a customization is done by calling the script product.php, with sending some post and get variables: /product.php?id_product=1&group_1=16&group_2=14&group_1=16&group_2=14 So now is my question, I don't want to show this form, but I want to set automatically the value for textField4, and call the product.php script (the latter I can do :-) ) Any help? I only show the code of the HTML to indicate what I want, I rather would like to stay in PHP...
  8. Hi, I have a customization field for a product. I would like to set this automatically with a generated reference, that I don't want to show to the customer. (this ID is actually generated by a Flash module, so I need to write it away when we add the product to the cart). I am able to hide it in the cart etc, but I don't know how I can set it automatically. I actually have even no clue where I have to start looking. I noticed that when I add it for a normal product the field indeed shows up in the product page, and there is a save button that triggers a javascript that saves this modification. Can someone give me a clue how I can automate the setting of a value? I know the product ID and I know the cart ID and the customizationfield ID, I just don't know how to put it all together.
  9. Thanks for your reply. In the end I modified the cart.php script, so I could include it, and only used the parameters I was sending... I know this is not completely the right way to do it, but I really know nothing about JavaScript, so that was a direction I didn't want to take. Anyway got it working now !
  10. OK I actually think curl is the bitch. He calls from outside... does anyone can please help me in showing how I can call the cart.php script automatically, and sending the necessary post variables with it? thanks in advance !
  11. I am facing the same problem... but instead of using the form I am using curl to call the script "cart.php". I use the Tools::getToken(true) to grab the token ID, but it simply creates a new cart, that is not linked to a customer. Is this Token linked with the current user? Or is it something completely else? Thanks in advance Andries
  12. Hi I am really new to prestashop. We are developping a webshop where it is possible to create a custom product using Flash. Everything works fine, except one thing: adding it to the cart. I am able to add items to the cart, but they don't appear in the front end. In the backoffice I can see that he creates a new cart each time we save the product. The goal is of course to add this product to the current cart. At the moment I call the cart.php script with curl, and send the following parameters: token, id_product, add, quantity_wanted. I have the feeling I am missing some or many parameters (for example the current customer ID, current cart ID, ...) but I don't know where to find the correct values for this. Which method allows me to grab those IDs? And which parameters are obligatory to add correctly an item to a cart? Thanks in advance! Andries Solution: the call from curl is an "outside" call and simply doesn't work. you have to use the Ajax call, or include the cart.php script.
  • Create New...

Important Information

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