Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove products_id from ajax request #22

Merged
merged 1 commit into from May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Installation files/includes/classes/dynamic_price_updater.php
Expand Up @@ -768,6 +768,10 @@ protected function getSideboxContent() {
function setCurrentPage() {
global $db, $request_type;

if (empty($_GET['products_id'])) {
$_GET['products_id'] = !empty($_POST['products_id']) ? $_POST['products_id'] : 0;
}

if (isset($_SESSION['customer_id']) && $_SESSION['customer_id']) {
$wo_customer_id = $_SESSION['customer_id'];

Expand Down
Expand Up @@ -149,7 +149,7 @@ function objXHR() { // scan the function clicked and act on it using the Ajax in
}
};

this.XHR.open(strMode.toLowerCase(), theURL + "<?php echo zen_decode_specialchars(substr(zen_href_link($theURL, zen_get_all_get_params(array('action','pid')) . (!empty($_GET['main_page']) && zen_not_null($_GET['main_page']) ? 'main_page=' . zen_output_string_protected($_GET['main_page']) . '&' : '') . 'act=DPU_Ajax&method=dpu_update', $request_type, true, true, true, false), strlen($theURL) + strlen(($request_type == 'SSL' && defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER)))); ?>" + (strMode.toLowerCase() === "get" ? "&" + this.compileRequest() : ""), true);
this.XHR.open(strMode.toLowerCase(), theURL + "<?php echo zen_decode_specialchars(substr(zen_href_link($theURL, 'act=DPU_Ajax&method=dpu_update', $request_type, true, true, true, false), strlen($theURL) + strlen(($request_type == 'SSL' && defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER)))); ?>" + (strMode.toLowerCase() === "get" ? "&" + this.compileRequest() : ""), true);

/* this.XHR.open(strMode.toLowerCase(), this.url+"?act=DPU_Ajax&method=dpu_update"+(strMode.toLowerCase() == "get" ? "&" + this.compileRequest() : ""), true);*/
if (strMode.toLowerCase() === "post") {
Expand All @@ -159,7 +159,7 @@ function objXHR() { // scan the function clicked and act on it using the Ajax in
this.XHR.send(combinedData.XML);
} else {
var option = {
url: theURL + "<?php echo zen_decode_specialchars(substr(zen_href_link($theURL, zen_get_all_get_params(array('action','pid')) . (!empty($_GET['main_page']) && zen_not_null($_GET['main_page']) ? 'main_page=' . zen_output_string_protected($_GET['main_page']) . '&' : '') . 'product_info&act=DPU_Ajax&method=dpu_update', $request_type, true, true, true, false), strlen($theURL) + strlen(($request_type == 'SSL' && defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER)))); ?>",
url: theURL + "<?php echo zen_decode_specialchars(substr(zen_href_link($theURL, 'product_info&act=DPU_Ajax&method=dpu_update', $request_type, true, true, true, false), strlen($theURL) + strlen(($request_type == 'SSL' && defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTP_SERVER)))); ?>",
data: combinedData.JSON,
timeout : 30000
};
Expand Down