Show Pricing Only For Specific Group

Hi,

I was wondering if it's possible to show the price of a product only for a specific group and to a specific product category.

I know if I change the "Allow shopping for unlogged customers" option to "hide the price and the add to cart button" then this would do what I want. However, I only want to change this for 1 specific category. Every other category can stay the same but I want to create one category which shows the products but not the price except if they are in a trade user group.

I have tried changing the base price to 0 and it shows "Contact us for a price", but when I use the quantity discount tab to add the price for the trade user group, it still only shows "Contact us for a price". Am I missing something here, or is this feature not possible without customisation?

Many thanks!

Requires use of hooks in your my_changes addon area for common/product_data.tpl

.

You will want to use a hook to reset the $smarty.capture.show_price_values variable based on your conditions. By default it is set to true if:

price is set or zero_price_action == 'P' or 'A' OR price is zero and action == 'R'

AND

anonymous shopping == hide_price_and_add_to_cart and the user is not logged in

Otherwise it's set to false

You could also use a PHP hook to set the price based on your condition and then set the zero price action to not show price or add to cart.

It can be done without code modifications

- set value of the "Zero price action" setting to "Do not allow customers to add the product to cart"

- create new catalog promotion

-- conditions:

1. if categories in [SPECIFIC_CATEGORY]

2. if user group not equal [TRADE]

-- bonuses

1. product discount by percentage of the original price 100

- enjoy

It can be done without code modifications

- set value of the "Zero price action" setting to "Do not allow customers to add the product to cart"

- create new catalog promotion

-- conditions:

1. if categories in [SPECIFIC_CATEGORY]

2. if user group not equal [TRADE]

-- bonuses

1. product discount by percentage of the original price 100

- enjoy

Hi eComLabs,

Thanks for the reply, I have tried it and logged in with a trade account but it is still saying "Contact us for a price". I have the following set in the quantity discounts:

Quantity Value Type User Group

1 0 Absolute All

1 50 Absolute (£) Trade

This is how I've been doing my user group discounts and it has worked fine, but I'm not sure if I have to do something different this time?

Hi eComLabs,

Thanks for the reply, I have tried it and logged in with a trade account but it is still saying "Contact us for a price". I have the following set in the quantity discounts:

Quantity Value Type User Group

1 0 Absolute All

1 50 Absolute (£) Trade

This is how I've been doing my user group discounts and it has worked fine, but I'm not sure if I have to do something different this time?

There is no need to set up price for user group in this case. Product price should be equal to price for traders

There is no need to set up price for user group in this case. Product price should be equal to price for traders

Removing the price for the user group has fixed the issue. Now the product can only be added to the cart for trade customers, which is want I wanted. However, the only downside is that for everyone else it says:

Old price: £50.00
Contact us for a price

You save: £50.00 (100%)

This wouldn't be ideal as it says what the price is. Is there any way to stop this from happening without removing the block as I do use this feature on other products?

I'm not entirely sure what tbirnseth means as I don't know how to use the hooks. Would this be something easy for me to do?

In this case it is required to use products:layout_content hook in the design/themes/THEME/templates/views/products/view.tpl file and set show_old_price, show_price, show_list_discount and show_clean_price to false if price is zero

In this case it is required to use products:layout_content hook in the design/themes/THEME/templates/views/products/view.tpl file and set show_old_price, show_price, show_list_discount and show_clean_price to false if price is zero

I have checked this and I cannot see a views folder under design/themes/THEME/templates

I see the following though:

addons

blocks

buttons

common

index.tpl

If you use 3rd party theme, check parent theme (usually it is called responsive)

design/themes/responsive/templates/views/products/view.tpl

If you use 3rd party theme, check parent theme (usually it is called responsive)

design/themes/responsive/templates/views/products/view.tpl

Ah yes, you are correct! How would I set show_old_price to false if the price is zero? Would I be right in thinking I need to add some extra code or create another line in the file?

Try

{if !$product.price || $product.price == '0.00'}
{include 
file=$product.product_id|fn_get_product_details_view
product=$product
show_sku=true
show_rating=true
show_old_price=false
show_price=false
show_list_discount=false
show_clean_price=false
details_page=true
show_discount_label=true
show_product_amount=true
show_product_options=true
hide_form=$smarty.capture.val_hide_form
min_qty=true
show_edp=true
show_add_to_cart=true
show_list_buttons=true
but_role="action"
capture_buttons=$smarty.capture.val_capture_buttons
capture_options_vs_qty=$smarty.capture.val_capture_options_vs_qty
separate_buttons=$smarty.capture.val_separate_buttons
show_add_to_cart=true
show_list_buttons=true
but_role="action"
block_width=true
no_ajax=$smarty.capture.val_no_ajax
show_product_tabs=true
}
{else}
{include 
file=$product.product_id|fn_get_product_details_view
product=$product
show_sku=true
show_rating=true
show_old_price=true
show_price=true
show_list_discount=true
show_clean_price=true
details_page=true
show_discount_label=true
show_product_amount=true
show_product_options=true
hide_form=$smarty.capture.val_hide_form
min_qty=true
show_edp=true
show_add_to_cart=true
show_list_buttons=true
but_role="action"
capture_buttons=$smarty.capture.val_capture_buttons
capture_options_vs_qty=$smarty.capture.val_capture_options_vs_qty
separate_buttons=$smarty.capture.val_separate_buttons
show_add_to_cart=true
show_list_buttons=true
but_role="action"
block_width=true
no_ajax=$smarty.capture.val_no_ajax
show_product_tabs=true
}
{/if}

(!) Not tested

This had the same result as before, not sure I've done this right though. I put that code between

{hook name="products:layout_content"}

{* NOTE: One of the selected product templates will be connected, depending on the 'Product details view' setting.
You can find product templates in the following directory: responsive/templates/blocks/product_templates/
Below are the display parameters we send to the product template.
*}
and
}
{/hook}
Was this the right place?

Correct, try to clear cache or delete the var/cache directory manually

Correct, try to clear cache or delete the var/cache directory manually

I have deleted the var/cache folder as well as using the ?cc&ctpl command but it's still showing this:

Old price: £50.00
Contact us for a price

You save: £50.00 (100%)

Check if you have custom template file in your third party theme. Check if you have view.tpl in

design/themes/[your_custom_theme_name]/templates/views/products/

If yes, add your edits in this file.

Check if you have custom template file in your third party theme. Check if you have view.tpl in

design/themes/[your_custom_theme_name]/templates/views/products/

If yes, add your edits in this file.

Hi alaa,

Thank you for the response. As mentioned previously, there is no views folder in the 3rd party theme folder

PM me temporary access, I will check

PM me temporary access, I will check

Hi eCom,

Thank you very much for the offer but I'm testing this on a dev server which isn't publicly available due to how it has been set up.

Thank you very much for the offer but I'm testing this on a dev server which isn't publicly available due to how it has been set up.

In this case I can only assume that 3rd party module uses hook in the view.tpl template and your changes are ignored

This works pretty well, how do you stop the old price showing in search results though also?