macro rules

merav tg asked on May 17, 2016 15:13

Hey,

This is for discount: how can I create a macro that applies only to a page that show a list of products. meaning applies only to products under X main menu item. And if i do this and the products in that page are actually linked products- will the discount apply to all of the products? Please advise thank you

Recent Answers


Brenden Kehren answered on May 17, 2016 16:53 (last edited on December 10, 2019 02:30)

Your macro rule could look like this:

{% if(CurrentDocument.NodeAliasPath.Contains("/your/path") && CurrentDocument.NodeLinkedNodeID <= 0) { "your discount"} else { "no discount") |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

merav tg answered on May 17, 2016 17:05

Hey,

thank you for the answer. I want to create an Order discount so I want to say that if the product was selected from this page then when you enter the coupon name in the shopping cart then it will take affect.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on May 17, 2016 18:02

That would have been good information to know in your original post. Unfortunately, I'm not sure you can do that without some custom event handler.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on May 17, 2016 20:15

Sounds like you need some custom logic or a custom control. You could clone the shoppingcartitemselector control and the modify your control to include the conditions applicable. The only down side could be that you may need to clone multiple controls depending on what you need to do. The shoppingcartitemselector control contains multiple other controls,but I think you could get by with just cloning the main one. Or like Brenden suggested having an event handler that maybe overrides the adding an item to the cart or creating the cart item. Depends on if you want the discount to be visible right away, or later in the process.

0 votesVote for this answer Mark as a Correct answer

merav tg answered on May 18, 2016 08:27

thank you.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.