Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]syntax error, unexpected OpenCart
Forum PHP.pl > Forum > Przedszkole
stawnasto
Witam
Posiadam sklep opencart 2.x.x www.sklep.alejasztuki.com
Dziś zauważyłem problem, jak próbuje wejść na strone pojawia się komunikatl

Parse error: syntax error, unexpected '$w1d36' (T_VARIABLE) in /home/virt100990/domains/alejasztuki.com/public_html/sklep/catalog/model/extension/total/reward.php on line 1

a jak próbuje wejść na zaplecze wyskakuje:

Parse error: syntax error, unexpected '$b198' (T_VARIABLE) in /home/virt100990/domains/alejasztuki.com/public_html/sklep/admin/model/extension/extension.php on line 1

Można prosić o pomoc, nie znam się w tym temacie a potrzebuje stronę sad.gif dodam że nie używałem strony od tygodnia...

kod pliku extension

  1.  
  2. <?php
  3. class ModelExtensionExtension extends Model {
  4. public function getInstalled($type) {
  5. $extension_data = array();
  6.  
  7. $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "' ORDER BY code");
  8.  
  9. foreach ($query->rows as $result) {
  10. $extension_data[] = $result['code'];
  11. }
  12.  
  13. return $extension_data;
  14. }
  15.  
  16. public function install($type, $code) {
  17. $extensions = $this->getInstalled($type);
  18.  
  19. if (!in_array($code, $extensions)) {
  20. $this->db->query("INSERT INTO " . DB_PREFIX . "extension SET `type` = '" . $this->db->escape($type) . "', `code` = '" . $this->db->escape($code) . "'");
  21. }
  22. }
  23.  
  24. public function uninstall($type, $code) {
  25. $this->db->query("DELETE FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "' AND `code` = '" . $this->db->escape($code) . "'");
  26. $this->db->query("DELETE FROM " . DB_PREFIX . "setting WHERE `code` = '" . $this->db->escape($code) . "'");
  27. }
  28. }
  29.  
  30.  



kod pliku reward


  1.  
  2. <?php
  3. class ModelExtensionTotalReward extends Model {
  4. public function getTotal($total) {
  5. if (isset($this->session->data['reward'])) {
  6. $this->load->language('extension/total/reward');
  7.  
  8. $points = $this->customer->getRewardPoints();
  9.  
  10. if ($this->session->data['reward'] <= $points) {
  11. $discount_total = 0;
  12.  
  13. $points_total = 0;
  14.  
  15. foreach ($this->cart->getProducts() as $product) {
  16. if ($product['points']) {
  17. $points_total += $product['points'];
  18. }
  19. }
  20.  
  21. $points = min($points, $points_total);
  22.  
  23. foreach ($this->cart->getProducts() as $product) {
  24. $discount = 0;
  25.  
  26. if ($product['points']) {
  27. $discount = $product['total'] * ($this->session->data['reward'] / $points_total);
  28.  
  29. if ($product['tax_class_id']) {
  30. $tax_rates = $this->tax->getRates($product['total'] - ($product['total'] - $discount), $product['tax_class_id']);
  31.  
  32. foreach ($tax_rates as $tax_rate) {
  33. if ($tax_rate['type'] == 'P') {
  34. $total['taxes'][$tax_rate['tax_rate_id']] -= $tax_rate['amount'];
  35. }
  36. }
  37. }
  38. }
  39.  
  40. $discount_total += $discount;
  41. }
  42.  
  43. $total['totals'][] = array(
  44. 'code' => 'reward',
  45. 'title' => sprintf($this->language->get('text_reward'), $this->session->data['reward']),
  46. 'value' => -$discount_total,
  47. 'sort_order' => $this->config->get('reward_sort_order')
  48. );
  49.  
  50. $total['total'] -= $discount_total;
  51. }
  52. }
  53. }
  54.  
  55. public function confirm($order_info, $order_total) {
  56. $this->load->language('extension/total/reward');
  57.  
  58. $points = 0;
  59.  
  60. $start = strpos($order_total['title'], '(') + 1;
  61. $end = strrpos($order_total['title'], ')');
  62.  
  63. if ($start && $end) {
  64. $points = substr($order_total['title'], $start, $end - $start);
  65. }
  66.  
  67. $this->load->model('account/customer');
  68.  
  69. if ($this->model_account_customer->getRewardTotal($order_info['customer_id']) >= $points) {
  70. $this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()");
  71. } else {
  72. return $this->config->get('config_fraud_status_id');
  73. }
  74. }
  75.  
  76. public function unconfirm($order_id) {
  77. $this->db->query("DELETE FROM " . DB_PREFIX . "customer_reward WHERE order_id = '" . (int)$order_id . "' AND points < 0");
  78. }
  79. }
  80.  
  81.  


b4rt3kk
A zmieniałeś coś ostatnio?
stawnasto
No właśnie nic, kila dni temu zerknełem na zamówienia jakie były i tyle sad.gif
markonix
A CTR+F znajduje tę zmienną gdzieś? Widzę jedną pustę linię na początku, nie jest tam gdzieś to wysunięte na prawo (wirusy wstrzykujące kod)?
aras785
po nazwie zmiennej obstawiam na 99% wirusa biggrin.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.