PHP calculate % and extract the result
Client's review of cooperation with Ivan Filippov
PHP calculate % and extract the resultI solved several tasks on PHP in 10 minutes. pleasant to work 🙂
Freelancer's review of cooperation with Vladislavs Sipov
PHP calculate % and extract the resultExcellent customer, clearly placed tasks and paid in time, I recommend cooperation
-
Winning proposal1 day2 USD
5599 394 9 3 Winning proposal1 day2 USDHello, I'll do it right now, go to Ls.
Hello, I'll do it right now, go to Ls.
-
357 21 0 Ready to take up the task.
Email: [email protected]
-
579 75 0 I will be happy to take your task. We will decide during the evening.
-
1 day4 USD
2748 153 0 1 1 day4 USDHello to you. Ready to do.
-
С проверкой, если цена меньше 10 округляем до меньшего целого
<?php echo esc_attr(($product->get_price()>10)?(floor(($product->get_price()*0.95)/10)*10):floor($c*0.95)); ?>
-
Ребята, зря мы старались...
-
Я в шоке, господа! Благодарю вас за доброту и щедрость. К сожалению не увидел комментариев, а в лс уже постучались и предложили решение.
Поздно заметил, если бы Алексей не стукнул в ЛС сейчас, то и совсем не увидел )
-
Решение кстати подошло следующее:
<?php echo esc_attr(floor($product->get_price()-$product->get_price()/100*5)); ?>
-
Если 119.00 РУБ, то должно стать 113.00 РУБ, но проблема еще в том, что:
<?php echo esc_attr( $product->get_price() ); ?>
выводит только 119 РУБ и на выходе я получаю 113 РУБ, но дописываю с помощью HTML в конец .00 РУБ
Всё из-за того что полную цену выводит:
<?php woocommerce_template_single_price(); ?>
А к такому выражению, которое подтягивает другой документ вычисления исполнитель не смог приминить, что наверное и невозможно. -
Еще один моент:
esc_attr() WP 2.8.0
Преобразует знаки <, >, &, ", ' в html сущности. Не создает двойного преобразования.
Функция предназначена для фильтрации строки, которую планируется выводить в значениях html атрибутов.
В данном случае esc_attr() нафиг не нужна дя обработки результата floor ...
Наверное надо закругляться - на такую пустяковую задачу 26 сообщений, да и проект закрыт ..
Всем пока. Было весело.
-
Current freelance projects in the category Javascript and Typescript
Development of an interactive Palworld map for the websiteWe need to develop an interactive map for Palworld based on the example: https://palworld.gg/map We need not just a static image, but a full-fledged interactive map where users can view locations, toggle object categories on/off, search for specific points, and interact with… HTML & CSS, Javascript and Typescript ∙ 4 minutes back |
Development of the AM Mobility platform (car service, parking, insurance, car rental)
5770 USD
We are looking for a team or an experienced Full Stack developer to create the MVP of the AM Mobility platform. AM Mobility is a unified digital ecosystem for motorists, combining in one application and web platform: parking; car service; tire fitting; car wash; car rental;… Javascript and Typescript, Web Programming ∙ 5 days 6 hours back ∙ 114 proposals |
Gsap animations
22 USD
Good day. Corrections need to be made in the current project. A specialist is needed who works well with gsap/lenis. Animation of cards needs to be done. Detailed specifications here:… Javascript and Typescript, Web Programming ∙ 5 days 12 hours back ∙ 21 proposals |
I am looking for a mentor with Claude Code to launch a web project from scratch.Brief about the task: I am a beginner with no programming experience. I have a ready specification for website development (42 pages, Next.js, PostgreSQL). I want to implement it myself using Claude Code - I need a specialist who will set up the environment and teach me how to… Javascript and Typescript, Tuition ∙ 7 days 11 hours back ∙ 19 proposals |
Website design updateIt is necessary to update the design of the existing website using HTML, CSS, JS: refresh the appearance, make it modern and responsive for mobile devices. Smooth animations and interactive elements need to be added. HTML & CSS, Javascript and Typescript ∙ 8 days 4 hours back ∙ 97 proposals |