VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: dirkb on May 29, 2017, 17:00:24 PM

Title: Different mail template for vendor
Post by: dirkb on May 29, 2017, 17:00:24 PM
Hi ... using latest Joomal and Latest VM.

I would like to modify the mailing function a little bit.

Put the mail_html_xxx.php in the override folder.

The file controlling the template structure ... mail_html.php calls the different building blocks (below)

How could I build the following. I want a different pricelist and footer for the vendor. How would I call that ?

I tried to duplicate and replace the recipient ==´shopper" with ==´vendor´... but that is not doing the trick.

Anybody Ideas ?

---------------------------what I tried -----------------------------------------

if ($this->recipient == 'shopper') {
             echo $this->loadTemplate('pricelist');
         }
         if ($this->recipient == 'vendor') {
             echo $this->loadTemplate('pricelist_admin');
         }



--------------------------mail_html.php---------------------------------------
<?php
// Shop desc for shopper and vendor
         if ($this->recipient == 'shopper') {
             echo $this->loadTemplate('header');
         }
// Message for shopper or vendor
         echo $this->loadTemplate($this->recipient);
// render shipto billto adresses
         echo $this->loadTemplate('shopperaddresses');
// render price list
         echo $this->loadTemplate('pricelist');
// more infos
         echo $this->loadTemplate($this->recipient . '_more');
// end of mail
         echo $this->loadTemplate('footer');
         ?>
Title: Re: Different mail template for vendor
Post by: AH on May 30, 2017, 10:45:14 AM
I want a different pricelist and footer for the vendor.

In your override folder just move the files and create the files you are intending to override

If you want to show order details and just adjust the list of items there are lots of ways you can go about this

Here is one:-

mail_html_pricelist.php



$oldlayout=$this->getLayout();
$this->setLayout('invoice');

if ($this->recipient == 'shopper') {

    echo $this->loadTemplate('items');
}

if ($this->recipient == 'vendor') {
    echo $this->loadTemplate('items_vendor');
}

$this->setLayout($oldlayout);




Then create the new override invoice_items_vendor.php
Title: Re: Different mail template for vendor
Post by: dirkb on June 06, 2017, 13:16:26 PM
sorry I´m late ... thanks I will try what you suggest, sounds like it might work =)
Title: Re: Different mail template for vendor
Post by: AH on June 06, 2017, 15:29:12 PM
let us know how you get on  :)