Jump to content

[Gelöst] Anzeige der Bilder in dem PDF Lieferschein


Recommended Posts

Hallo,

 

eigentlich wenn ich den code richtig lese müssten doch in den PDF Lieferscheinen auch ein kleines Produktbild zu sehen sein... in den Rechnungen ist es zu sehen, aber im Lieferschein nicht.

 

Hat jemand eine Idee, warum eventuell nicht im Lieferschein... anbei einmal der code vom Lieferschein...

<tbody>
		<!-- PRODUCTS -->
		{foreach $order_details as $order_detail}
			{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
			<tr class="product {$bgcolor_class}">

				<td class="product center">
					{if empty($order_detail.product_reference)}
						---
					{else}
						{$order_detail.product_reference}
					{/if}
				</td>
				<td class="product left">
					{if $display_product_images}
						<table width="100%">
							<tr>
								<td width="15%">
									{if isset($order_detail.image) && $order_detail.image->id}
										{$order_detail.image_tag}
									{/if}
								</td>
								<td width="5%"> </td>
								<td width="80%">
									{$order_detail.product_name}
								</td>
							</tr>
						</table>
					{else}
						{$order_detail.product_name}
					{/if}
				</td>
				<td class="product center">
					{$order_detail.product_quantity}
				</td>
				
			</tr>
			
			{foreach $order_detail.customizedDatas as $customizationPerAddress}
				{foreach $customizationPerAddress as $customizationId => $customization}
					<tr class="customization_data {$bgcolor_class}">
						<td class="center">  </td>

						<td>
							{if isset($customization.datas[Product::CUSTOMIZE_TEXTFIELD]) && count($customization.datas[Product::CUSTOMIZE_TEXTFIELD]) > 0}
								<table style="width: 100%;">
									{foreach $customization.datas[Product::CUSTOMIZE_TEXTFIELD] as $customization_infos}
										<tr>
											<td style="width: 30%;">
												{$customization_infos.name|string_format:{l s='%s:' pdf='true'[spam-filter]
											</td>
											<td>{$customization_infos.value}</td>
										</tr>
									{/foreach}
								</table>
							{/if}

							{if isset($customization.datas[Product::CUSTOMIZE_FILE]) && count($customization.datas[Product::CUSTOMIZE_FILE]) > 0}
								<table style="width: 100%;">
									<tr>
										<td style="width: 30%;">{l s='image(s):' pdf='true'}</td>
										<td>{count($customization.datas[Product::CUSTOMIZE_FILE])}</td>
									</tr>
								</table>
							{/if}
						</td>

						<td class="center">
							({if $customization.quantity == 0}1{else}{$customization.quantity}{/if})
						</td>

					</tr>
				{/foreach}
			{/foreach}
			
			
			
		{/foreach}
		<!-- END PRODUCTS -->
	</tbody>

Share this post


Link to post
Share on other sites

Och, ganz einfach. :D
 
Zuschalten des Bildes auf Rechnungen:

Back office Menü --> Bestellungen --> Rechnungen --> Abschnitt: Rechnungs-Optionen --> Aktiviere Produktbild (JA/NEIN)

Zuschalten des Bildes auf Lieferscheinen:

Back office Menü --> Bestellungen --> Lieferscheine--> Abschnitt: Lieferschein-Optionen --> Aktiviere Produktbild (JA/NEIN)

Dann wird eine 1 in das Feld PS_PDF_IMG_DELIVERY der Tabelle ps_configuration geschrieben und das war's!
 
Es sei denn, du hast eine 1.6er-PrestaShop-Version kleiner 1.6.1.2. Da hat man nämlich etwas Entscheidendes vergessen.

Dann musst du ein bisschen nachhelfen, indem du die Datei /controllers/admin/AdminDeliverySlipController.php öffnest und die Funktion __construct wie folgt erweiterst:

 

public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'delivery';

        $this->context = Context::getContext();

        $this->fields_options = array(
            'general' => array(
                'title' =>    $this->l('Delivery slip options'),
                'fields' =>    array(
                    'PS_DELIVERY_PREFIX' => array(
                        'title' => $this->l('Delivery prefix'),
                        'desc' => $this->l('Prefix used for delivery slips.'),
                        'type' => 'textLang'
                    ),
                    'PS_DELIVERY_NUMBER' => array(
                        'title' => $this->l('Delivery number'),
                        'desc' => $this->l('The next delivery slip will begin with this number and then increase with each additional slip.'),
                        'cast' => 'intval',
                        'type' => 'text'
                    ),
                    'PS_PDF_IMG_DELIVERY' => array(
                        'title' => $this->l('Enable product image'),
                        'hint' => $this->l('Adds an image before product name on Delivery-slip'),
                        'validation' => 'isBool',
                        'cast' => 'intval',
                        'type' => 'bool'
                    ),

                ),
                'submit' => array('title' => $this->l('Save'))
            )
        );

Dann erscheint auch die Abfrage im Back Office.
 

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More