WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › HTML Email editing
- AuthorPosts
- 30 January, 2015 at 12:39 am #7467
>it’s definitely the correct function.php file
no it isn’t, that file should be named functions.php
30 January, 2015 at 11:41 am #7479Hi Olly,
oh, no, so sorry!
I can see already changes on the order. So it is picking it up now.
Thanks and sorry again.
Regine
1 February, 2015 at 8:25 am #7506Hi Olly,
I managed to get the logo on top of my email. 😉
Now I would like to add some more text in this field:
“Order Email: Text you would like to display at the end of emails after everything else.”Like I want to add the full address of the restaurant like this:
El Mexicano Armadale
Shop 21 Jull Street, Armadale
Phone: 9399 5494I tried adding <br>, but it has translated them into text. Is there a way to enter returns in the field or would you need to change the field in WordPress for this?
I think the address is definitely missing especially for pick ups.
Thanking you in advance.
Kind regards
Regine
2 February, 2015 at 11:10 am #7521as of 2.11.7.5:
i have added action hooks to the end of the email templates .
(wppizza_emailhtml_end and wppizza_emailplaintext_end)
you can now use to do stuff there3 February, 2015 at 11:15 am #7556Hi Olly,
Thanks for the update and your message.
To be honest the action hooks are a bit of a mystery to me, as I have not really got much idea how they work and what I can do with it.
Ie If I put them in my functions.php file and add the restaurant address, does it mean that only I as programmer can change the content? Or can I refer to a specific field in wordpress?
Also I don’t actually know how to write the full code to add it in my functions.php file, so I am a bit lost here.
Would you please consider writing an FAQ post on how to use action hooks and how it works?
Thanking you in advance
Regine
3 February, 2015 at 11:48 am #7558do this (should at least get you going)
add_action('wppizza_emailhtml_end','myprefix_emailhtml_end',10,4); function myprefix_emailhtml_end($order_summary, $order_items, $htmlEmailStyle, $labels){ echo'<tr><td colspan="2" style="'.$htmlEmailStyle['mailPadding']['2x15'].'; font-size:90%;text-align:middle">'.$labels['order_email_footer'].'<td></tr>'; }
>Would you please consider writing an FAQ post on how to use action hooks and how it works?
no, as there’s a site for that already. it’s called http://codex.wordpress.org/ (alongside about another 1/2 million websites that explain how actions and filters work…..)
3 February, 2015 at 11:56 am #7559in fact, i would strongly encourage you to get to grips with actions and filters.
once you do, you’ll be amazed as to what you can do…one thing to know bear in mind (as that’s a common mistake i made myself once upon a time)
although actions and filters are somewhat similar. they have one vital difference.actions do things
filters change thingsactions tend to have some parameters passed to them which you can use (amongst other things) to echo/print things (based on the variables passed along to them if you want/need to)
filters have variables passed to them where – typically – the first one needs to be returned but you can change it during the processing of the function as required (quite often there are some more parameters passed along that first one, which you can use to change what the first one returns as appropriate..)
3 February, 2015 at 12:03 pm #7560so, (and then i shut up)
if you find a “do_action” hook, it doesnt do anything unless it’s called by an “add_action” somewhere (in your functions.php typically)same goes for filters
i.e if there is an “apply_filters” hook it just returns what’s been passed to it, unless you do/change something by adding “add_filters ” somewhere (in your functions.php typically)essentially, most/all wordpress plugins – so wppizza too – use the existing wordpress hooks to do their thing and add/extend stuff
4 February, 2015 at 11:40 am #7582Thanks heaps Olly,
I will have to work through this in the next days. Yes, always happy to learn new stuff.
Thanks again.
Kind regards
Regine
8 February, 2015 at 12:05 pm #7636Hi Olly,
Thanks again for the information.
I got an acceptable result, but still need to learn lots more about hooks.
THanks
Regine
- AuthorPosts
- The topic ‘HTML Email editing’ is closed to new replies.