Okay
  Public Ticket #3649271
Customization Options
Closed

Comments

  • Shihab started the conversation

    Hi, 

    Thank you for making this amazing plugin; it works great. Now, we are trying to make the customizations below on the Creme theme quick order form. Please help us.

    1) We need to change the heading of some of the items of the creme theme - quick order form - such as change name of the heading "In Stock" to "Inventory". Then change the wording of stock from " 20 in stock (can be back ordered)" to "20"

    2) We want to remove the product links from the quick order form.

    Could you please let us know how we can do those customizations?

    Thanks

  •  1,970
    WebWizards replied

    Hi Shihab,

    Thank you for purchasing our plugin,

    1) We need to change the heading of some of the items of the creme theme - quick order form - such as change name of the heading "In Stock" to "Inventory". Then change the wording of stock from " 20 in stock (can be back ordered)" to "20"

    To replace the heading 'In stock' to inventory , you can add this PHP code snippet to your site:

    function my_custom_text_translations( $translated_text, $text, $domain ) {
        if ( $domain == 'b2bking' ) {
            switch ( $translated_text ) {
                case 'In Stock':
                    $translated_text = 'Inventory';
                    break;
            }
        }
        return $translated_text;
    }
    add_filter( 'gettext', 'my_custom_text_translations', 20, 3 );

    Should result in:

    2583913180.png

    Then change the wording of stock from " 20 in stock (can be back ordered)" to "20"

    Regarding this,  just to clarify, this text is a standard WooCommerce text, obtained by calling 'get_availability_text()' for a product. This is handled by WooCommerce based on several things:

    - In WooCommerce -> Settings -> Inventory -> Products, this setting controls this partially: https://prnt.sc/UGDneKksVYp7

    - It also depends if you enable 'allow' or 'allow but notify customer' for each product: https://prnt.sc/Bie4QVAAIuqA


    Here are you looking to generally change this text everywhere? or strictly on the B2BKing order form? and do you want only strictly the number such as 0, 10, 20? If the number in stock is 0 but the product can be backordered, it should say '0'?


    2) We want to remove the product links from the quick order form.

    I understand you're referring to the links to each product when the product name is clicked? You can disable those, by adding the following PHP code snippet to your site:

    add_filter('b2bking_cream_form_link', function($val){
        return '#';
    }, 10, 1);
    add_action('wp_head', function(){
        ?>
        <script>
            jQuery(document).ready(function() {
                jQuery('body').on('click', 'a.b2bking_bulkorder_indigo_name, a.b2bking_bulkorder_cream_name', function(event) {
                    event.preventDefault();
                });
            });
        </script>
        <style>
            .b2bking_bulkorder_indigo_name.b2bking_bulkorder_cream_name:hover {
                cursor: auto !important;
            }
        </style>
        <?php
    });


    Kind regards,

    Stefan