Get The Box_Length Attribute Value In Category Page


I'm customizing a website the sells wallpapers and other goods, and I need to add the feature to buy a wallpaper sample.

I have solved the problem by adding one hidden product for each wallpaper to use it as a sample, and by using the box length field (not in use for shipping pourpose) to put in it the sample product_id.

This way I have the relation berween the wallpaper and its sample.

I'm able to show a "buy a sample" button in the product detail page with a little customization on the tpl file and using the $product.box_length attribute.

Now I have to do the same in the category page (where all the wallpapers are listed), but the "box_length" attribute seems to be empty.

{if $product}
{assign var="obj_id" value=$product.product_id}
{assign var="obj_id_sample" value=$product.box_length} <--- this is empty

For example this is a wallpaper detail page where the $product.box_length is populated correctly

On the category page I still have to add the "order a sample" button

Any idea regarding this issue ?