News:

Support the VirtueMart project and become a member

Main Menu

Editing the VM Invoice PDF

Started by blackrat999, September 23, 2012, 22:51:10 PM

Previous topic - Next topic

blackrat999

Hi.
It seems that lots of people would like to be able to edit the invoice and it is certainly beyond my capabilities.
If some clever person out there could advise how to do the following i would be eternally grateful!

1. remove the "Shipment description" Not the "Shipment name" from the top and bottom of the invoice
2. remove the  "payment description" Not the "payment name"  from the top and bottom of the invoice

and then at last i can start to sell ! Many thanks to anyone who can help.

jack19

Quote from: blackrat999 on September 23, 2012, 22:51:10 PM
Hi.
It seems that lots of people would like to be able to edit the invoice and it is certainly beyond my capabilities.
If some clever person out there could advise how to do the following i would be eternally grateful!

1. remove the "Shipment description" Not the "Shipment name" from the top and bottom of the invoice
2. remove the  "payment description" Not the "payment name"  from the top and bottom of the invoice

and then at last i can start to sell ! Many thanks to anyone who can help.
Hi blackrat999,
I had the problem that the name and description were displayed with no space and I found this workaround:
<?php 
$shipmentNewName str_replace("span","div",$this->orderDetails['shipmentName']);
echo $shipmentNewName;
//  echo $this->orderDetails['shipmentName']
 ?>

and
<?php 
$paymentNewName str_replace("span","div",$this->orderDetails['paymentName']);
echo $paymentNewName;
// echo $this->orderDetails['paymentName']
  ?>

I hope I can help, I have not been able to find was built as the output without description (payment and shipment).
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

blackrat999

Jack.
thanks for helping - (sorry missed your reply didnt have "notify" on !
Sorry for being a numpty - where would i find this code and what do i do with it ?!
thanks

jack19

Quote from: blackrat999 on September 26, 2012, 11:43:35 AM
Jack.
thanks for helping - (sorry missed your reply didnt have "notify" on !
Sorry for being a numpty - where would i find this code and what do i do with it ?!
thanks
Hi blackrat999,
I modified these:
components\com_virtuemart\view\invoice\tmpl\invoice_items.php
components\com_virtuemart\view\invoice\tmpl\invoice_order.php
Perhaps there are other files, but I have not found it yet.
If you use Dreamviewer try doing a search for $this->orderDetails
Must be replaced, as in my previous post.
Regards
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

blackrat999

Thanks for that will have a search through and try a bit of trial and lots of error !

jack19

Quote from: blackrat999 on September 26, 2012, 21:07:01 PM
Thanks for that will have a search through and try a bit of trial and lots of error !
I did not understand if you solved.
Rgds
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

blackrat999

To be honest no but i appreciate your help.
What i have done because i wasnt happy with the original invoicing system was to look elsewhere and i found a component called VMInvoice.
in the end i have got it to work fairly well, the invoices are far better than the originals although there are plenty of issues with the component, not least of all the writer doesnt help anyone unless you pay him!
So not solved and hoping that one day Virtuemart2 will have some simpler way to edit the invoices that are sent out.
cheers

caquita16

Hi, I have a similar problems.

How I can remove extra space before and after to vendor details in PDF bills?
(com_virtuemart/views/invoice/tmpl/invoice.php)


When I make a pdf bill, VM include uncomfortable spaces (image 1).
I've been trying remove that myself but I've not could. I was modifying this file: "com_virtuemart/views/invoice/tmpl/invoice.php".

<?php
/**
 *
 * Order detail view
 *
 * @package    VirtueMart
 * @subpackage Orders
 * @author Max Milbers, Valerie Isaksen
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: details.php 5412 2012-02-09 19:27:55Z alatak $
 */
//index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&order_number=xx&order_pass=p_yy
//
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::stylesheet('vmpanels.css'JURI::root() . 'components/com_virtuemart/assets/css/');
if (
$this->_layout == "invoice") {
    
$document JFactory::getDocument();
    
$document->setTitle(JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER') . ' ' $this->orderDetails['details']['BT']->order_number ' ' $this->vendor->vendor_store_name);
//$document->setName( JText::_('COM_VIRTUEMART_ACC_ORDER_INFO').' '.$this->orderDetails['details']['BT']->order_number);
//$document->setDescription( JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER').' '.$this->orderDetails['details']['BT']->order_number);
}

if (
$this->headFooter) {
    
?>

<div class="vendor-details-view">
    <h1><?php echo $this->vendor->vendor_store_name;
        if (!empty(
$this->vendor->images[0])) {
            
?>

            <div class="vendor-image">
                <?php echo $this->vendor->images[0]->displayMediaThumb(''false); ?>
            </div>
            <?php
        
}
        
?>
    </h1>
<div class="vendor-details-address">
<?php //Attention this is removed, please use directly
//echo $this->vendorAddress;
echo shopFunctions::renderVendorAddress($this->vendor->virtuemart_vendor_id'<br />');
?>

</div>
</div>

<div class="vendor-description">
<?php //echo $this->vendor->vendor_store_desc.'<br>';


    /* foreach($this->vendorAddress as $userfields){

         foreach($userfields['fields'] as $item){
             if(!empty($item['value'])){
                 if($item['name']==='agreed'){
                     $item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
                 }
             ?>
<!-- span class="titles"><?php echo $item['title'?></span -->
                         <span class="values vm2<?php echo '-'.$item['name'?>" ><?php echo $this->escape($item['value']) ?></span>
                     <?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>
                         <br class="clear" />
                     <?php
                 
}
             }
         }
     }*/
}
?>
</div> <?php


if ($this->print) {
    
?>


<body onload="javascript:print();">

<div class='spaceStyle'>
    <?php
//  echo require(__DIR__.'/mail_html_shopper.php');
    
?>

</div>
<div class='spaceStyle'>
    <?php
    
echo $this->loadTemplate('order');
    
?>

</div>

<div class='spaceStyle'>
    <?php
    
echo $this->loadTemplate('items');
    
?>

</div>
    <?php    //echo $this->vendor->vendor_legal_info; ?>
</body>
<?php
} else {

    
?>


<?php

    
echo $this->loadTemplate('order');

    
?>



<div class='spaceStyle'>
<?php

    $tabarray 
= array();

    
$tabarray['items'] = 'COM_VIRTUEMART_ORDER_ITEM';
    
$tabarray['history'] = 'COM_VIRTUEMART_ORDER_HISTORY';

    
shopFunctionsF::buildTabs$this$tabarray);
    echo 
'</div>
    <br clear="all"/><br/>'
;
}

if (
$this->headFooter) {
    echo 
$this->vendor->vendor_legal_info;
}

?>









Can you help me in this?

Thanks.

I use VM 2.0.14 on Joomla! 2.5.8.

[attachment cleanup by admin]

Pejo

I can not see Croatian letters in invoice.pdf (this letters: "Ž", "Đ", "Š", "Č", "Ć")

I see "?" sign instead this letters.

Is this problem with UTF-8 encoding? Where can I fix this? Thanks.


Pejo

Sorry...  :-[

Joomla 2.5.4 - VM 2.0.6

Problem is, I can not update Joomla or VM, because it is connected (this is bought theme, and it is connected one with other). I tried to update, but then nothing works anymore. Everything is messed up after upgrade, so I work with what I have. ;)

jenkinhill

@Pejo then you potentially have a serious site security issue. Already some J2.5 sites before version 2.0.14 have been hacked and that old VM version is known to be insecure. But you will have to recreate and edit your template overrrides to work with the current secure code.
http://forum.virtuemart.net/index.php?topic=118683.0
http://virtuemart.net/news/list-all-news/446-important-security-release-vm-team-at-joomladay-germany


Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Pejo

#12
@jenkinhill

OK, I have successfully upgrade to las Joomla, because Joomla does not include in my template that much, but when I upgrade WM, I got problems and my theme is useless.

How secure is to use that old VM with new JM? I have old site with Joomla 1.5.18 and VM 1.1.5 / nothing happend there.

Are this two new versions on new site more secure that I have on old one, are they the same or worse?
Thanks.

EDIT:

btw. I must emphasize that my store DOES NOT use any kind of credit card or PayPal payment. Everything is only order, payments are organized other way, that can not be access by site or have any kind connections or redirections with/by the site.
So, if this security issues are for payment, then I am quite OK with it, right?

Maxim Pishnyak

Quote from: Pejo on September 26, 2013, 20:58:30 PM
Problem is, I can not update Joomla or VM, because it is connected (this is bought theme, and it is connected one with other). I tried to update, but then nothing works anymore.
Bought theme and you couldn't ask template provider to give you an updated them?

Did you check layout_changes? See Dev Portal at the top of current page (files section).

Your outdated web site could be hacked and spammers could sent couple millions emails from your web shop. Your hoster wouldn't be pleased to have a such trouble.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Pejo

Theme is from 2010 and I bought it then. There was update last year and made for J2.5 with VM 2, but theme is old (for them) and there is no update for this theme anymore.

Unfortunately :(

But, I updated Joomla to latest version, VM is still 2.0.6