Product taxonomy pages are malformatted

paradoxx's picture
paradoxx
Sat, 11/28/2015 - 13:33
#1
Product taxonomy pages are malformatted

Hi,

My site is already running a few months and in the beginning all product displays were formatted okay, similar to demo theme.

Today i noticed my /product-tags/ and /product-category/ pages' main container isn't structured the way it should be.

You can witness yourself here : http://couture1.artstanding.be/product-category/swimwear

Image title

Indicated divs should be visible side by side, instead they now have parent-child relationship. So some </div> seems to be missing.

No customization on these taxonomy pages have been performed from my side, so i have no idea where this comes from.

Could you have a look at this ?

Thanks.

khoa's picture
khoa
Sat, 11/28/2015 - 17:44

Hello,

We also cannot know why your website is not well-formatted on Product Category. You can check our demo on https://validator.w3.org/. It shows no error about HTML formatting.

However, we created a template file for all category pages to fix that error.

Thanks!

P/s: If you like our theme and our support service please vote 5* for this theme and leave some good comment on Themeforest. It's very important for our business. It will be the motivation that will make us create more quality theme and good quality customer support.

paradoxx's picture
paradoxx
Sun, 11/29/2015 - 04:24

Hi Khoa,

Thanks a lot for this quick response ! Really appreciate it !

Since the template you seemed to have fixed is located on a copy of my live site, could you point me out the template name so i can bring it over to the live site ?

PS. Is it possible to vote twice 5* on themeforest ? Because i already did that before for your excellent support !

paradoxx's picture
paradoxx
Sun, 11/29/2015 - 04:38

Forgot to mention i already experienced a similar issue, which i solved myself rather 'controversial', because i couldn't find the template that goes with the render attributes on the add-to-cart-form : 

Image title

As you can see, i have added 5 </div> tags inside commerce-cart-add-to-cart-form.tpl because they were suddenly missing at the end of the rendered $form('attributes').

Not the most clean fix i aknownledge, but i couldn't find immediately the source template(s) behind this attributes form.

Thanks upfront if you could point me to this attributes template too !

PS. It looks more and more like hacky activities are the reason for all this.

khoa's picture
khoa
Sun, 11/29/2015 - 08:37

Hello,

+ The template file is page--taxonomy.tpl.php(md_orenmode/template).

+ For the latest error above, can you please send me the link of the page which causes that error?

Thank you!

paradoxx's picture
paradoxx
Sun, 11/29/2015 - 09:30

Hi,

1. Copied your page-taxonomy.tpl.php to live site and is now okay. Was this file somehow deleted you think ?

2. http://couture1.artstanding.be/product/benedict-handy is the page now apparantly still missing the add-to-cart (attributes) block. On http://couture.rawdesk.be/product/benedict-handy you can see the page after my dirty fix (adding /div's).
So: this render instruction is no longer returning closed div's : <?php print render($form['attributes']); ?> 

Thanks!!

khoa's picture
khoa
Sun, 11/29/2015 - 20:43

Hello,

1. Copied your page-taxonomy.tpl.php to live site and is now okay. Was this file somehow deleted you think ?

=> No, it was not. There is no page--taxonomy.tpl.php file in our original package that you download from Themeforest. We created that file to fix your error.

2. http://couture1.artstanding.be/product/benedict-handy is the page now apparantly still missing the add-to-cart (attributes) block. On http://couture.rawdesk.be/product/benedict-handy you can see the page after my dirty fix (adding /div's).

=> Please take a look at commerce-cart-add-to-cart-form.tpl.php file. Somehow the ADD TO CART form is nested within the "js-hide" div tag so it is hidden when viewing. Maybe you missed one or more </div>. Please check again on that file.

Thanks!

cindy's picture
cindy
Mon, 11/30/2015 - 04:46

Hi,

We recieved your email via our contact form

<?php print render($form['attributes']); ?>

The above code only prints attributes in form "add to cart". This theme does not have a specific file template for the code:

<?php print render($form['attributes']); ?>

Custom attribute was gennerated above this following code:

<?php if (isset($form['attributes'])): ?>
<fieldset class="attribute_fieldset">
<label class="attribute_label"><?php print t('Color'); ?>:</label>
<div class="attribute_list">
<ul class="attribute_color">
<?php foreach ($form['attributes']['field_product_colors']['#options'] as $id => $color) : ?>
<?php $color = md_orenmode_get_color($id); ?>
<?php if ($id == $form['attributes']['field_product_colors']['#default_value']) {
$color_class = 'active';
} else {
$color_class = 'inactive';
}
?>
<?php if (substr($color, 0, 1) === '#'): ?>
<li class="<?php print $color_class;?>">
<a href="#" style="background-color: <?php print $color;?>" data-color="<?php print $id; ?>" class="_<?php print $id; ?>"></a>
</li>
<?php else:
$image_url = file_create_url($color); ?>
<li class="<?php print $color_class;?>">
<a href="#" style="background-image: url(<?php print $image_url;?>); background-size: cover;" data-color="<?php print $id; ?>" class="_<?php print $id; ?>"></a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</fieldset>
<fieldset class="attribute_fieldset">
<label class="attribute_label"><?php print t('Size'); ?>:</label>
<div class="attribute_list">
<ul class="attribute_size">
<?php foreach ($form['attributes']['field_product_size']['#options'] as $id => $size) : ?>
<?php if ($id == $form['attributes']['field_product_size']['#default_value']): ?>
<li class="active"><a href="#" data-size="<?php print $id; ?>"><?php print $size; ?></a></li>
<?php else: ?>
<li><a href="#" data-size="<?php print $id; ?>"><?php print $size; ?></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</fieldset>
<?php endif; ?>

paradoxx's picture
paradoxx
Mon, 11/30/2015 - 05:44

Hi Cindy,

At 8am this morning (GMT+1), your site was offline.

It already tried your suggestion before : removing the js-hide classed div, but then somehow another div lower in the form is suddenly appearing and malformating the node-product.tpl. For example indenting the description tabs in the right portion of the page.

See attached screenshot : 

Image title

But hence, this issue is low prio for me right now since i already bypassed it with my quick and dirty trick.

PS. Where can i find this php code you embedded in your post here above ?

I want to compare it with my version of this code.

Thx!

phuonght's picture
phuonght
Mon, 11/30/2015 - 21:35

Paradoxx,

It is in file commerce-cart-add-to-cart-form.tpl.php.

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.