Greetings to all,
I want to customize built-in free shipping over $xxx limiting to only default group of customers.
Can anyone help me with the code to be added to php?
Have you looked at this extension http://forum.opencart.com/viewtopic.php?f=124&t=39792? It links shipping options to customer group.
Or for more options try putting
Or for more options try putting
into the search facilityshipping based on customer group
Genuine, Honest Opencart Support @ http://webvetservices.com
Hi, I just had the same request and buying an extension seemed extreme. Here's what I found to work on my site (1.5.5.1)
Open "Catalog/model/shipping/free.php" and go to line 19, between:
and
Now we want to add another condition to stop keep the option disabled (the bottom if statement on the php file makes it enabled)
Paste the following just above the "$method_data = array();":
The assumption here is that you will only be allowing free shipping to the default customer group (id =1), you can modify the if statement to suit your requirements.
Hope this helps
Open "Catalog/model/shipping/free.php" and go to line 19, between:
Code: Select all
if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
$status = false;
}
Code: Select all
$method_data = array();
Paste the following just above the "$method_data = array();":
Code: Select all
if ($this->customer->getCustomerGroupId() <> 1) {
$status = false;
}
Hope this helps
Just wondering if there may be an equivalent to this for 2.3?
When I try this method it informs me that the getCustomerGroupId() function doesn't exist.
The relevant file is in a different location of course:
catalog/model/extension/shipping/free.php
When I try this method it informs me that the getCustomerGroupId() function doesn't exist.
The relevant file is in a different location of course:
catalog/model/extension/shipping/free.php
That function was renamed a few versions ago. Using this edit should work:
Code: Select all
IN:
/catalog/model/extension/shipping/free.php
BEFORE:
if ($status) {
ADD:
if ($this->customer->getGroupId() != 1) {
$status = false;
}
Thanks Johnathan, this worked like a charm.Johnathan wrote:That function was renamed a few versions ago. Using this edit should work:
Code: Select all
IN: /catalog/model/extension/shipping/free.php BEFORE: if ($status) { ADD: if ($this->customer->getGroupId() != 1) { $status = false; }
Who is online
Users browsing this forum: No registered users and 14 guests