Issue With Vendor Data Premoderation Notification Email

Hey guys,

I've run into an issue with the vendor data premoderation notification email (located here: design/backend/mail/templates/addons/vendor_data_premoderation/notification.tpl). It is designed to include the name of the product and a link to it in the body of the email when it is either approved or disapproved. It works fine when multiple products are approved/disapproved in bulk, but when only one product is changed, the information isn't showing up in the email.

Here is the code for that part of the email template:

{else}
    {assign var="product_name" value=$products.0.product}
    {assign var="product_url" value="products.update?product_id=`$products.0.product_id`"|fn_url:"V":"http"}
    {if $status == "Y"}
        {__("product_approval_status_approved", ["[product]" => "`$product_name`"])}
    {else}
        {__("product_approval_status_disapproved", ["[product]" => "`$product_name`"])}
    {/if}
{if $reason}
    <p>{$reason}</p>
{/if}</pre>

It seems like the issue might be with assigning the variables called "product_name" and "product_url", specifically the "$products.0.product" and "$products.0.product_id" components. But, but I can't figure out why it isn't working.

Anyone have any idea how to fix it?

Thanks,

Jason

Try to replace the following part of code:

{if $products|count > 1}
    {if $status == "Y"}
        {__("products_approval_status_approved")}
{else} {__("products_approval_status_disapproved")}
{/if} {foreach name="products_list" from=$products item="product"} {$smarty.foreach.products_list.iteration}) {$product.product}
{/foreach}
{if $status == "Y"}
    
{__("text_shoppers_can_order_products")} {/if} {if $reason}

{$reason}

{/if}

{else}
{assign var=“product_name” value=$products.0.product}
{assign var=“product_url” value=“products.update?product_id=$products.0.product_id”|fn_url:“V”:“http”}
{if $status == “Y”}
{(“product_approval_status_approved”, [“[product]” => “$product_name”])}
{else}
{
(“product_approval_status_disapproved”, [“[product]” => “$product_name”])}
{/if}

{if $reason}
    

{$reason}

{/if}

{/if}

with:

    {if $status == "Y"}
        {__("products_approval_status_approved")}
{else} {__("products_approval_status_disapproved")}
{/if} {foreach name="products_list" from=$products item="product"} {$smarty.foreach.products_list.iteration}) {$product.product}
{/foreach}
{if $status == "Y"}
    
{__("text_shoppers_can_order_products")} {/if} {if $reason}

{$reason}

{/if}

Then clear cache and check the result

Try to replace the following part of code:

{if $products|count > 1}
    {if $status == "Y"}
        {__("products_approval_status_approved")}
{else} {__("products_approval_status_disapproved")}
{/if} {foreach name="products_list" from=$products item="product"} {$smarty.foreach.products_list.iteration}) {$product.product}
{/foreach}
{if $status == "Y"}
    
{__("text_shoppers_can_order_products")} {/if} {if $reason}

{$reason}

{/if}

{else}
{assign var=“product_name” value=$products.0.product}
{assign var=“product_url” value=“products.update?product_id=$products.0.product_id”|fn_url:“V”:“http”}
{if $status == “Y”}
{(“product_approval_status_approved”, [“[product]” => “$product_name”])}
{else}
{
(“product_approval_status_disapproved”, [“[product]” => “$product_name”])}
{/if}

{if $reason}
    

{$reason}

{/if}

{/if}

with:

    {if $status == "Y"}
        {__("products_approval_status_approved")}
{else} {__("products_approval_status_disapproved")}
{/if} {foreach name="products_list" from=$products item="product"} {$smarty.foreach.products_list.iteration}) {$product.product}
{/foreach}
{if $status == "Y"}
    
{__("text_shoppers_can_order_products")} {/if} {if $reason}

{$reason}

{/if}

Then clear cache and check the result

Simple solution, but that did the trick - thanks eComLabs!

You are welcome!