Post by labeshops » Thu Oct 05, 2017 3:25 am

Okay, this is one of those things that I am probably looking right at the error and not seeing it and it's now driving me nuts. Hoping a fresh set of eyes notices it.

I have 2 sections, Availability, and Average Delivery that always show on my specifications table even if I have no others set. It is hard coded in the product template and then the other specs pull from the database is normal. Everything is showing except for my headings are foobared and I cannot figure out why.

See screen shot for how it is displaying right now, but:
"Availability & Delivery" should be where "Stone Properties" is and the "Stone Properties" heading should be above the "Amethyst" section. (stone properties & amethyst as well as everything below is is coming from the database as it should be from the for each attribute section in the code. For some reason, the theads are just not where they are supposed to be and it's been bugging the crap out of me!!

Code: Select all

	<div class="tab-pane" id="tab-specification">
          <table class="table table-bordered" style="width:100%;overflow-y:auto;>
                <thead>
                  <tr>
                    <td colspan="2"><strong>Availability & Delivery</strong></td>
                  </tr>
                </thead>
			  <tbody>				
			  <tr>
			  <td>Availability:</td>
			  <td>Inventory is updated regularly and will be shown above with any sizes/colors/items out of stock indicated. Not all manufacturers provide inventory data and even in stock items can be sold out without notice. Items not shown out of stock are normally available. We will notify you of any out of stock items as soon as possible or you can contact us in advance of placing your order to verify availability. </td>
			  </tr>
			  <tr>
			  <td>*Average Delivery:</td>
			  <td>The average delivery time for delivery within the United States via Standard or Free Shipping. Deliveries outside the US will on average take an additional 10-15 days based on destination country and customs both in the US and at the destination. International deliveries may have additional import duties, taxes, or fees imposed before delivery that we cannot charge or estimate - contact your local customs office for information. <br/><br/>
			  Note: This is the average, estimated time for delivery and is subject to availability, seasonal sales volume, and other potential, unforeseen delays. If you must have an item by a specific date, be sure to include that date in your cart comments when checking out.</td>
				</tr>
				</tbody>
        <?php foreach ($attribute_groups as $attribute_group) { ?>
        <thead>
          <tr>
            <td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
          </tr>
        </thead>
        <tbody>
          <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
          <tr>
            <td><?php echo $attribute['name']; ?></td>
            <td><?php echo $attribute['text']; ?></td>
          </tr>
          <?php } ?>
        </tbody>
        <?php } ?>
      </table>
    </div>

Attachments

displaying-wrong.gif

displaying-wrong.gif (53.56 KiB) Viewed 2047 times

Last edited by labeshops on Mon Oct 30, 2017 6:45 am, edited 2 times in total.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by simonpieman » Thu Oct 26, 2017 3:51 am

Would you mind to post a link to the page itself please. its hard interpret by code alone.

Go the All Blacks!


Active Member

Posts

Joined
Thu Jul 02, 2015 8:58 am
Location - NZ - Auckland

Post by labeshops » Fri Oct 27, 2017 11:31 pm

Any of my product pages - link to my stores is in my signature.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MrPhil » Sat Oct 28, 2017 9:08 pm

It appears that you are trying to put multiple <thead>'s into a <table>, and that is not valid HTML. There is supposed to be zero or one <thead> and zero or one <tfoot> per table. Some browsers may let you get away with multiple ones, but it's not guaranteed to work everywhere. Multiple <tbody> sections are apparently OK.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by labeshops » Sat Oct 28, 2017 9:35 pm

Hmm I though the thead is what designated the header class.

And actually, the original code is working fine that includes the for each call for the thead in the database so it does repeat fine. You can see it on https://www.mysticconvergence.com/bed-o ... r-necklace

It's just not putting my added availability and delivery section in the right place (should be above stone properties and swarovski crystal) and formatting the heading correctly inside a table box.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by labeshops » Sat Oct 28, 2017 9:56 pm

Well, yeah! I am much closer though the "Availability & Delivery" head is still outside the table for some dumb reason though it is within it in the code.

I took out all the theads and move tbody up to encompass the entire thing. Again look at the link above for current version. Any idea why that one headline is not enclosed in the table lines like it should be? Below is my current code.

Code: Select all

          <table class="table table-bordered" style="width:100%;overflow-y:auto;>
		      <tbody>	
                  <tr>
                    <td colspan="2"><strong>Availability & Delivery</strong></td>
                  </tr>				  
			  <tr>
			  <td>Availability:</td>
			  <td>Inventory is updated regularly and will be shown above with any sizes/colors/items out of stock indicated. Not all manufacturers provide inventory data and even in stock items can be sold out without notice. Items not shown out of stock are normally available. We will notify you of any out of stock items as soon as possible or you can contact us in advance of placing your order to verify availability. </td>
			  </tr>
			  <tr>
			  <td>*Average Delivery:</td>
			  <td>The average delivery time for delivery within the United States via Standard or Free Shipping. Deliveries outside the US will on average take an additional 10-15 days based on destination country and customs both in the US and at the destination. International deliveries may have additional import duties, taxes, or fees imposed before delivery that we cannot charge or estimate - contact your local customs office for information. <br/><br/>
			  Note: This is the average, estimated time for delivery and is subject to availability, seasonal sales volume, and other potential, unforeseen delays. If you must have an item by a specific date, be sure to include that date in your cart comments when checking out.</td>
				</tr>
        <?php foreach ($attribute_groups as $attribute_group) { ?>
          <tr>
            <td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
          </tr>
          <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
          <tr>
            <td><?php echo $attribute['name']; ?></td>
            <td><?php echo $attribute['text']; ?></td>
          </tr>
          <?php } ?>
        </tbody>
        <?php } ?>
      </table>

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MrPhil » Sun Oct 29, 2017 6:08 am

Your style attribute in the <table> element is not closed. It has an opening " but no closing ". Effectively, the table does not start until the <tbody>. And why isn't that first row (Availability & Delivery) within <tbody>?

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by labeshops » Sun Oct 29, 2017 9:24 am

The <table class...> is closed by the final </table>

The first line is below the <tbody> so not sure what you mean???

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MrPhil » Mon Oct 30, 2017 1:55 am

Code: Select all

<table class="table table-bordered" style="width:100%;overflow-y:auto;>
should be

Code: Select all

<table class="table table-bordered" style="width:100%;overflow-y:auto;">

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by labeshops » Mon Oct 30, 2017 6:44 am

Ah! Thank you! It's always the little things the foul me up! Displaying correctly now :)

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MrPhil » Tue Oct 31, 2017 10:15 pm

Yep, always the stupid little things like that. :crazy: They need a facepalm emoji in the set. (x.x)|\

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: No registered users and 156 guests