Nth Product Discount – Woocommerce Coupons

I am looking to add the ability to apply a coupon to all products after a certain quantity. For example, a customer purchases 5 tickets and uses a valid coupon code. The first ticket will remain at full price while tickets 2 – 5 will receive the discount.

The discount should be reflected on the cart page (where the coupon code is entered) as well as the checkout page (where the purchase is completed).

I would love some direction/psuedo code on how to accomplish this.

LosAngelesVPS – 50% Lifetime Discount on all SSD KVM VPS’s starting from $2.99/month!

LosAngelesVPS recently contacted us with some KVM specials, complete with Promo Codes for 50% off!
They tell us that what makes these offers special, is that their storage is completely powered by pure SSD’s, and their servers are colocated in a premium datacenter facility (Internap LAX).

They are providing 50% off (lifelong discount) on VPS Servers! Enter Promo Code: 50OFFVPS at checkout to get this discount!

And if that wasn’t enough, then you will also be pleased to know that all offers below include Unmetered 1Gbps bandwidth!

Their WHOIS is public and you can find their ToS/Legal Docs here. They accept PayPal, Credit Cards, Alipay, Bitcoin, Litecoin, and Ethereum as payment methods.

Here’s what they had to say: 

“Los Angeles VPS was founded with the goal to provide the absolute best VPS experience in Los Angeles. Today we host over 1800 VPS customers on our network. Hosting your server in Los Angeles provides various advantages, from a network connectivity standpoint as well as redundancy. Despite our name, Los Angeles VPS eventually grew to offer more than just VPS hosting solutions. After successfully hosting thousands of Virtual Private Servers on our network, we also expanded to start offering hosting for the individuals too. From just offering Shared Web Hosting to a complete, fully scalable product line featuring Reseller, VPS and Dedicated Server solutions – LosAngelesVPS is your all-in-one solution provider for all your hosting needs! “

Here are the offers: 

1GB SSD KVM

  • 1GB RAM
  • 1x CPU Core
  • 20GB SSD Space
  • Unmetered Bandwidth
  • 1Gbps uplink
  • KVM / Virtualizor
  • Promo Code: 50OFFVPS
  • $ 2.99/month
  • [ORDER]

2GB SSD KVM

  • 2GB RAM
  • 2x CPU Cores
  • 40GB SSD Space
  • Unmetered Bandwidth
  • 1Gbps uplink
  • KVM / Virtualizor
  • Promo Code: 50OFFVPS
  • $ 4.99/month
  • [ORDER]

4GB SSD KVM

  • 4GB RAM
  • 4x CPU Cores
  • 60GB SSD Space
  • Unmetered Bandwidth
  • 1Gbps uplink
  • KVM / Virtualizor
  • Promo Code: 50OFFVPS
  • $ 7.50/month
  • [ORDER]
NETWORK INFO:

Internap LAX014 Datacenter, Los Angeles, CA, USA

Test IPv4: 45.12.110.109

Test file: http://45.12.110.109/10gb.bin


KVM Nodes:

– Dual Intel Xeon E5-2620 v2

– 256GB RAM

– 8x 2TB SSD’s

– Hardware RAID-10 w/ Cache

– Dual 1Gbps Uplink

Please let us know if you have any questions/comments and enjoy!

The post LosAngelesVPS – 50% Lifetime Discount on all SSD KVM VPS’s starting from $ 2.99/month! appeared first on Low End Box.

IndoVirtue – LEB/LET Exclusive US/Singapore Dedi and VPS Offer – Up to 50% Discount, $24/year VPS, $49.5/month Dedi

IndoVirtue is back with attractive offers on various VPS products. They are offering KVM VPS and OpenVZ based VPS’s. They have Budget options as well as Premium options of both types of plans.

IndoVirtue has been featured on LowEndBox once before, and they’ve received positive reviews from users. You can find their ToS/Legal Docs here. They also let us know that they have a 7-day refund period for new clients (not valid if that new customer breaks TOS).
Their accepted payment methods include PayPal and CryptoCurrency.
As always, if you purchase from them, feel free to comment below about your experience!

Here’s what they had to say: 

“We have been providing cPanel website hosting solutions since late 2010 at local city in Bali (Indonesia) for startup projects, companies and young entrepreneurs. Then we continued entering un-managed dedicated servers and VPS market since around May 2013 globally under international commercial domain, before finally were featured on LowEndBox at the end of 2014.

With more than 8 years of experience, we are currently holding strong with many happy customers from all around the world, hosted at our Singapore and USA locations. Please contact us and we will be happy and grateful to answer any questions, custom needs, suggestions and any feedback you may have!”

Here are the offers: 

USA KVM SSD – USKVMSSD-1

  • 1024MB RAM
  • 1x IvyBridge vCPU
  • 20 GB SSD space
  • 1000 GB transfer
  • 1Gbps uplink
  • 1x IPv4
  • $ 5/month regular price
  • Coupon: USKVMSSDLEB-B (50% discount, USKVMSSD with 3, 6 and 12 months only)
  • With LEB/LET exclusive coupon, price is $ 7/quarter or $ 26.5/year recurring
  • [ORDER]

Budget Singapore KVM SSD – SGKVMPOPSSD-SPECIAL

  • 512MB RAM
  • 1x SandyBridge vCPU
  • 5GB SSD space
  • 1000 GB transfer
  • 1Gbps uplink
  • 1x IPv4
  • /64 IPv6
  • $ 30/year regular price
  • Coupon: LEBSGPOPSSD-A (20% recurring discount, all Singapore Budget VPS with 3, 6 and 12 months only)
  • With LEB/LET exclusive coupon, price becomes $ 6/quarter or $ 24/year recurring
  • [ORDER]

Budget Singapore OpenVZ SSD VPS – SGOVZPOPSSD-SPECIAL

  • 1024MB RAM
  • 32MB Swap
  • 1x Haswell vCPU
  • 10GB SSD space
  • 1000 GB transfer
  • 1Gbps uplink
  • 1x IPv4
  • /64 IPv6
  • $ 30/year regular price
  • Coupon: LEBSGPOPSSD-A (20% recurring discount, all Singapore Budget VPS with 3, 6 and 12 months only)
  • With LEB/LET exclusive coupon, it becomes $ 6/quarter or $ 24/year recurring
  • [ORDER]

Premium Singapore KVM SSD – SGSSDKVM-1

  • 512MB RAM
  • 64MB Swap
  • 1x Skylake vCPU
  • 20GB SSD space
  • 500 GB transfer
  • 1Gbps uplink, additional DDoS protection available
  • 1x IPv4
  • /64 IPv6
  • $ 10/month
  • [ORDER]

Premium Singapore OpenVZ – SGOVZSSD-1

  • 1024MB RAM
  • 32MB Swap
  • 1x Skylake vCPU
  • 20GB SSD space
  • 400 GB transfer
  • 1Gbps uplink, additional DDoS protection available
  • 1x IPv4
  • /64 IPv6
  • $ 7/month
  • [ORDER]

NETWORK INFO:

Network US-West (USKVMSSD) – PhoenixNAP – Phoenix, AZ

Test IPv4: 104.161.32.32

Test file: http://us-lg.indovirtue.com/100MB.test

Network SG-Budget (SG*POPSSD and BUDGETDEDI-1) – HurricaneElectric, Racks Central – Affordable Singapore network

Test IPv4: 103.253.25.129

Test IPv6: 2400:fb80:1:1::1234

Test file: http://singaporepop-lg.indovirtue.com/100MB.test

Network SG-Premium (SG*SSD) – SG.GS, Global Switch – Premium Singapore with direct China and over 3700+ ASN peers

Test IPv4: 116.251.223.250

Test IPv6: 2405:4200:202:2:0:0:0:2525

Test file: http://singapore-lg.indovirtue.com/100MB.test


No other network in Singapore can match this network latency! Highlights:
Malaysia (<40ms),
Philippines (<50ms),
Mainland China (<50ms),
Taiwan (<60ms),
Vietnam (<65ms),
India (<75ms),
Japan (<80ms),
United Arab Emirates (<90ms),
Australia (<95ms),
Thailand (<100ms),
Germany (<165ms),
United Kingdom (<160ms),
Netherland (<160ms),
West US (<165ms),
Italy (<165ms),
France (<170ms),
Belgium (<175ms),
Russia (<205ms),
Canada (<210ms),
East US (<235ms),
and many more.

Here is the latency test data:
http://ping.chinaz.com/116.251.223.250

http://ping.pe/116.251.223.250

https://pulse.turbobytes.com/results/5b783f50ecbe406ef8001d8b/


Host Nodes Specifications:

– Intel Xeon E3-1230v5 / E3-1246v3 / Dual E5-2670 / Dual E5-2680v2

– 128GB / 32GB ECC RAM

– 2x 1 TB SSDs / 4x 1 TB SSDs

– Soft RAID1 / Hard RAID10

– 1 Gbit/sec uplink

Please let us know if you have any questions/comments and enjoy!

The post IndoVirtue – LEB/LET Exclusive US/Singapore Dedi and VPS Offer – Up to 50% Discount, $ 24/year VPS, $ 49.5/month Dedi appeared first on Low End Box.

Hosting73 – 3 New SSD VPS Plans, discount pricing – out of Atlanta and New York!!

Hosting73 has prepared some new offers for the community of three SSD VPS plans at sale prices. Hosting73 has been featured on LowEndBox before with positive feedback/response from the community, so we are excited to share their new offers with you today!

As always, if you decide to buy from them we are very interested in hearing your feedback/comments in the comments section below!

You can find their ToS/Legal Docs here. They accept PayPal, Credit Cards, Bitcoin, Litecoin and Ethereum as payment methods.

Here’s what they had to say: 

“Our purpose is straight forward and simple. Since our inception, our mission has and continues to be aiming to disrupt the hosting space by leading by good example. We do this by providing good service, reliable servers, high uptime, fast speeds, and personalized (and fast) support. By choosing to work with us, not only will you experience the best, but you are also supporting us in our purpose to better hosting services for everyone. And best of all, everything we provide is SSD powered, so you are being serviced with the most up to date technology. Welcome to Hosting73, and we look forward to working with all of you!”

Here are the offers: 

1GB SSD VPS

  • 1024MB RAM (1GB)
  • 1 CPU Core
  • 20GB SSD Storage
  • 1TB Monthly Transfer
  • OS – Any Linux OS
  • Remote Reboot and OS Reinstalls – Yes
  • Instant Set Up – Yes
  • $ 36/yr
  • [ORDER]

2GB SSD VPS

  • 2048MB RAM (1GB)
  • 2 CPU Cores
  • 40GB SSD Storage
  • 2TB Monthly Transfer
  • OS – Any Linux OS
  • Remote Reboot and OS Reinstalls – Yes
  • Instant Set Up – Yes
  • $ 63/yr
  • [ORDER]

3GB SSD VPS

  • 3072MB RAM (3GB)
  • 2 CPU Cores
  • 40GB SSD Storage
  • 5TB Monthly Transfer
  • OS – Any Linux OS
  • Remote Reboot and OS Reinstalls – Yes
  • Instant Set Up – Yes
  • $ 85/yr
  • [ORDER]

NETWORK INFO:

Buffalo, New York, USA

Test IPv4: 192.3.180.103

Test file: http://192.3.180.103/1000MB.test


Hardware Information:

– Intel Xeon E3’s

– 32 GB to 64 GB DDR3/DDR4 RAM

– 4x 1TB Samsung 860 Pro SSD’s

– Hardware RAID10 via LSI 9271-4i

– 2x 1Gbps uplinks

Please let us know if you have any questions/comments and enjoy!

The post Hosting73 – 3 New SSD VPS Plans, discount pricing – out of Atlanta and New York!! appeared first on Low End Box.

High Domain Authority Guest Post Backlinks at Cheap Prices: DA 25 – 90 (Up to 35% Discount)

[​IMG]

Hello everyone,

Guest posts are one of the best ways to increase your search engine rankings. Forget about those 1000 blog comments backlinks or 1000 wiki backlinks. The truth is one guest post backlink from a high domain authority website is better than 1000 blog comment backlinks. At Technabyte, we have built strong relationships with high domain authority websites to be able to…

High Domain Authority Guest Post Backlinks at Cheap Prices: DA 25 – 90 (Up to 35% Discount)

Cheap and Reliable Shared, Reseller, VPS and Dedicated Servers – 50% OFF Lifetime Discount!!

[​IMG]

Technabyte provides cheap and reliable Web Hosting services for your business or project. We offer Shared Hosting, Reseller Hosting, Virtual Private Servers and Dedicated Servers, all ran on high quality servers. Technabyte also offers guest posting services, domains, SSL Certificates and more. Technabyte is not just a Web Host but aims to become a one-stop…

Cheap and Reliable Shared, Reseller, VPS and Dedicated Servers – 50% OFF Lifetime Discount!!

MyW – 50GB Reseller Hosting Plan, with discount provided at checkout! Germany and Los Angeles locations!

MyW contacted us to tell us about their latest changes. What they had to say was that for them, due to the recent cPanel price hiking, they’ve decided to migrate to DirectAdmin. They informed us that the experience has been awesome and their clients are actually enjoying the UI, most of them even prefer it versus cPanel.
They have provided an offer specifically created for this community of a Reseller Hosting plan with a discount that’s provided at checkout!
If you decide to buy, we look forward to your feedback in the comments section below!

They accept PayPal and Credit Cards as payment methods. You can find their ToS/Legal Docs here.

Here’s what they had to say: 

“MyW is a new division for WNDP – WebNegócio Lda. (VAT PT513780542), a business registered in Portugal since December, 2015. Even though this is a new division, we have been selling WebHosting, locally, since 2004. Due to the cPanel price hikes, we felt it was just about time to expand to the international market. So far so good and our clients have been loving the new UI!”

Here’s the offer: 

50GB Reseller Hosting

  • 50GB SSD Storage
  • Unmetered Bandwidth
  • Shared IP Address
  • Unlimited Clients
  • DirectAdmin Access
  • Softaculous Script Installer
  • LiteSpeed Web Server
  • MailChannels
  • DDoS Protection
  • Falkenstein, Hetzner, Germany or Los Angeles, CA, USA
  • €4.30 a month / $ 4.86 a month
  • [ORDER]

NETWORK INFO:

Falkenstein, Germany, EU

Test IPv4: speed.hetzner.de
Test file: https://speed.hetzner.de/1GB.bin

Los Angeles, California, USA

Test IPv4: speed.hetzner.de
Test file: http://los-angeles-speedtest.reliablesite.net/1000mb.test.zip

Hardware Information:

– Intel Xeon E3 1246v3

– 32GB

– 4x 1TB SSD’s @ RAID 5

– 1Gbps Network

Please let us know if you have any questions/comments and enjoy!

The post MyW – 50GB Reseller Hosting Plan, with discount provided at checkout! Germany and Los Angeles locations! appeared first on Low End Box.

Apply discount amount on cart line items in Magento 2

I am trying to set discount amount on each cart item in the cart with some condition.

I have followed like this to achieve that.

Vendor/Module/etc/sales.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Sales:etc/sales.xsd"> <section name="quote">     <group name="totals">         <item name="testdiscount" instance="Vendor\Module\Model\Quote\Discount" sort_order="500"/>     </group> </section> 

then in Vendor\Module\Model\Quote\Discount.php

namespace Vendor\Module\Model\Quote; use Magento\Catalog\Model\ProductRepository; class Discount extends   \Magento\Quote\Model\Quote\Address\Total\AbstractTotal {  protected $  _priceCurrency;  protected $  _productRepository;  protected $  _resource;  public function __construct(    \Magento\Framework\Pricing\PriceCurrencyInterface $  priceCurrency,    \Magento\Framework\App\ResourceConnection $  resource,    ProductRepository $  productRepository   ){      $  this->_priceCurrency = $  priceCurrency;      $  this->_resource = $  resource;      $  this->_productRepository = $  productRepository;     }     public function collect(       \Magento\Quote\Model\Quote $  quote,       \Magento\Quote\Api\Data\ShippingAssignmentInterface $  shippingAssignment,       \Magento\Quote\Model\Quote\Address\Total $  total     )    {    $  data = $  quote->getItems();     if (!count($  data)) {         return $  this;     }    parent::collect($  quote, $  shippingAssignment, $  total);     foreach ($  data as $  item) {             $  productSku = $  item['sku'];             $  checkSkuExist  = $  this->checkProduct($  productSku);             if($  checkSkuExist){               $  item->setDiscountAmount(10);               $  item->setBaseDiscountAmount(10);               $  item->setTaxAmount(10);               $  item->setBaseTaxAmount(10);             }         }         return $  this;        }    public function checkProduct($  productSku){     $  connection = $  this->getConnection();     $  sql = "select * from custom_table where sku='".$  productSku."'";     $  resultProduct = $  connection->query($  sql);     $  resultQuery = $  resultProduct->fetchAll();     if(!empty($  resultQuery)){       $  parent_sku = $  resultQuery[0]['parent_sku'];     return true;    }   }else{   return false;    }    }   public function getConnection(){    $  connection = $  this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);   return $  connection;     }  } 

Here When i am check the item SKU against the custom table, if the SKU present in the table then, applying the discount amount for that quote item.

Which is not applying any discount amount for the quote item.

Can anyone suggest me the better way how this can be achieve.

Thanks