WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Html Template for Mail
- AuthorPosts
- 13 March, 2019 at 10:19 pm #42113
Hi Olly
Wie kann ich Menge breite verkleinern?
Wie kann ich grösse der Zutatentext ändern. im Bild als Gelb markiert.I have under the wppizza> Template> html format> Style input html code changed but still could not improve both points.
Thanks for any help
Umut14 March, 2019 at 1:02 am #42114you can only do this using filters
assuming that you know how filters work, this is the one that’s added for this ($styles being an array of different elements )$styles = apply_filters('wppizza_ingredients_filter_email_styles', $styles );
14 March, 2019 at 1:03 am #42115PS: the default $styles array is this
$styles = array(); $styles['ingrinfo'] = 'white-space: initial; margin: 3px; line-height: 130%;' ; $styles['ingr_item'] = 'font-style: italic;' ; $styles['ingrinfo'] = 'white-space: initial; margin: 3px 3px 3px 20px; line-height: 130%; font-size:85%;' ; $styles['ingrgrp'] = 'white-space: initial; margin: 3px;line-height: 130%;' ; $styles['ingrgrp_0'] = 'white-space: initial; margin: 3px;line-height: 130%; display:inline' ; $styles['ingrgrp_1'] = 'white-space: initial; margin: 3px;line-height: 130%; margin-left: 15px' ; $styles['ingrgrp_lbl'] = 'font-weight: bold; padding-right: 3px;' ; $styles['comments'] = 'padding: 3px 0; font-size: 75%;' ;
14 March, 2019 at 2:55 pm #421271- where should I insert this code?
2- Will it be deleted after an update?Thanks
14 March, 2019 at 3:21 pm #421281)
you MUST learn how wordpress action and filter hooks work if you want to do ANY kind of wordpress alteration that are beyond just simple point and click
here’s a quick overviewhttps://docs.wp-pizza.com/developers/?section=filters-actions-functions
2) it depends on where you put your code (i strongly suggest you use child themes as they do not get updated when you update your theme)
the reason why it’s not in the template section is because it’s coming from the add ingredients plugin and the options that plugin provides to add things to orders would make it completely unmanageble if added to the inputs of th etemplates
your filter will the look *something like* this (depending what exactly you want to achieve, but as a starting point)
add_filter('wppizza_ingredients_filter_email_styles', 'myprefix_filter'); function myprefix_filter($styles){ /* the 120% here overrides any previous (default of 85%) font-size declaration for the element */ $styles[ingrinfo] .= 'font-size:120%;'; return $styles; }
14 March, 2019 at 9:32 pm #42133Dear Olly
Thank you for your valuable help. I did it.
Only now I want to take all selected ingredients in brackets.
For example: (1 x olives, 1x broccoli, 1 x capers)Which code can I use for brackets?
Thanks again for all the help.
best regards
Umut16 March, 2019 at 7:03 pm #42176[Edit:redacted by admin to not confuse people (errors in code) ]
16 March, 2019 at 8:02 pm #42177hello olly
I think I solved the problem.
Thank you
best regards - AuthorPosts
- The topic ‘Html Template for Mail’ is closed to new replies.