Jump to content

All Supplier Info In Head Of Delivery-Slip


holle75

Recommended Posts

Hi there, im pulling my hair now for 2 days to figure this out. Reading a lot of threads without success. I want ALL supplier Info in the HEAD of my delivery-slip.

 

I managed to read all the info for EACH product by changing/putting following code in /classes/order/OrderInvoice.php:

foreach ($products as $row)
        {
            // Change qty if selected
            if ($selectedQty)
            {
                $row['product_quantity'] = 0;
                foreach ($selectedProducts as $key => $id_product)
                    if ($row['id_order_detail'] == $id_product)
                        $row['product_quantity'] = (int)($selectedQty[$key]);
                if (!$row['product_quantity'])
                    continue;
            }

            $this->setProductImageInformations($row);
            $this->setProductCurrentStock($row);
            $this->setProductCustomizedDatas($row, $customized_datas);            

            // Add information for virtual product
            if ($row['download_hash'] && !empty($row['download_hash']))
            {
                $row['filename'] = ProductDownload::getFilenameFromIdProduct((int)$row['product_id']);
                // Get the display filename
                $row['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);
            }
            
            $row['id_address_delivery'] = $order->id_address_delivery;                    

            $supplier = new Supplier($row['id_supplier']);    
            
            $row['supplier_name'] = $supplier->name;
            
            
            $id_address = Address::getAddressIdBySupplierId($row['id_supplier']);
            $supplier_address_object = Address::initialize($id_address);

            $row['supplier_address1'] = $supplier_address_object->address1;
            $row['supplier_address2'] = $supplier_address_object->address2;
            $row['supplier_postcode'] = $supplier_address_object->postcode;
            $row['supplier_city'] = $supplier_address_object->city;
            $row['supplier_country'] = $supplier_address_object->country;
            $row['supplier_phone'] = $supplier_address_object->phone;
            $row['supplier_phone_mobile'] = $supplier_address_object->phone_mobile;

            /* Stock product */
            $resultArray[(int)$row['id_order_detail']] = $row;
        }

        if ($customized_datas)
            Product::addCustomizationPrice($resultArray, $customized_datas);

        return $resultArray;
    }

i can use all the $row variables 

 

{$product.supplier_name}{$product.supplier_address1}{$product.supplier_address2}{$product.supplier_postcode}{$product.supplier_city}{$product.supplier_country}

 

in delivery-slip.tpl AFTER or IN the foreach. But i need to use this info in The HEAD (before the foreach) of the pdf.

{foreach $order_details as $product}
        {cycle values='#FFF,#F2F2F2' assign=bgcolor}
        <tr style="line-height:6px;background-color:{$bgcolor};">

            <td style="width: 5%">{counter}</td>
            <td style="width: 32%">{$product.product_name}</td>    
            <td style="width: 10%">{$product.weight}</td>
            <td style="width: 12%">{$product.tares}</td>
            <td style="width: 13%">{$product.supplier_country}</td>
            <td style="width: 5%">{$product.product_quantity}</td>
            <td style="width: 10%">{$product.wholesale_price}</td>
            <td style="width: 13%">{$product.gesamtpreis}</td>

        </tr>    
      
    {/foreach}

Actually i only need the supplier-data of ONE product for the HEAD Information (in my shop a whole order always will be supplied by one supplier).

 

Any suggestions are highly appreciated.

 

best

 

H.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...