[wcj_product_purchase_price]

Display WooCommerce saved product purchase cost price

Description

[wcj_product_purchase_price] shortcode displays WooCommerce product purchase cost price. Shortcode has no required attributes, optional attributes are listed below.

Args

product_id
(optional) The integer ID for a product.

Default: The current product ID, if exists
before
(optional) Text to place before the content. If content is empty this argument is ignored.

Default: None
after
(optional) Text to place after the content. If content is empty this argument is ignored.

Default: None
visibility
(optional) User visibility. Possible values are WordPress user roles (including custom), e.g. administrator, shop_manager, customer, guest etc.

Default: all
location
(optional) Make shortcode results visible only to customers from specific country (by user IP). Value is two letter country code.

Default: all
site_visibility
(optional) Restrict shortcode output to some pages only. Possible values: single, page, archive.

Default: None
wpml_language
(optional) Restrict shortcode output to certain WPML language only. Possible values are two letter language codes. Can be comma separated list.

Default: None
not_wpml_language
(optional) Restrict shortcode output to exclude certain WPML languages. Possible values are two letter language codes. Can be comma separated list.

Default: None

Examples

[wcj_product_purchase_price before="Product purchase cost: "]
Accessible through:
  • [wcj_product_purchase_price]
Tested on WooCommerce 3.5.7 and WordPress 5.1.1
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

5 Comments

  1. Facu April 11, 2019 at 2:28 am #

    How can I add this shortcode to the PDF Invoice Template? Thank you in advance

    Reply to thread

    Avatar
    • RokasJ April 11, 2019 at 1:48 pm #

      Hi,

      Unfortunately it’s not currently possible to add it to order_items_table (to be shown for each product), but we have added it to our todo list. Of course, you could hardcode it to be shown for specified product(s) by adding this shortcode directly to the template however it will always be shown regardless of what customer actually purchases.

      Best regards,
      Rokas – Support Team

      Avatar
    • Facu April 12, 2019 at 1:53 pm #

      Do you have a timeframe? I recuestes something like this 2 months ago and at that moment also told me that was on your todo list, I just need a timeframe so I can plan accordingly, Thank you very much

      Avatar
  2. Facu April 17, 2019 at 1:13 pm #

    How can I “hardcode” this? is there any tutoría? Thank you

    Reply to thread

    Avatar
    • RokasJ April 17, 2019 at 7:27 pm #

      Hi Facu,

      What I meant is that you could add
      [wcj_product_purchase_price product_id="1"],
      [wcj_product_purchase_price product_id="2"]…
      to the PDF template and it would show purchase price for these products. This would be counterproductive since it would show this for all products you have listed this way. Unfortunately I do not have a time-frame since these requests are handled by our development team.

      Best regards,
      Rokas – Support Team

      Avatar