Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation on 12/13/2024 in all areas

  1. Вітаю, ще пропозиція для розвитку, у останній час ну дууууже необхідне стало- у кошик додати іньшого отримувача ну і звісно аби це протягувало данні у модулі доставок @Prorab337
    1 point
  2. Перевірте, чи це модуль не с варезу, а то може бути беда
    1 point
  3. Чи можна ось так зібрати ocmod, але треба перевірити <?xml version="1.0" encoding="utf-8"?> <modification> <name>Quantity Based Cart Discount</name> <code>quantity_based_cart_discount</code> <version>1.0</version> <author>niger</author> <link>https://www.example.com</link> <file path="catalog/model/checkout/cart.php"> <operation> <search position="after"><![CDATA[ $products = $this->getProducts(); ]]></search> <add><![CDATA[ $total_quantity = 0; foreach ($products as $product) { $total_quantity += $product['quantity']; } if ($total_quantity >= 4) { $discount_quantity_percentage = 0.30; } elseif ($total_quantity == 3) { $discount_quantity_percentage = 0.25; } elseif ($total_quantity == 2) { $discount_quantity_percentage = 0.15; } elseif ($total_quantity == 1) { $discount_quantity_percentage = 0.05; } else { $discount_quantity_percentage = 0; } if ($discount_percentage > 0) { $total = $total - ($total * $discount_quantity_percentage); $total_data[] = array( 'code' => 'quantity_discount', 'title' => 'Знижка за кількість товарів (' . ($discount_quantity_percentage * 100) . '%)', 'text' => '-' . $this->currency->format($this->tax->calculate($total * $discount_quantity_percentage, 0, $this->config->get('config_tax'))), 'value' => $total * $discount_quantity_percentage, 'sort_order' => 1 ); } ]]></add> </operation> </file> <file path="catalog/view/theme/*/template/checkout/cart.twig"> <operation> <search position="before"><![CDATA[ </tbody> ]]></search> <add><![CDATA[ {% if quantity_discount %} <tr> <td colspan="4" class="text-right"><strong>Знижка за кількість товарів</strong></td> <td class="text-right">-{{ quantity_discount }}</td> </tr> {% endif %} ]]></add> </operation> </file> <file path="catalog/view/theme/default/template/checkout/confirm.twig"> <operation> <search position="before"><![CDATA[ </tbody> ]]></search> <add><![CDATA[ {% if quantity_discount %} <tr> <td colspan="4" class="text-right"><strong>Знижка за кількість товарів</strong></td> <td class="text-right" style="color: red;">-{{ quantity_discount }}</td> </tr> {% endif %} ]]></add> </operation> </file> <file path="catalog/controller/checkout/cart.php"> <operation> <search position="after"><![CDATA[ $data['products'] = array(); ]]></search> <add><![CDATA[ $data['quantity_discount'] = ''; if (isset($total_data)) { foreach ($total_data as $total_line) { if ($total_line['code'] == 'quantity_discount') { $data['quantity_discount'] = $total_line['text']; } } } ]]></add> </operation> </file> <file path="catalog/controller/checkout/confirm.php"> <operation> <search position="after"><![CDATA[ $data['totals'] = array(); ]]></search> <add><![CDATA[ $data['quantity_discount'] = ''; if (isset($totals)) { foreach ($totals as $total_line) { if ($total_line['code'] == 'quantity_discount') { $data['quantity_discount'] = $total_line['text']; } } } ]]></add> </operation> </file> </modification>
    1 point
  4. без интерфейса в админке могу сделать за 50$ в виде модификатора все по уму
    1 point
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.