Greetings:
I was wondering if there was a line or code that we can add to the "Store Pickup" shipping model that will make it so that only people in my Group discount called "Friends" can use this option..
Thanks
Greetings:
I was wondering if there was a line or code that we can add to the "Store Pickup" shipping model that will make it so that only people in my Group discount called "Friends" can use this option..
Thanks
While this is not built into Zen Cart ... you could customize the shipping module to only show for people in a given Group Discount group ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
You need to look up the customers Group Discount to find out if they are allowed to see the Store Pickup shipping modules ...
This is best done with a function in the catalog to look up the customer's group_id and a function in the admin to return true so that the modules can function in both the Catalog and Admin ...
If you look at the current /includes/modules/shipping/storepickup.php there is the line:
If you added an IF statement around this where the function checks for the right group id and returns true if this is the Friends or false if it is not ... that can control whether this shows:PHP Code:$this->enabled = ((MODULE_SHIPPING_STOREPICKUP_STATUS == 'True') ? true : false);
PHP Code:if (your_function_here) {
$this->enabled = ((MODULE_SHIPPING_STOREPICKUP_STATUS == 'True') ? true : false);
} else {
$this->enabled = false;
}
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Do you know what is wrong with this code ? 'Friends' is the group that i want it to show too...if (MODULE_ORDER_TOTAL_GROUP_PRICING_TITLE == 'Friends') {
$this->enabled = ((MODULE_SHIPPING_STOREPICKUP_STATUS == 'True') ? true : false);
} else {
$this->enabled = false;
}
You need to really build a lookup function for the Group ID as it is not available to you in that format when the shipping modules run ...
The function would check either the group_pricing table for that customer based on group_name or could check the customers table for the customers_group_pricing which is the group_id ...
If it is the one associated with your "Friends" return true and the shipping module would show ... if not, return false and the shipping module would hide or be disabled ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Yea, see i don't know how to do this ...
In order to tell you all that you have to do, I would have to sit down and write the code to manage this for you ...
As I say, it can be done ... it just takes customization to the code to manage the conditions where a given Group Discount group controls the shipping module(s) ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Look at the shipping modules ...
You will see that there is a function that controls them via the $this->enabled example on the file:
/includes/modules/shipping/item.php
If you did a search in the Tools ... Developer's Tool Kit ... in the bottom input box for:PHP Code:// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
}
Select Catalog/Admin ... Click Search ...function zen_get_shipping_enabled
You would find two files with this function ...
The one in the Admin just returns true so that the module loads properly in the Modules ... Shipping ...
The one in the Catalog checks for various conditions and returns true or false when the shipping module should be displayed ...
If you were to write a function to manage the $this->enabled for the storepickup.php to look up the customer's group_id then you could make a similar function to enable/disable the shipping module ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!