Skip to content

Commit

Permalink
Update recurring.php
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 authored Dec 22, 2023
1 parent 35b0157 commit 33c9c4b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions upload/catalog/model/checkout/recurring.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
class ModelCheckoutRecurring extends Model {
public function create($recurring, $order_id, $description) {
public function create($recurring, $order_id, $description, $data) {

$this->db->query("INSERT INTO `" . DB_PREFIX . "order_recurring` SET
`order_id` = '" . (int)$order_id . "',
`date_added` = NOW(),
`status` = 6,
`product_id` = '" . (int)$item['product_id'] . "',
`product_name` = '" . $this->db->escape((string)$item['name']) . "',
`product_quantity` = '" . (int)$item['quantity'] . "',
`recurring_id` = '" . (int)$item['recurring']['recurring_id'] . "',
`recurring_name` = '" . $this->db->escape((string)$item['recurring']['name']) . "',
`product_id` = '" . (int)$data['product_id'] . "',
`product_name` = '" . $this->db->escape((string)$data['name']) . "',
`product_quantity` = '" . (int)$data['quantity'] . "',
`recurring_id` = '" . (int)$data['recurring']['recurring_id'] . "',
`recurring_name` = '" . $this->db->escape((string)$data['recurring']['name']) . "',
`recurring_description` = '" . $this->db->escape($description) . "',
`recurring_frequency` = '" . $this->db->escape((string)$item['recurring']['frequency']) . "',
`recurring_cycle` = '" . (int)$item['recurring']['cycle'] . "',
`recurring_duration` = '" . (int)$item['recurring']['duration'] . "',
`recurring_price` = '" . (float)$item['recurring']['price'] . "',
`trial` = '" . (int)$item['recurring']['trial'] . "',
`trial_frequency` = '" . $this->db->escape((string)$item['recurring']['trial_frequency']) . "',
`trial_cycle` = '" . (int)$item['recurring']['trial_cycle'] . "',
`trial_duration` = '" . (int)$item['recurring']['trial_duration'] . "',
`trial_price` = '" . (float)$item['recurring']['trial_price'] . "',
`recurring_frequency` = '" . $this->db->escape((string)$data['recurring']['frequency']) . "',
`recurring_cycle` = '" . (int)$data['recurring']['cycle'] . "',
`recurring_duration` = '" . (int)$data['recurring']['duration'] . "',
`recurring_price` = '" . (float)$data['recurring']['price'] . "',
`trial` = '" . (int)$data['recurring']['trial'] . "',
`trial_frequency` = '" . $this->db->escape((string)$data['recurring']['trial_frequency']) . "',
`trial_cycle` = '" . (int)$data['recurring']['trial_cycle'] . "',
`trial_duration` = '" . (int)$data['recurring']['trial_duration'] . "',
`trial_price` = '" . (float)$data['recurring']['trial_price'] . "',
`reference` = ''");

return $this->db->getLastId();
Expand All @@ -39,4 +39,4 @@ public function editReference($order_recurring_id, $reference) {
return false;
}
}
}
}

0 comments on commit 33c9c4b

Please sign in to comment.