[Skip to main content](#vessel-content)

#   Mass action if product has discount

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

9 years 10 months ago [\#258545](#258545) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[Mass action if product has discount](/forum/44-mass-actions/888104-mass-action-if-product-has-discount#258545 "Hi,  I have added code below to show my own discount badge:  What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....  Many thanks")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

I have added code below to show my own discount badge:
Code:

&lt;!-- show discount on product listing ---&gt; &lt;?php if(!empty($this-&gt;row-&gt;discount)){ if(bccomp($this-&gt;row-&gt;discount-&gt;discount_flat_amount,0,5)!==0){ echo '&lt;span class="discount-badge"&gt;'.$this-&gt;currencyHelper-&gt;format(-1*$this-&gt;row-&gt;discount-&gt;discount_flat_amount,$price-&gt;price_currency_id),'&lt;/span&gt;'; }elseif(bccomp($this-&gt;row-&gt;discount-&gt;discount_percent_amount,0,5)!==0){ echo '&lt;span class="discount-badge"&gt;'.-1*$this-&gt;row-&gt;discount-&gt;discount_percent_amount.'%','&lt;/span&gt;'; } }?&gt; &lt;!-- end discount ---&gt;

What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....

Many thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84ODgxMDQtbWFzcy1hY3Rpb24taWYtcHJvZHVjdC1oYXMtZGlzY291bnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 10 months ago [\#258552](#258552) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mass action if product has discount](/forum/44-mass-actions/888104-mass-action-if-product-has-discount#258552 "Hi,  I have added code below to show my own discount badge:  What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....  Many thanks")*

Hi,

Due the fact that a discount can be applied to products and categories, that the information is stored in the discount and not in the product ; there is no possible mass-action for that.
You would be able to do that using a custom plugin ; but it is not something I would recommend.
We more recommend to use discounts on a (unpublished) category and then put the products in the category to apply the discount than the "opposite".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84ODgxMDQtbWFzcy1hY3Rpb24taWYtcHJvZHVjdC1oYXMtZGlzY291bnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

9 years 10 months ago [\#258572](#258572) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Mass action if product has discount](/forum/44-mass-actions/888104-mass-action-if-product-has-discount#258572 "Hi,  I have added code below to show my own discount badge:  What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....  Many thanks")*

Thanks for replay Jerome. I see what you mean.

Have a great New Year evening

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84ODgxMDQtbWFzcy1hY3Rpb24taWYtcHJvZHVjdC1oYXMtZGlzY291bnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

9 years 10 months ago -  9 years 10 months ago [\#258652](#258652) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Mass action if product has discount](/forum/44-mass-actions/888104-mass-action-if-product-has-discount#258652 "Hi,  I have added code below to show my own discount badge:  What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....  Many thanks")*

Hi,
1 more Question. Example:
I create discount -5% and publish it. -5% discount will be applied to all my products in the shop automatically.
If i add any product or category then it works fine. Remove it and same result.

Should it be like this?

Many thanks

Last edit: 9 years 10 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84ODgxMDQtbWFzcy1hY3Rpb24taWYtcHJvZHVjdC1oYXMtZGlzY291bnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

9 years 10 months ago [\#258669](#258669) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Mass action if product has discount](/forum/44-mass-actions/888104-mass-action-if-product-has-discount#258669 "Hi,  I have added code below to show my own discount badge:  What i want is to add product to category if that product has discount. Can this be done with mass action? I couldn't find such filter....  Many thanks")*

Hi,

Yes that's normal.
If you don't restrict a discount to a product, then it means that you want it to apply to all the products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ0LW1hc3MtYWN0aW9ucy84ODgxMDQtbWFzcy1hY3Rpb24taWYtcHJvZHVjdC1oYXMtZGlzY291bnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.073 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
