Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Related Products with file preview Rate Topic   - - - - -

 
  • hostandname
  • Senior Member
  • Members
  • Join Date: 05-Jan 06
  • 196 posts

Posted 21 September 2009 - 10:52 AM #1

Hi Guys,

Im doing a small modification to load related products to a block using products2.tpl but to add the related products attached preview file but having a few problems getting it to work.

Any ideas?

[highlight]file: /public_html/skins/basic/customer/blocks/products2.tpl[/highlight]
{* $Id: products2.tpl 7321 2009-04-20 13:20:33Z angel $ *}
{** block-description:products2 **}
{assign var="columns" value=$settings.Appearance.columns_in_products_list|default:"3"}
{if $columns > $items|count}
	{assign var="columns" value=$items|count}
{/if}
{split data=$items size=$columns assign="splitted_objects"}
{math equation="floor(100/x)" x=$settings.Appearance.columns_in_products_list|default:"3" assign="cell_width"}

{if $block.properties.item_number == "Y"}
	{assign var="cur_number" value=1}
{/if}
<table cellpadding="0" cellspacing="0" border="0" width="100%">
{foreach from=$splitted_objects item="sobjs" name="splitted_objects"}

<tr>
	{foreach from=$sobjs item="product" name="sobjs"}
	{assign var="obj_id" value="`$block.block_id`000`$product.product_id`"}
	{if $product.product}
	{include file="views/products/components/product_files.tpl" product=$product obj_id=$obj_id assign="file_info"}
	{include file="views/products/components/buy_now.tpl" but_role="act" but_rev="product_form_`$obj_id`" box_class="products-rounded" hide_wishlist_button=true hide_compare_list_button=true product=$product obj_id=$obj_id simple=true capture_price=true assign="buttons" hide_add_to_cart_button=$block.properties.hide_add_to_cart_button additional_link=$additional_link}
		<td>{if $block.properties.item_number == "Y"}{$cur_number}. {math equation="num + 1" num=$cur_number assign="cur_number"}{/if}{$product.product|unescape}</td>
		<td>{$smarty.capture.price}</td>
	{/if}
	{/foreach}

	{foreach from=$sobjs item="product" name="sobjs"}
		<td>{$buttons}</td>
		<td>{$file_info}</td>
	{/foreach}	
		
</tr>

{/foreach}
</table>

[highlight]file: /public_html/skins/basic/customer/views/products/components/products_files.tpl[/highlight]
{* $Id: product_files.tpl 7419 2009-05-05 11:40:34Z lexa $ *}

{foreach from=$files item="file"}
	<a onclick="$("#jquery_jplayer").jPlayer.setFile("{$index_script}?dispatch=orders.get_file&file_id={$file.file_id}&preview=Y");" href="{$index_script}?dispatch=orders.get_file&file_id={$file.file_id}&preview=Y">preview</a>
{/foreach}


All the other information i can get displayed apart from the preview link any ideas anyone?

Host & Name Ltd - your reliable & trustworthy media provider (www.hostandname.co.uk)
Approved CS-Cart Developers and Official CS-Cart Licensing Supplier
Web Hosting | Cloud Hosting | Dedicated Servers | VPS | Domains | Emails | Design | Development | Marketing | Management


 
  • jagorny
  • Senior Member
  • Members
  • Join Date: 29-Nov 08
  • 226 posts

Posted 21 September 2009 - 02:35 PM #2

Correct me if I'm wrong, but I'm seeing nested double quotes in he products_files.tpl you posted. That doesn't fly in HTML - you need to either escape a set with a slash or change the outermost set to single quotes.
Jacob Gorny

www.orthodoxmarketplace.com - CS-Cart 2.2.4 Pro (Dedicated)