Jump to content

Kekeno

Members
  • Posts

    23
  • Joined

  • Last visited

Profile Information

  • First Name
    Webmaster
  • Last Name
    Brinzy

Kekeno's Achievements

Newbie

Newbie (1/14)

1

Reputation

2

Community Answers

  1. Pascal finally put me on the right way to solve this. When you go on the Localization page with your shop selected (Not "all Shops"), find out the "Configuration" fields. There is a "Default currency" with a dropdown to select the currency for the shop, and a box to set this currency as default. If this box is checked (I don't know why, maybe this should be fixed...) : the prices will NEVER be converted because PS thinks this is default so it don't need to be converted. So i unchecked this box, set GBP as currency again, save and all is now working fine !!
  2. No, "ps_product_shop" contains prices for specific shops as there is a "id_shop" field ! "ps_product" contains the "default" prices.. If i change the price of a product in "ps_product_shop" with id_shop=id_uk_shop, it only changes the price of this product for the uk website ! I can write a script to apply the currency on all products but it's a "hard" way to do it
  3. Since i have no news, and i can't fin the problem. I found an other "temp" idea: Should I develop a "mini-script" that will change the prices only for my UK website ? I can change all prices in "ps_product_shop" ? What do you think about it ?
  4. Oh didn't expect that, but there's a Product.php file in the override folder, is there any way that, this may have a link with my issue ? here's the code : public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null, $id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null, $use_customer_price = true) { if ($id_product == 0 && !empty($id_product_attribute)) { $quotation_product = new QuotationProduct((int)$id_product_attribute); if (!empty($quotation_product->id)) { if ($only_reduc) { if ($usetax) return ($quotation_product->final_price_with_tax - $quotation_product->final_price_with_tax_discount); else return ($quotation_product->final_price_without_tax - $quotation_product->final_price_without_tax_discount); } if ($usereduc) { if ($usetax) return $quotation_product->final_price_with_tax_discount; else return $quotation_product->final_price_without_tax_discount; } else { if ($usetax) return $quotation_product->final_price_with_tax; else return $quotation_product->final_price_without_tax; } } } return parent::getPriceStatic($id_product, $usetax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity, $force_associated_tax, $id_customer, $id_cart, $id_address, $specific_price_output, $with_ecotax, $use_group_reduction, $context, $use_customer_price); } No, there's only 1 database for all differents shops. This is what i found too, in smarty.config.inc.php, but no changes again... If you think that my override/classes/Product.php do not affect the price convertion, i'll pm you right after ! Thanks again pascal !
  5. Yes, you're right. Prestashop just print the good GBP symbol, but do not convert the prices.. Whenever i change convertPrice to convertAndFormatPrice, i get a blank page ! I tried to clear cache etc.. same problem, blank page. (I'll investigate this) This was a really good idea, maybe more efficient than changing all {convertPrice...} by {convertAndFormatPrice...} ! But unfortunately, no change... Still the same issue A really big thanks for your help anyway !! You're awesome
  6. Yes, you're right. But if i just change by hand the "convertPrice" in the TPL file, it'll just modify my 'displayed' price on the associated page, so i'll have to change it everywhere (in every TPL file..). And when the customer will have to pay (at the end of his order) it will still be the non converted price, won't it ? I think the problem is deeper than in the TPL file, if you know what i mean :/ Thanks again for your help ! [EDIT] I just saw that some of my products are ok on product page but not in category page.. Here's some real example: Not-Working product : - French website - English website Approximately working product : - French product page - English product page As you can see in the English category page, the "Black display fridge, 78 L" is £ 379, but when you click on it, it becomes £ 276,33 and when you add it to cart, it goes back to £ 379... I can't understand where this issue comes from ! [/EDIT]
  7. I solved my problem ! You can get the prices of products thqt you want by "playing" with the arguments of the function Product::getPriceStatic() I just put '1' for the $id_cart argument ! Thanks for your help sandipchandela !
  8. No changes on the FO product page... But in fact, i don't want the "displayed price" to change but the real price. As if i change convertPrice to toolsConvertPrice, it'll (maybe) change the displayed price but at the end, the customer will pay the "not displayed price"... I told about the 'convertPrice' on the product page to get back to the source and understand what's going on... This issue is weird, because prestashop understand the currency but just don't want to convert my prices ! Thanks for the help Pascal.. To be continued
  9. Ok this is nearly perfect, now i just have to do the convertion by hand ! Thank you very much for helping me ! If someone knows an other way to do it, i'm here to take the solution (something like "Product::getPrice($idProduct)" that will give me directly the final price with reductions) [EDIT] after few tests, getByProductId(1) just give me a select * where productid = 1. The 'from' and 'to' fields are not taken in consideration, so past reduction will be taken :/. I'll have a look with getSpecificPrice(...) [/EDIT]
  10. Yes but i need the price of my product with all reductions applied. I need to get the price written in the FO product page...
  11. But this is warning that prints me "fatal error" and cannot load the rest of my page whenever i put debug mode at false... How do i get the product price so ?
  12. I get this error : Notice: Undefined index: link_rewrite in /home/www/.../classes/Product.php on line 3874 Is it the right way to get the real selling price of a product ?
  13. $sql = 'SELECT * FROM '._DB_PREFIX_.'product WHERE id_product = 1'; $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); $prop = Product::getProductProperties($this->context->language->id, $row); var_dump($prop); I'm getting "bool(false)" with the var_dump.. At least, I have a product with id = 1... $row isn't empty [edit] I had to use $row[0] instead of $row.. or getProductsProperties [/edit]
  14. Hey, thanks for your answer ! I'm trying this to test, but getting a "fatal error" $sql = 'SELECT * FROM '._DB_PREFIX_.'product WHERE id_product = 1'; $row = Db::getInstance()->getRow($sql); $prop = Product::getProductProperties($this->context->language->id, $row); Am i doing something wrong ?
×
×
  • Create New...