Vendor Info On Checkout Page

Hello CS gurus.

Does anyone know how I can show the vendor of each product on the checkout page, where the products are listed?

Thanks

Do you mean block with products at right side?

Yes :)

Use hooks in the following file to show necessary data

design/themes/responsive/templates/blocks/checkout/products_in_cart.tpl

Thanks eCom. Could you please be a bit more specific, as my programming skills are rather limited? Many thanks in advance

It depends on your needs. Use something like

{if $product.company_id}
     {$_company_data = $product.company_id|fn_get_company_data}
     {$_company_data|fn_print_r}
{/if}

It will print out available company data

Nop... doesn't seem to work. I have tried to include the above code in several places but no result. This is how my current products_in_cart.tpl looks like. Where should the code go?

Thanks



    {hook name="block_checkout:cart_items"}
    {foreach from=$cart_products key="key" item="product" name="cart_products"}
    {hook name="block_checkout:cart_products"}
    {if !$cart.products.$key.extra.parent}

  • {$product.product nofilter}
    {if !$product.exclude_from_calculate}
    {include file="buttons/button.tpl" but_href="checkout.delete?cart_id=`$key`&redirect_mode=`$runtime.mode`" but_meta="ty-order-products__item-delete delete" but_target_id="cart_status*" but_role="delete" but_name="delete_cart_item"}
    {/if}
    {hook name="products:product_additional_info"}
    {/hook}

    {$product.amount} x {include file="common/price.tpl" value=$product.display_price}

    {include file="common/options_info.tpl" product_options=$product.product_options no_block=true}
    {hook name="block_checkout:product_extra"}{/hook}

  • {/if}
    {/hook}
    {/foreach}
    {/hook}

For example, add the code before the following line

{hook name="block_checkout:product_extra"}{/hook}

Do not forget to clear cache then

Kind of worked... but this displays ALL the available vendor data, description etc etc... I was looking for just the vendor name (so that the buyer knows which vendor each product is from).

Thanks again

My code just shows all available data. You can display only required one. For exameple

{if $product.company_id}
     {$_company_data = $product.company_id|fn_get_company_data}
     {$_company_data.phone}
{/if}

But to display only vendor name, use the following code

{if $product.company_id}
     {$product.company_id|fn_get_company_name}
{/if}