Reject Discount code for few products in Shopify Plus checkout

Aashish Kasma|4/2/2018, UTC|1 MIN READ|
Play
//Reject Discount code for few products in Shopify Plus checkout

Share

It's been requested by multiple enterprise clients to remove discount code for particular products.

We thought to have 2 solution 

[data-reduction-form="update"] {
display: none
}

#Reject Discount for few products
reject = false
Input.cart.line_items.select do |line_item|
product = line_item.variant.product
if product.tags.include?('reject_code')
reject = true
end
end

if reject and Input.cart.discount_code
Input.cart.discount_code.reject(
message: "discount can't applied! for this product."
)
end
Output.cart = Input.cart

    Aashish Kasma

    Looking for

    Development

    Solutions?

    Lets Discuss

    Why Lucent...

    innovatio

    Learning

    Learning comes not only with training but it comes as we facilitate the learning of the organization as well as individuals and the clients continuously refurbishing ourselves.

    innovatio

    Innovation

    We believe in Innovation and have started our company based on that concept. When you don't transform you become stagnant.
    Innovation arrow Transformation
    arrow Growth.

    innovatio

    Team Work

    We work efficiently as a team. We self-monitor. We deliver results efficiently with the help of multiple perspectives and skill sets. We form strong working relationships as we communicate well with each other.

    Lucent innovation
    We are a family filled with talented experts that help global brands, enterprises, mid-size businesses or even startups with innovative solutions.
    Newsletter
    Accelerate your tech projects with us. Get in touch with us.
    Follow us
    facebooklinkedinyoutubeinstagramtwitter
    lucent innnovation: cltuch

    Lucent Innovation, © 2023. All rights reserved.Privacy policyDMCA compliant image