alue' => $this->dataHelper->formatCurrencyValue($cart_fee_tax_amount, $this->currency)], 'metadata' => ['order_item_id' => $cart_fee->get_id()]]; $this->order_lines[] = $fee; } // End foreach(). } // End if(). } /** * Process Gift Cards * * @access private */ private function process_gift_cards() { if (!empty($this->order->get_items('gift_card'))) { foreach ($this->order->get_items('gift_card') as $cart_gift_card) { $gift_card = ['type' => 'gift_card', 'name' => $cart_gift_card->get_name(), 'unitPrice' => ['currency' => $this->currency, 'value' => $this->dataHelper->formatCurrencyValue(-$cart_gift_card->get_amount(), $this->currency)], 'vatRate' => 0, 'quantity' => 1, 'totalAmount' => ['currency' => $this->currency, 'value' => $this->dataHelper->formatCurrencyValue(-$cart_gift_card->get_amount(), $this->currency)], 'vatAmount' => ['currency' => $this->currency, 'value' => $this->dataHelper->formatCurrencyValue(0, $this->currency)]]; $this->order_lines[] = $gift_card; } } } // Helpers. /** * Get cart item name. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return string $item_name Cart item name. */ private function get_item_name($cart_item) { $item_name = $cart_item->get_name(); return html_entity_decode(wp_strip_all_tags($item_name)); } /** * Calculate item tax percentage. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return integer $item_tax_amount Item tax amount. */ private function get_item_tax_amount($cart_item) { return $cart_item['line_tax']; } /** * Calculate item tax percentage. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * @param object $product Product object. * * @return integer $item_vatRate Item tax percentage formatted for Mollie Orders API. */ private function get_item_vatRate($cart_item, $product) { if ($product && $product->is_taxable() && $cart_item['line_subtotal_tax'] > 0) { // Calculate tax rate. $_tax = new WC_Tax(); $tmp_rates = $_tax->get_rates($product->get_tax_class()); $item_vatRate = 0; foreach ($tmp_rates as $rate) { if (isset($rate['rate'])) { if ($rate['compound'] === "yes") { $compoundRate = round($item_vatRate * ($rate['rate'] / 100)) + $rate['rate']; $item_vatRate += $compoundRate; continue; } $item_vatRate += $rate['rate']; } } } else { $item_vatRate = 0; } return $item_vatRate; } /** * Get cart item price. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return integer $item_price Cart item price. */ private function get_item_price($cart_item) { $item_subtotal = $cart_item['line_subtotal'] + $cart_item['line_subtotal_tax']; return $item_subtotal / $cart_item['quantity']; } /** * Get cart item quantity. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return integer $item_quantity Cart item quantity. */ private function get_item_quantity($cart_item) { return $cart_item['quantity']; } /** * Get cart item SKU. * * Returns SKU or product ID. * * @since 1.0 * * @access private * * @param object $product Product object. * * @return false|string $item_reference Cart item reference. */ private function get_item_reference($product) { if ($product && $product->get_sku()) { $item_reference = $product->get_sku(); } elseif ($product) { $item_reference = $product->get_id(); } else { $item_reference = ''; } return substr(strval($item_reference), 0, 64); } /** * Get cart item discount. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return integer $item_discount_amount Cart item discount. */ private function get_item_discount_amount($cart_item) { if ($cart_item['line_subtotal'] > $cart_item['line_total']) { $item_discount_amount = $cart_item['line_subtotal'] + $cart_item['line_subtotal_tax'] - $cart_item['line_total'] - $cart_item['line_tax']; } else { $item_discount_amount = 0; } return $item_discount_amount; } /** * Get cart item total amount. * * @since 1.0 * @access private * * @param WC_Order_Item $cart_item Cart item. * * @return integer $item_total_amount Cart item total amount. */ private function get_item_total_amount($cart_item) { return $cart_item['line_total'] + $cart_item['line_tax']; } /** * Get cart item Category. * * Returns selected or default product category. * * @since 5.6 * @access private * * @param object $product Product object. * @param string $voucherDefaultCategory Voucher default category. * * @return string $category Product voucher category. */ private function get_item_category($product, $voucherDefaultCategory) { $category = $voucherDefaultCategory; if (!$product) { return $category; } //if product has taxonomy associated, retrieve voucher cat from there. $catTerms = get_the_terms($product->get_id(), 'product_cat'); if (is_array($catTerms)) { $term = end($catTerms); $term_id = $term->term_id; $metaVoucher = get_term_meta($term_id, '_mollie_voucher_category', \true); $category = $metaVoucher ?: $category; } //local product voucher category $localCategory = get_post_meta($product->get_id(), Voucher::MOLLIE_VOUCHER_CATEGORY_OPTION, \false); $category = $localCategory[0] ?? $category; //if product is a single variation could have a voucher meta associated $simpleVariationCategory = get_post_meta($product->get_id(), 'voucher', \false); return $simpleVariationCategory ? $simpleVariationCategory[0] : $category; } /** * Get shipping method name. * * @since 1.0 * @access private * * @return string $shipping_name Name for selected shipping method. */ private function get_shipping_name() { foreach ($this->order->get_items('shipping') as $i => $package) { $chosen_method = isset(WC()->session->chosen_shipping_methods[$i]) ? WC()->session->chosen_shipping_methods[$i] : ''; if ('' !== $chosen_method) { $package_rates = $package['rates']; foreach ($package_rates as $rate_key => $rate_value) { if ($rate_key === $chosen_method) { $shipping_name = $rate_value->label; } } } } if (!isset($shipping_name)) { $shipping_name = __('Shipping', 'mollie-payments-for-woocommerce'); } return (string) $shipping_name; } /** * Get shipping method name. * * @since 1.0 * @access private * * @return string $shipping_name Name for selected shipping method. */ private function get_shipping_id() { $shipping_id = ''; foreach ($this->order->get_items('shipping') as $package) { $shipping_id = $package->get_id(); } return (string) $shipping_id; } /** * Get shipping method amount. * * @since 1.0 * * @access private * * @return string $shipping_amount Amount for selected shipping method. */ private function get_shipping_amount(): string { return number_format(WC()->cart->shipping_total + WC()->cart->shipping_tax_total, 2, '.', ''); } /** * Get shipping method tax rate. * * @since 1.0 * * @access private * * @return float|int $shipping_vat_rate Tax rate for selected shipping method. * * @psalm-return 0|float */ private function get_shipping_vat_rate() { $shipping_vat_rate = 0; if (WC()->cart->shipping_tax_total > 0) { $shipping_vat_rate = round(WC()->cart->shipping_tax_total / WC()->cart->shipping_total, 4) * 100; } return $shipping_vat_rate; } /** * Get shipping method tax amount. * * @since 1.0 * @access private * * @return integer $shipping_tax_amount Tax amount for selected shipping method. */ private function get_shipping_tax_amount() { return WC()->cart->shipping_tax_total; } } Horizontal Header - Juffrouw taart winsum
Skip to content

Red Agency

We focus on UX, Design, and Apps 

Demo Reel 

Services

Writing

The Landing Theme is great as it comes pre-built with multiple layouts that can be loaded on any page using the Builder. Check out this tutorial to see how the Builder layouts work.

Apps

The theme is also built with various header styles. You have the option to make it transparent, hide, or place it on the left. There are also other styles that customizes the placement of your logo.

Games

We’ve packed this theme with multiple extendable Addons. All of which, comes built into the theme allowing you have the most flexibility when managing your content!

A Landing page is a great way for you to attract more business for your brand, or to connect with your community.

A blogger from Inbound Now wrote a very interesting article called “7 Killer Ways Landing Pages Benefit & Market your Business“. It outlines various ways on how you can benefit from creating landing pages for your business.

Get a theme that’ll enhance, market, and grow your business now!

Create a testimonial section on your landing page. Simply insert an icon and an image on the row to copy the same look as this layout.

 – John PurdueThemify Team

Horizontal Header

Connect with us