luckysengoku Posted February 27, 2012 Share Posted February 27, 2012 Hi everyone, i want to add a unique number (3 digit) behind the total payment to different payment from each customer. How to do such a thing in prestashop? example : total payment $10.321, the 321 is the unique number that being added to the total payment. and the unique number is being random for each payment. hope you all can help me...thank you... Link to comment Share on other sites More sharing options...
luckysengoku Posted February 28, 2012 Author Share Posted February 28, 2012 i already created the unique number with random and place it at the class/cart.php, but it changes everytime you refresh the page. Any good solution for this?...thanx Link to comment Share on other sites More sharing options...
tomerg3 Posted February 28, 2012 Share Posted February 28, 2012 What are you trying to do? The price of products in not dynamic, it is directly connected to the product price in the products table. It can only be adjusted using attributes, or a discount (to get it lower). Link to comment Share on other sites More sharing options...
luckysengoku Posted February 28, 2012 Author Share Posted February 28, 2012 what i'm trying to do is different each payment from each customer. For example if there is 100 customer a day buying a same product and transfer a same amount of payment, then its gonna be hard to track which transfer is from customer A since all of them transfer the same amount of money. So to make things easy, i want to make a unique code to be add to total payment to make a different for each customer. Any solution?...thanx for the reply Link to comment Share on other sites More sharing options...
tomerg3 Posted February 28, 2012 Share Posted February 28, 2012 I see, you mean you are getting a bank wire transfer. Are all your orders of round numbers? I don't think you can send a wire transfer with 3 decimal points, so the max you are likely to be able to get is 99 unique number a day. Link to comment Share on other sites More sharing options...
luckysengoku Posted February 28, 2012 Author Share Posted February 28, 2012 I see, you mean you are getting a bank wire transfer. Are all your orders of round numbers? I don't think you can send a wire transfer with 3 decimal points, so the max you are likely to be able to get is 99 unique number a day. yeah, all of it is round, i random 3 digit behind, like the example i already explained. i already implement it at the cart.php but it changes everytime i refresh the page. still need to find a better way to do it... Link to comment Share on other sites More sharing options...
tomerg3 Posted February 28, 2012 Share Posted February 28, 2012 I think the best way to do this, which is with making the minimum changes to Prestashop would be to create a new hidden product with a price of 0 and attributes with a price impact in 0.001 increments. (potentially 999 of them). whenever a customer goes into the checkout process you will need to add that product you created to their cart with the next attribute to be used (IE .001 .002 .003), you would have to store the last amount used in the database, to make sure you don't add the same one twice. You would also need to check that the current cart does not already have the new product ID. This should all be done with an override of just the checkout or cart classes. Link to comment Share on other sites More sharing options...
luckysengoku Posted February 28, 2012 Author Share Posted February 28, 2012 I think the best way to do this, which is with making the minimum changes to Prestashop would be to create a new hidden product with a price of 0 and attributes with a price impact in 0.001 increments. (potentially 999 of them). whenever a customer goes into the checkout process you will need to add that product you created to their cart with the next attribute to be used (IE .001 .002 .003), you would have to store the last amount used in the database, to make sure you don't add the same one twice. You would also need to check that the current cart does not already have the new product ID. This should all be done with an override of just the checkout or cart classes. hmmm, a little complicated i believe right. I believe we only need to add the unique code to the last checkout, which i think its in the bankwire module. Its the simpliest way? Link to comment Share on other sites More sharing options...
tomerg3 Posted February 28, 2012 Share Posted February 28, 2012 You could do the same thing but only from the bankwire module. There are hacks you can do to reduce the price, but in order to increase the price, you need to use a new product or product attributes. Link to comment Share on other sites More sharing options...
dotrock Posted September 27, 2016 Share Posted September 27, 2016 i already created the unique number with random and place it at the class/cart.php, but it changes everytime you refresh the page. Any good solution for this?...thanx hi lucky, can you share to me, plese.. i want to add 2 numbers, but it will reduce total payment. thanks Link to comment Share on other sites More sharing options...
Recommended Posts