WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Remove labels/tags for customer details on order history printout
- AuthorPosts
- 2 February, 2015 at 5:41 pm #7532
Hi Olly. I understand how to change/remove everything on the order history printout using the code snippets you have provided. On customer details I understand how to remove a certain line i.e.
add_filter(‘wppizza_filter_print_order_customer’,’myprefix_amend_customer_details’);
function myprefix_amend_customer_details($details){// do a print_r($details); to get all keys – they will be something like [cname],[cemail],[caddress],[ctel] etc
// so to remove the line containing the email address (key being [cemail]) do:
unset($details[‘cemail’]);return $details;
}But how do I remove the labels but not the line? I don’t need say:
Email: [email protected]
Postcode: Whatever the postcode isAll I want is the end value without the ‘Email:’ and ‘Postcode:’ labels. How do I remove these labels without removing the data?
Any help would be much appreciated as usual thank you.
2 February, 2015 at 7:13 pm #7533as it happens, you cant really do that at the moment (well, you could if you write some regular expression, but that’s overkill)
i need to add a parameter to the filter (or write this a bit differently – not sure yet) in the next update and will post something here (or – more likely, add an example to the codesnippet of these things)
2 February, 2015 at 11:47 pm #7545doable as of 2.11.7.6
see https://www.wp-pizza.com/topic/filteredit-order-history-print-output/
there look for : wppizza_filter_print_order_customer_detail
3 February, 2015 at 10:35 pm #7577Thanks Olly works a charm! Now I just need to figure out some other part non related to wppizza and launch my new website 🙂
19 March, 2015 at 7:23 pm #8552Hi Olly thought i’d reply in here. I just changed the ingredients style to make it bigger and it looks great HOWEVER and i’m not sure this is even possible – is there anyway to make it so that each ingredient starts on a new line?
Currently it is like this
ITEM NAME
INGREDIENT1, INGREDIENT 2, INGREDIENT 3 etcI would ideally like it
ITEM NAME
INGREDIENT1
INGREDIENT2
INGREDIENT321 March, 2015 at 3:20 pm #8605i really cannot code everything for everybody here.
look at the template and codesnippets and use your creativity.its doable with the filters available, just use a
str_replace(',','<br />',$var);
where appropriate21 March, 2015 at 4:13 pm #8606Thanks i’ll see what I can do. I haven’t got my head around functions etc so i’m still finding it hard.
- AuthorPosts
- The topic ‘Remove labels/tags for customer details on order history printout’ is closed to new replies.