-1
我完全不熟悉PHP和WooCommerce,所以這可能是一個非常簡單的問題,但是我試圖讓'WooCommerce PDF Watermark'插件打印來自在我的WordPress網站上訂購。我無法爲此獲取代碼。插件附帶的文檔提供了下面給出的如何將模板標籤添加到插件的示例。任何援助與此將非常感激!從woocommerce的訂單調用項目數量pdf watermark
function wc_pdf_watermark_extend_template_tags($parsed_text, $unparsed_text, $order, $product) {
// Look for {product_title} in text and replace it with the product title
$parsed_text = str_replace('{product_title}', $product->get_title(), $parsed_text);
return $parsed_text;
}
add_filter('woocommerce_pdf_watermark_parse_template_tags', 'wc_pdf_watermark_extend_template_tags');
你能更詳細地闡述你的要求嗎? –