开发者 |
pexlechris
theogk |
---|---|
更新时间 | 2024年8月26日 00:32 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.6.1 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Yes, you can add a cost easily through the plugin settings.
Yes, just set the gift wrapper cost to zero (0).
Yes, you can do this using the tgpc_wc_gift_wrapper_cost
filter.
Simple example:
add_filter('tgpc_wc_gift_wrapper_cost', function($cost){ //Do magic here return $cost; });
You should add this code in your child theme's functions.php file or a Code Snippets plugin.
Yes, you can use the filter tgpc_wc_gift_wrapper_icon_url
in order to return the public url of the image you want
OR
the filter tgpc_wc_gift_wrapper_icon_html
in order to filter the printed html of the icon.
You can do this easily with the following php snippet:
add_filter('tgpc_wc_gift_wrapper_icon_html', function($icon_html){ return ''; });
This highly depends on your theme's CSS, and there is no universal solution. If the icon is not aligned with the checkbox and the label, then you have to add some CSS to fix this.
Try setting a vertical align property to the icon to align it correctly:
.tgpc-enable-checkout-gift-wrapper--label_icon { vertical-align: middle; }
See here the list of all available vertical-align CSS property values.
Yes, you can choose between several checkout page locations through the plugin settings. If you want to use some other hook, read below.
Yes, you need to define the hook that prints the input. And maybe the hook's priority.
define( 'TGPC_GIFT_WRAPPER_CHECKOUT_CHECKBOX_LOCATION_HOOK_NAME', 'new_hook_name' );
define( 'TGPC_GIFT_WRAPPER_CHECKOUT_CHECKBOX_LOCATION_HOOK_PRIORITY', 12 );
Yes, you can write your own CSS to style it as you like. There are appropriate classes in all the right places, so you can apply your CSS wherever you need to.
Yes. All strings in this plugin use the gettext functions, plus an always updated .pot template file is included. This means that they can be translated to any language using a translation plugin like WPML, Polylang, Loco Translate etc. For texts like the checkout checkbox label which is user defined in plugin's settings, translation is also supported for all plugins that support the wpml-config.xml protocol like WPML, Polylang etc., and also TranslatePress. For example, if you use WPML, use "String Translation" and search for (a) "admin_texts_tgpc_gift_wrapper_checkbox_label" domain, or (b) "tgpc_gift_wrapper_checkbox_label" option name, or (c) simply your own text you inserted in the admin field.
Yes, but not out of the box, you have to add some code yourself. You have to use the filter tgpc_wc_gift_wrapper_cost
and modify the gift wrapper cost depending on the selected currency.
You can find some examples in the support forum.
tgpc_wc_gift_wrapper_cost
to modify the gift wrapper cost on the fly.