Announcement

Collapse
No announcement yet.

Coupon / Add item Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Coupon / Add item Question

    Is it possible to have a coupon add an item to the cart that is exclusively available with this coupon? We wouldn't want the item to be able to be purchased by customers who do not use the coupon.

    Thanks

    #2
    Foreman2 That functionality is not available natively but can be accomplished with some template code. You could create a checkbox product custom field called "Not for Sale" and check the box for products only available via coupon. Then on the PROD template select the newly created custom field in the Product Display Layout section so that it is available via a template variable. Finally, find the add to cart button in the template and wrap it in a conditional that check the custom field, something like this (note there may be multiple places the add to cart button appears in your framework):

    Code:
    <mvt:if expr="l.settings:product:customfield_values:custom fields:not_for_sale NE 1">
        <mvt:item name="buttons" param="AddToBasket"/>
    </mvt:if>
    This will hide the add to cart button for the product if the "Not For Sale" product custom field is checked, thus allowing you to create the Add-on Product promotion. Note remember to add a 1 to the Restrict to Qualifying Quantity when creating the price group to ensure that the add on product (qualifying product) is removed from basket if the coupon is removed.



    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment

    Working...
    X