Add to Cart Button and Quantity Selector Shown or Hidden by Shopper Group

Started by saviB, June 21, 2012, 14:59:37 PM

Previous topic - Next topic

saviB

I couldn't find a solution for this in the forum so I hired a very talented programmer to build the solution for me. He was tasked with two parts and in the spirit of open source, agreed to share the fruits of his labor (and my money!). Credit to Kulwant Singh for the programming.

A: A simple edit/hack - to disable the add to cart button and quantity selector to all non logged in users

B: Create a new option in Shopper Group admin "Show Cart Tools". This wonderful mod shows or hides the add to cart button and quantity selector by shopper group. This allows one site to be used as both catalog and store.

Part A: Follow the instructions for Part B - BUT use the file attached named "default_part_a.php" instead removing the _part_a before use. NOTE - I haven't tested part A yet.

Part B: The files for part B are attached and these are the instructions:

BE SURE TO BACK UP YOUR SITE FIRST AND MAKE COPIES OF THE ORIGINAL FILES. THIS CODE WORKS FOR ME BUT I ASSUME NO RESPONSIBILITY OR LIABILITY FOR DAMAGE IT MAY CAUSE. USE AT YOUR OWN RISK.

Replace these files with the attached.

en-GB.com_virtuemart.ini to be placed in administrator\language\en-GB
shoppergroup.php to be placed in administrator\components\com_virtuemart\models
edit.php to be placed in administrator\components\com_virtuemart\views\shoppergroup\tmpl
default.php to be placed in components\com_virtuemart\views\productdetails\tmpl

One item I stumbled on is that I am using a Rockettheme. The location for the default.php file in my case was: templates/your_template_name/html/com_virtuemart/views/productdetails/tmpl

Enjoy!

[attachment cleanup by admin]