Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Show Pricing Only For Specific Group Rate Topic   - - - - -

 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 23 July 2018 - 02:51 PM #1

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!



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10912 posts

Posted 23 July 2018 - 09:45 PM #2

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 24 July 2018 - 06:19 AM #3

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 24 July 2018 - 07:31 AM #4

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 24 July 2018 - 01:25 PM #5

 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 


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 24 July 2018 - 02:33 PM #6

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 25 July 2018 - 06:41 AM #7

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 25 July 2018 - 07:55 AM #8

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 25 July 2018 - 01:18 PM #9

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

 

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 25 July 2018 - 01:25 PM #10

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 25 July 2018 - 01:27 PM #11

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 25 July 2018 - 02:15 PM #12

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?


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 26 July 2018 - 06:05 AM #13

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 26 July 2018 - 07:33 AM #14

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%)



 
  • alaa
  • Advanced Member
  • Trial users
  • Join Date: 18-Mar 18
  • 69 posts

Posted 26 July 2018 - 10:11 AM #15

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. 



 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 26 July 2018 - 10:16 AM #16

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 26 July 2018 - 12:53 PM #17

PM me temporary access, I will check


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Ghiyas
  • Advanced Member
  • Trial users
  • Join Date: 07-Aug 17
  • 113 posts

Posted 26 July 2018 - 01:13 PM #18

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.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18181 posts

Posted 27 July 2018 - 05:22 AM #19

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.