Extra characters in product page.

Permalink
First let me say how excited I am to discover Concrete5. I haven't built a site in 8 years, and did it all back then in Dreamweaver. What a pain then.

So the dimensions are printed on every product page, even thought (I think) have their display option turned off. I have attached one screen shot of a product page, and another of part of the data formatting tab of the 'edit product list' form.

All I have checked is 'name', 'description', and 'price', and yet the dimensions still show up. I moved the dimensions to the bottom of the list, but there was no difference.

Am I overlooking something, or is this not supposed to be happening?

2 Attachments

 
Mainio replied on at Permalink Reply
Mainio
You're probably mixing up the editing the product list block and product block.

You should edit the product block not to include the dimensions what I got from your screenshot. Also, in the other screenshot you are editing the product list block, so that's probably where the problem is.

Click "edit page" on the page where you see the dimensions and edit the block also that shows the dimensions.

If this does not work, you can always override that file that displays the product properties.

Br,
Antti / Mainio
MrGrowBizz replied on at Permalink Reply
MrGrowBizz
treypaul,

Think I may know what you need to do.

The Dimensions Attribute Label is a default, which means whether you put dimensions in or not it will show as a product attribute, with label and zeros. I wrestled with this as well, but was able to get help from the core team through requesting it in the eCommerce add-on support board.

First you will need to copy the product file up to your elements folder. This will prevent changes from occurring during upgrades. Then go to root/elements/product/display/properties.php. The changes I made are as follows:

1) If shipping is not indicated the label does not show.
2) If there are only two dimensions entered, it drops the "0" and the associated label.
3) Added the Weight attribute whenever shipping is indicated. (the default is not to show shipping weight and can not be changed to show unless you code.
4) Put Dimensions and Weight in Bold Caps, as I did with all other attribute labels to meet my design needs.

Hope this helps!

<?php if ($product->productRequiresShipping()) { ?>
<?php if ($property->handle == 'displayDimensions') { ?>
<div>
<strong><?php echo t('SHIPPING DIMENSIONS')?></strong><br/>
<div>
<?php
if($product->getProductDimensionLength() > 0) {
echo $product->getProductDimensionLength() . "x";
}
if($product->getProductDimensionWidth() > 0) {
echo $product->getProductDimensionWidth() . "x";
}
if($product->getProductDimensionHeight() > 0) {
echo $product->getProductDimensionHeight();
}
?>
<?php echo $product->getProductDimensionUnits()?>
</div>
</div>
<div style="padding: 5px 0px 0px 0px">
<div>
<strong><?=t('SHIPPING WEIGHT')?></strong><br/>
<div>
<?=$product->getProductWeight()." ".$product->getProductWeightUnits()?>
</div>
</div>
<? } ?>
treypaul replied on at Permalink Reply
Thank you so much, that is exactly what I needed. And I appreciate the quick answer.
treypaul replied on at Permalink Reply
MrGrowBizz
I finally got around to working on this. You solution I don't think will work for me. I have a customer option for size, and each size has a different dimension.

I just commented out the part of the loop that printed the dimension information. Works for me.

I am pretty sure this is a bug though. I haven't investigated it much yet, but it could be that the problem is not actually here; maybe the database information. From the code here it looks like if there are no dimensions then it should not print anything out here, instead of the descriptive text like it actually does.

And also, no matter how the display fields are arranged in the block edit, the unwanted text is always printed first. It looks like probably the display fields print in the order they are in the database. Just a guess.

But anyway, at the moment I am happy this cleaned up my product pages.

But anyway, onto another subject, you mentioned copying the file into my products directory instead of modifying the original. So I understand how you copy a file from the core files into the corresponding root lever directory and it overrides the core.

But the file in question here is already in the root level structure, so where do I put it where it will override the one in packages?

I'm still learning my way around.
MrGrowBizz replied on at Permalink Reply 1 Attachment
MrGrowBizz
Treypaul,

Sorry for the delay. A you familiar with editing your site files?

Actually, you should be able to accomplish what you want within reason. Note the attachment of one of the product pages of a site I am working on. The image on the right is below the one on the left in the page. Note I have product dimensions on the left and shipping dimensions on the right. Since products are not boxed until sold, there is obviously a difference. The Shipping Dimensions are actually the eCommerce default attribute used to calculate UPS shipping (weight is the same in this respect). The Product Dimension is a custom attribute created by me. If I leave either of these empty, the Dimension Label will not show. The code I gave you is for hiding default W,D,L, labels when not used, or the entire dimension label if shipping is disabled. There are additional edits made to hide any attribute label (& space) if there is no entry made for that attribute. The typical way of doing this is checking or not checking the attributes in the product block, but I needed greater control to deal with thousands of unlike products.