Actions on product barcodes

YITH WooCommerce Barcodes lets you perform actions on products based on the barcodes generated, you have to simply use the following shortcode:

[yith_product_barcode]

With this shortcode you can show a text field where the user can enter a barcode value and perform some action, from some custom action like the search to customized actions hooked by third party plugins.

The available parameter are the following:

‘capability’
(string) The capability needed in order to see this shortcode rendered on front end pages.
It could be useful to allow only admins or shop managers to see and work with the shortcode area, hiding the shortcode results to all the other users.
Default: ‘manage_woocommerce’

‘actions’
(string) A comma separated string with the list of the actions that could be performed on product based on their barcode value.
Every action will be shown as a button and all custom actions need a third party code to manage the action itself.
Default: ‘search’

Examples

Show the shortcode area to all the users

You can choose to let everyone see and manage the content area rendered by the shortcode, setting the capability attribute as ‘all’.
The following example will show the shortcode area to everyone.

[yith_product_barcode capability="all"]

The result will be the following(use 994 as value for performing a search on product barcodes):

Product barcode

Show the shortcode area only to user with capability ‘manage_woocommerce’

You can choose to let users to see the shortcode area only if they have a specific capability.
The following example will show the shortcode area only to users with ‘manage_woocommerce’ capability.

[yith_product_barcode capability="manage_woocommerce"]

or leaving the capability attribute empty(the default value is ‘manage_woocommerce’

[yith_product_barcode]

The result will be:

Product barcode


(if you do not see any content, you do not have enough capability).

Show additional buttons in the shortcode area

There is a default action(‘search’) that can be performed on products but it’s possible to add as many buttons, one for every additional actions, allowing third party plugins to manage their custom actions.

The following example will show 3 buttons, labelled ‘search’, ‘increase stock’, ‘decrease stock’.
While the ‘search’ button will perform really a search based on the barcode value entered, the other 2 buttons wont do anything because there aren’t any custom code associated to them.

[yith_product_barcode actions="search, increase stock, decrease stock"]

The result will be:

Product barcode

30 Days Money Back Guarantee 30 DAYS MONEY BACK GUARANTEE
100% refund if you are not satisfied