We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Shop

Sale pricing for members (specific products)

Hello,

I know it is possible to enable sale or trade pricing if the logged in member has a certain tag like so:

if (perch_member_logged_in() && perch_member_has_tag('unicorn')) {
  perch_shop_enable_sale_pricing();
}

The above enable sale pricing for all products. Is it possible to apply sale pricing to certain products only if a member has a certain tag?

As far as I know:

  • Promotions can be used to apply sale pricing or discounts for a set period of time, but they apply to all products
  • Similarly, Sales apply to all products for a set period of time
  • When an item's sale price is enabled ("use sale price" is checked), the sale price is used for all customers
  • When perch_shop_enable_sale_pricing() is used, sale pricing is used for all products
Hussein Al Hammad

Hussein Al Hammad 105 points

  • 1 year ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Promotions can be used to apply sale pricing or discounts for a set period of time, but they apply to all products

Promotions can be restricted to given products by adding those products to a category and restricting the promotion to that same category.

Does that help at all?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Yes, that is perfect!

How do I restrict a promotion to a category? Do I simply add the category tag to the promotion template?

<perch:categories id="category" set="products" label="Category" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

There should already be one there. Is there not?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

The default template in perch/addons/apps/perch_shop/templates/shop/promotions does indeed have the field in there.

I joined this project halfway through and didn't think the promotion template in perch/templates would be modified (or old?), but it is.

Thanks, Drew.