Skip to content

Art-iDev/arti-product-shipping-notices

Repository files navigation

Donate with PayPal

Ajude a manter plugins gratuitos com Pix

Documentação em português aqui.

Product Shipping Notices for WooCommerce-based marketplaces

Add automated notices to your product page based on vendor's shipping configurations.

Currently, the marketplace supported is WCFM, but plans are to add most WooCommerce marketplace providers existent.

How to use

Download the latest release here and install normally. To show the notices in you product page, you have the following options:

<?php
// Render in whichever action you want.
add_action( 'woocommerce_after_add_to_cart_button', [ \Arti\PSN\Shipping_Notices::get_instance(), 'render_notices' ] );

// Use directly in a template file.
\Arti\PSN\Shipping_Notices::get_instance()->render_notices();

// Use the shortcode.
// [shipping-notice] or
do_shortcode( '[shipping-notice]' );

Hooks

Available hooks are:

Filters

  • arti_psn_shipping_notice_update
  • arti_psn_group_notices_by_min_amount
  • arti_psn_sort_notices_by_min_amount
  • arti_psn_remove_default_when_free_shipping_present
  • arti_psn_free_shipping_notice_template
  • arti_psn_free_shipping_url_template

You may also check the files in the "templates" dir for additional actions.

CSS

The plugin doesn't have styles applied to it, so you must implement your own. The available selectors are:

  • .shipping-notice for the outer box;
  • .shipping-notice.default
  • .shipping-notice.free-shipping

Example adding some padding and background color with Storefront theme:

image

Templates

You can copy the files in the templates dir into your theme dir, and edit it to make them suitable to your needs.