-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
Hi everybody,
I am a beginner on Magento and I need some help !
- I ve got a product with 2 options (width and length), is it possible to make a dynamic multiplication of this 2 values and to multiplicate this by a price ?
(ex : width 1200 mm height 1000mm
surface = 1200*1000 = 1200000
price on mm² = 0.00001€
price = 0.00001*1200000 = 12€
Thank for your help
|
| |
-
- Posted: August 14 2009
-
| top
-
|
 |
 |
 |
|
|
-
- jroakes

-
Total Posts: 19
Joined: 2008-08-09
|
There is nothing for this. If there were I would be jumping up and down and doing cartwheels right now. I don’t ever see this happening unless you pay someone to hack the software for you. There have been a number of people asking for this for a long while and no dice from the developers or extension developers.
|
| |
-
- Posted: August 16 2009
-
| top
| # 1
-
|
 |
 |
 |
|
|
-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
thanks a lot, I have adapted your script and it works, but when I add the product to the cart this is the original price (not the price calculate dynamicly)
How can I change the price in the cart ? or the inserted price ?
|
| |
-
- Posted: August 18 2009
-
| top
| # 2
-
|
 |
 |
 |
|
|
-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
Hi, thanks for you reply, I will assign 25€ as the base price…
thanks in advance
|
| |
-
- Posted: August 25 2009
-
| top
| # 3
-
|
 |
 |
 |
|
|
-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
No, it will be : (25 + (height custom option x width custom option x 0.00001))
|
| |
-
- Posted: August 25 2009
-
| top
| # 4
-
|
 |
 |
 |
|
|
-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
yes it’s true
no problems thanks for your help
|
| |
-
- Posted: August 25 2009
-
| top
| # 5
-
|
 |
 |
 |
|
|
-
- skrime

-
Total Posts: 24
Joined: 2009-07-09
|
Thanks a lot for your reply ! It works !
|
| |
-
- Posted: September 2 2009
-
| top
| # 6
-
|
 |
 |
 |
|
|
-
- Sam Granger

-
Total Posts: 65
Joined: 2007-09-13
|
Nice stuff guys!
Just a few questions about this code. Does it take Tier Pricing into consideration, ifnot, how can I get this code to do so? And secondly, isn’t it a bad idea to medit core code? Isn’t it a better idea to extend the class in local?
|
| |
-
- Posted: September 14 2009
-
| top
| # 7
-
|
 |
 |
 |
|
|
-
- Sam Granger

-
Total Posts: 65
Joined: 2007-09-13
|
dd_gi, that would be awesome if you could!
|
| |
-
- Posted: September 15 2009
-
| top
| # 8
-
|
 |
 |
 |
|
|
-
- Brother Bui

-
Total Posts: 14
Joined: 2009-05-06
|
Thank you very much for your post.
And I have a question, wish you help me to answer.
I need to be able to set a minimum and maximum width, minimum and
maximum height. How do I validate the width and height input
by the customer? And of course, if the value is not valid, the customer
cannot continue.
Thanks in advance
|
| |
-
- Posted: September 17 2009
-
| top
| # 9
-
|
 |
 |
 |
|
|
-
- Brother Bui

-
Total Posts: 14
Joined: 2009-05-06
|
dd_gi - 17 September 2009 10:55 AM Would all products that have height/width custom options have the same limits?
No, each product type has its own limits.
|
| |
-
- Posted: September 18 2009
-
| top
| # 10
-
|
 |
 |
 |
|
|
-
- Brother Bui

-
Total Posts: 14
Joined: 2009-05-06
|
dd_gi - 17 September 2009 07:32 PM In that case you will need to use product attributes to define those limits, the easiest way to add those are when you are viewing a product, select a tab in the product’s details where you want to add the limits, then select add. You would add width_min width_max height_min height_max
Then we can use those in the code. How do you want the front-end entry to be accomplished (text input, select list)?
If you want select list, what increment do you want as you go from low to high (0.01)?
Dear dd_gi,
Yes, we should add the min and max width, height for products.
I have two product types:
The first one is fixed width (the customer can select width from dropdown list, such as: 10cm, 20cm, 30cm.... This width list I will add for products in admin, and of course it’s fixed list) and he must type the height he wants in a textbox. In this case, we need only validate the height.
The second one is dynamic width and height, it means, the customer can input any width and height in textbox.
I need to validate the value input by the customer, the condition is: min <= inputvalue <= max.
And the customer can input any inputvalue, it can be: 50, 63.5, even 70.546....
I need only validate the value to meet the condition above. And produce the errors if it not meet.
Thank you.
|
| |
-
- Posted: September 18 2009
-
| top
| # 11
-
|
 |
 |
 |
|
|
-
- Brother Bui

-
Total Posts: 14
Joined: 2009-05-06
|
dd_gi - 17 September 2009 09:51 PM This should be workable, I will need to look at how Varien does the front-end validation, possibly we can call those functions for this task. It would be easy enough to feed this info by the way of a var that we dynamically assign based on existence and value of the min/max attributes. I likely won’t be able to work on this for a couple days but I will look at this and it should be an easy enough fix.
I look forward to hear from you soon.
|
| |
-
- Posted: September 18 2009
-
| top
| # 12
-
|
 |
 |
 |
|
|
-
- Sam Granger

-
Total Posts: 65
Joined: 2007-09-13
|
I uploaded the options.phtml & js, now, when I add the custom options and try to add the product I get the following error: Can not add item to shopping cart
Weird right? :(
Anyone know what might be causing this? Thanks for the code so far!
|
| |
-
- Posted: September 21 2009
-
| top
| # 13
-
|
 |
 |
 |
|
|
-
- Sam Granger

-
Total Posts: 65
Joined: 2007-09-13
|
Please ignore my previous post, it’s wqorking now, guess it was a database quirk on my side Just the dynamic js price update doesnt want to work :(
|
| |
-
- Posted: September 21 2009
-
| top
| # 14
-
|
 |
 |
 |
|
|
-
- Sam Granger

-
Total Posts: 65
Joined: 2007-09-13
|
Sorry sorry sorry, I’m an idiot. I have a local version and a live version, I uploaded the js and phtml to the luve version and not the local version. I’m a dipstick! Please excuse my sillyness, it works like a charm! Thank you very much for helping! Great work!
|
| |
-
- Posted: September 21 2009
-
| top
| # 15
-
|
 |
 |
 |
|
|