Avatar of xiss
xissFlag for Netherlands asked on

Cannot 'while loop' with one row

Hi guys,

I created a product configurator for our company, which uses javascript to add, multiple etc prices in a form, depending on the amounts that are filled in. It is showcased at http://shop.cloud2.nl/configurator.

If you look at the Server Backup Lite/Basic tab, it works like a charm. But when you check the Server Backup Pro tab, if you fill in the amount under "Aantal", nothing happens. The price for one server is 0.00. However, when you add another item with "Server Toevoegen", the price is changed from 0.00 to whatever amount you filled in times the value of the field.

I managed to figure out it does not work with one row, seeing as the Server Backup Lite/Basic tab works fine. But for the life of me I can't seem to figure out how to solve it.

Does anyone have a solution to this? I have included the code in the .php, the css and js for the tabs come from tabber.js and example.css (See source code or attachments).

Thanks a lot!
configurator.php
example.css
tabber.js
JavaScriptPHPHTML

Avatar of undefined
Last Comment
xiss

8/22/2022 - Mon
Member_5340450

line 502 and 503 of configurator's html close the head and start the body, but that's already done at lines 75, 76.

calc totals refers to incorrect cart name cart_sbp should be cart_sbb
ASKER CERTIFIED SOLUTION
Member_2_248744

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Gary

I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
ASKER
xiss

Hi guys,

My apologies for the late reply, I was quite busy and totally forgot about this. @Slick812: You are definitely right about the large amount of Javscript. This is one of the major downsides of Magento, and I have been working on fixing this.

In the end there was as slight mistake in the code regarding variable/function naming which caused it to fail. Although it still needs some work, for now this issue is solved.

Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER
xiss

Although it does not solve the actual problem, it did give me some ideas as to how to clean up the code.