Jump to content

Text limits in order Presta PDF 1.6


karlosman

Recommended Posts

Put this code in admin_folder/themes/default/css/overrides.css

@media print {
    .product-line-row .productName {
        max-width: 300px;
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
        text-overflow: ellipsis;
    }
}

You can play with the max-width property to fit better your requirments.

PS: Do not forget to clear the browser cache, and when doins so, at "Time range", select "everything", and only tick "Cache".

  • Like 1
Link to comment
Share on other sites

Yup, add this inside "@media print" block:
 

#main #content.bootstrap #start_products .panel {
    page-break-inside: auto !important;
}

so it becomes something like:
 

@media print {
    .product-line-row .productName {
        max-width: 300px;
        overflow: hidden;
        white-space: nowrap;
        display: inline-block;
        text-overflow: ellipsis;
    }
    #main #content.bootstrap #start_products .panel {
        page-break-inside: auto !important;
    }
}
  • Like 1
Link to comment
Share on other sites

 

Works 100% !!! Thank you
 
I would like to ask you about the last 2 things.
I need to add a number of orders in the name of the saving. Add a shipping method, and payments under the picture. Could you give me an advice please? Thank you so much

 

About the order ID in the name of the saving, I am pretty sure that you can enter the name before saving the file. If you want something automatically, you can rename the title of the page when you click on the "Print order" button and then rename it back to original (using javascript).

For shipping method and payment method written where you want:

 

<tr id="carrier_override">
    <td class="text-right">{l s='Carrier'}</td>
    <td class="carrier-name text-right nowrap">
        {$carriers_array = array()}
        {foreach from=$order->getShipping() item=line}
            {$carriers_array[] = $line.carrier_name}
        {/foreach}
        {implode(', ', $carriers_array)}
    </td>
</tr>
<tr id="payment_override">
    <td class="text-right">{l s='Payment'}</td>
    <td class="payment_method-name text-right nowrap">
        {$payments_array = array()}
        {foreach from=$order->getOrderPaymentCollection() item=line}
            {$payments_array[] = $line->payment_method}
        {/foreach}
        {implode(', ', $payments_array)}
    </td>
</tr>

You have to put this in file "admin_folder/themes/default/template/controllers/orders/helpers/view/view.tpl", search for '<tr id="total_order">' and put it right after it's end tag ( '</tr>' )

 

PS: Don't forget to REP+ if I've been useful.

Edited by Goe Burlibasa (see edit history)
  • Like 1
Link to comment
Share on other sites

Transport's okay always displayed. Payment only if the order is finished. I attach image.

Got it

 

Replace this:

{$payments_array = array()}
{foreach from=$order->getOrderPaymentCollection() item=line}
     {$payments_array[] = $line->payment_method}
{/foreach}
{implode(', ', $payments_array)}

with this:

 

{$order->payment}

So it becomes:

 

 

<tr id="carrier_override">
    <td class="text-right">{l s='Carrier'}</td>
    <td class="carrier-name text-right nowrap">
        {$carriers_array = array()}
        {foreach from=$order->getShipping() item=line}
            {$carriers_array[] = $line.carrier_name}
        {/foreach}
        {implode(', ', $carriers_array)}
    </td>
</tr>
<tr id="payment_override">
    <td class="text-right">{l s='Payment'}</td>
    <td class="payment_method-name text-right nowrap">
        {$order->payment}
    </td>
</tr>
Edited by Geo Burlibasa (see edit history)
  • Like 1
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...