I have found some posts that describe how to do this in older versions of OpenCart, but I was not able to find where to do the same thing in OC 3.0.x as the paypal.php file contents in the closest looking subdirectory was not the same.
Any help on how and if this can be done with a simple php file edit would be appreciated.
You should post..ArtGallery wrote: ↑Wed May 27, 2020 2:05 amI have found some posts that describe how to do this in older versions of OpenCart,
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
viewtopic.php?t=123593
I looked at the paypal.php file in this directory catalog/model/extension/payment, but it wasn't at all like the one in the post and I couldn't figure out if it was perhaps a different paypal.php file somewhere else or if the OC 3.0.x version was just different now.
Code: Select all
if ($this->config->get('payment_pp_standard_total') > $total) {
$status = false;
in catalog/model/extension/payment/pp_standard.php
you could change it to
Code: Select all
if ($total == 0 || $this->config->get('payment_pp_standard_total') < $total) {
$status = false;
that would make that field max iso min.
you can also change this:
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_pp_standard_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if ($this->config->get('payment_pp_standard_total') > $total) {
$status = false;
} elseif (!$this->config->get('payment_pp_standard_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
to this:
Code: Select all
if ($this->config->get('payment_pp_standard_total') > $total) {
$status = false;
} elseif (!$this->config->get('payment_pp_standard_geo_zone_id')) {
$status = true;
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_pp_standard_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if ($query->num_rows) {
$status = true;
} else {
$status = false;
}
}
as it is silly to always execute a query on the zones if it is not needed.
in your case:
Code: Select all
if ($total == 0 || $this->config->get('payment_pp_standard_total') < $total) {
$status = false;
} elseif (!$this->config->get('payment_pp_standard_geo_zone_id')) {
$status = true;
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_pp_standard_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if ($query->num_rows) {
$status = true;
} else {
$status = false;
}
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_pp_standard_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if ($this->config->get('payment_pp_standard_total') > $total) {
$status = false;
} elseif (!$this->config->get('payment_pp_standard_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
to
Code: Select all
// defaults
$status = true;
$limit_min = 1;
$limit_max = 1000000;
// process total limits separated by dash
if (strstr($this->config->get('payment_pp_standard_total'),'-')) {
$min_max_totals = explode('-',$this->config->get('payment_pp_standard_total'));
if (is_numeric($min_max_totals[0])) $limit_min = (float)$min_max_totals[0];
if (is_numeric($min_max_totals[1])) $limit_max = (float)$min_max_totals[1];
}
// determine whether to disable
if ($total < $limit_min || $total > $limit_max) {
$status = false;
} elseif ($this->config->get('payment_pp_standard_geo_zone_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('payment_pp_standard_geo_zone_id') . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
if (!$query->num_rows) {
$status = false;
}
}
then you can input 1-500 in that field as in min-max total limits
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
There is no file with that name in that directory. Only pp_braintree.php and paypal.php. I don't want to use the braintree version so I am assuming I should use the one named paypal.php
Use paypal.php, similar code.
just replace
Code: Select all
$this->config->get('payment_pp_standard_total')
Code: Select all
$this->config->get('payment_paypal_total')
Code: Select all
$this->config->get('payment_pp_standard_geo_zone_id')
Code: Select all
$this->config->get('payment_paypal_geo_zone_id')
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: Semrush [Bot] and 215 guests