Adding new field in product list page

I am trying to change a product list page and can’t figure out how to pull up a database entry.



What I did was create a new row in my product table in my database. This new row allows me to enter in the quantity type. Basically I can enter in things like:



each

per. lb.

per. oz.



I was able to set this up so that I can enter in what I want in the admin, and I have it so it will come up on my product details page, but I can figure out how to get it set up on my product list page.



Here is what I have on my product details page:







This is where I want it in my product list page:







I made a new hook template for my product list page. The file is:



skins/artificial_casting/customer/addons/my_changes/hooks/products/product_multicolumns_list_override.tpl



This is the code that is in there:


{assign var="obj_id" value="`$obj_prefix``$product.product_id`"}







{include file="common_templates/image.tpl" image_width=$settings.Appearance.thumbnail_width obj_id=$obj_id images=$product.main_pair object_type="product"}

1} title="{$product.product}">{$product.product|unescape|strip_tags|truncate:25:"...":true}{else}>{$product.product|unescape}{/if}


{include file="views/products/components/buy_now.tpl" hide_wishlist_button=true hide_compare_list_button=true simple=true show_qty=true show_sku=true hide_add_to_cart_button=$hide_add_to_cart_button but_role="action"}






I have also modified my buy_now.tpl



I added:


{if $product.type} {$product.type}{/if}



After:


{if !$hide_price_title}{$lang.price}: {/if}{include file="common_templates/price.tpl" value=$product.price span_id="discounted_price_`$obj_id`" class="price"}



Like I said, this works on my product details page, just not my list page.



Does anyone have any ideas on how I can fix this? I would really appreciate any help.



Brandon

brandonvd,



trying to do something similar, and having the same problem…have you had any luck figuring this out?



walter

Walter



No, not yet, but Sno said he might take a look at it so I am hopeful. He has been pretty busy with his new addon, but hopefully I’ll hear something soon. When I do I will post it on this thread.



Brandon

Brandon-



I see there are a number of if statements in buy_now.tpl that test the value of ‘$simple’. I have not tried this but I wonder if the following in skins/artificial_casting/customer/addons/my_changes/hooks/products/product_multicolumns_list_override.tpl might make a difference:

{include file="views/products/components/buy_now.tpl" hide_wishlist_button=true hide_compare_list_button=true [B][COLOR="Red"]simple=true[/COLOR][/B] show_qty=true show_sku=true hide_add_to_cart_button=$hide_add_to_cart_button but_role="action"}



Maybe try changing ‘true’ to ‘false’.



Bob

Bob



Thanks, but that didn’t do it. Any other ideas?



Brandon

Hmmm…everything looks right to me. I am pretty much stumped.



Bob

I’ll have the fix posted for you guys tomorrow, Thanks - Sno

The solution is posted in the new how to article section at snorocket.com:

[url]http://www.snorocket.com/forums/showthread.php?p=1154[/url]