• Hi, we currently have a very successful online shop, dealing with the public. However we now wish to add a trade only section to our shop (obviously trade prices a different to public) So how do i add a new password protected section to the shop? i know how to password protect a page but cant seem to add the shop to that page if that makes any sense.

    Cheers
    Mark

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You can password protect individual product pages the normal way by altering the visibility of the product, but I would advise against this approach. You end up managing shared passwords, it would be a nightmare. Shared passwords have no place in real security.

    I recommend managing trade users by user role. If they would be buying the same products, only at different pricing, the price displayed can be managed by user role. There is likely a WooCommerce (WC) hook that can be used to display pricing different than the usual retail price. If not, the WC templates displaying prices can be overridden. I’m unsure of the best way to save trade pricing. If you are merely offering a percentage discount, it can be calculated dynamically. Otherwise, it could be stored in post meta (custom fields) or something.

    The default custom field UI would be workable but not ideal for specifying trade pricing on product pages. There may be a way to add fields in the normal WC pricing metabox through some hook. For details on specific hooks, you may need to search through WC source code. Before resorting to that, try asking in the dedicated WC support forum. Someone there may already have been there or at least have a good idea of where to look. Unfortunately, I’m not that knowledgeable of WC hooks, other than there are a lot of them and the chances of there being one are good.

    The fall backs for no hooks being available are template overrides for pricing display, which is documented on the WC site; and custom metaboxes for the product edit screen UI.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Password Protected pages to my shop’ is closed to new replies.