{"id":3931,"date":"2016-02-20T11:28:32","date_gmt":"2016-02-20T00:28:32","guid":{"rendered":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/?p=3931"},"modified":"2016-02-20T11:32:54","modified_gmt":"2016-02-20T00:32:54","slug":"simple-shopping-cart-adding-values-to-paypal-custom-field","status":"publish","type":"post","link":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/simple-shopping-cart-adding-values-to-paypal-custom-field-3931","title":{"rendered":"Simple Shopping Cart &#8211; Adding Values to PayPal Custom Field"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-simple-paypal-shopping-cart-plugin-768\">simple shopping cart plugin<\/a> has a filter that you can use to add extra data to the PayPal custom field.<\/p>\n<div class=\"custom_yellow_box\">\n<p><strong>Note:<\/strong> The plugin already uses the PayPal custom field to pass some parameters to PayPal. So you should append your data to this custom field (to make sure you don&#8217;t erase the custom data added by this plugin)<\/p>\n<\/div>\n<h2>Code Example<\/h2>\n<p>The following code example shows how you can append data to the custom field (add this code to your theme&#8217;s functions.php file or a custom plugin).<\/p>\n<pre>add_filter('wpspc_cart_custom_field_value', 'append_my_custom_data');\r\nfunction append_my_custom_data($custom_value)\r\n{\r\n    \/\/Append my data using query parameter\r\n    $custom_value = $custom_value . '&amp;my_data=XYZ';\r\n    return $custom_value;\r\n}<\/pre>\n<p>This will pass your data along with the cart&#8217;s custom data to the PayPal&#8217;s custom field.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The simple shopping cart plugin has a filter that you can use to add extra data to the PayPal custom field. Note: The plugin already uses the PayPal custom field to pass some parameters to PayPal. So you should append your data to this custom field (to make sure you don&#8217;t erase the custom data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[34,30],"tags":[182,149,169,24,32],"class_list":{"0":"post-3931","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-additional-guidance","7":"category-wordpress-shopping-cart","8":"tag-paypal","9":"tag-paypal-advanced","10":"tag-paypal-api","11":"tag-tweaks","12":"tag-wp-shopping-cart","13":"entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/3931"}],"collection":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/comments?post=3931"}],"version-history":[{"count":0,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/3931\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/media?parent=3931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/categories?post=3931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/tags?post=3931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}