TinoArts Posted July 10, 2020 Share Posted July 10, 2020 I basically need to set up custom rules for which products should be displayed based on various conditions. E.g. is user with the user group "X" is logged in, only display products that has a specific price for group "X" set up, the rest should be hidden completely. Is there a hook, or a core function in which I could add my code? Thank you. Link to comment Share on other sites More sharing options...
joseantgv Posted July 13, 2020 Share Posted July 13, 2020 Maybe this fits your needs: https://addons.prestashop.com/en/stock-supplier-management/32668-hide-or-show-products-by-stock-by-price-by-geoip.html Link to comment Share on other sites More sharing options...
TinoArts Posted July 13, 2020 Author Share Posted July 13, 2020 Thank you, but I need to make an automated solution, so I won't have to set these rules for each product individually. I just want to set up a rule in code (e.g. if [column] in [ps_products] table for current product equals 0, do not display it for users in [group_x], etc.). For example in WooCommerce I can easily hook into 'woocommerce_product_query' and alter the query settings with custom rules. I'm looking for a similar solution for PS. Link to comment Share on other sites More sharing options...
TinoArts Posted January 22, 2021 Author Share Posted January 22, 2021 Bump: This is becoming really urgent for me, any ideas? Link to comment Share on other sites More sharing options...
TinoArts Posted February 1, 2021 Author Share Posted February 1, 2021 Bump: Anyone? Link to comment Share on other sites More sharing options...
joseantgv Posted February 1, 2021 Share Posted February 1, 2021 En 13/7/2020 a las 10:39 AM, TinoArts dijo: Thank you, but I need to make an automated solution, so I won't have to set these rules for each product individually. I just want to set up a rule in code (e.g. if [column] in [ps_products] table for current product equals 0, do not display it for users in [group_x], etc.). For example in WooCommerce I can easily hook into 'woocommerce_product_query' and alter the query settings with custom rules. I'm looking for a similar solution for PS. You can do it with this module, it's not needed to set a rule for each product. For example, you could set: "If product price is between X and Y, hide for customers group Z". Link to comment Share on other sites More sharing options...
TinoArts Posted February 1, 2021 Author Share Posted February 1, 2021 I understand, but I've checked their back end demo and it really seems it doesn't fit my use case. I need to hide all products for [customer group X], that do not have a specific price set explicitly for [customer group X]. In that module I can only filter the products to be hidden by price, sale, stock, etc., not this specific condition. Link to comment Share on other sites More sharing options...
joseantgv Posted February 2, 2021 Share Posted February 2, 2021 hace 17 horas, TinoArts dijo: I understand, but I've checked their back end demo and it really seems it doesn't fit my use case. I need to hide all products for [customer group X], that do not have a specific price set explicitly for [customer group X]. In that module I can only filter the products to be hidden by price, sale, stock, etc., not this specific condition. Yes you can, with this option: Please send a message here https://addons.prestashop.com/contact-form.php?id_product=7422 to configure exactly what you need. Link to comment Share on other sites More sharing options...
TinoArts Posted February 3, 2021 Author Share Posted February 3, 2021 Do you mean the "Hide products without discount" setting? That is not my use case unfortunately. I have three customer groups: B2B-1, B2B-2, B2B-3 For some products I have the Specific prices set only for group B2B-1, B2B-2, or B2B-3 For example, some product might not have any of those specific prices, it should be completely hidden for all three B2B user groups. Some products might only have a B2B-1 specific price set, it would only show to B2B-1 customer group. Some products might have all three, they would be visible to all three groups. In WooCommerce I can hook into 'woocommerce_is_purchasable' for this, or even alter the query completely with 'pre_get_posts' hook, which would totally fit my use case based on my custom conditions. Isn't there anything similar in Presta 1.7? Link to comment Share on other sites More sharing options...
joseantgv Posted February 3, 2021 Share Posted February 3, 2021 hace 3 horas, TinoArts dijo: Do you mean the "Hide products without discount" setting? That is not my use case unfortunately. I have three customer groups: B2B-1, B2B-2, B2B-3 For some products I have the Specific prices set only for group B2B-1, B2B-2, or B2B-3 For example, some product might not have any of those specific prices, it should be completely hidden for all three B2B user groups. Some products might only have a B2B-1 specific price set, it would only show to B2B-1 customer group. Some products might have all three, they would be visible to all three groups. In WooCommerce I can hook into 'woocommerce_is_purchasable' for this, or even alter the query completely with 'pre_get_posts' hook, which would totally fit my use case based on my custom conditions. Isn't there anything similar in Presta 1.7? I'm pretty sure you can configure this with this module. Please send a message here https://addons.prestashop.com/contact-form.php?id_product=7422 and we will help you to configure exactly what you need. Link to comment Share on other sites More sharing options...
TinoArts Posted February 3, 2021 Author Share Posted February 3, 2021 I sent you a pre-sale ticket, looking forward for your reply. Thank you for your time. :) Link to comment Share on other sites More sharing options...
TinoArts Posted February 3, 2021 Author Share Posted February 3, 2021 OK I just got confirmation that it is not doable with the mentioned module. Is there anyone who would help me finding the code that queries the products on category/catalog pages? I can get all the necessary information from the database, I just need to know where can I put my conditions and filters. Something like 'pre_get_posts' in WP. Anyone? Thank you. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now