{"id":5333,"date":"2025-01-13T22:24:43","date_gmt":"2025-01-13T11:24:43","guid":{"rendered":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/?page_id=5333"},"modified":"2025-08-20T11:21:54","modified_gmt":"2025-08-20T01:21:54","slug":"simple-shopping-cart-filter-hooks-reference","status":"publish","type":"page","link":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/simple-shopping-cart-filter-hooks-reference","title":{"rendered":"Simple Shopping Cart &#8211; Filter Hooks Reference"},"content":{"rendered":"\n<p>Below is a list of filter hooks that are available in the&nbsp;<a href=\"https:\/\/wordpress.org\/plugins\/wordpress-simple-paypal-shopping-cart\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Simple Shopping Cart<\/strong><\/a>&nbsp;plugin.<\/p>\n\n\n<h2 class=\"simpletoc-title\">Table of Contents<\/h2>\n<ul class=\"simpletoc-list\">\n<li><a href=\"#frontend-hooks\">Front-End Hooks<\/a>\n\n\n<ul><li>\n<a href=\"#wpscproductboxthumbnailcode\">wpsc_product_box_thumbnail_code<\/a>\n\n<\/li>\n<li><a href=\"#wpscpaypalipnnotifyurl\">wpsc_paypal_ipn_notify_url<\/a>\n\n<\/li>\n<li><a href=\"#wpsccarticonimagesrc\">wpsc_cart_icon_image_src<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartitemname\">wpsc_cart_item_name<\/a>\n\n<\/li>\n<li><a href=\"#wpscbeforecheckoutform\">wpsc_before_checkout_form<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartcheckoutbuttonimagesrc\">wpsc_cart_checkout_button_image_src<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartextrapaypalfields\">wpsc_cart_extra_paypal_fields<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartstripecheckoutbuttonimagesrc\">wpsc_cart_stripe_checkout_button_image_src<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartextrastripefields\">wpsc_cart_extra_stripe_fields<\/a>\n\n<\/li>\n<li><a href=\"#wpscaftercartoutput\">wpsc_after_cart_output<\/a>\n\n<\/li>\n<li><a href=\"#wpscaddcartbuttonformattr\">wpsc_add_cart_button_form_attr<\/a>\n\n<\/li>\n<li><a href=\"#wpscaddcartsubmitbuttonvalue\">wpsc_add_cart_submit_button_value<\/a>\n\n<\/li>\n<li><a href=\"#wpscredirecttourl\">wpsc_redirect_to_url<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartcustomfieldvalue\">wpsc_cart_custom_field_value<\/a>\n\n<\/li>\n<li><a href=\"#wpscprintformattedprice\">wpsc_print_formatted_price<\/a>\n\n<\/li>\n<li><a href=\"#wpsccartcurrentpageurl\">wpsc_cart_current_page_url<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#payment-related\">Payment Related<\/a>\n\n\n<ul><li>\n<a href=\"#wpscstripescasessionopts\">wpsc_stripe_sca_session_opts<\/a>\n\n<\/li>\n<li><a href=\"#wpsccustompostagecost\">wpsc_custom_postage_cost<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#email-related\">Email Related<\/a>\n\n\n<ul><li>\n<a href=\"#wpscbuyernotificationemailbody\">wpsc_buyer_notification_email_body<\/a>\n\n<\/li>\n<li><a href=\"#wpscsellernotificationemailbody\">wpsc_seller_notification_email_body<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#admin-hooks\">Admin Hooks<\/a>\n\n\n<ul><li>\n<a href=\"#wpscexportcsvheader\">wpsc_export_csv_header<\/a>\n\n<\/li>\n<li><a href=\"#wpscexportcsvdata\">wpsc_export_csv_data<\/a>\n\n<\/li>\n<li><a href=\"#wpscordersmenupermission\">wpsc_orders_menu_permission<\/a>\n\n<\/li>\n<li><a href=\"#pluginlocale\">plugin_locale<\/a>\n<\/li>\n<\/ul>\n<\/li><\/ul>\n\n<h2 class=\"wp-block-heading\" id=\"frontend-hooks\">Front-End Hooks<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"wpscproductboxthumbnailcode\">wpsc_product_box_thumbnail_code<\/h3>\n\n\n<p>This filter allows you to override the product box thumbnail.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscpaypalipnnotifyurl\">wpsc_paypal_ipn_notify_url<\/h3>\n\n\n<p>This filter can be used to override the PayPal IPN notify URL.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccarticonimagesrc\">wpsc_cart_icon_image_src<\/h3>\n\n\n<p>This filter can be used to override the PayPal cart icon URL.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartitemname\">wpsc_cart_item_name<\/h3>\n\n\n<p>This filter can be used to override the PayPal cart item name.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscbeforecheckoutform\">wpsc_before_checkout_form<\/h3>\n\n\n<p>This hook can be used to append or change the content that renders before the checkout form of the cart.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartcheckoutbuttonimagesrc\">wpsc_cart_checkout_button_image_src<\/h3>\n\n\n<p>This hook can be used to override the image of the PayPal Standard checkout form button.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartextrapaypalfields\">wpsc_cart_extra_paypal_fields<\/h3>\n\n\n<p>This hook can be used to add extra PayPal hidden input fields for the cart checkout.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartstripecheckoutbuttonimagesrc\">wpsc_cart_stripe_checkout_button_image_src<\/h3>\n\n\n<p>This hook can be used to override the image of the Stripe checkout form button.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartextrastripefields\">wpsc_cart_extra_stripe_fields<\/h3>\n\n\n<p>This hook can be used to add extra Stripe hidden input fields for the cart checkout.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscaftercartoutput\">wpsc_after_cart_output<\/h3>\n\n\n<p>This hook triggers at the very end of the cart and can be used to change the overall output content of the cart.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscaddcartbuttonformattr\">wpsc_add_cart_button_form_attr<\/h3>\n\n\n<p>This hook can be used to customize the HTML form attributes of the \u2018Add to Cart\u2019 button.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscaddcartsubmitbuttonvalue\">wpsc_add_cart_submit_button_value<\/h3>\n\n\n<p>This hook can be used to add custom button text for the \u2018Add to Cart\u2019 button.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscredirecttourl\">wpsc_redirect_to_url<\/h3>\n\n\n<p>This hook can be used to override the redirection URL used by the <code>wpsc_redirect_to_url()<\/code> function.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartcustomfieldvalue\">wpsc_cart_custom_field_value<\/h3>\n\n\n<p>This hook can be used to override the values of custom fields in the cart added by the \u2018SWPM Custom Fields\u2019 add-on.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscprintformattedprice\">wpsc_print_formatted_price<\/h3>\n\n\n<p>This hook can be used to override the output of the price format by the <code>print_payment_currency()<\/code> function.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccartcurrentpageurl\">wpsc_cart_current_page_url<\/h3>\n\n\n<p>Use this hook to override the current page URL where the cart renders.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<h2 class=\"wp-block-heading\" id=\"payment-related\">Payment Related<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"wpscstripescasessionopts\">wpsc_stripe_sca_session_opts<\/h3>\n\n\n<p>This hook can be used to modify the options while creating a Stripe checkout session. Below is an example of how this filter hook can be used.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter('wpsc_stripe_sca_session_opts', 'customize_wpsc_stripe_session_opts', 10, 2);<br><br>function customize_wpsc_stripe_session_opts($opts, $cart_id) {<br>    \/\/ Modify the success URL to a custom thank-you page<br>    $opts['success_url'] = home_url('\/custom-thank-you-page?cart_id=' . $cart_id);<br><br>    \/\/ Optionally, you can modify other parameters, e.g., add a custom cancel URL<br>    $opts['cancel_url'] = home_url('\/custom-cancel-page');<br><br>    return $opts;<br>}<\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpsccustompostagecost\">wpsc_custom_postage_cost<\/h3>\n\n\n<p>This filter allows developers to provide their own custom postage cost calculation routine. It gives access to the <code>WPSC_Cart<\/code> class instance, which can be used for additional context or logic when calculating the postage cost.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<h2 class=\"wp-block-heading\" id=\"email-related\">Email Related<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"wpscbuyernotificationemailbody\">wpsc_buyer_notification_email_body<\/h3>\n\n\n<p>This hook can be used to override the notification email body for the buyer.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscsellernotificationemailbody\">wpsc_seller_notification_email_body<\/h3>\n\n\n<p>This hook can be used to override the notification email body for the seller.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<h2 class=\"wp-block-heading\" id=\"admin-hooks\">Admin Hooks<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"wpscexportcsvheader\">wpsc_export_csv_header<\/h3>\n\n\n<p>This hook can be used to customize or change the order data CSV export file&#8217;s header row.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscexportcsvdata\">wpsc_export_csv_data<\/h3>\n\n\n<p>This hook can be used to customize or change the order data CSV export file&#8217;s data row.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"wpscordersmenupermission\">wpsc_orders_menu_permission<\/h3>\n\n\n<p>This hook can be used to override the permission of the orders menu.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"pluginlocale\">plugin_locale<\/h3>\n\n\n<p>This hook can be used to change the text domain for loading language files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below is a list of filter hooks that are available in the&nbsp;Simple Shopping Cart&nbsp;plugin. Front-End Hooks wpsc_product_box_thumbnail_code This filter allows you to override the product box thumbnail. wpsc_paypal_ipn_notify_url This filter can be used to override the PayPal IPN notify URL. wpsc_cart_icon_image_src This filter can be used to override the PayPal cart icon URL. wpsc_cart_item_name This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","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":""},"class_list":{"0":"post-5333","1":"page","2":"type-page","3":"status-publish","5":"entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/pages\/5333"}],"collection":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/types\/page"}],"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=5333"}],"version-history":[{"count":1,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/pages\/5333\/revisions"}],"predecessor-version":[{"id":5414,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/pages\/5333\/revisions\/5414"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/media?parent=5333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}