Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2389961
Add discount to multiple bundle products
Closed

Comments

  • Wojciech Augustyniak started the conversation

    Hi,

    We have multiple bundle products. For the most part we add discount in each bundle using WPC plugin. So that individual products could have their individual price.

    Is there a way to add/remove percentage or value discount to multiple bundles at once? 

    Sorry for my english.

    Regards

  •  767
    Janilyn replied

    Hi Wojciech, 

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. Please stay in touch as he might need discuss further with you. 

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,228
    Dustin replied

    Hi Wojciech,

    Yes! I can help you to do that. Please add below code to current theme (or child-theme) / functions.php

    1. If you want to add the discount percentage for bundle IDs: 10, 11, 12, 13, 99, 608

    add_action( 'admin_init', 'woosb_bulk_change_discount' );
    function woosb_bulk_change_discount() {
        $bundle_ids = array( 10, 11, 12, 13, 99, 608 );
        foreach ( $bundle_ids as $bundle_id ) {
            delete_post_meta( $bundle_id, 'woosb_discount_amount' );
            // discount percentage 15%
            update_post_meta( $bundle_id, 'woosb_discount', '15' );
        }
    }

    2. If you want to add the discount percentage for bundle IDs: 10, 11, 12, 13, 99, 608

    add_action( 'admin_init', 'woosb_bulk_change_discount' );
    function woosb_bulk_change_discount() {
        $bundle_ids = array( 10, 11, 12, 13, 99, 608 );
        foreach ( $bundle_ids as $bundle_id ) {
            delete_post_meta( $bundle_id, 'woosb_discount' );
            // discount amount 20
            update_post_meta( $bundle_id, 'woosb_discount_amount', '20' );
        }
    }

    * After adding the code, you only need to open the Dashboard page (wp-admin) then all bundles will be changed. Then please remove this code, just add the code when you need to bulk change again.

    Best regards,
    Dustin

  • Wojciech Augustyniak replied

    WOW! That works pretty well, thank you!

    There are two small issues though. Instead of percentage value on sale bubble there is only "sale" word. Both on the store and product page there is just discounted price without normal crossed price.

    These are minor issues that ultimately i can live without but it would be great if this could match normal products.

    Sorry for my english.

    Regards

  •  1,228
    Dustin replied

    The percentage value on the sale bubble maybe was added by the theme or a custom function. I need to access your website to check it.

    Please send me your website info (wp-admin link, username, password) then I can check and fix this problem for you. You also can create a dev/staging site with the same issue then I'll work on it. Read more about sending secure login information here https://wpclever.net/faqs/sending-secure-login-information.

    Remember to mark your reply is private!

    Best regards,
    Dustin