Shortcodes

YITH Render Barcode

The shortcode [yith_render_barcode] allows you to display a barcode anywhere you wish on the page. You can set up the following attributes:

  • id: enter the ID of the order/product/ticket/gift card to display a specific barcode.
  • hide_if_empty (default: 1): this has to be used together with the ID attribute to make sure the shortcode box hidden if there is no barcode with the selected ID.
  • protocol: it allows you to specify which protocol to use to display the barcode (default: EAN8).
  • value: it allows you to specify the barcode number you want to display. This has to be used with the protocol parameter.
    Example: if you want to display a barcode with value 1234 on a specific place on your website, you can use this shortcode setup:

[yith_render_barcode protocol=EAN8 value=1234]

YITH Order Barcode

The shortcode [yith_order_barcode] allows you to view a section with which you can apply actions on orders.
You can configure this shortcode from YITH > Barcode > Shortcode tab in the plugin settings.

  • Shortcode capability: this allows you to choose which capabilities are required to be able to use the information printed by this shortcode. Default to: manage_woocommerce, so that only admins and shop managers will be able to access to this information. You can use ‘all’ or any other capability to customize this option.
  • Show Processing button: this allows you to add a button so that you can set the status of the rendered order to Processing in one click.
  • Show Completed button: this allows you to add a button so that you can set the status of the rendered order to Completed in one click.
  • Update an order status after scanning: choose here if you want to automatically perform a specific action whenever an order status is scanned:
    • Don’t update the order status
    • Process the order automatically
    • Complete the order automatically


YITH Product Barcode

With this shortcode, you will be able to show the product barcode and automatically or manually update the stock quantity and add it to the cart. Go to YITH > Barcodes > Shortcode > Product shortcode to configure the shortcode options.

  • Shortcode capability: this allows you to choose which capabilities are required to be able to use the information printed by this shortcode. Default to: manage_woocommerce, so that only admins and shop managers will be able to access to this information. You can use ‘all’ or any other capability to customize this option.
  • Show Stock buttons: this allows you to add two buttons to let you increase or decrease the stock quantity of the product displayed.
  • Stock behavior on product scan: choose here if you want to automatically perform a specific action whenever a product barcode is scanned:
    • Don’t update the stock
    • Decrease the product stock automatically
    • Increase the product stock automatically

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 many buttons, one for every additional actions, and allow third-party plugins to manage their custom actions.

The other button, Custom action (or more buttons if you prefer) will only work if you write a custom code associated with it, using “custom action”.

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

The result will be: