Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Oct 3, 2023
1 parent 20fdf74 commit b58fc0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion functions/data-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ function dolicart_request() {
];

//if ($qty != $result['newqty']) { $response['modal'] = doliModalTemplate('CartInfos', __( 'Cart', 'doliconnect'), __( 'This item is not available in this quantity!', 'doliconnect'), '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">'.__( "Continue shopping", "doliconnect").'</button> <a class="btn btn-primary" role="button" href="'.esc_url(doliconnecturl('dolicart')).'" >'.__( 'Finalize the order', 'doliconnect').'</a>', 'modal-lg'); }
if (doliCheckModules('relatedproducts') && doliCheckRelatedProducts($product->id)) { $response['modal'] = doliModalTemplate('CartInfos', __( 'Related products', 'doliconnect'), doliRelatedProducts($product->id), '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">'.__( "Close", "doliconnect").'</button>', 'modal-lg', null, 'p-0'); }
if (doliCheckModules('relatedproducts') && doliCheckRelatedProducts($product->id)) { $response['modal'] = doliModalTemplate('CartInfos', __( 'Related products', 'doliconnect'), doliRelatedProducts($product->id, true), '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">'.__( "Close", "doliconnect").'</button>', 'modal-lg', null, 'p-0'); }
wp_send_json_success($response);
die();
} elseif (isset($_POST['modify']) && ($_POST['modify'] == "wish" || $_POST['modify'] == "unwish")) {
Expand Down
6 changes: 3 additions & 3 deletions functions/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function doliCheckRelatedProducts($id) {
}
}

function doliRelatedProducts($fk_parent_line) {
function doliRelatedProducts($fk_parent_line, $refresh = false) {
$request = "/relatedproducts/".$fk_parent_line;
$relatedproducts = callDoliApi("GET", $request, null, dolidelay('product', esc_attr(isset($_GET["refresh"]) ? $_GET["refresh"] : null)));
if ( !isset( $relatedproducts->error ) && $relatedproducts != null ) {
Expand Down Expand Up @@ -668,7 +668,7 @@ function doliconnect_supplier($product, $refresh = false){
}

// list of products filter
function doliproductlist($product, $fk_parent_line = null) {
function doliproductlist($product, $refresh = false, $fk_parent_line = null) {
global $current_user;

$wish = 0;
Expand Down Expand Up @@ -724,7 +724,7 @@ function doliproductlist($product, $fk_parent_line = null) {
$list .= "</div></td></tr></table></li>";
return $list;
}
add_filter( 'doliproductlist', 'doliproductlist', 10, 2);
add_filter( 'doliproductlist', 'doliproductlist', 10, 3);

// list of products filter
function doliproductcard($product, $attributes) {
Expand Down

0 comments on commit b58fc0e

Please sign in to comment.