WC_Email_Customer_POS_Completed_Order::replace_footer_placeholders
Replace footer text placeholders with POS-specific values.
Method of the class: WC_Email_Customer_POS_Completed_Order{}
No Hooks.
Returns
String. Modified footer text.
Usage
$WC_Email_Customer_POS_Completed_Order = new WC_Email_Customer_POS_Completed_Order(); $WC_Email_Customer_POS_Completed_Order->replace_footer_placeholders( $footer_text, $email );
- $footer_text(string) (required)
- The footer text to be filtered.
- $email(mixed) (required)
- Email object.
WC_Email_Customer_POS_Completed_Order::replace_footer_placeholders() WC Email Customer POS Completed Order::replace footer placeholders code WC 10.8.1
public function replace_footer_placeholders( $footer_text, $email ) {
// Only replace placeholders if we're in the context of a POS email.
if ( $email->id !== $this->id ) {
return $footer_text;
}
if ( ! is_string( $footer_text ) ) {
$footer_text = is_scalar( $footer_text ) ? (string) $footer_text : '';
}
return str_replace(
array(
'{site_title}',
'{store_address}',
'{store_email}',
),
array(
$this->get_pos_store_name(),
$this->get_pos_store_address(),
$this->get_pos_store_email(),
),
$footer_text
);
}