Post by Salvatore » Sun Jan 06, 2019 1:38 am

Hi, I have a problem with a php code. I have to make the paiment on delivery as free as the total of the products (excluding shipping costs) exceeds a certain amount, now on my extension for the payment on delivery I have this code:
if ($total> 291.50)
{
Cost = $ 0;
}
else
{
Cost = $ 3;
}
But this code calculates the final total of the cart, total without taxes + taxes + shipping costs.
I need to calculate the total Without taxes + taxes
What should I insert in place of "$total"?
My version of Opencart is 2.3.0.2
Thanks in advance for your reply!

New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm

Post by ADD Creative » Sun Jan 06, 2019 7:05 am

Where are you trying to make this change? It's not clear what exactly you are trying to do?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Salvatore » Sun Jan 06, 2019 11:25 pm

Hi ADD Creative. I have an extension for payment on delivery. within the extension I can modify some parameters, one of these I can modify as custum, now I have that code which for me is not good and I have to modify as I said.

New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm

Post by ADD Creative » Mon Jan 07, 2019 3:12 am

If you are modifying a custom extension there is not much anyone can suggest as they will not know how the custom extension works. You could try asking a developer of the author of the extension to make the changes for you.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Salvatore » Mon Jan 07, 2019 3:57 am

Hi ADD Creative, perhaps an image is better than a thousand words. I enclose screenshots of the checkuot and extension page.
However I try to contact the developer.

Attachments

Chackout page.jpg

Screenshot checkout page - Chackout page.jpg (175.7 KiB) Viewed 6526 times

Cash on delivery.jpg

screenshot extension - Cash on delivery.jpg (156.4 KiB) Viewed 6526 times


New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm

Post by kestas » Mon Jan 07, 2019 4:52 am

have you tried insert prices without currency symbol? From another hand very strange extension if user should write some php code for that simple usage... :)

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by Salvatore » Mon Jan 07, 2019 5:05 am

I would not know how to insert prices without a currency symbol! However they weigh that it should be simple, it would be enough to change $ total with another word, but I do not know which one. Anyway I wrote to the developer of the extension!
What does "Just PM me" mean?

New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm

Post by ADD Creative » Mon Jan 07, 2019 5:07 am

Try looking or asking in the forum post for that extension. viewtopic.php?f=119&t=104532

At a guess it will be something like.

Code: Select all

if ($this->getSubTotalWithTax() > 291.50)
{
$cost = 0;
}
else
{
$cost = 3;
}

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by kestas » Mon Jan 07, 2019 5:19 am

Salvatore wrote:
Mon Jan 07, 2019 5:05 am

What does "Just PM me" mean?
:) just send me PM (personal message) if you did not find an answer on the forum...

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by Salvatore » Mon Jan 07, 2019 5:36 am

ok tomorrow I try and let you know, now I go to sleep I'm tired! thanks for everything!

New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm

Post by Salvatore » Mon Jan 07, 2019 3:58 pm

Good morning, I entered the formula that wrote to me and now works well. thank you so much .... it was what I was looking for!

New member

Posts

Joined
Thu Jul 19, 2018 2:10 pm
Who is online

Users browsing this forum: No registered users and 17 guests