php - 如何使用 WooCommerce 将产品描述传递给 Paypal
问题描述
问题:我们的产品是二手的。因此,我们详细描述了每个产品。此描述必须显示在 PayPal 发票上才能获得 PayPal 卖家保护。目前,在成功销售后,我们手动添加此描述。
到目前为止我们所做的:我们将描述附加到产品名称中。但是,此字段有字符限制。
wp-content/plugins/woocommerce/includes/class-wc-checkout.php
if ( $product ) {
$item->set_props(
array(
'name' => $product->get_name() . '<p>' . $product->description .'</p>' ,
'tax_class' => $product->get_tax_class(),
'product_id' => $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id(),
'variation_id' => $product->is_type( 'variation' ) ? $product->get_id() : 0,
)
);
}
PayPal 是否完全接受来自 WooCommerce 的详细描述字段?如果是,我们如何将描述字段传递给 PayPal,使其自动显示?
感谢您的指导,欧文
解决方案
推荐阅读
- kubernetes - 使用 kubectl 工具时如何添加自定义 http 标头
- xna - 任何现有的游戏内 MonogGame/XNA 性能统计/诊断信息?
- mysql - 如何通过触发器减少另一个表中的值?(MySQL)
- android - Firebase如何停止监听器
- javascript - 在 Firefox 中使用 Javascript 动态填充某些字段的问题
- reactjs - Antd 表 - 排序不适用于渲染
- json - WP REST API v2 JSON 端点似乎难以阅读
- php - Woocommerce:我下订单以使用银行 API 处理付款时出现运行时错误
- qt - 拖动 QSplitter 时似乎有问题?
- c# - 我应该为 .NET Core + Xamarin Android App 使用哪种类型的类库项目?