title: Opencart question regarding square feet and boxes needed calculator
body: <p>I am creating a website in Opencart that sells flooring, and they need me to create a field in which the buyer can put the amount o square feet needed, and then the "system" will tell them how many boxes to purchase.</p>
  
  <p>this is simple enough anywhere else that is not Openncart, I would just grab the element where the product list its square feet per box and do the appropriate function.</p>
  
  <p>The issue that I am having, is that Opencart uses PHP and there is no static place where this number resides.</p>
  
  <p>I tried adding a class to the specifications table on the product twig, however, since technically there are no tables until it already initializes in the html, all I was able t do was add class="sqft" to every  it created.</p>
  
  <p>For instance, in the Twig it merely says  {{attribute.name}}  which is pulling from PHP I imagine. So I put  {{attribute.name}}  and the html rendered all my attributes with  even those that were not square footage like a width attribute. Example  width&lt; /td>  5.5" wide </p>
  
  <p>There is no where else for me to put the square footage per box on the product, so I am at a loss how to grab this information so that the user themselves to not have to enter their square footage that they need AND the products square foot per box.</p>
  
  <p>So far also, I have looked up different extensions and a few ideas on stack, but none of the dealt with boxes..only create a square footage calculator ( length x width etc ).</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>I'm using Opencart 3.x</p>
  
  <p>This is also my first question on Stack, so I I missed any needed information or came across as anything that gets on your nerves I apologize.</p>
  
  <p>EDIT:</p>
  
  <p>I figured it out. Since the square feet per box changed depending on the product, the option227 or option228 could not be used with getElementById, so I instead used querySelector, which only grabbed the optoin part NOT the numbered product.</p>
  
  <p>worked like a charm.</p>