sousmart Posted May 7, 2012 Share Posted May 7, 2012 Need to give a chance to buyers to order quantities under and above 1 ( for example 0,3 meters or 1,6 meters ). As the product is fabric, we must have the price in meters ( eg: € 15,00 / linear meter )... Can anybody help??? Thanks, Carlos Link to comment Share on other sites More sharing options...
tomerg3 Posted May 7, 2012 Share Posted May 7, 2012 I think you are better off leaving all the fields as is (IE INT and not Decimal) as this would require a lot of work. Instead, you can change the display of the quantity to be in multiples of 100 and then divide by 100 where needed (or vice versa) Link to comment Share on other sites More sharing options...
sousmart Posted May 8, 2012 Author Share Posted May 8, 2012 Thanks for the advise tomerg3. It was my first idea as it seems to be the less complicated. The problem is that the store will have products to be sold with INT units ( like a pencil or a needle ). Please inform if the " lot of work " solution would be only the change from INT to Decimal or we must to make more changes. Many thanks, Carlos Link to comment Share on other sites More sharing options...
tomerg3 Posted May 8, 2012 Share Posted May 8, 2012 I imagine there are castings that need to be changed, potentially in quite a few functions, as well as external modules. Link to comment Share on other sites More sharing options...
sousmart Posted May 9, 2012 Author Share Posted May 9, 2012 It seems that is quite dificult to make these modifications in 1.45 and 1.47 versions. Can you give any sugestion?? Thanks! Link to comment Share on other sites More sharing options...
tomerg3 Posted May 9, 2012 Share Posted May 9, 2012 I gave you the suggestion I had... If you have any specific questions, ask them here and you may get answers. If it's too much to handle, try finding a developer to do it for you. Link to comment Share on other sites More sharing options...
sousmart Posted May 9, 2012 Author Share Posted May 9, 2012 Thanks for your help tomerg3. Our developer is taking care about that. We have an indication from a previous post, to make changes in several php files and also in DB tables, but it seems that only work with 1.40 version. We are trying to find a solution. Following the changes that have been done by WFREEBIRD in his website www.lacouture.nl It's a lot of work in 1.4. First I changed the database. I searched in all the tables with the fields quantity and changed the type to decimal(17,2). The tables are: - ps - ps - ps_discount - ps_orders (total_products and total_products_wt) - ps_order_detail (all the fields with quantity in the name) - ps_order_return_detail - ps_order_slip_detail - ps_pack - ps_product - ps_product_attribute - ps_product_sale - ps_specific_price - ps_stock_mvt After this you go to your prestashop folder Now you have to search for all the files where the quantity value is set. Open the files one by one and search for "intval($row['cart_quantity'])" for example. Every line with the word "intval" before the word "quantity" or "qty". Change the word "intval" to "floatval". Then repeat all but now you search for the word "int" an change this to "float". You need to do this for the files: - prestashop/classes/Attribute.php - prestashop/classes/Cart.php - prestashop/classes/Customization.php - prestashop/classes/Discount.php - prestashop/classes/Order.php - prestashop/classes/OrderDetail.php - prestashop/classes/OrderHistory.php - prestashop/classes/OrderReturn.php - prestashop/classes/Product.php - prestashop/classes/ProductSale.php - prestashop/classes/QuantityDiscount.php - prestashop/classes/StockMvt.php - prestashop/controllers/CartController.php - prestashop/controllers/OrderController.php - prestashop/order.php - prestashop/cart.php - prestashop/themes/prestashop/product.tpl (or if you have a other theme prestashop/themes/themename/product.tpl Please check yourself if the above files are all the files you need to change. Just open the other files as well and search. I did it with dreamweaver and used "find and replace" type by Find "int" and by Replace "float". Do you agree with this solution?? Thanks Link to comment Share on other sites More sharing options...
tomerg3 Posted May 9, 2012 Share Posted May 9, 2012 I have not tried to do this before, so I don't know off the top of my head all the things that need to be changed. Link to comment Share on other sites More sharing options...
Recommended Posts