PHP Wordpress - дописать к коду скидок условие максимальной скидки
5 USDПривет фрилансеры!
Есть интернет магазин на Wordpress + Woocommerce.
Там есть система сикдок, от цены которая реализована вручную кодом, код ниже.
Например если сумма заказа от 2.000 до 4999 то скидка 5%, и тд.
Максимальная же скидка тут - 13%.
Но когда мы добавляем купон - он прибавляется к скидке, и получается скажем 10+13 = 23% скидки.
Нужно сделать, что б максимальная скидка по сайту с купонами или без была 13%!
Также добавить, что б в поле купонов - была возможность скажем поставить галочку, которая отключает этот код с скидками.
---
if($woo_current_price >= 1999 && $woo_current_price <= 4998) {
$discount = $cart->subtotal * 0.05; // 0.05 - это 5%
$cart->add_fee("Скидка в 5% за заказ на сумму от 2 000 до 5 000 грн", -$discount);
}
elseif($woo_current_price >= 4999 && $woo_current_price <= 10000) {
$discount = $cart->subtotal * 0.08; // 0.08 - это 8%
$cart->add_fee("Скидка в 8% за заказ на сумму от 5 000 до 10 000 грн", -$discount);
}
elseif($woo_current_price >= 10001 && $woo_current_price <= 20000) {
$discount = $cart->subtotal * 0.10; // 0.10 - это 10%
$cart->add_fee("Скидка в 10% за заказ на сумму от 10 000 до 20 000 грн", -$discount);
}
elseif($woo_current_price >= 20001) {
$discount = $cart->subtotal * 0.13; // 0.13 - это 13%
$cart->add_fee("Скидка в 13% за заказ на сумму от 20 000 грн", -$discount);
}
}
add_action("woocommerce_cart_calculate_fees" , "woo_discount_total");
Current freelance projects in the category PHP
Development of a WordPress website
23 USD
We are looking for a contractor to develop a custom website on WordPress for a jewelry store. The first stage will be a consultation. Content Management Systems, PHP ∙ 1 day 7 hours back ∙ 59 proposals |
The WooCommerce cart (WordPress) is broken — it does not add products and the cart page does not open.On the website of the online store https://www.dobryi-gospodar.com/ (WordPress + WooCommerce), the checkout function has completely stopped working. When clicking the "Add to cart" button (both in the product card and in the catalog), a long loading process begins (the indicator… Content Management Systems, PHP ∙ 1 day 9 hours back ∙ 57 proposals |
Product search function by imageIt is necessary to develop and integrate a product search function by image on the website.What needs to be implementedA "Search by Photo" button on the website.Image upload by the user: JPG.Search for visually similar products in the catalog.Display results in the form of… PHP, Web Programming ∙ 1 day 16 hours back ∙ 44 proposals |
Parser expireddomains.net
113 USD
A parser is needed for expireddomains.net. You need to log in to the site first; the problem is that it blocks the IP when trying to parse data. You need to parse thematic domains based on a list of keywords. If you are not confident in your abilities, please do not write. PHP, Web Programming ∙ 3 days 15 hours back ∙ 51 proposals |
Integration of payment service with Sales Force
70 USD
There is a payment system widget on the site that needs to be integrated with Salesforce so that all required parameters are visible on the Salesforce side. It needs to be done in such a way that all payments and subscriptions are controlled through Salesforce. PHP, Web Programming ∙ 3 days 19 hours back ∙ 41 proposals |