Skip to content

Commit

Permalink
Code updated in catalog recurring model
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed Dec 22, 2023
1 parent d7ba7e8 commit 89b3130
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion upload/catalog/controller/checkout/cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function index() {
'week' => $this->language->get('text_week'),
'semi_month' => $this->language->get('text_semi_month'),
'month' => $this->language->get('text_month'),
'year' => $this->language->get('text_year'),
'year' => $this->language->get('text_year')
);

if ($product['recurring']['trial']) {
Expand Down
26 changes: 13 additions & 13 deletions upload/catalog/model/checkout/recurring.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
class ModelCheckoutRecurring extends Model {
public function create($recurring, $order_id, $description, $data) {
public function create($order_id, $description, $data) {

$this->db->query("INSERT INTO `" . DB_PREFIX . "order_recurring` SET
`order_id` = '" . (int)$order_id . "',
Expand All @@ -9,18 +9,18 @@ public function create($recurring, $order_id, $description, $data) {
`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_id` = '" . (int)$data['recurring_id'] . "',
`recurring_name` = '" . $this->db->escape((string)$data['name']) . "',
`recurring_description` = '" . $this->db->escape($description) . "',
`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'] . "',
`recurring_frequency` = '" . $this->db->escape((string)$data['frequency']) . "',
`recurring_cycle` = '" . (int)$data['cycle'] . "',
`recurring_duration` = '" . (int)$data['duration'] . "',
`recurring_price` = '" . (float)$data['price'] . "',
`trial` = '" . (int)$data['trial'] . "',
`trial_frequency` = '" . $this->db->escape((string)$data['trial_frequency']) . "',
`trial_cycle` = '" . (int)$data['trial_cycle'] . "',
`trial_duration` = '" . (int)$data['trial_duration'] . "',
`trial_price` = '" . (float)$data['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 89b3130

Please sign in to comment.