Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Fred,
    Adding the following code to your themes functions.php should do the trick:

    /**
     * Add Packing slip button to My Account
     */
    add_filter( 'wpo_wcpdf_myaccount_actions', 'wpo_wcpdf_myaccount_packing_slip', 20, 2 );
    function wpo_wcpdf_myaccount_packing_slip ($actions, $order) {
    	$actions['packing-slip'] = array(
    		'url'  => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=packing-slip&order_ids=' . $order->id . '&my-account' ), 'generate_wpo_wcpdf' ),
    		'name' => __( 'PDF Packing Slip', 'wpo_wcpdf' ),
    	);
    	return $actions;
    }

    Hope that helps!

    Thread Starter Frederick Werk

    (@fredsarran)

    Hi, many thanks for that ??

    I also have another question: How can I remove just the pricing from the invoice? See https://www.dropbox.com/s/w1sd4h29c9orv6r/TA-Scotland-913.pdf?dl=0 as example.

    When I try to remove the pricing, it also removes everything else from the Order Details, it only leaves “Cruises” and the quantity 1.

    As well, I followed your guide to add custom fields into the template and this works fine. However, how can I make those fields translatable? I have WPML.

    Thanks,

    Plugin Contributor Ewout

    (@pomegranate)

    Hi Fred,
    You can simply remove these two lines:

    <th class="price"><?php _e('Price', 'wpo_wcpdf'); ?></th>
    <td class="price"><?php echo $item['order_price']; ?></td>

    But it looks like you have a heavily modified template, so I suggest that you contact the person that made those modifications for you – he or she will know exactly what to remove.

    What kind of custom fields do you want to translate? Or do you just want to make the labels to the fields translatable? In the latter case, you can either work with string translation, or add them to the wpo_wcpdf textdomain (or your themes textdomain) and create your own translation files.

    i.e. instead of:

    <?php $wpo_wcpdf->custom_field('custom_fieldname', 'Custom field:'); ?>

    you use:

    <?php $wpo_wcpdf->custom_field('custom_fieldname', __( 'Custom field:', 'wpo_wcpdf') ); ?>

    Note that for the PDF invoice plugin to pick up those translations automatically in the order language, you need the professional extension.

    Hope that helps!

    Thread Starter Frederick Werk

    (@fredsarran)

    Hi,

    My problem is removing the price such as “+£43” and your 2 lines of code doesn’t remove that: https://www.dropbox.com/s/7dzo3olu9lo0s84/invoice-VOUCHER-1139.pdf?dl=0

    The template from your plugin, it is me trying to modify it ??

    Thanks for checking,

    Thread Starter Frederick Werk

    (@fredsarran)

    And about translating, yes, it is only the labels I would like to be translated. I normally use String Translation from WPML but I cannot find those strings to translate.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi Fred,
    The “+£43” comes from another plugin and is probably part of the item meta:

    <span class="item-meta"><?php echo $item['meta']; ?></span>

    To remove only the prices an keep all other descriptions, I would simply hide it with CSS. Output to HTML and look at the source to see which classes are used and apply display:none to those classes.

    For WPML (if you have the professional extension), send me an email at [email protected] and I’ll try to help!

    Ewout

    Thread Starter Frederick Werk

    (@fredsarran)

    Hi Ewout,

    I very much appreciate your help.

    Could I hire your services in order for me to get the result I need quicker? Their is a bunch of other things I need such as the packing slip file packing-slip-1151.pdf to be named voucher-1151.pdf

    I will email you with a list of things I need and if you can quote me that would be great ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Customers to download Packing Slip?’ is closed to new replies.