Mass action if product has discount
9 years 10 months ago #258545
by kyratn
Mass action if product has discount was created by kyratn
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
I have added code below to show my own discount badge:
Code:
<!-- show discount on product listing --->
<?php if(!empty($this->row->discount)){
if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){
echo '<span class="discount-badge">'.$this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id),'</span>';
}elseif(bccomp($this->row->discount->discount_percent_amount,0,5)!==0){
echo '<span class="discount-badge">'.-1*$this->row->discount->discount_percent_amount.'%','</span>';
}
}?>
<!-- end discount --->
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 or Create an account to join the conversation.
9 years 10 months ago #258552
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Mass action if product has discount
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,
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
9 years 10 months ago #258572
by kyratn
Replied by kyratn on topic Mass action if product has discount
Thanks for replay Jerome. I see what you mean.
Have a great New Year evening
Have a great New Year evening
Please Log in or Create an account to join the conversation.
9 years 10 months ago - 9 years 10 months ago #258652
by kyratn
Replied by kyratn on topic Mass action if product has discount
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
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.
Please Log in or Create an account to join the conversation.
9 years 10 months ago #258669
by nicolas
Replied by nicolas on topic Mass action if product has discount
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.
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 or Create an account to join the conversation.
Time to create page: 0.051 seconds