Αυτό το πρόσθετο δεν έχει δοκιμασθεί με τις 3 τελευταίες κύριες εκδόσεις του WordPress. Μπορεί να μην αναπτύσσεται ή να υποστηρίζεται άλλο και να έχει προβλήματα συμβατότητας με τις πιο πρόσφατες εκδόσεις του WordPress.

WC Gift Packaging

Περιγραφή

Add a simple “Send this order packaged as gift” checkbox to the checkout. Optionally it is possible to set a price for the packaging.

If you want multiple gift packagings and other fancy stuff this is not the plugin for you … this plugin is intentionally very lightweight to fit directly into the WooCommerce user experience.

Εγκατάσταση

Here’s how to install the plugin:

  1. Upload ‘woocommerce-gift-options’ to the ‘/wp-content/plugins/’ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to WordPress Admin > WooCommerce > Settings > Checkout and set the ‘Gift packaging cost’ field if you want to charge something for the packaging

Συχνές Ερωτήσεις

Is it possible to add a price for the packaging

Yes. You can change this under Woocommerce > Settings > General > WC Gift Packaging in the ‘Gift packaging cost’ field.

Is it possible to change the position of the checkbox

Yes. You can change the hook of the checkbox like this:

add_filter( 'wc_gift_packaging_field_hook', 'custom_hook_position' );

function custom_hook_position( $text ) {

    return 'woocommerce_after_order_notes';

}
Is it possible to change the text of the checkbox

Yes. You can change the text of the checkbox with the wc_gift_packaging_checkout_field filter:

add_filter( 'wc_gift_packaging_checkout_field', 'my_checkbox_text' );

function my_checkbox_text( $text ) {

    return __( "Send this order as awesome packaged gift" );

}
Is it possible to wrap the checkbox in some html

Yes. You can use the before_wc_gift_packaging_checkout_field and after_wc_gift_packaging_checkout_field hooks like this:

add_action( 'before_wc_gift_packaging_checkout_field', 'custom_start' );

function custom_start() {

    echo '<div class="my-custom-html">';

}

add_action( 'after_wc_gift_packaging_checkout_field', 'custom_end' );

function custom_end() {

    echo '</div>';

}
Is it possible to customize the note in the mail, order details or backend

Yes. You can use the wc_gift_packaging_admin_note, wc_gift_packaging_order_note or wc_gift_packaging_email_note filters to completely change the note. Here are two examples:

add_filter( 'wc_gift_packaging_admin_note', 'custom_note', 10, 2 );

function custom_note( $text, $is_gift ) {

    if( $is_gift ):

        return '<h3>' . __( "This is a regular order" ) . '</h3>';

    else:

        return '<h3>' . __( "This order is a gift" ) . '</h3>';

    endif;


}


add_filter( 'wc_gift_packaging_order_note', 'html_wrap', 10, 2 );

function html_wrap( $text, $is_gift ) {

    return '<div class="my-custom-html">' . $text . '</div>';


}

Κριτικές

1 Φεβρουαρίου 2022
Hi there! Many thanks to your lightweight plugin!! It is easy to use, also lightweight. WORKS FINE but, I have found some bugs in your plugin (about translations) UPDATE: The plugin is abandoned so, we had released a similar plugin to this fixing the bugs and giving the ability for free gift wrappers!! Gift Wrapping for WooCommerce
14 Σεπτεμβρίου 2019
Its working great now..
Ανάγνωση όλων των 3 κριτικών

Συνεισφέροντες & Προγραμματιστές

“WC Gift Packaging” είναι λογισμικό ανοιχτού κώδικα. Οι παρακάτω έχουν συνεισφέρει στη δημιουργία του.

Συντελεστές

Το “WC Gift Packaging” έχει μεταφραστεί σε 3 γλώσσες. Ευχαριστούμε τους μεταφραστές για τις συνεισφορές τους.

Μεταφράστε το “WC Gift Packaging” στην γλώσσα σας.

Ενδιαφέρεστε για την ανάπτυξη;

Περιηγηθείτε στον κώδικα, ανατρέξτε στο αποθετήριο SVN ή εγγραφείτε στο αρχείο καταγραφής αλλαγών ανάπτυξης μέσω RSS .

Σύνοψη αλλαγών

1.5

  • The price setting is now visible again under Woocommerce > Settings > General in the WC Gift Packaging section

1.4

  • Updated plugin information

1.3

  • Bugfix that removes a PHP-Undefined-Index-Notice

1.2

  • Bugfix that changes $order->id to $order->get_order_number()

1.1

  • Bugfix wich makes the $checkout parameter in the wc_gift_packaging_field function optional to allows the usage of more hooks

1.0

  • Initial release