Okay
  Public Ticket #3366382
Request quote only for specific product category
Closed

Comments

  •  4
    Mārtiņš started the conversation

    https://prnt.sc/hzWwIa67kX8N

    This is cart page for products that have dynamic rule "Quotes on Specific Products".
    Rule is set for one specific product category. 
    Couldnt find a way to hide the grey block that is woocommerce native "cart-totals-section", since there are no products with price and there is only option to request_custom_quote.

  •  2,218
    WebWizards replied

    Hi Martins,

    I looked into it and I believe I was able to write a code snippet that could solve this on your site.


    Please try to add this PHP code snippet to your site:

    add_action('wp_footer', function(){
        if (b2bking()->user_has_p_in_cart('quote') === 'yes'){
            ?>
            <style type="text/css">
                .cart-totals-section {
                    display: none;
                }
                .woocommerce-cart-form {
                    width: 100% !important;
                    max-width: 100% !important;
                    flex: 0 0 100% !important;
                }
            </style>
            <?php
        }
    });
    

    It should be able to hide that area and stretch the cart contents to 100% width if there is a quote product in cart.


    Let me know if that works for you,


    Kind regards,

    Stefan

  •  4
    Mārtiņš replied

    Hey!

    Yea! This works like an charm! Thank you very much! 

  •   WebWizards replied privately
  •  4
    Mārtiņš replied

    There is one more thing.

    Im not sure if its possible, but can i use VAT validation field and remove VAT also for other type of users, not just b2b?

    Iw gotten so far now that the b2bking VAT field shows in checkout for all users, but Validation button doesnt seem to appear for other type of users. The error in case of invalid VAT nr still shows, so im asuming the validation it self hapens.

    So i gues i am missing just the button and the tax removal in case of valid VAT nr.

    ________________________________________________________________

    About original problem.

    I see that if client has quote product in cart, they cant add other normal products to the cart. The store is set up mainly with ordenary products. Just  one category products is set to be only quote products and are visible only for b2b clients. This logic seems normal and  is standart if im understanding correctly. In that case im woundering if solution you provided for me shouldnt be in plugin functionlity by default ( or an feature atleast ) ?

  •  4
    Mārtiņš replied

    Sorry about the "one more thing". Just needed a fresh look i gues. I got it, all good.

  •  4
    Mārtiņš replied

    Hello. 
    One more question. 

    Is it possible to enable offers for b2b client only when an client has made custome quote request via special category thats has dynamic rule set to be custome quote only products? The goal is not to enable custome quotes globaly, but only for this special category products.

    Now if custome quote request is made by b2b client and Offers are disabled globaly, this client cant see the admin response offer.

  •  2,218
    WebWizards replied

    Hello,

    Offers would have to be enabled globally - there's no way to enable them only if the user has a quote request/offer.

    But please note that you can create an offer for a specific user only: https://prnt.sc/1Y4gFUl0-kqD (so other users would not see it).

  •  4
    Mārtiņš replied

    Thing was about the "Request an custom quote" button in cart allways showing, but i used the same code you provided earlyer and added an else to hide that button if there are no quote products in cart. All good. 

    But overall im thinking plugin lacks functionality for such unique category quote products, since there is such dynamic rule available to set up. 

    Dont get me wrong, plugin is great. :) 

  •  4
    Mārtiņš replied

    And one more thing...


    https://prnt.sc/VDVPbeuO6kXC
    Can this default measage field for request be made required? 
    Now clients can easy make an offer and dont provide any price and/or info.

  •  2,218
    WebWizards replied

    Oh, I'm sorry, I misunderstood,

    I see your point - it would make sense to have a setting maybe to show that only if there are quote products in cart,


    We will look into it for future updates,

    Right now we are working on a big update with many UI improvements that will be ready soon,


    Kind regards,

    Stefan

  •  4
    Mārtiņš replied

    How about this?

    https://prnt.sc/VDVPbeuO6kXC Can this default measage field for request be made required?  Now clients can easy make an offer and dont provide any price and/or info.

  •  4
    Mārtiņš replied

    Hello! Its me again! 

    What about translating plugin with loco translate?
    We have polylang pro and loco translate set up.

    Registration role dropdown values doesnt seem to translate for all languages altho theyr appear translated in PO files. 

    https://prnt.sc/MD1JxpV7mVNB

  •  2,218
    WebWizards replied

    Hi again,

    Registration Fields / Roles will need to have their values changed directly in B2BKing -> Registration Roles / Fields. Please see our guide here about that: https://woocommerce-b2b-plugin.com/docs/how-to-translate-b2bking-to-any-language-localization/ - "Translate Registration Fields and Roles with Loco Translate".


    Do you need to translate to multiple languages using Polylang? or only 1 language? (for multiple languages with Polylang it is a bit more complex, I can send you the necessary details if helpful).


    There’s no feature in the plugin to make the "message" field required, but you can go to B2BKing -> Settings -> Other -> Quote -> Manage Quote Fields, and there you can configure a custom Required field:

    2916522868.png

    (you can add any field there such as "price", "info", "size" etc).


  •  4
    Mārtiņš replied

    Yea the problem is i have 4 languages and we are using Polylang and loco combo. 
    Iw noticed there are multiple strings that appear translated in loco, but in front end they appear in English anyways. 

  •  4
    Mārtiņš replied

    There is one more thing. 

    If for example Polish shop client makes an offer to Product ( PL translation of a product ) and an Show admin creates an offer when his admin dashboard languege is set other than language the Offer was made, the product appears as "Null" everywhere. 

    When admin sets his language the same one client is using the product appears correctly.

    https://prnt.sc/Oq6C1lwm32Ot

    Once again this is the same Polylang and loco sett up with multiple languages. 

  •  2,218
    WebWizards replied

    Hi again,

    Thank you for your patience on this,


    Generally speaking, to translate registration roles, it would be needed to modify their title directly:

    1120050290.png

    (the values in the PO file are not used in this case)


    And to translate registration fields, it is needed to edit the Label and Placeholder:

    2606769221.png

    (again, these are not controlled in the PO file),



    Now if you are using PolyLang, it is needed to first of all enable the "Custom Registration Role" and "Custom Registration Field" post types  in Polylang>Settings:

    7893397498.png


    Then when you go to B2BKing -> Registration Fields / Roles you can see translations (flags) in the right side column.

    4700544498.png


    To translate roles, basically it would be needed to add a version of the role in each language, and change the title of each version to the correct language.



    I believe it would be the same for Offers, it would be needed to create a version of the offer in each language (enabling the custom post type in settings first). I think the problem in your example where you're seeing NULL is that the offer exists in only 1 language, but not the other.



    If you are not able to get the above working, I would be happy to look into it directly on your site to get this resolved. I would need a backend login to the site, or to a staging clone site,


    Kind regards,

    Stefan

  •  4
    Mārtiņš replied

    What version of Polylang are you testing on? 
    Registration taxonomies arnt showing for me in settings for Polylang Pro ( 3.3 ).
    https://prnt.sc/eDEO9uwXrvf3

  •  4
    Mārtiņš replied

    Another question. 

    We are using Woodmart theme. In checkout there quantity buttons for each product. If product has step value set in settings, after changing the quantity in checkout, after ajax reload the input resets back to min amount value set by b2bking. 


    https://prnt.sc/4GT2fTTAzkrU

    https://gyazo.com/485735e482eb21583778e4bbec4dc7d3

  •   WebWizards replied privately