首页 > 解决方案 > 如何使用 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,使其自动显示?

感谢您的指导,欧文

标签: phpwordpresswoocommercepaypal

解决方案


推荐阅读